Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I read two values via FPGA on MyRio?

Hi,

I'm trying to read two values from a MyRio devices via FPGA interface. I can only get one of the values to read in real-time at any given time (either temperature from DIO-1, or from the onboard accelerometer).

 

I've including both sub-systems in the same for loop, and separate for loops, but neither has worked. 

 

Is this something to do with the FPGA interface prioritising reading one element over the other?

 

 

0 Kudos
Message 1 of 6
(2,462 Views)

Hi, I haven't seen your code but following link should help you.

Transfer multiple channels of data through one DMA FIFO on FPGA

Certified LabVIEW Developer
There are only two ways to tell somebody thanks: Kudos and Marked Solutions

GCentral
0 Kudos
Message 2 of 6
(2,442 Views)

Thanks for the info! I'm attempting to implement a FIFO now, but have a query about my FPGA target vi.

 

Should I have individual FPGA target VIs for each type of data from the sensors (i.e. one for temperature, one for accelerometer, one for GPS), or include them all within the same VI? 

 

Thanks in advance! Smiley Happy

0 Kudos
Message 3 of 6
(2,435 Views)

You can transfer acquired data through FPGA FIFO.

One FIFO has only one data type. You cannot combine and transfer DBL and FXP at once.

 

Using the Single-Precision Floating-Point Data Type

As above link, convert the data to SGL and then transfer it.

SGL data type uses more FPGA resource, be careful.

Certified LabVIEW Developer
There are only two ways to tell somebody thanks: Kudos and Marked Solutions

GCentral
Message 4 of 6
(2,427 Views)

For my GPS modules I am reading the NMEA sentences, in a string format. 

 

Would you suggest that I use separate Target-To-Host FIFOs for each data type acquired from the MyRio to transfer the data to the host or RT? 

 

If so, would it be best to acquire all data from sensors within the same subVI? 

0 Kudos
Message 5 of 6
(2,382 Views)

Make sure to check out what the working code looks like on an oscilloscope, you'll need that later.

 

Let's say you have code that works and a loop around that. You can put everything in that loop into a subVI. Assuming there's no resource conflicts, you should be able to put multiple of those subVIs in one big loop and still have that work. If it doesn't, go back to the oscilloscope and try and figure out what changed in the signal.

 

If there is some resource conflict you should be able to wire an enum control to a case structure and drop one of those subVIs in each frame of the structure. That would make it so they don't run at the same time.

 

I didn't see accelerometer code or GPS code. Is that also 1 wire?

 

 

0 Kudos
Message 6 of 6
(2,372 Views)