Recommended Posts

I was just going through the user manual with Labjacks and i am at 7.1 Doing things based on an input.

The script i am using is this under temperature channel is:


private TempFormular0 = Temperature[0] * 200 * 0.2222 - 61.111

private TempFormular1 = Temperature[1] * 200 * 0.2222 - 61.111

if ((TempFormular0 < 23) && (TempFormular1 >= 23))

HeaterPower = 1


if ((TempFormular0 > 25) && (TempFormular1 <= 25))

HeaterPower = 0


if ((TempFormular0 > 25) && (TempFormular1 <= 25))

SendEmail("Pressure is greater than 80. Its going to blow!!!!")



I have also put on a page a variable value as HeatPower[0] on a page along with variable value for temperature too. The problem is when i first start up the file is that HeatPower vairable value just has red line through it. The Temperature variable value works on start up .It is only when the temperature sensor goes past 25 which then puts out a 0 and gets rid of the red cross through it. Then when the temperature drops to 23 it goes to = 1.

It works but not on start up even thou the temperature is under 23 on start up which should = 1.

So how do i get it to start up with HeatPower Value = 1 and why isn't it now?

Thanks steve

Link to comment
Share on other sites

Your if() statements only change Heaterpower when the temperature transitions around 23 and 25. You either need to flat out initialize heaterpower to 1 in an auto-start sequence. You may want to actually check the current value of temperature first to determine whether to init it to 0 or 1. In this case you shouldn't evaluate [1]. You'll also need to make sure you've read Temperature first, possibly by forcing it using:


Link to comment
Share on other sites


This topic is now archived and is closed to further replies.