LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Look up table or a formula node?

Solved!
Go to solution

Hi, all,

 

  I am doing a temperature measurement at this moment, and I use Labview to receive the meaured data from a microcontroller. However, the measured data is voltage, so I want to convert them into temperature. To do this, I have two ways, the first one is to insert a formula node, while the other one is to build a lookup table. But I don't know which one is better in terms of speed.

  If making a lookup table, I would have around 70000 data, which makes this table very big. I don't know whether it is okay?  If inserting a formula, the relationship between the voltage and temperature is very non-linear, I'm afraid it will also take a long time to calculate. So which one is better? Please give me some hints or instructions. Thank you in advance.

  By the way, to make a look up table, I was trying to use scaling and mapping.vi. I wanted to define an interpolated table to do the job, however I don't know how to insert my lookup table into this sub-vi. Could anyone tell me?

0 Kudos
Message 1 of 17
(4,794 Views)

You definitely don't want to use a formula node, just use plain G. In the case of a lookup table, you would just use "index array" after linearly scaling the index. Create the lookup table once with a FOR loop based on all diagram constants, and it will be folded at compile time into a constant.

 

What is the formula? I seriously doubt you need 70000 points. How many decimal digits do you need for the temperature? 

0 Kudos
Message 2 of 17
(4,785 Views)

Thank you for your reply. The formula is the typical Steinhart-Hart equation. Because the dynamic range of my measurement is 16-bit, so in the complete temperature range, there will be 65536 data points. The minimum temperautre should be in mK range, so at least 5 decimal digits are needed.

 

By the way, I tried to use the sub-vi: scaling and mapping.vi to work as a look up table. Because this sub-vi has a interpolated table, which can be used as the look up table. Is it okay?

0 Kudos
Message 3 of 17
(4,775 Views)

OK, this is a simple equation that can be calculated near instantly. Do you really have performance problems? How many times per second do you need to recalculate it?

 

Can you give some typical data?

0 Kudos
Message 4 of 17
(4,772 Views)

tingxuejh wrote:

The minimum temperautre should be in mK range, so at least 5 decimal digits are needed.


mKelvin with 5 decimals Smiley Surprised

Are you looking for the absolute zero temperature, -273.15 Kelvin, or did you mean something else?

 

If this is your formula, I would go for plain G like altenbach suggested.

0 Kudos
Message 5 of 17
(4,770 Views)

Hi, altenback,

  My microcontroller will send one data per 300us. Of course the calculation process can be much slower, however, we may need a very large I/O buffer to store the unprocessed data. Therefore, I hope this process can be as fast as possible, in order to relax the requirment of the buffer size. Do you think it is right?

  Also, I need to set a target temperature in labview, and this temperature has to be translated into digital code and sent to the microcontroller. In this case, the formular can be very complicated (we have to calculate from T to V. But fortunately, this is one time only). I guess lookup table is still a better solution. What is your opinion?

0 Kudos
Message 6 of 17
(4,767 Views)

Hi, Alain,

 

What I mean by the 5 decimals is, for example T=23.115oC, I'm sorry for the confusing.

0 Kudos
Message 7 of 17
(4,764 Views)

You can use the polynominal evaluation, e g. as follows:

 

 

For the reverse you could use the explicit formula as e.g. given here or simply do some a quick newton-raphson on the forward eqaution.

Message Edited by altenbach on 07-26-2009 09:45 AM
Message 8 of 17
(4,763 Views)
But which one do you think is better? The formula? or the lookup table?
0 Kudos
Message 9 of 17
(4,758 Views)

tingxuejh wrote:
But which one do you think is better? The formula? or the lookup table?

It does not matter what I think. Code a few alternatives and do a benchmark. 😄

  

The formula is so simple that I think a lookup table would not be of great benefit. Instead of the polynomial evaluation, I would code it explicitly, e.g. as follows.

Message Edited by altenbach on 07-26-2009 09:59 AM
Message 10 of 17
(4,754 Views)