01-02-2015 08:19 AM
All,
Having issues sending out my arbitrary waveform to my cRIO analog output. My values are doubles and by the time I send them out, they have been converted to U32 values and are all turning out as zeroes. This led me to assume two things: 1) That cRIO analog output can only output integers since the values need to be deployed in the memory first and 2) that I'm missing a step in the conversion process. My values range from 0-8, therefore I don't expect that the simple conversion tool in labview should make everything into zeroes.
Any help?
01-02-2015 09:34 AM
Hi George,
how are you writing values to your AO outputs?
- Using the ScanEngine you would write DBL values, they are handled and converted by the ScanEngine.
- Using the FPGA interface you would write FXP values as each (AO) module provides access nodes to its in/outputs with the correct (FXP) datatype. Conversion from DBL to FXP should be done on RT (IMHO, even when FPGA supports SGL data from LV2013(?) on).
Please show your VI for further analysis and more detailed help…
01-02-2015 12:45 PM
GerdW,
I am currently writing to AO using the FPGA interface, because I am using the NI-9263 and don't have ScanEngine compatibility. I won't have access to my VI until Monday, but I can describe what I am doing.
I have a VI programmed on my cRIO to write the values from my PC Host VI to the analog outputs on the cRIO. On the host VI, I am pulling my values for an arbitrary waveform from a txt file and loading them to the cRIO memory. After they are loaded, the VI on the cRIO pushes these values through the Analog Output.
However, I found out that the values that are being sent from the Host VI to the cRIO VI are being automatically converted to integers and are appearing to all be zero.
I don't have much experience with the FXP datatype... how do I do the actual conversion from double to FXP?
VR,
George
01-02-2015 01:17 PM
Hi George,
I also used the NI9263 before.
Do these steps:
- create a FPGA VI with an output node for your 9263 AO channel. That node will have a FXP datatype.
- create a control for that AO channel by right-clicking the output node and Create->Control.
- Put a loop around that all and compile the FPGA VI.
Then create a RT VI that sets that control in the FPGA front panel. That way you will use the very same FXP datatype in the RT VI. By connecting your DBL values to the FPGAWriteControl node you will have a coercion dot where the DBL is converted to the correct FXP datatype "on the fly" (to quote Altenbach 🙂 ).
I too have access to LabVIEW with FPGA on Monday to provide you with a snippet / image…
01-02-2015
01:45 PM
- last edited on
12-04-2024
02:16 PM
by
Content Cleaner
The Fixed Point 101 and 102 articles are very much worth your time if you want to learn more about what a fixed point representation is and how it works. Also the attached VI helped make fixed point representation 'click' for me.
01-02-2015 10:50 PM
01-05-2015 07:09 AM
Since we are using the cRIO's FPGA interface, you really should be doing most of this inside of the FPGA. Use DMA FIFOs to pass your data between your RT and the FPGA (and visa versa).
On your FPGA, you can have a loop that just reads the analog inputs at whatever loop rate you want. You just send the data to the RT using a DMA.
Similarly, use a DMA to send your analog output values to the FPGA. The FPGA can have another loop that reads the DMA and writes the value to the analog output. This should be done in the FPGA since you can have the FPGA send out the values at a given (and deterministic) loop rate.
01-08-2015 10:54 AM
All,
Thank you for your help - I'm now able to send out my signal. I am now facing a problem with timing of sending the signal. Currently, I pull the signal from an excel file and send one element at a time through my analog output through FIFO using a for loop. Since I'm using FIFO, it looks like I have to send an element at a time and cannot hook up an array to the FIFO input, but using this for loop to pull the elements out is causing it to be sent in about 2 seconds, when I need to send it in about 0.002 seconds. I'm currently sending about 2000 elements. Please let me know how to go about sending the signal faster.
01-09-2015 08:10 AM
Hi Ghaf,
I am new to LabVIEW and cRIO programming. I want to transfer the sinusoidal waveform to analog Output card. Could you please give me a direction to start with? Your input can reduce the tedious task to a simple one. Kindly share some example VI if you have regarding sending waveform data from cRIO to AO card using FPGA.
01-09-2015 08:13 AM
@ijaz wrote:
Hi Ghaf,
I am new to LabVIEW and cRIO programming. I want to transfer the sinusoidal waveform to analog Output card. Could you please give me a direction to start with? Your input can reduce the tedious task to a simple one. Kindly share some example VI if you have regarding sending waveform data from cRIO to AO card using FPGA.
Look through the LabVIEW Examples (Help->Find Examples). I know there are a few in there that will show you exactly what you are looking for.