02-03-2012 12:33 AM
Hi,
i wish to send data from computer A to computer B (one way only). I have set the IP address of computer A (sender) to be at 123.11.22.1 and the IP address of computer B (receiver) to be at 123.11.22.200. This is identical to the IP address that i have set (in computer A) for the TCP open connection.
Attached are the two VIs that i am trying out with two PCs. I am not able to get it to work. Would appreciate if anyone can help to point out my mistakes? Thank you!
02-03-2012 12:37 AM
so sorry.. its working.. just that i didnt run the receiver first..
03-27-2012 02:38 AM
Hi,
I wish to send data from Host computer to cRIO . I have set the IP address of Host computer (sender) to be at 192.168.1.3 and the IP address of cRIO (receiver) to be at 192.168.1.2. And giving sasme port no (6341) in both side.
I am getting random value with actual value. Also every time its getting reset
I have attached my VIs. Please find it and help me here to find the solution.
03-27-2012 10:49 AM
You're asking the TCP Read to return 500 bytes, even though that is not the size of the data packet you're sending. Your data is 4 double-precision (8-byte) values, so each packet is 32 bytes. Since 500 is not a multiple of 32, after reading the first 500 bytes (and discarding most of them), the next read will contain part of a previous packet, and that will give you random values.
Since you have mixed data types, it will be easier if you bundle the data into a cluster instead of building an array. Read only the number of bytes in that cluster, not some arbitrary number of bytes. Also, there is no reason to use a timed loop on the receiving side since the timing is determined by waiting for the data. A standard while loop is fine here.
03-28-2012 01:53 AM
Thanks Nathand . Now its working.
04-28-2012 02:42 PM
How to find the how much bytes is required to read in TCP read while sending mix data type?
I am tring to send 4 boolean & one integer value(dbl) also I'm tring to send 5 boolean value using TCP/IP from one HOST PC and 4 EXE instaaled PC to the RT target. But In RT side receiving random value with actual value. Also every time its getting reset and boolean value in RT side is getting change every time.
So please tell me how to calulate how much bytes is required while receiving mix signal?
Thanks!
04-29-2012 12:18 AM
Convert the data to a string (using typecast or flatten to string, whichever you are using in your application) and then use the "string length" function to determine the length in bytes. Often you would send this length as part of the data, so that your code can easily adapt to changes in the data type. You get the string length, convert it to a string, then prepend it to the data string. On the receiving end, read 4 bytes (the length as a 32-bit value), then read that number of bytes, as shown below. Each TCP read does not strictly correspond to a single packet of data, so you can send the length and data in a single write but read the length and the data in two separate read operations with no loss of data.
05-02-2012 06:10 AM
Hi,
I am new in LabVIEW and I am using TCP communication protocol to send mix Data(Numeric, boolean) from 5 client(5 PC) to the RT Target. We are sending different data from different Host PC to the RT target. I am using TCP listener in RT target and TCP open coneection in PCs. Here I am facing problem is that every time I have to run RT vi first and then host PCs VI. If I am running PC vi first I am getting error 63 occured at TCP open connection. Is there any solution for this? Is there any possibility to communicate if I run the any one of the VI first?
Also I am not able to make a connection , Disconnection and connect to all connection switch to connect the network(communication) between different PC to RT Target. If you have any idea about this, please let me know.
Thanks!
05-02-2012 10:30 AM
@srikant kumar wrote:
If I am running PC vi first I am getting error 63 occured at TCP open connection. Is there any solution for this? Is there any possibility to communicate if I run the any one of the VI first?
Please spend some time reading about the TCP communication protocol. The server side must already be listening in order for the client side to establish a connection. If the client attempts to make a connection and there is no server listening for it, you'll get an error at the client. The solution to this is if you get that error, try again.
@srikant kumar wrote:
Also I am not able to make a connection , Disconnection and connect to all connection switch to connect the network(communication) between different PC to RT Target. If you have any idea about this, please let me know.
I cannot understand what you are trying to say here. Could you explain more clearly? It might help if you attach your code.
11-28-2012 06:24 AM
Hi Nathand,
I have built a program using LabVIEW 2011 version . I was trying to edit my front panel without running the VI. During editing the vi( move the control or indicator to other place on front panel) my labview program became very slow. It was taking 8-10 sec to change.
Also when I tried to save my vi it was showing the popup " LabVIEW:Cannot load Block diagram. Cannot save VI test.vi" . Then I tried to close the VI and thereafter Labview become busy and not responding and shows the popup that "LabVIEW 11.0 Development System is not Responding" and finally my VI file get corrupted. Whenever I tried to open my VI, its shows the Popup "LabVIEW: Resource not found". File size of my VI was 1789 KB and became 912KB. I have attached my all error and popup.
Why my VIs are getting corrupted?
Please help me to find the solution of this problem.
Thanks,
Srikant Kumar