LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I acquiring 150ms square wave pulse from bill validator and use it to automate control of 5 relays in a specific sequence, with a proximity sensor whose condition controls relays also

My project is to design an ice vending machine. I am using a NI-USB 6501 to control relays and also acquire sensor conditions. I am reading a pulse  from a third part device using their provided VI.( I think I can also use PF10 port on the 6501). I downloaded example VIs. One is to turn relays on /off, the other to read On /Off positions of a proximity sensor and another to read pulses from a bill validator and a coin acceptor. All these VIs work discreetly. I also found a VI called Coke Vending Machine that is built on Labview machine states which I do not understand. I need assistance to get the 150ms pulse to trigger steps 4, 5 and 6 (In my attached VI) to turn on for 3 seconds(adjustable) and then get the relays to turn off when a proximity sensor changes from  0 to 1., then reset to start condition. Please help, I have to meet a week deadline because it has taken me a whole month to at least get to where I am.

0 Kudos
Message 1 of 4
(2,730 Views)

I recommend that you study the state machine example and search through the help and this Forum for more information about state machines.

 

I doubt that your VI can be fixed to do what you want. Pieces of it can be copied and moved to a state machine.

 

You should start by working through the on-line tutorials for Getting Started with LabVIEW.  You need to understand the basics of dataflow to help you get something working.

 

When you can ask specific questions about a particular part of your program, it is more likely that you will get directly relevant answers.

 

Lynn

0 Kudos
Message 2 of 4
(2,727 Views)

Thanks, I have a good feeling that I can get the part with machine state VI working , which will produce a 1-D Boolen T/F. My dilema is how to use the 1-D  Boolen T/F to control Boolen T/F, and how do I use that signal to just  trigger my process and run it for 3s.

0 Kudos
Message 3 of 4
(2,724 Views)

With a good state machine architecture your program will probably only require one loop.  That loop can handle the inputs, outputs, and timing- separate states for each, plus states for intialization and shutdown and perhaps others.

 

Lynn

0 Kudos
Message 4 of 4
(2,715 Views)