desactive realy | LabJack
 

desactive realy

7 posts / 0 new
Last post
JAIMEMAN
jmanjarresc3's picture
desactive realy

I try to control relay with digital outputs, from Excel
I can activated but I cannot deactivate them. Using the Ljcontrol Panel I can activate and deactivate them. What will happen

LabJack Support
labjack support's picture
Controlling relays requires a

Controlling relays requires a couple tricks. Check out our app-note for guidance: https://labjack.com/support/app-notes/Controlling-Relays

JAIMEMAN
jmanjarresc3's picture
Obviously, I saw your app

Obviously, I saw your app notes, but it refer to solid state relays. but my question is why with the Ljcontrol Panel the control works with the digital output, but when I try to control it with the excel order it is activated but I cannot deactivate it.

LabJack Support
labjack support's picture
Make sure you are only

Make sure you are only running 1 program at a time.  Close LJCP before you try using your Excel program.

What sort of relay do you have and how is it connected to your U6?

What are you doing in the Test panel in LJCP that does work?

Copy/paste the code snippets from your Excel program that do not work.

JAIMEMAN
jmanjarresc3's picture
"Make sure you are only

"Make sure you are only running 1 program at a time.  Close LJCP before you try using your Excel program."

A/ Yes Sure, I close all programs that may have my U6 open. In fact, if not, a warning appears saying that it is open in another program

"What sort of relay do you have and how is it connected to your U6?"

A/ Módulo Relay 1CH 5VDC

"What are you doing in the Test panel in LJCP that does work?"

A/ That is the strange thing. I set the DO high and low and normally activate and deactivate the Relay

"Copy/paste the code snippets from your Excel program that do not work."

A/ I use this to set High "lngError = AddRequest(lngHandle, LJ_ioPUT_DIGITAL_BIT, 0, 1, 0, 0)
GoOne (lngHandle)" and this to set Low  "lngError = AddRequest(lngHandle, LJ_ioPUT_DIGITAL_BIT, 0, 0, 0, 0)
GoOne (lngHandle)".

But I use your example with Labview and happens the same. I can activet setting  to High but not back it setting to low.

I set the DO without conecting the relay and It works, set it High and Low.

 

File Attachment: 
LabJack Support
labjack support's picture
Your relay probably needs tri

Your relay probably needs tri-state control. Check out the "Directly with Digital I/O" section of the relay app-note: https://labjack.com/support/app-notes/Controlling-Relays

TL;DR: Setting the line to OUTPUT-LOW draws enough current to activate the relay. Setting the line to OUTPUT-HIGH (3.3V) still pulls enough current to keep the relay running. If we set the IO to Z (high impedance) then current will not flow (unless powering the relay from > 5V.)

JAIMEMAN
jmanjarresc3's picture
That was what happened.

That was what happened. Thanks, it was solved