12-06-2011 01:04 AM
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.
Solved! Go to Solution.
12-06-2011 04:14 AM
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:
Hope this helps.
12-06-2011 11:31 AM
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
12-07-2011 04:10 PM
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.
12-08-2011 10:54 AM
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: