Soohwan

Solenoid valve control

Recommended Posts

Hi, 

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(https://forums.labjack.com/index.php?showtopic=6716), 

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

 

Please let me know how to do this.

 

Thanks,

Soohwan

Share this post


Link to post
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.

Share this post


Link to post
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).

https://labjack.com/support/app-notes/Controlling-Relays

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."

https://labjack.com/support/datasheets/accessories/rb12

 

Share this post


Link to post
Share on other sites

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

Quote

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"
myChannel.restart()

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

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

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

 

Share this post


Link to post
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.

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now