NI Home > Community > NI Discussion Forums

LabVIEW

Showing results for 
Search instead for 
Do you mean 
Reply
Member
jimmyinct3
Posts: 84
0 Kudos

serial port locking and not letting go of serial port

[ Edited ]

 

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

Knight of NI
Ray.R
Posts: 10,583
0 Kudos

Re: serial port locking and not letting go of serial port

[ Edited ]

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.

______________________________________________________________________
Kudos!!!! Gimme Kudos!!!! It's that little golden star on the left below my avatar... :smileyhappy:
Member
jimmyinct3
Posts: 84
0 Kudos

Re: serial port locking and not letting go of serial port

[ Edited ]

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

 

 

Member
jimmyinct3
Posts: 84
0 Kudos

Re: serial port locking and not letting go of serial port

[ Edited ]

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.

 

 

 

Member
jimmyinct3
Posts: 84
0 Kudos

Re: serial port locking and not letting go of serial port

 

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.

 

 

Knight of NI
Ray.R
Posts: 10,583
0 Kudos

Re: serial port locking and not letting go of serial port

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

______________________________________________________________________
Kudos!!!! Gimme Kudos!!!! It's that little golden star on the left below my avatar... :smileyhappy: