Setting state of switches after startup


Recommended Posts

Hi there,

thank you for the interesting info on this forum. Just reading through some of the postings gave me some inside on what is possible in DaqFactory.

Here is my problem ... I made a GUI with a couple of switches (they turn on/off heaters via a relay board ) and valve symbols (on/off solenoid valves via the same relay board). Every time I load up the GUI for the first time the state (on vs off) of these switches is undefined. Meaning I have to toggle them on/off once before the switch status matches the actual status.

Is there a way to set the switch i.e. channels to off in the start-up sequence? I would like to have defined states for my heaters and valves during start up for safety reasons. I don't want to create a situation where during start-up I get a run off heater without me noticing it.

Thank you for any input.

Clo

Link to comment
Share on other sites

Yes, just set the outputs attached to these switches to default values using a sequence marked Auto-Start. This means, however, that every time you start DF the outputs will change to this default state. This is, in many situations what you want, but can also cause the opposite problem to what you describe: you have a heater running because it needs to be on, and you restart DF which resets the heater to off. You forget that the default is off, and don't turn it back on.

The best solution is to actually read the state of the outputs and tell DF what it is, but that requires input channels, either separate ones, or read-back channels depending on the DAQ device you are using.

The other option is to use real control loops so DF would determine what the initial state of your outputs should be based on your various input readings.

Link to comment
Share on other sites

thank you for your advice...

Here is my hardware from Labjack:

- UE9 Pro with DaqFactory Standard edition

- CB37 Terminal Board with LJTickInAmps for temperature measurement

- RB12 Relay Board with Greyhill AC output modules 70G-OA to drive the relays.

"Yes, just set the outputs attached to these switches to default values using a sequence marked Auto-Start"

I am a NEWBIE at this any suggestion on the syntax on how to set the value of these outputs?

"The best solution is to actually read the state of the outputs and tell DF what it is, but that requires input channels, either separate ones, or read-back channels depending on the DAQ device you are using."

Can I do that with my hardware?

thanks again

Clo

Link to comment
Share on other sites

To set output channels in script:

mychannel = newvalue

where mychannel is the name of the channel and newvalue is the desired value.

I believe the LabJacks support direct readback, but you'd have to use sequence script to do it as the channels will change the state of the flex I/O. You'll have to ask LabJack what the command is. Use the LabJack eGet() function to read each of the values, then do:

mychannel.addvalue(result)

where mychannel is the particular output channel you want to init, and result is the result of the eGet().

The difference between these two formats, = and addvalue() is that = will actually go to the hardware to set the value, then update the channel, while addvalue() skips the hardware and just puts the value in the channel directly.

Link to comment
Share on other sites

Archived

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