LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timed Loop TCP/IP

I'm redoing the architecture of a program I have written and for my concept I'm seeing a weird behavior with a timed loop.

 

The Project File has two main VI, the ground station (server), and the Fligtht DAQ (client). The Flight DAQ will log data every 10 ms (timed loop) and every 1 second (every 100 iterations of the timed loop). The Data gets added to two different ques and then is sent to a subVI which writes the data via TCP to two different ports. The loop counter from the flight daq (temporary concept data) is displayed on the Ground Station front panel, (RT = 10ms data), (Test Data = 1 s data). 

 

When running the program I observe that the Test Data increments every 100 loop iterations which equates to every second. However the RT Data increments very slowly and lags the Test Data. At first I thought it was an issue with the consumer loop so I added some "get que status" to indicate the number of the elements but the stack never grows so the consumer loop is just as fast as the producer loop. One thing I do notice is that when I stop the client, the RT data catches back up. 

 

To troubleshoot the issue, I looked at the data going into my TCP write subVI and I noticed that the correct data is going into the subVI so I'm not sure why I'm not getting the correct output during runtime. 

 

If anyone has any suggestions or ideas I would greatly appreciate it. To get this program to work, the Ground Station VI has to be running before the flight daq vi.

 

 

0 Kudos
Message 1 of 7
(3,818 Views)

Thanks for the code. let us try it 

 

Did you try to use the Execution Highlighting, the probe watch, and the breakpoint  manager ? 

https://www.ni.com/en/support/documentation/supplemental/12/debugging-techniques-in-labview.html

0 Kudos
Message 2 of 7
(3,758 Views)

I did use typical debugging tools with the LV environment. Some observations I made.

 

1) The input to the TCP Write VI is correct, as it matches the loop counter.

2) The value is incorrect at the TCP Read VI, as the RT lags, (dependent on the Tes-Data, increment value)

3) I tried putting known values into the TCP Write VI, and when doing this I get the correct TCP Read values so I believe the conversion from a I32 to a byte string and then byte string to I32 is correct.

4) When stopping the Flight VI the RT data catches back up to its correct value.

0 Kudos
Message 3 of 7
(3,745 Views)

Thanks 

0 Kudos
Message 4 of 7
(3,723 Views)

I run your code, but I have no advance with this. everything seems right.

 

0 Kudos
Message 5 of 7
(3,704 Views)

Are you running the client and server on two separate computers? I have tried running it on two different computers, but the server and client always on the same pc, on both pcs I observed the issue. Maybe if your running on two separate computers its a NIC issue.

0 Kudos
Message 6 of 7
(3,677 Views)

let me try. 

0 Kudos
Message 7 of 7
(3,671 Views)