Showing results for 
Search instead for 
Did you mean: 

watlow pid

Hi All,


I am currently working on a project for college.I am hoping to control a watlow 96 temperature controller with labview (v8.5)Currently I am receiving a voltage into my ni 6008 which is representative of the process temperature.My college lecturer has said he would prefer if I used labview to actually control and run the pid settings for the temperature control as opposed to letting the watlow 96 do all the work and switch on and off the solid state relay.


My plan is now to use the 96 to input a voltage to labview to give the current temperature.

I wish to use labview to run the pid control,basically use it to fire the solid state relay to switch on and off the heating element in the tank


My questions are as follows


Can a ni 6008 switch on and off a solid state relay quickly enough to provide adequate control or should I think about trying to get a ni 9472 to switch on and off the relay(cost and expense are a major issue for me so need to do this as cheaply as possible)


2 any pid example vi's out there which already do this and can be converted to do the above task,read input temperature and fire the relay??


Currently the 96 I have does not have serial connection but I can get one if necessary,as at the moment I cannot set the set point on the watlow using labview as I can not get a proper 0-5 voltage from the 6008.I currently set the setpoint by just injecting a voltage between 0-5v using a power supply.Can the 6008 perform all of these functions


a) read an incoming voltage which tells it the temperature

b) feed out a voltage 0-5v which I can vary to set the setpoint on the watlow(at the moment the watlow sets the setpoint using 0-5v input as reference) and

c) output a voltage 0-5v to switch on and off the solid state relay to control the temperature


or should I look at a vi which uses serial to connect to the watlow,this is an option I am afraid off as I have no clue what so ever of modbus and how to run it.


0 Kudos
Message 1 of 16

I think that you should be able to do what you want. but I do need a little more information please.


you had three questions


a - reading a voltage should be fine - the 6008 has only 12 bit resolution so depending on what levels you are reading out you may run into difficulties with accuracy but I can't see a problem if the output from your temperature measurement box is reasonable.


b - yes this is OK


c - What kind of speeds do you need to achieve in the digital line to drive your relay. The 6008 is software timed and therefore you are not going to achieve a very high speed pulse train but it may be sufficient depending on what you need.


As for PID control code have a look at some of the examples in LabVIEW under Help>>find examples  then search for PID.


Also can I ask a slightly more high lecel question. What is the aim of this application? How many temperatures are you reading in, and to what accuracy. Will the temperature be changing rapidly? What kind of sensor for the temp readings (eg thermocouple) or are these built into the box. If so why not create your own instrument within LabVIEW. I would consider this before spending money on digital modules as with a thermocouple module and a bit of playing around with your 6008 you could drive a heater, take temperatures and have all the control and flexibility you want for little expense.


best regards

Graham Green

Sr. Product Marketing Manager

National instruments
0 Kudos
Message 2 of 16

slightly more infomation for question b as you said you were currently using a power supple. Can you not just use the analogue out lines of your 6008 to drive the setpoint on your watlow?


best regards



Graham Green

Sr. Product Marketing Manager

National instruments
Message 3 of 16

Hi Graham,


I am basically using an old washing machine element to heat a little tank of water. I am reading one temperature measurement.

The initial plan was to use labview to monitor the temperature but not actually control it I was going to autotune the 96 and let it do all the work  ! . However this was a little bit low level for my project. Now I plan to use labview to control the pid settings and switch on and off the solid state relay.The watlow 96 now has only one function to provide a voltage feedback to labview for current temperature.I am taking this route as the resolution of the 6008 with themocouples is not great and this is an easy solution.


I also need to let the watlow know if the setpoint is adjusted as I intend to use some of the inbuilt relays in the 96 to switch on lights (temp ok/out of temp alarm) etc. This is where my big problem is occurring. I need to get 0-5v out of my 6008 unit. I need this voltage to basically go up and down depending on the position of a knob on the front panel. I will use this voltage as an input to the watlow to let it know the current setpoint.Any vi's help would be greatly appreciated here !!Any time I try to get a voltage out I get alarms coming up,I don't want to use daq assistant instead I want to just write to an output. Would this output need to be digital or analog as I can't seem to get a dc output wave using the daq assistant, I am also not sure what it means when it asks for samples to write.

The error I keep having is something to do with "you select on demand"


As regarding accuracy I am not overly concerned. I take it I use a digital output to switch on and off the relay. How often can the 6008 switch on and off as I take it this will be a determining factor on how accurate I can be with the temperature measurement.


Again thanks, I know this mail will confuse probably more than it answers









0 Kudos
Message 4 of 16

Hi Graham,


Should i buy the labview pid add on tool kit or should i be able to achieve what i need to do with out it??.One of the guys has converted this vi for me to run on 8.5.I havent had a chance to play with it yett as i am still at work but i am wondering if there is much i need to do with it to get the result i want





0 Kudos
Message 5 of 16

You could download a trial version from the link. Perhaps it can give you some ideas on how to du things 😉

Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 6 of 16

Hi Declan


Right, where to start. First you analogue output:


What you want here is a simple analogue output between 0 and 5 volts. The problem you have been having with number of samples is this. Most Analogue out (AO) cards will have a hardware buffer and onboard clock. This means that what you can do is transfer a chunk of data down to the card and then use the clock to send this out hardware timed. this gives very low jitter between signals as there isnt any kind of windows or other OS getting in the way and delaying things. the 6008 does not have a buffer ir onboard clock and so it has limitations in this way. this said I dont think this will be a problem for you, what you can do have it software timed, this is called one sample on demand. so you run the analogue write command in a loop and every time it is called it outputs a voltage. In this way you dont need any timing on the card itself. What it means by "number of samples" is how big the chunk of data is that you dend down to the card and then stream from.


For just an analogue out then I cant see any problem in using the express VI DAQ assistant and I would just have a simple program simmilar to the one below. called analogue out declan


As for the PID control, I think that what you are trying to do is on a reasnobly slow speed as temperature is not a swift or impulsive medium (well it can be in bombs and stuff but not when using a washing machine element) so I would design your own within labview. All you need is a loop in which you first read the temperature, then make a decision on it to high or too low and the output the relevant output to the relay.


For this relay, what kind of current do you want driven. Would a digital line at 5V be ok. This would be easy to turn on or off just plug a boolean into another DAQ assistant assigned to DIO 0.


if you have any further queries then try and put them into a more specific list as although i can advise best i can it is your call on how to architect your system, have a go and get a basic vi or at least the shape of it and the try posting it up here and I will try to advise further.


best regards



Graham Green

Sr. Product Marketing Manager

National instruments
Message 7 of 16

Thanks Graham,


Yes a 5v output will be fine from one of my DO's to turn on the relay as it energises at +4.5 volts.


I will hopefully get to play around with all these vi's over the weekend.I am currently physically building the unit and electrical cabinet needed to power the thing.Being an electrician thats the easy part.Hopefully then i will be in a position to connect up my laptop and finally start getting them to work together.


The trick i think is going to be writing the code to make that pid control but i will have a go at it.What i hope to end up with is a vi that does the following.

Reads the input 0-10 voltage,this is the current temp of the water.Turn on the relay to fire the heating element until the water reaches the setpoint temp,this setpoint will be set on the front panel and will also need to be constantly outputted as a 0-5v variable voltage to the watlow, then maintain that temperature using pid calulations


Thanks again for your help and i will get cracking on it and I will update(beg for help) as i go along



0 Kudos
Message 8 of 16

Hey Declan, good luck with it and post back if i can help


best regards

Graham Green

Sr. Product Marketing Manager

National instruments
Message 9 of 16

Hi Graham,


So here is where I am at with my project,I have completed the hardwiring.I have two watlow 96's in the electrical circuit.One just for monitoring and safety and there other provides a voltage which is proportional to the temperature of the water.The second just cuts power to the circuit and also closes a relay.I intend to get an input from this relay which will be the overtemp alarm.As you can see from the code on over temp the setpoint et all goes to 0,Just a little safety thing to switch off the heater if the thermocouple gets damaged for the watlow which is providing the voltage input.


I bought the pid add on toolkit which is a great help.I also got a little relay board on eBay which has basically 8 relays on it.These relays open and close using 8 transistors to do so.My questions as follows.This week I am hoping laptop and usb6008 meet electrical circuit and nothing disappears is a cloud of smoke.If I simulate an overtemperature by removing the thermocouple will my USB unit read a 5 volt signal sent in on alarm and can in generate the 5v signal to turn on and off the transistor.

The power on light is part of an estop 5 volt input I get from the circuit.


I have done a little experimentation by running this vi and connecting the 5volt supply in the USB unit to one of the input terminals of it and seen no state change so I must be going wrong some where.I am unsure which digital write vi to use I am unsure of the whole u8 u16 u32 thing,I want 5v on 0v I go about that IM unsure

Also when setting up inputs/outputs I see this local/gobal channel thing,do I need to set this correctly for mine to work??


Thanks all 




Thanks for any help advice you may have

0 Kudos
Message 10 of 16