LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RT TCP data transfer

I want to set up  a continuous TCP data transfer from the RT target to the host PC. I made a simple program [attached] in that I got to the stage where I can see in Wireshark that packets move regularly for a little while. For the sake of simplicity I use the 1kHz clock with 100ms period time.

 

However I'm kind of stuck with it because of the following problems:

 

- at first I have to start the VI on RT target [it has the listener] and then the host VI, it doesn't work the other way round

- the non-time-critical loop runs at the pace of the time-critical one for a while and stops at a random time leaving the time-critical loop running filling up the RT FIFO

- I wanted to make the TCP reading fire only at times when data comes. So in the host VI at TCP Read I used the "Immediate" mode assuming that it had an event-structure like effect but the while loop just kept running.

 

I ask for suggestions why my VIs behave so strange/what I'm possibly doing wrong. 

 

Thanks,

Krivan

0 Kudos
Message 1 of 4
(2,641 Views)

Hi Krivan,

 

Are you still having trouble with this?

 

I have looked at your code. In your target VI I noticed that you haven't set any priority between the loops. One of the main advantages of using Timed Loops is that you can determine which loop has priority. In your case the deterministic loop will need a higher priority. The higher the number, the higher the priority.

 

Also, In you deterministic loop you are building an array. Everytime the loop runs you are building a new array. This is creating a lot of data and is not neccessarily good practice. A good idea would be to initialise the array outside the loop and code it so you programmatically replace the values of an array everytime the loop iterates.

 

I hope this helps.

Kind Regards

Michael
NIUK Application Engineer
0 Kudos
Message 2 of 4
(2,544 Views)

Hi Michael,

 

thanks, I'm not having the problem anymore. In the meantime I found the solution and rebulit the VI with lots of additional stuff in it.

 

Krivan

0 Kudos
Message 3 of 4
(2,540 Views)

Hi Krivan

 

Would you please do me a favor about this issue: I am now trying to do the both things, transfering image data from the computer VI to the RT VI and then to the FPGA vi and do some processing, then transfer back to the RT vi from the FPGA vi, finally back to the computer vi. I am now able to communicate unidirectionally between the RT vi and the FPGA vi. However, in terms of the communication between the computer vi and the RT vi, i still couldn't. Therefore, could you please give some suggestions on this? Since i guess you must be able to do this by yourself now based on your question here. Thank you very much!

0 Kudos
Message 4 of 4
(2,382 Views)