Multiple ComOpen problem?

Paul T.
Maennedorf, Zurich

Mar 14, 2012
63 Posts

0  |  0  

Re: Multiple ComOpen problem?

Hi! Is there a problem if ComOpen(...) is run multiple times without ComClose(...) ? I know ComOpen returns -1 if the COM port is already open, but is it possible for the COM port to not work properly because it has been opened multiple times? I mean is it possible that COMSetup(...), COMSend(...) and COMReceive(....) to not work properly after multiple COMOpen(...) ?

DrATEasy (Ron Y.)
Mission Viejo, CA

Mar 15, 2012
358 Posts

0  |  0  

Re: Multiple ComOpen problem?

Calling ComOpen() multiple times on the same port does not have any effect. The function will basically ignore the request since it is already open. Maybe the problem is with the target device or with your other function calls ComSend/Recive or Setup. What exactly does not work after awhile?

Paul T.
Maennedorf, Zurich

Mar 15, 2012
63 Posts

0  |  0  

Re: Multiple ComOpen problem?

Well, sometimes the communication breaks. I'm not receiving anything from the target and I thought that multiple ComOpen could be the problem. Also if I call ComClose() extra times (without the COM port to be open any more) it is not a problem?

Solution Available
DrATEasy (Ron Y.)
Mission Viejo, CA

Mar 16, 2012
358 Posts

1  |  0  

Re: Multiple ComOpen problem?

The issue is not related to ComOpen.To troubleshot, write a small procedure that loops on ComOpen, Setup, Send and Receive and see how this works with your device and at what point it stops working..You can use the Monitor window to log the progress or place trace statements.



Please Note
You need to have a M@GIC account to participate in the Forums.
Not yet registered on our website? Click here to register today!

All content, information and opinions presented on the Marvin Test Solutions User Forums are those of the authors of the posts and messages and not Marvin Test Solutions'. All attachments and files are downloaded at your own risk. [Read More]