LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial port locking and not letting go of serial port

 

Im using labview to communicate with the serial port of the servo drive, and am getting problematic failures under a certain set of conditions. The problem occurs when it servo drive has not yet powered when labview initiates communication. There seems to be some type of comm port lock created by labview which cant be released, even if I close labview (exit) and reboot the servodrive.    So far the only way I have been able to unlock the communications is to close labview and then open up the vendors proprietary software with establishes communication with the serial port.  After this has been done, I can immediately close the vendors application and work with labview/servo drive again. But this is not a professional solution. 

I cant figure out who to fix this or how to describe what is going, Its like I need a lower level to work at to see it.    For debugging, Ive also implemented up to a 1 second “serial break” which does not fix the problem.

 

Any help or ideas on how to fix or debug this?

thanks

 

attached, relevant code with irrelevant sections stripped

0 Kudos
Message 1 of 6
(3,851 Views)

I don't have your subvi's so I can't comment on your code (although there is a huge nearly-empty While Loop...)

 

Are you closing the VISA (serial) reference?  That will allow you to use the serial port with other applications.

0 Kudos
Message 2 of 6
(3,847 Views)

hi ray,

i forgot to upload the subvis and have loaded them here

 

the mostly empty while loop is done to reduce clutter

the items in it dont effect the serial port locking

 

 

Download All
0 Kudos
Message 3 of 6
(3,839 Views)

ok

this is now solved

 

im still not sure what the causes are but it is realted to shutting off remote serial port and also changing the baud rate.

 

without wasting a lot of time, ill just post a screen shot of what has to be done to fix it

this will allow the user to connect to a copley controls servo drive, set at unknown baud rate, regardess of PC state

 

i will say its probably a good idea to add the serial break to the main labview VIs (its in the "touch panel module",), its a good general use VI for connecting with a serial controller that can accept a break command, many of which do.

 

 

 

0 Kudos
Message 4 of 6
(3,820 Views)

 

this, attached, is a little  bit better (fixes case of computer reboot) and documented a little better too

 

 

yes, serial break is not part of standard license so make sure you have license for it.

but i would like to point out, its a great general tool to have, i honestly wasted 2 weeks becuas i needed it

its in part of some embedded control set.

 

 

0 Kudos
Message 5 of 6
(3,809 Views)

Zip up every subvi (everything) and post the entire code.  We cannot determine what goes on from those images..

0 Kudos
Message 6 of 6
(3,790 Views)