Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

can't convert temperature (double) to voltage (fixed point)

Hi,

I 'm trying to control temperature with a cRIO-9012 controller along with a 9103 chassis and a 9211 module; the heater is controlled by a 9474 DO; however my problem is trying to convert a temperature to voltage (fixed point) so the PID controller in the FPGA target can process this setpoint and run its calculations. I have tried the VI's found in the Getting Started examples in the module specific folder (Convert to Binary 9211.vi) but they do not give me a value similar to the value read by the FPGA.  

For instance, this is what i will read from the FPGA VI

 -0.00012877583503723144531250 which corresponds to 23.1 deg. Celsius after using the NI 9211 Convert to Temperature (Calibrated).vi.

  CJC = 0.02585478127002716064453125 

 Autozero = 2.56299972534179687500000000E-6

 

So my question is: Is there a VI which will convert Temperature to Voltage for the fixed point data type in LV 8.6.1?

 

Thanks,

 

 

0 Kudos
Message 1 of 3
(3,927 Views)

bermea,

 

I usually run my PID with temperature setpoints, not voltage setpoints, so I don't know of a subvi on FPGA that accomplishes that.  I would just look in the 9211 getting started example, look at the 'cRIO temperature to volts', which is built to run on the host so it is using DBL datatypes, and just use those equations on the FPGA without formula nodes. 

 

Or, if you want a different approach with less math, pass all your temperature data to the Host with DMA, use that subvi to convert to voltage, then convert to fixed point and send it back to the FPGA for processing.

 

Let me know if that is clear!

Rob K
Measurements Mechanical Engineer (C-Series, USB X-Series)
National Instruments
CompactRIO Developers Guide
CompactRIO Out of the Box Video
0 Kudos
Message 2 of 3
(3,858 Views)

Rob,

Thanks for the reply,Yes I see what you mean. I will look into the DMA approach; but I have to ask you: Do you run your PID on the HOST vi or on the FPGA? Because I also want to use Temperature Setpoints but since my PID is executed on the FPGA the PV is read in volts so I assumed that I should send the Setpoint in Volts and do the conversion on the Host VI. In any case I will follow your advice and run some tests.

Thank you,

0 Kudos
Message 3 of 3
(3,854 Views)