LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Network shared variables to host PC

Solved!
Go to solution

Hi Everyone,

 

I need to send results of an operation from real time PC to host PC without affecting the determinism on the real time PC.

 

To do this I have two timed loops both running at 417 microseconds but at different priority levels. The one which executes the algorithm on the real time PC is at priority of 1000 and the the other loop which just transfers results from the real time PC to host PC is at priority 100.

 

I have measured the worst case time taken to execute my high priority loop to be 150 microseconds. So I should have plenty of time left to send the results to the host PC. (I want results updated every 417 microseconds).

 

I run the algorithm for 40 seconds on the real time PC. But the values are updated on the host PC only at the end of 40 seconds and not at every loop iteration as I desire.

 

What is my mistake?

 

Regards,

Prashant

0 Kudos
Message 1 of 5
(2,258 Views)

Hello Prashant,

 

Is it possible to post your VI or a screenshot of it, then we can see a bit closely what is going on. It might be that the FIFOs not updating fast enough, there may be an option we can disable there. Are the variables inside the loop? I'd also check over this article, Troubleshooting Network-Published Shared Variables.

 

Thank you,

Deborah Y.

Deborah Burke
NI Hardware and Drivers Product Manager
Certified LabVIEW Architect
0 Kudos
Message 2 of 5
(2,244 Views)

Try to enable the network buffering option of the variable.

In addition I would enable the shared variables RT FIFO option, because it's to be written in a time critical loop.

 

Be aware that reading the shared vars every 417ms is not the realtime feature.

Your realtime is the equidistance of the values guaranteed by the timed loop. I suggest to read the values asynchronous and map them to your timebase (417ms).

 

Hope it helps

Christian

0 Kudos
Message 3 of 5
(2,236 Views)

First, if you need greater determinism while transfering, you should prefer TCP/IP functions over shared variables. Using the RT FIFO option would increase the memory consumption, as it creates a separate FIFO instance for every connection being made to the shared variable engine.


@Prashant_dsp wrote:

I run the algorithm for 40 seconds on the real time PC. But the values are updated on the host PC only at the end of 40 seconds and not at every loop iteration as I desire.

 

What is my mistake?


Use TCP/IP functions to transfer data through over the host PC. The RT timed loop should be iterating every 417 ms, since you want data to be updated at that rate. Send data through TCPIP Send every 417ms. On the Host PC, read this data through TCPIP Recieve function. You need to flatten the data to string while sending it to TCPIP and unflatten it at host.

-FraggerFox!
Certified LabVIEW Architect, Certified TestStand Developer
"What you think today is what you live tomorrow"
0 Kudos
Message 4 of 5
(2,233 Views)
Solution
Accepted by topic author Prashant_dsp

Thank you all for the responses.

I did find my mistake. I had wired a variable directly from the first timed loop to the second timed loop. That was the reason that the second loop was always waiting and never executing. I used dummy shared variables to transfer data between loops. Now the loop works fine.

 

Thanks again

Prashant

0 Kudos
Message 5 of 5
(2,219 Views)