LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

syncronize FPGA AI / AO

Hello,

 

I'm testing the sbRIO 9631 and I want to make some data acquisition.

I want to simultaneously acquire 25000 points of data from 6 analog inputs and generate a 25000 point ramp on the analog output.

I tried it with two channels (one reading the potmeter of my evaluation board and the other reading the data I generate in the AOut0).

I use two DMA FIFOS, one to send the acquired data to the RT host and the other to send the ramp from the Host to the FPGA.

My AOut FIFO has 25000 points depth and the AIn FIFO has 50000 points. This way I was hoping to ensure synchronization between them since I right twice per cycle in the AIn and once in the AOut (every second - 25000 points @ 25 kS/sec).

 

As you can see from the graphs.jpg, they are out of sync. In the first one or two iterations they seem to move a bit, but stabilize at the point shown in the picture.

 

Another question I have is the sample rate, I just added the 40us loop timer to ensure a sample rate of 25 kS/sec. Is this the best way to do this?

 

Thanks,

Paulo

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

Hi Paulo,

 

I think this is just a display issue, have you been able to check with a scope if your input / output are synchronized ?  

 

To synchronize the display of the AO with the response you get on the AI, you will need to code this logic yourself.  Something like a "merge signals" VI using the AO as one input and the AI as the other input might work, although you will need to make sure that the AI waits until valid data points are being read before merging it with the AO (a case structure would probably be sufficient for this).  In other words, you need to make sure that an AO point is merged with its corresponding AI point.

 

Regards,

0 Kudos
Message 2 of 4
(2,721 Views)
How did you connect the analog input to the sbRio? I am trying to read a simple Analog Input from a function generator on AI0 on a sbRIO 9641.  I have the analog signal connected to AI0, and the ground from the fucntion generator connected to AGND.  I am unable to read any signal.
0 Kudos
Message 3 of 4
(2,621 Views)

Hello, 

 

That should be enough.

Are you sure it is not a software problem?

Did you build you program or use the available examples?

 

Best Regards,

Paulo 

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