02-22-2023 04:51 AM - edited 02-22-2023 05:18 AM
ok thank you so much. i actually open my TCP connection in the Loop because i want to place an event structure in my first Loop that will help me to send different request to my device when i click on a particular event.
02-22-2023 05:13 AM
HI you are right, thats just what i did and it works. but the second Loop is faster than the first because i added an event structure in my first loop. How can i make the two loops to work individually. each at its own rythm
02-24-2023 07:21 AM
Hallo,
i want to use my TCP connection in a bidrectional way to read and write using the same Port and IP Adresse. I want to send data from the client to my server and read back the data from the server to the client.
this is what i have writen, but it does not seem to work as expected. Please can someone help me out?.
thanks in advance
02-24-2023 08:00 AM
Create VIs to send and receive messages and use them on both server and client. Sending could consist of prepending a message with the message length and receiving of reading the message length and reading the expected number of bytes.
02-24-2023 08:08 AM - edited 02-24-2023 08:10 AM
HI cordm,
thanks for your reply. I need to constantly read and write that why i used only one VI
I modified my both VIs as seen below. but i can only read some data coming from the server. i am unable to read all the data coming from the server.
02-24-2023 08:42 AM
You are not doing the same on client and server side. An i32 has four bytes.
Use subVIs, set them to shared clone reentrant.
02-27-2023 01:00 AM
Hi Cordm,
thanks for your reply. i donot really figure out what you are saying about using shared clone reentrant
02-27-2023 03:06 AM
Hi Natacha_Kam,
1. Your server sends the length of the returned data in I32 format - 4 bytes. But the client first reads only 2 bytes, and then tries to typecast them to I32 - this is wrong.
2. See the example in "labview\examples\Data Communication\Protocols\TCP\TCP Named Service\TCP Named Service.lvproj" for how to create a listening TCP server.
PS: If you need to read and write TCP frames in the same VI, then why do you even need TCP? You can transfer data directly...
02-27-2023 03:13 AM
HI diman27,
thank you for replying. I am confused beacuse in my client i wired 4 as the Bytes to be read. where do you excatly see that i am reading only 2 bytes.
i used the same VI to write and read because my Server is in a different Project and i cannot use an FGV to to directly trasnfer data, except if there is another way to transfer data without using fgv. ( please correct me ,if i am wrong)
02-27-2023 03:23 AM