LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Send message from one PC to another via TCP/IP.

Solved!
Go to solution

Hi Duarte,

 

the "Simple Network Streams" example explains how to use network streams.

It uses one stream to transfer data from commands from host to target and another stream to transfer data from target to host. I thought you want to do very similar things…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 11 of 14
(1,701 Views)

Hi GerdW,

Thank you for your kind tips.

I will explain better what I need. I developed a VI that is running on a PC that I call PC1 (writer). In this computer, there are two RF antennas receiving data from a flying object. I have two antennas for redundancy and because I don´t want to lose any message. My VI verifies the integrity of the messages arriving (search for a special code and check CRC) at the two antennas. So, if the message in antenna 1 is OK then the VI sends it to PC2 via Network Streaming. If not, the VI sees if the message in antenna 2 is OK and sends. If none of the messages are good, the last good message is sent.

When arriving to PC2 (reader), the message containing several variable values is processed and data is displayed in some indicators and graphs, some LED’s are used to show sensor power on or off, and so on.

One of the features that I want to do is to send commands to the flying object. I have done this before when using VISA Write when having this VI connected to the antennas in other project.

That’s why I need to send characters from PC2 (normally the reader) to PC1 (mainly the writer). Each character corresponds to a certain command sent to the flying object via one of the antennas connected to PC1.

I am studying the examples you told me. I think that, in this examples, data is sent and received continuously. And I think that probably some logic to just send when its not receiving(?).

In the last Snippets I sent yesterday, I am able to send the Q when pressing the button (from PC2) but I don’t receive anything from the writer(PC1).

What I need is to have some buttons in the PC2 VI to send commands to one of the antenna via Network Streaming from PC2 to PC1 while receiving messages in PC2 sent from PC1.

I hope it’s clear,

Thanks again.

 

PS - sorry for my limited English.

0 Kudos
Message 12 of 14
(1,691 Views)
Solution
Accepted by topic author DuarteCota

Hi Duarte,

 

in your snippet you were setting up the SAME netstream twice on each computer using the VERY SAME label for that stream. As a stream has a direction you can only use it to receive OR send data, but not doing both with just one stream!

 

Please examine the referenced example CAREFULLY to learn how to use two streams between two VIs to send data back and forth…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 13 of 14
(1,682 Views)

Hello GerdW.

I have arrived to the solution! Thank you!

Above all, thanks for leading me to the wright path. You taught me how to do the fishery instead of giving me the fish.

Best to you!

Duarte

0 Kudos
Message 14 of 14
(1,663 Views)