LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to program a simple relay ON/OFF manually?

Solved!
Go to solution

Hello Everyone,

                      Can anyone please tell me how to program a simple relay ON/OFF using DAQ assistant? The user should be able to select

which relay he wants ON/OFF....

 

I actually want to turn ON/OFF a MOTOR using the relay....

 

I think it should be using digital outputs, but I am unclear about the manual control...

 

Can anyone please suggest/

 

Now on LabVIEW 10.0 on Win7
0 Kudos
Message 1 of 30
(4,873 Views)

I take it you did not look at any of the examples I mentioned?

 

If you want to use the DAQ Assistant, configure it for digital outputs. When done, right click on the Data input and select 'Create Control'. This will be an array and you can select individual elements.

0 Kudos
Message 2 of 30
(4,856 Views)

Hi CrackJack,

 

Yes that's correct, it can be done using the digital outputs so long as the relay input voltage (i.e the voltage required to switch the relay armature) is less than or equal to the digital output line voltage, typically 5V.

 

If you use the DAQ assistant and set up the amount of digital output lines you require and wire boolean switches to the DAQ assistant (though you will need to put these into an array beforehand if you need more than one output) that should work.

 

 

 

 

 

0 Kudos
Message 3 of 30
(4,844 Views)

I did, in fact I do have the code for the digital output...


I have done exactly the way you say, arrays and stuff...

 

only thing is, i have a drop down menu which indicates which digital

line to select...

 

Can we program like a button/switch... where the user indicates whenver to turn on the motor or turn off...

 

Check the attachment for the code I have written....

Now on LabVIEW 10.0 on Win7
0 Kudos
Message 4 of 30
(4,842 Views)

You obviously did not look at the basic examples I mentioned. I will ask you to do so again. The simple ones are called Write Digital Channel and Write Digital Port.

 

You also are not using the DAQ Assistant. If you had actually used that, it would also be trivial.

0 Kudos
Message 5 of 30
(4,829 Views)

Ok, thanks a lot..

 

@Kev1823 ... i tried doing what you said, can we have a boolean switch to turn on/off the lines/??

 

Now on LabVIEW 10.0 on Win7
0 Kudos
Message 6 of 30
(4,822 Views)

Dennis,

         I am trying to read what I wrote on a particular channel... Can you please check the VI i have attached and let me know if I am doing it correctly???

 

I would really appreciate that....

Now on LabVIEW 10.0 on Win7
0 Kudos
Message 7 of 30
(4,806 Views)

You're using the wrong instance of the DAQmx Write.vi for that.  You selected waveform, try using Digital > Multiple Channels > Single Sample > 1D Boolean.  Then you will need to erase your waveform control and create a control for the Data input.  It will be an array of booleans that will switch the lines on and off.

 

Unless I'm misunderstanding your question...

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 8 of 30
(4,801 Views)

I don't have the hardware to run it with, but as long as the number of elements in the array match the number of lines you select, it should work. I would recomend you use a button with the correct mechanical action to stop the loop (i.e. Latch When Released). Just delete the stop button you have and right click on the termination terminal and select 'Create Control'. You should also wire up an error indicator or unbundle it to stop the loop like the Write Dig Chan example.

0 Kudos
Message 9 of 30
(4,793 Views)

NIquist, Ihave done as you mentioned... Now, Iwould like to read the data that I am writing... How can I do it???

Now on LabVIEW 10.0 on Win7
0 Kudos
Message 10 of 30
(4,791 Views)