10-27-2014
11:37 AM
- last edited on
06-17-2025
01:19 PM
by
Content Cleaner
hello everyone
I have a PXIe-5122 and a PXIe-7965R. I tried the P2P interleaved data example found here:
http://www.ni.com/example/31370/en/
A single shot works fine, but I'd like to implement this in a loop. I tried to wrap the acquisition/read cycle in a timed loop but this works only once (then the DMA to host FIFOs don't seem to be filled anymore and the read operation times out). What I tried so far but didn't help was:
- remove the "SamplesAcquired" limit on the FPGA side
- flush the FIFOs before restarting the acquisition (Stop/Start FIFOs + read remaining number of elements)
- re-create the P2P stream
- explicitly wait for the acquisition to complete
For the exercise I tried to read 1000 points at 10kHz and I have a timeout of 5sec, so really no risk of overload here.
It only works if I destroy the P2P stream and re-create it on every iteration (i.e. blocks "niP2P Create Peer to Peer Stream" and "niP2P Destroy Peer to Peer Stream" are included in the loop) and set the "P2P Enabled" property on the scope side again.
I suppose there's a better way to do this, but which one?
10-29-2014 10:27 AM
Dear cent20,
the problem was that on the FPGA in the FPGA VI the Number of measurements which are forwarded back to the host is limited by the Record Length.
So you have to modify the FPGA VI and also the Host VI to make the acquisition continues.
I did this and make the acquisition continues and made a LV Snipped where you can see what you have to change.
Host VI
FPGA VI
When you change the FPGA VI you have to recompile it and then use the new compiled Bitfile in the FPGA Open Reference in the Host VI to use it.
Kind Regards,
SG3 | Applications Engineering | National Instruments | NIG |
10-29-2014 11:49 AM
Thanks a lot, this solved the problem.
Turns out I had recompiled it this way before but the FPGA_Open command was pointing to the wrong file.
In case anyone is interested, I also got it to work through Python with some wrappers to the C libraries:
https://github.com/vpaeder/pynip2p
https://github.com/vpaeder/pyniscope
https://github.com/vpaeder/pynifpga
Best regards
V. Paeder