From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
02-17-2021 04:56 PM
Hello,
I am curious on output amplitude when running a VI and sending signals to analog output modules. I have an NI 9264 and an NI 9266 and am running an executable with an fpga file. My question is on the fpga file how do I know what the amplitude is going to be? For example if I set a variable to 1 and send it straight to the analog voltage module channel 0, I will get 1 volt on that channel. However, for the NI 9266, it is a 0-20mA module. If I send a variable 10 to that module am I going to get 10mA or is it going to try to output 10Amps and clip at 20mA? I am just unsure of how to scale that output as a variable to what kind of output I am going to get.
Thanks,
Matt
02-17-2021 07:34 PM
Modules for FPGA are give a value from 0 to 65535, a 16-bit integer. So 0 is 0 and 65535 is 10 V on a 0-10V module. Same numbers are 0 and 20 mA on a 0-20 mA module.
So if you want to send 10 mA to a 0-20ma module 10/20*65536 = 32768. Check the manual for the module for more details. It might be divide by 65535.
02-18-2021 01:13 AM - edited 02-18-2021 01:22 AM
Hi,
most often in the FPGA you use FXP datatypes to handle AI/AO values.
FXP are similar to floating point values, but with a fixed value range/resolution. A ±10V module will accept FXP values in the range of ±16.000, a 0-20mA module will probably accept FXP values in the range of 0-32.00e-3.
I just checked in a recent cRIO project of mine:
Again: RTFM (read the friendly manual). Don't forget to learn from the example VIs provided by NI for each cRIO module!
02-18-2021 09:30 AM - edited 02-18-2021 10:11 AM
Thank you Gerd,
This is interesting because for my analog voltage module I know I am sending a sine wave of amplitude 5 out to the module and that's what I am getting on the hardware so I am not sure what RavensFan is referring to. Also I was not aware there were examples for each cRIO module, I will try to find those. Then with the manual, I have the getting started guides and the datasheets but I am not sure that I ever found a different manual for the modules and they don't mention anything about the coding side to it.
Thanks for the help,
Matt
02-18-2021 02:47 PM
@MGardner5 wrote:
Thank you Gerd,
This is interesting because for my analog voltage module I know I am sending a sine wave of amplitude 5 out to the module and that's what I am getting on the hardware so I am not sure what RavensFan is referring to. Also I was not aware there were examples for each cRIO module, I will try to find those. Then with the manual, I have the getting started guides and the datasheets but I am not sure that I ever found a different manual for the modules and they don't mention anything about the coding side to it.
Thanks for the help,
Matt
C-series modules can be used in both cDAQ chassis and cRIO chassis. If you were using a cDAQ, then you'd be using DAQmx drivers and you can write the data as a double precision floating point number.
When it is in a cRIO chassis and executing through an FPGA like you are talking about, then you can't use floating point numbers. I just created a simulated project, and like Gerd says, it uses a fixed point data type with a range of ~ +/-16
I did not realize the c-series modules in a cRIO chassis used a fixed point. What I am talking about was from my experience with an FPGA, but it turns out it was an R series card in a PXI chassis. There the analog inputs and outputs were I16 integers. So any engineering number like +/- 10 V had to be rescaled to an I16 integer of -32768 to 32767. (Earlier I thought it was a U16.)