Quantcast
Channel: Instrument Control (GPIB, Serial, VISA, IVI) topics
Viewing all articles
Browse latest Browse all 5565

usb to serial communication problem

$
0
0

 

I have a program that is looking for an input from a Click PLC(which is basically being used as an I/O device).   the click plc is hooked up to the computer using a USB to rs-232 cable.  

 

the program will run fine for anywhere between 10 minutes and 2 hours before it appears to stop communicating with the PLC.  There is ultimately a timeout error, that is returned.  We have tried different PLC's and different computers with no luck. the only way to get it back up and running again is to restart the computer.  upon restart, the program will again run for a number of minutes.

 

within the labview program we initialize the communication using the VISA configure serial port VI at the beginning of the program.  we then go into the main program loop and call sub vi's(that use the MB serial master query.vi) to check the status of "coils"/or  bits on the PLC.  when one goes high, that kicks the program into sub loops.    

 

my question is, should we be opening or closing the serial communication port in each "main loop" or is it valid to configure the serial port once and leave it "open" indefinitely, or do we need to open/close the serial communication port each time through the high level loop?

 

I thought it might have something to do with overflowing a buffer, but in putting in a "VISA bytes at serial port" i get a 0 returned at the start of each main loop.  As a precaution, i also have put in a "VISA flush I/O buffer" at the beginning of the main program loop but it doesn't seem to change anything.   

 

thoughts?


Viewing all articles
Browse latest Browse all 5565

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>