Solenoid valve control

Recommended Posts


I want to control a solenoid valve (120VAC) using Daqfactory. 

I connected the valve with Labjack U3-LV and RB12 with a 70G-OAC5A relay.

According to the Labjack forum(, 

it seems I have to make a function to change the digital direction (output↔ input).


Please let me know how to do this.




Link to comment
Share on other sites

For the U series devices there is the DAQFactory - LabJack Application Guide which is installed with DAQFactory.  This covers most everything you need to know.  To control an output, you just need to create a Channel in DAQFactory with device type Dig Out.  DAQFactory will switch the pin direction for you in this case.

Link to comment
Share on other sites

The comment you are seeing in LabJack forum topic is about directly controlling a solid-state relay (SSR), which is best done using "sinking" control.  When you do that you need to change the DIO between input (relay off) and output-low (relay-on).

With the RB12, however, you just change the DIO between output-high (module off) and output-low (module on).  The following is from the RB12 Datasheet:

"The RB12 behaves with inverted or negative logic.  For output modules that means the applicable LabJack DIO must be set to output-low to enable the I/O module.  Output modules will be disabled with the DIO set to input or output-high."


Link to comment
Share on other sites

  • 10 months later...

I would also like to comply with the guidelines for controlling relays published by Labjack. @LabJackSupport says:


When you do that you need to change the DIO between input (relay off) and output-low (relay-on).

Does this mean the correct way to control relays (to comply with app note) is:

// to turn off
myChannel.strIOType = "Dig In"

// to turn on
myChannel.strIOType = "Dig Out"
myChannel = 0

...instead of just using a Dig Out type channel:

myChannel = 0 //off
myChannel = 1 //on


Link to comment
Share on other sites

I'm going to let LabJack comment on what should be done on a hardware level.   But if you do, in fact, need to change between Dig Input and Dig output, you'd be better off just making two channels with the same channel #, but different I/O types, and using read(digInChannel) to do the digital input, and digOutChannel = 0 for the digital out.  Doing channel.restart() all the time is not very efficient.



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.