473,399 Members | 4,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

VB.Net 2005 comms problem

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

Jun 18 '07 #1
5 1934
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.
Jun 18 '07 #2
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.
"Dick Grier" <dick_grierNOSPAM@.msn.comwrote in message
news:uZ**************@TK2MSFTNGP02.phx.gbl...
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.

Jun 18 '07 #3
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(Str ing assemblyFile)
at
Microsoft.VisualStudio.Design.VSTypeResolutionServ ice.AddProjectDependencies(Project
project)
at
Microsoft.VisualStudio.Design.VSTypeResolutionServ ice.AssemblyEntry.get_Assembly()
at
Microsoft.VisualStudio.Design.VSTypeResolutionServ ice.AssemblyEntry.Search(String
fullName, String typeName, Boolean ignoreTypeCase, Assembly& assembly,
String description)
at
Microsoft.VisualStudio.Design.VSTypeResolutionServ ice.SearchProjectEntries(AssemblyName
assemblyName, String typeName, Boolean ignoreTypeCase, Assembly& assembly)
at
Microsoft.VisualStudio.Design.VSTypeResolutionServ ice.SearchEntries(AssemblyName
assemblyName, String typeName, Boolean ignoreCase, Assembly& assembly,
ReferenceType refType)
at Microsoft.VisualStudio.Design.VSTypeResolutionServ ice.GetType(String
typeName, Boolean throwOnError, Boolean ignoreCase, ReferenceType refType)
at
Microsoft.VisualStudio.Design.Serialization.CodeDo m.AggregateTypeResolutionService.GetType(String
name, Boolean throwOnError, Boolean ignoreCase)
at
Microsoft.VisualStudio.Design.Serialization.CodeDo m.AggregateTypeResolutionService.GetType(String
name, Boolean throwOnError)
at
System.ComponentModel.Design.Serialization.CodeDom SerializerBase.GetType(ITypeResolutionService
trs, String name, Dictionary`2 names)
at
System.ComponentModel.Design.Serialization.CodeDom SerializerBase.FillStatementTable(IDesignerSeriali zationManager
manager, IDictionary table, Dictionary`2 names, CodeStatementCollection
statements, String className)
at
System.ComponentModel.Design.Serialization.TypeCod eDomSerializer.Deserialize(IDesignerSerializationM anager
manager, CodeTypeDeclaration declaration)
at
System.ComponentModel.Design.Serialization.CodeDom DesignerLoader.PerformLoad(IDesignerSerializationM anager
manager)
at
Microsoft.VisualStudio.Design.Serialization.CodeDo m.VSCodeDomDesignerLoader.PerformLoad(IDesignerSer ializationManager
serializationManager)
at
Microsoft.VisualStudio.Design.Serialization.CodeDo m.VSCodeDomDesignerLoader.DeferredLoadHandler.Micr osoft.VisualStudio.TextManager.Interop.IVsTextBuff erDataEvents.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
"Dick Grier" <dick_grierNOSPAM@.msn.comwrote in message
news:uZ**************@TK2MSFTNGP02.phx.gbl...
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.

Jun 19 '07 #4
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.
Jun 19 '07 #5
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
"Dick Grier" <dick_grierNOSPAM@.msn.comwrote in message
news:u$**************@TK2MSFTNGP06.phx.gbl...
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.

Jun 19 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Steve T | last post by:
Hi, I am developing some software in C++ to access a PMC card in a PC. The PMC card comes with a set of C++ libs to access it and to handle interrupts from it. I am therefore writing entirely in...
0
by: Karl | last post by:
Hi, I've been trying for some time to establish reliable serial comms for a 4-port system, i.e. with the two regular COM1 and COM2 on the motherboard and with a dual PCI serial card (COM3 and...
0
by: Zahid | last post by:
Hi, Im a little confused with sending and receiving data using UDP comms. Im writing an app that sends and recieves data (a byte array) using the UDP protocol. The data I send is 36 bytes long...
0
by: Starbuck | last post by:
Hi Using the socket examples found in the 101 VB examples from microsoft I have build a server/client comms program. This worked fine in studio 2003 but since I upgraded to 2005 and converted...
9
by: =?Utf-8?B?SG93YXJkIFNtaXRo?= | last post by:
I am using VC++ 6.0 (with SP5 installed). When using WinXP this is with SP2 installed. I am developing an instrumentation system comprising a set of networked PCs connected using TCP/IP TCP links....
2
by: Kevin | last post by:
I would appreciate it if anyone could help or advise on coding for comms. I am using C# and need to be able to open a comms port, send a command to a device, receive the data back and close the...
2
by: Andrew Kitlas | last post by:
hi, im using MS Visual C++ 2005 express edition and need to be able to send and resieve data on the serial port(com port). i can send data, but dont know how to recieve it. what is the name of the...
5
by: Tony Johansson | last post by:
Hello! SqlConnection myConnection = new SqlConnection(@"Server=(local)\sqlexpress;Integrated Security=True;" + "Database=northwind"); When I have this Integrated Security=True does this mean...
4
by: adlloyd | last post by:
Hi all, I've got an application that's written in C++ making use of MFC (VS6). Its purpose is to process SMS messages received from a GSM modem connected via a serial port (USB connection). The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.