As of May 2, 2022 the LabJack forums have been set to read-only.
If you are in need of support, please contact us via one of the methods described on our contact page.
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
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.
"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.
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.)
Controlling relays requires a couple tricks. Check out our app-note for guidance: https://labjack.com/support/app-notes/Controlling-Relays
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.
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.
"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.
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.)
That was what happened. Thanks, it was solved