Recommended Posts

I'm a little new to DAQFactory and programming in general so forgive me if this is simple.  I have a device with a number of thermocouple jacks for plugging in thermocouple probes, but not all of them are used for some operations.  When no probe is connected, the value displayed (after the conversion is applied) is around -170,000 oC.  My question is what is the easiest way to get the display to read "OPEN" or "NO TC" when no thermocouple is attached to the jack, but display the temperature as normal when there is a thermocouple connected?  Is there a way to do this without having to run a sequence for every reading?  Thanks for the help.

Link to comment
Share on other sites

Sure, let's assume that your channel is simply "temp".  Instead of doing Temp[0], do:

 

iif(temp[0] < -300, "OPEN", temp[0])

 

iif() is an inline if.  If temp[0] is less than -300, it will choose the first option, "OPEN", otherwise it will use the second one, the current reading.

Link to comment
Share on other sites

Thanks, that was simple.  I didn't realize you could put if statements directly into the component expression.  One more thing though, the unit (oC) is still added to the end of "OPEN".  Is there a way to get rid of this when temp[0] < -300?

Link to comment
Share on other sites

Archived

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