U12 with RB12 | LabJack
 

U12 with RB12

5 posts / 0 new
Last post
juju
juju's picture
U12 with RB12

Hi,

I have a U12 module with the RB12 board. I have filled the RB12 with Grayhill Inc. 70M-ODC5 relay module to pilot 24 VDC valve.

I am trying to control the relay using python. I am able to manage the U12 I/O however I still have no clue on how to manage the RB12 relays. Could someone help me?

Thanks in advance.

LabJack Support
labjack support's picture
You will need to use the

You will need to use the digital I/O lines D0-D15 to control the relays. Inverted logic is used, where a digital low state (0) is active and a high state (1) is disabled.

Regarding Python, first make sure our driver software is installed and LabJackPython:

https://labjack.com/support/software/installers/u12
https://labjack.com/support/software/examples/ud/labjackpython

Using LabJackPython and its U12 class in the u12 module, you can set a D line state with the eDigitalOut method. To set all digital lines at once, use the digitalIO method on Windows, or the rawDIO method on Linux/macOS. A quick eDigitalOut example:
 

import u12

# Use first found U12
myU12 = u12.U12()

# Set D0 to output state low, R0 active
myU12.eDigitalOut(channel=0, state=0, writeD=1)

juju
juju's picture
Hi,

Hi,

Thanks for the help.

This is what we have done but we are still stuggling with one issue. The sate us not staying at the level we stated. If we use ljlogger this work fine the state at the level when we click on the led. but using eDidigitalOut seems to revert to inistial state after a short time.

Could you advise?

Thanks again.

juju
juju's picture
using eDigitalOut seems to be

using eDigitalOut seems to be temprary. the is switch back after few milli seconds. How can we keep the state up like on LJLogger?

Thanks

 

LabJack Support
labjack support's picture
The digital state changes

The digital state changes when a command is set to change it, the U12 is reset / power cycled, or the Watchdog is active and setting the D line or resetting the U12 on timeout.

When the D line "switches back" the state, is the STATUS LED on the U12 turning off and blinking back on? That would indicate a device reset.

What does your U12 related code look like?