LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

relay module and DAQ Assistant

Solved!
Go to solution

Hi everyone!

 

I'm a Labview beginner and currently dealing with a priori easy business. Recently I got a USB Relay Module to be incorporated in an alarm system. Let's say if one gets a certain value bigger than other, the relay should close and activate a siren (see example attached). For this I've used the DAQ assistant and configured one of the module output channel. By using a simple boolean switch, I can easily close and open the relay. However, if I use a case structure, an error is obtained, as the DAQ Assistant for one output can be only used once. I mean, if the relay is closed and I'd like to get back the original situation, i.e. opened relay, what should I do?

 

Schematically:

-if A>B, then closed relay

-if A<B, then opened relay

 

Sorry for the messy explanation, but I think you get the point.

Thanks in advance 

0 Kudos
Message 1 of 3
(2,411 Views)

Hi Henry

 

I'm not sure that I fully understand your question and the code you've attached only functions to switch a single output on.

Have you looked at the digital output examples included with LabVIEW? I think you need to use the DAQmx functions palette to continuously write either 0 or 1 to your output.

If you provided some more complete code I can help further.

 

Kind regards

 

 

 

Chris | Applications Engineer NIUK
0 Kudos
Message 2 of 3
(2,403 Views)
Solution
Accepted by topic author HenryOrtega

I just got it. The problem was that in the main vi, not in the example I attached, the same output via DAQ Assistant was configured for two different case structures. Obviously the relay module was going completely mad, since I had two independent pairs of TRUE and FALSE working at the same time. If I get, for instance, TRUE for one case structure and FALSE for the other, the switch doesn't know what to do. Hope now it's clear... Smiley Embarassed

 

 

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