03-15-2017 11:33 AM
Hello,
I need to connect to PC's. In the first, I will have a VI receiving data from two RF antennas. The same messages are received containing several data and a CRC. Each line is checked for their consistency and the one with no errors is selected and saved in a text file. If the two messages have no error, then Antenna 1 have priority.
Now I want to transfer this lines to another computer, to be processed in another VI that displays the data from the message.
Let’s say that the first computer and VI acts like a server after checking for the “best” message.
For this data transfer I am thinking about using TCP/IP connecting the two computers via cable.
I saw some examples of VI’s for sending and receiving but I am not very familiar with this protocol and procedures.
Can I have your help please?
Thank you.
Duarte
Solved! Go to Solution.
03-15-2017 12:16 PM
03-15-2017 12:23 PM
The two routes I would recommend are: 1) use Network Streams (handles a lot of the low level TCP stuff for you) and 2) the STM (Simple TCP/IP Messaging) library (free on the LabVIEW Tools Network). The Network Streams is probably the better route for you.
03-20-2017 08:48 AM
crossrulz escreveu:
The two routes I would recommend are: 1) use Network Streams (handles a lot of the low level TCP stuff for you) and 2) the STM (Simple TCP/IP Messaging) library (free on the LabVIEW Tools Network). The Network Streams is probably the better route for you.
Hello and thank you.
Before I do it in my main project, I tried to do some tests. Bellow I have the snippets of my writer and reader sides. Its fine but if I abort the execution on the reader side the writer keeps sending strings. If I run the reader VI again it doesn’t receive any data. I have to abort writer VI and run it again.
I was wondering how can I make reader VI to reestablish data reception after aborting the execution one or more times?
Thank you.
WRITER VI
READER VI
03-20-2017 09:01 AM
Stop your loops on an error. You will get an error when the other disconnects. This will clear out the connections. Then you can just run both again.
Alternatively, you have a state machine to manage your connections. If you lose a connection, you go into a state of waiting for a connection again. When you have the connection, go back into the Write or Read state.
03-20-2017 10:05 AM
Ok! Thank you.
I have one more question, please. Is it possible to send a character from the reader to the writer by pressing a button for example?
03-20-2017 10:09 AM
03-20-2017 01:35 PM
Well,
I’m not sure if am in the wright path.
Now my writer(PC1) is also a reader and my reader(PC2) becomes a writer. I am testing by sending a character from PC2 back to the writer (PC1) if the button is pressed.
I still can’t put this into work. Should I se the same line like VISA?
Any idea please?
Bellow my snippets:
PC1 (now with the second NS to read from PC2)
PC2 (now with second NS to write characters to PC1)
03-20-2017 01:56 PM - edited 03-20-2017 01:57 PM
03-20-2017 07:10 PM
Well,
I think it's to much for me.
I don't get how to adapt it. 😞
Thank you!