06-24-2009 04:02 AM
I try to control 3 relay by using NI-DAQ (USB 6009) but i can only determine one port for one relay, i don't know how to determine 3 ports for 3 relay.....
could anybody tell me how to do that?
appreciate your help......
06-24-2009 10:45 PM - edited 06-24-2009 10:47 PM
Your question has nothing to do with NI Switches. It should have been posted to the multifunction DAQ or digital I/O board.
A port of the USB-6009 consists of multiple lines and you can easily write to all lines if you are configured for port access. For example, if you write a binary 001 to the port, you output a 0 on lines 1 and 2 and a 1 on line 0. Writing a binary 100 will write a 1 to line 2 and a 0 to lines 0 and 1. Instead of port mode, you can use line mode and either use one task for all three lines or a separate task for each line.
You have not mentioned which language you are using. If LabVIEW, open the example finder. You will find some simple examples of line and port mode. The DAQ Assistant can also be used. This is a very simple task to code. If you continue to have problems, post the code you've writte. You should also review the information on the DAQmx Getting Started page.
06-26-2009 02:01 AM
Sorry, I'm using the LabVIEW language, I done as shown below, can it becomes more simple?
06-26-2009 08:19 AM
Sure, you can simplify it. Look at the example program called Write Dig Chan.
p.s. when you have a while loop, you should place a wait function inside. No need to spin the loop so fast. It will just cause your cpu usage to climb for no reason.
06-30-2009 02:33 AM
how to place the wait function? could u show me?
Thanks a lot..........
07-02-2009 09:41 AM
Right click to get the functions palette. Set one of the wait functions on the timing palette.
07-04-2009 09:36 PM