04-08-2012 12:57 PM
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.
04-08-2012 01:42 PM
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
04-08-2012 02:20 PM
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.
04-08-2012 04:15 PM
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