LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

A switch on/off problem about the relay in a loop

hi group:
 
I am developing a project based the Ni-sci-1160. Now I meet a problem about switch on/off in a loop.
 
for example:  I creat a loop, and continually check a boolean. if the boolean is true, then the realy is closed, otherwise the relay is open. The problem is when I make the boolean is true,  the corresponding relay is not always on,  but just on-off, on-off,on-off.  I don't know why? Is there any good idea to fix it?
 
the easy example codes is attached here , thanks for you help.
0 Kudos
Message 1 of 3
(2,623 Views)
Try moving that first DAQmx function out of the while loop.  Since it is called switch set and Reset, I'm guessing it is resetting the status of the switch every iteration of the while loop which probably means setting it back to false.  It looks like an initialization type of function which means it should only be run once.
0 Kudos
Message 2 of 3
(2,619 Views)
Thanks!  The problem is something about resetting, now it is working.
 
 
0 Kudos
Message 3 of 3
(2,617 Views)