LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to synchronize windows and RT using shared variable.

Hi,

I am using NI cRIO 9014 and NI 9215 module to read the AC voltage signal. I used FPGA interface mode.

I read the FPGA control output in the RT program. I have to transfer the analog waveform to windows VI.

In the RT VI, i have a timed while loop with 1 MHZ clock  .I am passing 500 microsec as FPGA 9215 loop rate and 500 microsec as iteration rate in RT.  i place the data from FPGA on to a network double data type shared variable. I keep the RT VI running continuously. Now i open a VI on windows in the same project explorer and read from the same shared variable. Here i have to give the loop rate in millisec. i gave as 10 millisec. When i plot the data on to a chart in windows, the waveform data is completely skewed. If i put a chart in RT and check, i can see the plot correctly. So how do i synchronize the loop rates of RT and windows VI.

I want to use shared variables because they are simpler to code(transfer data).

Please let me know how to get the correct analog voltage data waveform on windows using shared variables from RT. The waveform in RT and windows should match. actually i can remove the plot in RT as the user only sees the windows VI.

Thank you. Hema

0 Kudos
Message 1 of 4
(3,469 Views)

Hi Hema,

 

Thanks for the post and I hope your well today.

 

I noticed you hadn't received any support thus far.

 

There are several common ways to communicate between VIs running on RT targets and host VIs running on a Windows based desktop PC. You are correct, shared variables are a good method. 

 

Please see this link - which explains more:

 

Real-Time VI to Host VI Communication Methods

http://digital.ni.com/public.nsf/allkb/48D244EC86971D3986256BD4005CCC28?OpenDocument

 

My understanding is to acheive Deterministic Data Transfer Between VIs you would need  to use Real-Time FIFO. Are you familar with this?

 

If not, please take a look at this developer zone artcile:

 

Real-Time FIFO for Deterministic Data Transfer Between VIs

http://zone.ni.com/devzone/cda/tut/p/id/3934

 

and there is also an example,

 

Real-Time FIFO Example

http://zone.ni.com/devzone/cda/epd/p/id/1898

 

Please let me know what you think and how you get on,

 

Kind Regards

 

 

 

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 2 of 4
(3,439 Views)

Hi Hillman,

 

Thanks for the post and links. I was basically not doing deterministic transfer. i used RT FIFO and wavefrom is fine .

-hema.

0 Kudos
Message 3 of 4
(3,419 Views)

Hi Hema,

 

Im glad thats all sort! and thanks for letting me know.

 

Kind Regards,

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 4 of 4
(3,417 Views)