VB.Net 2005 comms problem

T

Tym

Not sure this is the right group - but here goes.

I kinda expect Dick Grier to jump in on this one ;-)

I've got a windows app in VB.Net 2005 which sends and receives text messages
via a USM GSM modem. THe app cycles to poll the modem for incoming SMS as
well as pausing this cycle to send...

Working absolutely fine... except....

After a given period of time, the app "looses" the GSM modem, and gets stuck
on the .write command when I'm trying my AT+CSQ command. If I re-run the app
it says the device isn't working properly.

BUT

I've I go to control panel, Phone and modem options, Modems - right click -
properties - diagnostics and query the modem - all is well. After this, my
app sees the modem fina again.

I'm using the serialport1 control and talking to com13 in this isntance.

How can I keep the port alive? what is happening?

Secondly, I have connected an olf moble phone the the PC via a cable. This
puts it on COM14. I can query this in hyperterminal by selecting the port
and
issuing AT+CSQ, and getting a response. However, if I try it in my ap -
COM14 doesn't respond? What's the difference between Hyperterminal talking
to the port and VB.Net?? My VB6 app can send and receive to this port (or so
it seems to - sending AT+CMGF=1 results in an error code - in VB.NET it
doesn't give a response at all. However, with exactly the same code, VB.NET
does
responde to the USB on COM13 -

Tym
 
D

Dick Grier

Hi,

Sorry, I don't have a specific answer for you. However, I do have a
suggestion. Download DesktopSerialIO.dll (the VS2005 version) from my web
site and port your code to use it -- the syntax is slightly different, but
similar enough that it should take only a few minutes of work (OnComm
instead of DataReceived, Output instead of Write, and InputString instead of
ReadExisting). Give this a try.

I have found that the SerialPort object in VS2005 can be problematic with
Virtual Serial ports for USB devices -- but my dll seems to be "OK" with
them. Microsoft is aware of the issues that I have seen, though the only
time I've seen a problem is if the physical device connection is lost, then
re-established.

Anyway, let me know what you find.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
 
T

Tym

Thaks Dick,

I had considered using the mscom32.ocx from my vb6... I presume this will do
the same thing? -

On your site now.. will report back as soon as I can

Thanks

Tym.
 
T

Tym

Dick,

Thanks for the dll and although it "works" there is a serious problem. When
I reload my project, my main form, in which your code is utilised comes up
with :

at System.IO.Path.NormalizePathFast(String path, Boolean fullCheck)
at System.IO.Path.GetFullPathInternal(String path)
at System.Reflection.AssemblyName.GetAssemblyName(String assemblyFile)
at
Microsoft.VisualStudio.Design.VSTypeResolutionService.AddProjectDependencies(Project
project)
at
Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.get_Assembly()
at
Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.Search(String
fullName, String typeName, Boolean ignoreTypeCase, Assembly& assembly,
String description)
at
Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchProjectEntries(AssemblyName
assemblyName, String typeName, Boolean ignoreTypeCase, Assembly& assembly)
at
Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchEntries(AssemblyName
assemblyName, String typeName, Boolean ignoreCase, Assembly& assembly,
ReferenceType refType)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.GetType(String
typeName, Boolean throwOnError, Boolean ignoreCase, ReferenceType refType)
at
Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String
name, Boolean throwOnError, Boolean ignoreCase)
at
Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String
name, Boolean throwOnError)
at
System.ComponentModel.Design.Serialization.CodeDomSerializerBase.GetType(ITypeResolutionService
trs, String name, Dictionary`2 names)
at
System.ComponentModel.Design.Serialization.CodeDomSerializerBase.FillStatementTable(IDesignerSerializationManager
manager, IDictionary table, Dictionary`2 names, CodeStatementCollection
statements, String className)
at
System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager
manager, CodeTypeDeclaration declaration)
at
System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager
manager)
at
Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager
serializationManager)
at
Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32
fReload)

in the designer.

If I close ths, view the code, comment out the line:
Private WithEvents SerialPort1 As New DesktopSerialIO.SerialIO.SerialPort

or change it to

Public WithEvents SerialPort1 As New DesktopSerialIO.SerialIO.SerialPort

I can then view the designer. If I put the line back to what it was, it is
still ok. The project builds fine, and builds the deployment ok - also
deploys fine, but I'm confused as to why this "error" occurs?



Tym
 
D

Dick Grier

Hi,

I have never seen this error. I have no idea what it means, sorry.

BTW, yes, you can use MSComm32.ocx (there are licensing issues, and there is
a KB article that addresses them -- this is the reason that I make my
NETComm.ocx wrapper available). Deployment is a pain with MSComm, so I
suggest that you use either my DesktopSerial dll, or stick with the
SerialPort object, if practical.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
 
T

Tym

Dick,

I copied the app to antoher dirctory to make alterations for a "light"
version and don't get the error!!

Ho hum!!

Thanks for the DLL - I'll use that - seems to work great for me other than
the "glitch" which I can work with.

Tym
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top