From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass data from RT to PC that cycle at different speed?

Dear all,

I have labview 8.6.1 installed on the PC.

I have a cycle in RT with 10ms execution rate  that produces an array of 10 numbers every 10 ms,

I have a cycle on the PC with 1s execution rate that reads the data every 1s. Therefore the numbers to be read on the PC are 1000 every cycle.

How to set the shared variable in order to pass the data between the loops at different speed without loosing data?

 

Thanks

Max

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

You have to use an RT FIFO for keeping the data in the buffer in RT so for every 1000ms you have 100 sets of data that you can write to that shared variable but the data is not guarantied instead you can use TCP/IP communication for sending the data so for every 1000 ms you can send the data from the RT and in the host you can read the data and keep it in a queue that you can use for data logging and plotting.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 4
(2,049 Views)

Dear Anand,

thank you for you reply.

Regarding the RT FIFO, it is not clear to me your idea. It looks like you propose to write from RT every 1000ms 100 sets of data, whereas I would like to write from RT 10 numbers every 10 ms and read 1000 data every 1000ms.

 

Regarding TCP/IP, where could I find examples for RT / PC communications?

Thanks

Massimo

 

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

Ok I go with your Idea. Instead of writing to the Shared variable write it to a FIFO or Queue. Then for every ms write the data to the shared variable and in the Host you create a Queue and write the data that you read from the shared variable and then read the queue so you will not loose any data. I would suggest that it would be better if you increase the read rate in the Host in a parallel vi.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 4 of 4
(2,033 Views)