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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Acquiring temp with NI 9214 using labview fpga

Solved!
Go to solution

Hello there,

I am a student, very new to labview and data acquisition. I have been having problems with wiring a type T thermocouple to an NI 9214 module and writing a labview FPGA program to acquire temperatures. I have been struggling with this and researching the web for a long time to no avail.

Please find attached the code I am working with. I was told to use the obtained CJC value and convert using the formula I found here ( http://zone.ni.com/reference/en-XX/help/370984T-01/criodevicehelp/9214_converting/ ) and the thermocouple type T conductor tables to find the temperature, but I didnt obtain anything that made sense.

 

 Please can someone help me out?

 

Jeremiah

 
0 Kudos
Message 1 of 8
(4,271 Views)
Solution
Accepted by topic author jey_0320

Hi Jeremiah,

 

Are you using this 9214 in a cRIO chassis? If so, which model?

 

As far as converting the data, you will have to take care of fetching the data from the host side (you will need a separate VI) and taking care of the conversion there. When you mention you don't obtain anything that makes sense, what exactly are you reading/expecting?

 

I strongly suggest you open and tinker with the shipping host/FPGA example VIs for the 9214 (NI 9214 Getting Started.lvproj, found in Program Files\National Instruments\LabVIEW 2013\examples\CompactRIO\Module Specific\NI 9214\NI 9214 Getting Started). These should allow you to have a good background in understanding the relationship between the host and the FPGA VIs.


Hope this helps!

Xavier
0 Kudos
Message 2 of 8
(4,217 Views)

Hello Xavier,

Thanks for getting back to me. I am using the 9214 with the cRIO 9072. I was reading the TC, CJC and Autozero values straight of the indicators and tried to convert the CJC value to obtain the resistance of the thermistor but I am not sure where to go from there.

I have also been trying to understand the examples but it is a bit complicated given that alot of the functions that were utilized in the example could not be found on my fpga target interface and copy pasting those functions from the examples caused errors on my block diagram.

 

Best regards,

Jeremiah

0 Kudos
Message 3 of 8
(4,143 Views)

Hi Jeremiah,

 

The actual target interface for this example is fairly simple: it mostly acquires data after doing some setup:

9214_FPGA_2013.png

 

I believe you're referring to the host VI (NI 9214 Getting Started (Host))- this is where the calculations are done: Get the TC, AutoZero and CJC values and pass them through the algorithm (2 subVIs) that result in a temperature (in the snippet below the TC Ouput and CJC Output clusters are read from the FPGA Read control):

9214_Calc_2013.png

 

The actual conversion subVIs are all done on the host side - if you were trying to run this on the target this is probably why you were getting block diagram errors. It looks like the NI 9214 Convert to Temperature (Calibrated) function is the one you are looking for as far as getting a relevant reading out of the CJC, AZ and TC values. Hopefully this helps!

Xavier
0 Kudos
Message 4 of 8
(4,099 Views)

Good day Xavier,

Thank you very much, you are right, I was trying to run the examples on the target VI, but it works perfectly on the Host VI, so I am getting coverted values. The one problem I am having now is that I am trying to use an Open FPGA Reference on the Host VI so I can read and right directly from there to make conversions smooth so I dont have to manually input the values everytime I need them which will be tedious and the Host VI was looking good without any broken arrows but when I run it it gave me an error in the deployment "LabVIEW: Memory or data structure corrupt". What do you think is the issue here?

 

See attachment to view my Host VI

 

Best regards,

Jeremiah

0 Kudos
Message 5 of 8
(4,069 Views)

Hi Jeremiah,

 

Which version of LabVIEW are you using? 

Have you compiled the target already?

 

I would suggest setting up your build specification, building it, then pointing to either the build specification or the bitfile itself and see if you get similar errors when trying to run (refer to here: http://zone.ni.com/reference/en-XX/help/371599G-01/lvfpgahelp/compiling_fpga_vis_howto/).
 
If you are not using the other inputs/outputs of the target, I would recommend taking them away from the host and only keeping the Autozero, CJC and T0 I/O nodes in this read/write control - this will minimize unnecessary access to your target. Hope this helps!
Xavier
0 Kudos
Message 6 of 8
(4,036 Views)

Hello Xavier,

I am using Labview 2013, I did compile the target VI first. Today, I just took out the "Close FPGA VI reference" and reset my Chassis and it started working as I expected with all the controls and indicators. I am guessing it is not necessary to use the Close FPGA reference everytime the Open FPGA VI reference is used, is this correct?

 

Thank you very much for all your support, I really appreciate it.

 

Best regards,

Jeremiah

0 Kudos
Message 7 of 8
(4,028 Views)

Hi Jeremiah,

 

I'm glad you got your system up and running. It is recommended to use a Close FPGA Reference function - otherwise you might leave it in an unknown state and this could get troublesome next time you start the VI. You could right-click on that function and select "Close and Reset if Last Reference" to make sure the FPGA reference is properly taken care of. You could also wire a Simple Error Handler at the end of the Close FPGA Reference function in order to see if there was anything unusual that happened when trying to access the controls.

Xavier
0 Kudos
Message 8 of 8
(4,011 Views)