LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to do this in labview

Solved!
Go to solution

I have a cdaq relay module. I'm wondering how I can create a for loop in which i enter the number and it sends digital signal (boolean) to my daq . i'll upload my vi once im on my laptop. basically,i created a daq assist then generate/digital out put/line 0. I created a for loop and connected a boolean array to it. the problem is once the value of boolean becomes true it doesnt go back to false. I'm hoping that when i enter 4 for my for loop N,  true enters my daq and change the boolean back to false before the next loop starts

0 Kudos
Message 1 of 3
(2,320 Views)
Solution
Accepted by topic author Canucks.canucks

You want a digital signal to go Up and Down, which implies that Time is involved.  LabVIEW does Time, in fact, there's a whole Timing Palette.

 

I don't like using the Dreaded DAQ Assistant, as I have no control over what it is doing.  What I'd do is open MAX, find the DAQ device with the Digital I/O, create a Task that lets me toggle a digital line, then follow the simple steps shown in "Learn 10 Functions in NI-DAQmx and Handle 80% of Your Data Acquisition Applications" (Web-search for this paper).  You'll need 3 DAQmx functions -- Create Task, DAQmx Write, and Close Task.  Wire them together, wire a Constant to the Create Task's Task input, click the Selector and ... Select the Task you created in MAX.  Now put a While loop around the Write, put a Shift Register through it with "False" wired to the outside of the left Register (to initialize it to False), wire the Boolean to the Write terminal, Negate it (so it flips between False to True to False to ...), and put, say, a 100-msec Wait inside the While Loop (next to the Stop control).  This will now produce a square digital signal, High for 100 msec, Low for 100 msec, etc., opening and closing your Relay.

 

Enjoy.

 

Bob Schor

Message 2 of 3
(2,304 Views)

Thank you very much. very helpful 🙂

0 Kudos
Message 3 of 3
(2,286 Views)