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: 

temperature control with NI cDAQ-9172

Hi,

I am a new user of Labview, and right now I need to work on a project about temperature control.

 

Hardware: NI cDAQ-9172 chassis with NI 9401 thermal couple modue and NI 9263 analog output module and a heater (~120V,10A).

 

Purpose : Setup a temperature on front panel, then 9263 could output voltage to turn on the heater, 9401 measures and monitors temperature at the same time.Once the temperature reached the setpoint, 9263 turn off the heater.

 

According to other people's questions and posts, I know the best way to control temperature is using PID.vi, and I tried to work on the vi code but still have some questions. Could somebody help me to figure out and solve them? I really appreciate your help.

 

Q1. The setpoint would go up to 170C,and I know the spec of 9401 is -40~70C, does 9401 still work for that high temperature?

Q2. How to wire output data of DAQ write to Heater (Analog output voltage)?

Q3. How to stop and shut down Heater if Temp monitored = setpoint?

Q4. How to wire Waveform to DAQ Read, data mismatched?

0 Kudos
Message 1 of 20
(3,194 Views)

@holc1 wrote:

Q1. The setpoint would go up to 170C,and I know the spec of 9401 is -40~70C, does 9401 still work for that high temperature?

Q2. How to wire output data of DAQ write to Heater (Analog output voltage)?

Q3. How to stop and shut down Heater if Temp monitored = setpoint?

Q4. How to wire Waveform to DAQ Read, data mismatched?


I don't know your specific hardware, but:

Q1: that spec will be for the allowed temperature of the 9401 itself, not the other end of the thermocouple, which will easily do 170C.

Q2. an easy power control method is to use a digital output connected to a SSR (solid-state replay) which turns the power on and off.  Control the power fraction by controlling the fraction of the time the power is on (ie. turn on for a bit, then off for a bit, repeat in a cycle)

Q3. If you have a PID implimented, it will handle all that.

Q4. I don't understand this question.

0 Kudos
Message 2 of 20
(3,187 Views)

Thanks for your reply, drjdpowell.

 

Actually, we are using a time-delay relay to control the heating time for the heater and use a thermometer to measure the tmperature seperately,however, sometimes it would overshoot. That's why I need to use Labview to control temperature precisely.

 

Q1. Can't I just connect existing NI 9263 to heater by changing output voltage to turn on/off the heater?

Q2.In my vi code, I tried to wire the ouput data from DAQmX read to Waveform,but it does not work. DBL cannot wire 1D array. However, I only need to get one channel one sample from DAQmX read to compare setpoint. So how could I make it connectable?

 

Thanks for your help.


0 Kudos
Message 3 of 20
(3,183 Views)

Q1:  Only if your heater accepts a variable voltage.   But I don't think you have that; most heaters can only be ON of OFF.   

Q2: sounds like you need to "build array" in there somewhere.

0 Kudos
Message 4 of 20
(3,177 Views)

Thanks for your help again, and I am researching SSR now for switching my heater. However, I am not so familiar with the DAQmx vi.

 

Q1. How could I specify which channel of NI module my Labview code would receive input data from?

For example, measured temperature input data from module NI 9211.

 

Q2.I think from my DAQmx Task vi, I only need single channel and single sample for data transmission so does it mean I need to store all the input data points from thermal couples than I could creat an array for plotting a waveform?

0 Kudos
Message 5 of 20
(3,155 Views)

Hi holc1

 

If you are in the LabVIEW main windows you can click in the Find Examples link and that will open the example finder.

 

You can go there to Hardware Input and Output » DAQmx » Analog Measurements » Temperature and you can use the Cont Acq Thermocouple Samples-Int Clk.vi

 

This example VI shows how to acquire temperature and display it in a graph. You can use and study that example and be up and running quickly.

 

To answer your questions:

 

Q1. The Daqmx Create Channel VI must be set as AI Temp TC, and in the physical channels input you can right click and create a control, this will show in the front panel all possible TC channels available.

 

Q2. I don’t quite understand the question, but, in the example VI that I mention, you will see the output as a waveform, you can take the data unbundle it and manipulate it to have an average, or to show the value in a number, etc.

 

 

Regards,

steve.bm
AE | NI
0 Kudos
Message 6 of 20
(3,133 Views)

Thanks for your answer,steve,

 

I have modified my Labview code,but still have some questions:

 

Q1. How could I wire the output data from PID vi to my digital output DAQmx as its input data, so when the tempeture from DAQmx AI TC equals to setpoint,it could trigger the relay and turn it off?

 

Q2. Someone suggested me to use SSR to control the heater, and I need to use NI 9401 to connect the relay. Where should I connect 9401 to my SSR? Is that the voltage input terminal or switch control terminal? My relay is a muti-function time delay relay(Macromatic TD-8), so it needs a trigger to turn on the relay otherwise it is disconnected.

 

 

0 Kudos
Message 7 of 20
(3,125 Views)

I did some changes on my code because I found PID vi seems not so necessary for my application.However, the code could run but still has an error. It shows the measurement error on my DAQmx Read vi. :

"Measurements: Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten."

 

"Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem."

 

So how could I fix it? Could somebody give me any suggestion?

 

0 Kudos
Message 8 of 20
(3,098 Views)

Hi holo1,

 

The VI that you posted needs two changes, first delete and create again the input lines (constant) for the Digital output task, then in the while loop add a merge error and use the error status signal to the stop button from the while loop. (see attached VI)

 

About the error message that you are getting here I found a couple of articles related to this error that you should look at:

 

Why Do I Get Error -200279 from my DAQmx Read VI or Property Node?

Common NI-DAQmx Error Codes and Solutions: Codes -200000 to -200299 and -50103

 

 

Regards,

steve.bm
AE | NI
0 Kudos
Message 9 of 20
(3,057 Views)

I really appreciate your answer,steve. However, I cannot open the vi you attached. The version is later than what we are using now so how could I do? Thanks a lot.

 

Jei

0 Kudos
Message 10 of 20
(3,051 Views)