Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Binary to Nominal.vi

Hello,
I want to use the Binary to Nominal.vi in my FPGA vi. However, everytime I cut and paste component of the Binary to Nominal.vi to my FPGA vi, especially the ones of type double, the FPGA vi refuses to accept it. As a consequence, the arrow in Labview becomes broken and I cannot compile and run my vi. For instance, if I want  put 1E-12, the FPGA vi refuses it. Any advice from you would be appreciated.
 
Thanks
 
Dedy
0 Kudos
Message 1 of 6
(7,280 Views)
Hi Dedy
 
FPGA by its nature supports integer programming only. There isnt an arithmetic chip within an FPGA therefore it can only support simple mathematical functions. You are using a double which is a non integer data form. when using FPGA you will have to use only integer data.
 
If you are using labVIEW 8.5 it is possible using a programmable floating point to use non integer numbers but this is not simple. Are you using this version if so would this help as I can advise further?
 
Is your Binary to Nominal.vi a sub vi that you have created as I have not used it before.
 
Is there a chance I can take a look at you VI, could you attach it. this would help me get an understanding of your aims?
 
Thanks very much, hope I have been helpfull
 
 
Graham Green

Sr. Product Marketing Manager

National instruments
0 Kudos
Message 2 of 6
(7,260 Views)

The Binary to Nominal.vi is shipped as part of the LV FPGA examples that illustrate how to convert binary data from cRIO analog input modules into scaled and calibrated real world units (volts, amps, etc.) This VI can not be used on the FPGA as it uses double precision floating point numbers. It should be used in the host VI which runs either in Windows or LV RT.

The raw binary data from the analog input modules must be tranferred from the FPGA to the host VI before it can be scaled and calibrated using the Binary to Nominal VI. You must also transfer the calibration constants from the analog input module to the host VI for the scaling and calibration process. See the example shipped with cRIO for each module type that illustrate this process.

authored by
Christian L, CLA
Systems Engineering Manager - Automotive and Transportation
NI - Austin, TX


  
0 Kudos
Message 3 of 6
(7,257 Views)

Hi Graham,

thank you so much for your reply. Please find my vi attached (in word document). What I want to do is to convert the binary of channel AI0 which is 6407225 (refer to the front panel in the attached document) to a nominal value. If I do manual calculation by following the calculation procedure shown in Binary to Nominal.vi (also attached), with Ch 0 Callibration LSB Weight 1252909 and offset 7951587, I can obtain 8.04. This is exactly the value of the battery connected to Ch 0.

However, at this present stage as no double is supported in FPGA vi, this calculation cannot be done automatically.

I am using Labvew 8.2.1, but I can get 8.5 installed in both my cRIO and my computer if this solves the problem. Please let me know what you think.

Thanks,

Dedy

 

0 Kudos
Message 4 of 6
(7,256 Views)

Dear Christian,

thank you for your feedback. I will run my Compact RIO as a stand alone system. That means the only way I can get callibration constants is to run the compact RIO systems whilst it is connected to the host computer. My question is, can the callibration constants change after say 7 days?

My idea is to run CompactRIO for 7 days on its own. The data from all channels will be saved into the nonvolative memory. After 7 days I will copy the data from the Compact RIO to my computer and convert the data manually using the callibration constants which I obtained previously. Would this be acceptable approach? Or the callibration constant will also change as time elapses and therefore I should also save these to the nonvolatile memory?

 

Thank you in advance for your time

 

Dedy

0 Kudos
Message 5 of 6
(7,253 Views)
Dedy,
 
To clear things up, the cRIO controller has two LabVIEW targets, the FPGA for LabVIEW FPGA, and a regular processor for LabVIEW RT. A typical application consists of code running on both the FPGA and the cRIO controller in LV RT. The Binary to Nominal VI is designed to run in the RT VI on the cRIO controller to convert data from binary to nominal before you pass it to a host application, log it to a file on the RT controller flash memory, or use it for processing/analysis in the RT controller. The application in the RT controller will run standalone without a host system connected.
 
The calibration constants are stored in EEPROMs on each module. These values are calculated and stored on the module during a calibration process at the NI factory. They will never change while you are using the module. Therefore you only need to read them once and store them with the data. You don't need to worry about repeatedly reading and saving them.
 
Saving the binary data in the non-volatile memory (flash memory) on the cRIO controller and applying the calibration constants during offline post-processing of data is a valid solution for your application, but as I mentioned you can apply the calibration constants to the binary data on the cRIO RT controller and store nominal values in the flash memory.
 
authored by
Christian L, CLA
Systems Engineering Manager - Automotive and Transportation
NI - Austin, TX


  
0 Kudos
Message 6 of 6
(7,183 Views)