LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Question about communication between labview programs on separate

I have labview programs running on two different computers, it's two halves of a
system and they need to communicate with each other. Let's call them Alice and
Bob. The communications are nothing fancy, it's mostly just to ensure that Bob
is ready before Alice executes certain actions.

Specifically, Alice sends a series of laser pulses to Bob to trigger a port on
Bob's NI-6534 (NI digital I/O card) to latch data. There is a possibility that
one or more of these laser signals will not ever be received by Bob, and the
result would be that the port's buffer doesn't fill completely and the program
hangs until the port read times out, and an error is generated. I need to have
a way for Alice to determine if the port has not filled, and if so Alice will
send more laser pulses until it has filled.

I've decided the best way to do this is to use a TCP connection. Once Alice has
finished sending the pulses, I will put a TCP read with a short timeout. On
Bob's end, after the buffer read has completed, there will be a TCP write. If
the TCP write does not execute, because the buffer has not filled and the buffer
read vi is waiting, Alice's TCP read will timeout and return an error. When
this occurs Alice will send more laser pulses, hopefully triggering the buffer
enough times to fill it. When the buffer is filled Bob's TCP write will occur,
and Alice's TCP read will not return an error, and program execution will
continue as normal. I plan to ignore the actual error and simply use the
"status" boolean from the error out cluster of Alice's TCP read to determine
which action to take. My questions are: is there a problem with this plan, i.e.
purposely triggering (or not triggering) an error in order to control program
flow in this way? And, can anyone think of a better way for Alice to determine
whether or not Bob's buffer read has hanged? Can anyone think of a better
solution to this problem?

I'm using Labview 7.0 Pro on Alice, and Labview 7.0 Standard on Bob. Thanks to
anyone who can provide any feedback at all, I'm sure it will be useful.

Alex
0 Kudos
Message 1 of 2
(2,397 Views)

I ma not sure if you have to use TCP/IP.

What if Bob had a seperate loop that just used UDP to repeatedly broadcast a count that is incremented each time a read completes.

Alice could listen for the broadcast and and act depending on if it saw Bob count change in a resonable amount of time.

The next variation I would concider is using to use VI server (based on TCP/IP but the low level stuff is done for you). Bob could invoke a VI on Alice that told her to start. If she does not hear from Bob to stop she just keep blasting away.

Otherwise the approach you have outlined MAY work. I can not say the will not be complications becuase I ussaully write my code to avoid errors so I can not speak from experience. I seem to remember people having some trouble wit
h restarting/reopening TCP sessions over extended periods of time. That may have been some time ago, not sure on that.

I hope this help. Fire away if you have follow-ups.

Ben


Ben Rayner
Certified LabVIEW Developer
www.DSAutomation.com

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 2
(2,397 Views)