Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronized I/O using FPGA R Series device

Hi everyone,

 

I have been using the Balanced I/O Personality (http://www.ni.com/example/5961/en/) to generate and acquire analog signals. However, I am finding that it doesn't quite fit the requirements of my application.

 

I would like to acquire and generate data in a synchronized manner. I recently completed the online FPGA course, but I am still left with some questions, regarding how to modify this particular code to fit my requirements.

 

I would like to run acquisition and output loops at the same clock rate. For that, I understand that I need to use the same loop timer ticks for the AI and AO loops, which will be hard-coded into the FPGA. I also understand that the AI and AO while loops only start running if the "AI Enable" and "AO Enable" booleans are set to true. Should I only use one boolean which enables both at the same time in the FPGA VI?

 

Also, most of my confusion lies in the way the Host VI works. I would like to output and acquire a finite number of samples, starting at the same time. I am not sure which functions of the code should be synchronized. Please find attached an image containing the two original codes for AO and AI and my suggested changes to make them run simultaneously. I would really appreciate it if someone could suggest whether my proposed changes make sense and point me in the right direction.

 

The FPGA course brought to my attention the use of occurences to synchronize tasks - should I be using them for this code?

 

Thanks in advance, and looking forward to your replies.

 

 

Download All
0 Kudos
Message 1 of 4
(4,041 Views)

Should I rephrase my question? Please let me know if it is not clear.

0 Kudos
Message 2 of 4
(4,016 Views)
Have a little patience. You posted to the wrong board and on a national holiday.
0 Kudos
Message 3 of 4
(4,014 Views)

Hi Nde,

 

The suggestions that you make do seem reasonable. I would have thought that having a joint enable boolean and same loop timing would make the AI and AO synchronised as they use the same clock. Try this out, possibly link the output to the input and see if you are receiving the entire signal.

 

I think using the booleans instead of occurances will be fine to control when the VIs run.

 

Just a quick clarification on terminology: Host would be the HMI (human machine interface, eg the PC) and RT Target would be the RT VI's. Then FPGA obviously still the FPGA target onboard of the RT target.

 

Let me know how it goes.

 

Pete

Certified LabVIEW Architect
0 Kudos
Message 4 of 4
(3,959 Views)