Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Question about USB-ERB08 Relay VI

Solved!
Go to solution

I just had a specific labview question....  So for our relay VI (which works fine), we now want it to continuously start/stop about every 1 second, instead of having to click the button a hundred times.  This seems like it would be an easy fix, I'm just having trouble figuring it out.  I've played around with "for loops" and "waveform" VIs, but haven't had much luck.  I've attached the VI for the relay.  Thanks.

0 Kudos
Message 1 of 9
(5,002 Views)

Do you want the relay to turn on and off at 1second intervals?

 

If so, first make another ULx Write VI inside the loop and wire a true constant to one and a false to the second Write VI. This should make the relay turn on an off as fast as possible.

 

Now you can add timing. To do that, you could place a Wait (ms) VI in 2 sequence structures which would be placed just before and just after one of the write VI's. Wire the reference and error wires into these sequence structures which contain the Wait VI's. 

So all together we would have a while (or for loop).

The reference and error wires would come in the left of the loop.

 

Next they would then go in a sequence structure of one frame. The frame would have a wait vi inside.

Next the wires would pass into a write vi with a true constants.

next they would then go in a sequence structure of one frame. The frame would have a wait vi inside.

Next the wires would pass into a write vi with a false constants.


You should close your virtual channel outside the loop on the right.

 

Did I explain this correctly and does this help?

Thanks,
Eric

0 Kudos
Message 2 of 9
(4,982 Views)

Wow... I'm going to be honest, I am very new to LabVIEW. The project am I working on is my first experience using LabVIEW. I've watched all of the tutorials, but the program still isn't something I'd say I feel confident about.  I am sure everything you just told me is correct, but there are parts of your explanation where you kind of lost me. Particularly this part:  

 

Next they would then go in a sequence structure of one frame. The frame would have a wait vi inside.

Next the wires would pass into a write vi with a true constants.

next they would then go in a sequence structure of one frame. The frame would have a wait vi inside.

Next the wires would pass into a write vi with a false constants.

 

Would I be out of line in asking you to send me the VI? So I don't spend hours beating myself up trying to figure this out.  I understand if you don't want to do it for me, but if you could, I would REALLY appreciate it! 

0 Kudos
Message 3 of 9
(4,966 Views)
Solution
Accepted by topic author MattSin

I cannot write the VI for you because I don't have the particular VI's that you're using. Here is a screenshot of what the code should look like with DAQmx VI's used instead. This should help you understand my text a bit better.

 

Message 4 of 9
(4,953 Views)

The picture helped a lot! Thanks!  Just one more question and I'm done.  What exactly is the green icon labeled status? And is that a "or" or a "Not or" icon connected to the stop button?  

0 Kudos
Message 5 of 9
(4,931 Views)

Here is a screen shot of what I have, but as you can see, something isn't connected correctly

0 Kudos
Message 6 of 9
(4,928 Views)

No need to respond to that last question.  I just scrapped that part of the VI because I really didn't need it, and the relay works exactly how I want it to now!

 

Thanks so much for all of your help Eric! I really appreciate it!

0 Kudos
Message 7 of 9
(4,916 Views)

in the cld....

 

7. Timing

 

b. Timing functions:

 

3. Avoid using any of the Wait functions to time a software operation

 

so try this instead of using the Wait ms function and using the Daq write twice....

tf.png

Message 8 of 9
(4,903 Views)

That's a much cleaner method. Thanks for posting.

0 Kudos
Message 9 of 9
(4,879 Views)