09-07-2010 10:41 AM - edited 09-07-2010 10:43 AM
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/
Solved! Go to Solution.
09-07-2010 10:49 AM
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.
09-07-2010 10:56 AM
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.
09-07-2010 10:57 AM - edited 09-07-2010 11:03 AM
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....
09-07-2010 11:07 AM
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.
09-07-2010 11:22 AM - edited 09-07-2010 11:24 AM
Ok, thanks a lot..
@Kev1823 ... i tried doing what you said, can we have a boolean switch to turn on/off the lines/??
09-07-2010 11:49 AM
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....
09-07-2010 11:54 AM
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...
09-07-2010 12:00 PM
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.
09-07-2010 12:01 PM
NIquist, Ihave done as you mentioned... Now, Iwould like to read the data that I am writing... How can I do it???