LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with Serial 'repeater' I/O

I want to set-up LabView as a serial repeater, which would allow two instruments (Client/Host) to communicate thru my LabView PXI serial card transparently, until an operator decides to intervene. At that point the operator (and LabView s/w) would be the Client and assume control of the Host. I have my baud rates, flow control, etc, set-up properly, but the problem seems to be things like timeout (do I _have_ to set a timeout?), execution timing and/or # of bytes to Read in my LabView VI's (attached). Note that it is not set up yet to allow operator intervention, I'll work that out next...

Thanks!
0 Kudos
Message 1 of 3
(2,701 Views)
mark-san,

I have had a look at your block diagram and few things must be considered when using LabVIEW as a serial port relay.

1. Currently the program is opening the serial port during each loop execution and not closing the reference. It is probably best to configure the serial ports once and close them once execution of the program has been completed.

2. You will probably want to set termination characters to false, as LabVIEW will disregard termination characters when reading.

3. Reading one byte at a time is fine, but make sure that your application will be fast enough that the buffers do not overflow.

4. The timeout can be set as you see accordingly. Just remember, a read will wait until the number of bytes are read or a timeout. Make
sure a read operation is not blocking other code.

5. As for execution timing, much of this will be dependent on your application. You will want to make sure that no read or write is blocking other parts from running when need be.

Good luck with your application.

Matt Friedman
Applications Engineer
National Instruments
www.ni.com/support
Message 2 of 3
(2,701 Views)
Hi Matt - 'mark-san' is my alias, but you also know me as the guy @ L-3 with the WinXP problem. Looks like you're saving my bacon again on this serial repeater problem, and thanks for the useful tips.

Incidentally, I think we have the hang-up problem solved, no more freezes or anything since I turned off the monitor & hibernation modes. So today I've started working on my serial interface, and will take your advice on the serial repeater questions.

Regards,
MarkF
0 Kudos
Message 3 of 3
(2,701 Views)