LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tcp read and write

Hello,
I'm working on the connection TCP IP between two pc's.
One with Labview Real Time, the other with Labview.
The communication is no good between the two pcs.
The program on RT send a boolean to the host pc for to command a led. And i don't find why my programs doesn't ok. Please see my two programs. Where is the error? the adress IP are ok.
Download All
0 Kudos
Message 1 of 4
(3,089 Views)
I see a few problems that could be causing this:

1) In the VI that runs on RT, you are using "TCP Create Listener" which does not itself wait for a connection. It would be more appropriate to use "TCP Listen.vi" which is on the same palette.

2) You are not specifying how many bytes to read in your TCP Read on the host VI. I'm not sure what the behavior of that primitive is when that input is not wired.

Try changing those two things, and that should hopefully get you closer at least.

Hope this helps,
Greg
0 Kudos
Message 2 of 4
(3,089 Views)
Thank you for your help.
But with this modification the problem is the same !!

On the host program , i receive every time a state 0 also the LED is oFF.
i recieve never a state 1.
It's a problem a send of state between the two pc .


DAMIEN
0 Kudos
Message 3 of 4
(3,089 Views)
PLease post examples of your updated code.

Your original example VI's do indeed show that you did not wire up a read byte count. The default value for this input is zero bytes. A zero length string passed to the type cast to boolean will always return a false.

This is consistent with what you have reported.

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