LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ni-switch close or open relay with a 1 or 0 input

Solved!
Go to solution

I am trying to open and close relays on pxi-2503 with ni-switch using a 0 or a 1 input into the relay action node. I am trying to replace the constant open/close control with a 0 or 1. The digital input is 20 and 21 respectively, those intergers do control the relay. How can I change those values to a 0 and 1. I deleted the open/close control from the driver itself and connected a constant integer into the driver node I32. I made the mistake of saving it. Now the relay returns an error as the sink being void and all relays now have a broken wire and no input control. I tried undoing it and wiring the original control (open/close) to the I32 input. It continues to error. I am noe re-installing the ni-switch drivers. All I need is a solution to get the relay to accept 1 or 0 for the relay control.

0 Kudos
Message 1 of 5
(3,591 Views)

Please post a snippet of what you are trying to acheive. I am not sure what relay action node is!

Have you tried using a case structure to do this. I know this is not what you are looking for, but you could take some pointers from the snippet below:

se.png

Hope this helps.


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
Message 2 of 5
(3,583 Views)

I will try to reload the NI-Switch drivers. My goal is to control the relays using binary values as I have range of capacitance load measurements to collect. I thought if I can make the capacitors binary weighted, Ex. 1,2,4,8,16, etc. it would be easier to implement, but I cannot get the relays to accept a 1 or 0 to control the action(open/close). I've attached my broken relay screen shots.

 

Sincerely,

Martin

0 Kudos
Message 3 of 5
(3,572 Views)
Solution
Accepted by topic author casio

Hi Martin,

 

Working from the example VI you do not need to change anything with the Relay Control VI.  All you have to do is input a 20 to open the relay or a 21 to close the relay.  If you are working from 0 to close and 1 to open you can have it set up so that you subtract the control from 21.  That way if your control is giving a 0 value you get 21-0=21 going into the Relay Control VI which will close the relay.  If you have a value of 1 from the control you will get 21-1=20 going to the Relay Control which will open the relay.

 

switch with 0 or 1.png

Andy K.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(3,550 Views)

Thanks Andy,

 

That is what I had figured out after I got the driver problem ironed out. I right clicked the enumerated constant for the relay action input and selected the edit items option, I was able to change the 20 and 21 value for the constant to 0 and 1. Even though it accepted the changes, it would only accept 20 and 21. Basically i did what you did just a tad different. Here are a couple options:

 

 

  relay options

0 Kudos
Message 5 of 5
(3,538 Views)