LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding Temperature derivative

Hi,

I am new here.

I will appreciate if anyone helps me.

I am reading temperature from a temperature measurement device.  my program shows temperature chart correctly. But Derivative of temperature iz always zero (I am sure temperature changes is not constant).  The attache is my program block diagram.

does Labview consider x axis in the chart as time? How can Labview get time? Should I put an specific icon to introduce time to my program?

I do not know how to get temperature derivative in my program.

Regards,

Mehdi

Message Edited by Neka on 01-30-2009 10:56 AM
Message Edited by Neka on 01-30-2009 10:58 AM
Download All
0 Kudos
Message 1 of 4
(5,212 Views)

Neka,

 

The derivative of a single point is not defined. Look at the right side of your diagram.  The value coming from the String to Numeric conversion is a scalar - one double precision number.  You then use a Dynamic data conversion block to convert this to an array of DBL which is then inserted into a Waveform data type and passed to the Derivative function.  But there is still only one value in that data!

 

The Temperature Chart has an internal buffer which accumulates the data so the display shows all the temperature changes, but the derivative function only sees one point.

 

1. Always connect and check error outputs from VIs and functions.  The Derivative function output almost certainly generates some kind of error indicating that you did not supply enough data points.

2. The Derivative function takes arrays as the normal inputs.  Converting from array to Waveform and then (internally in the Derivative function) back to array is of no value.

3.  The Build array primitive is a better way to convert a scalar into a one-element array than the Dynamic Data converter.  Notice the coercion dots at the inputs of the Dynamic Data converter and the Derivative function.  They tell you that LabVIEW is converting data types.

 

Since you appear to be getting the data from a serial port, you will need to add a timestamp to the data.  The Derivative function assumes that the datapoints are evenly spaced in time which in general is not true of data received from a serial port.  Also you only take one reading from the serial port.  Does the instrument send an entire time series of data or do you need a loop?

 

Lynn 

0 Kudos
Message 2 of 4
(5,180 Views)

Thank you so much Lynn,

I am new in Lab view and your answer was a little difficult to understand.

As far as I know the instrument send only temperature to lab view. most of the block diagram was designed by the company which I bought instrument.

My purpose is to make a derivation of temperature as time goes and at the specific condition I need to send a signal to a relay out side of the computer.

at this stage I am trying to just make a derivative of temperature.

it seems to me that in the chart x axis is time. so, it should have time history and make derivative.

 I am wondering if you help me to do this stage.

Regards,

 

0 Kudos
Message 3 of 4
(5,172 Views)

Neka,

 

You are seeing a zero output from the derivative because the array going into it is only one value.  Because the array only has one element in it, we are just taking the derivative of a constant.  The simplest way of building a proper array will be to use the "Insert Into Array" with a loop with a shift register.  I have built a simple VI that demonstrates this as well as your previous approach. 

 

Regards, 

Cole

ColeR
Field Engineer
Message 4 of 4
(5,122 Views)