LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a control sequence of digital outputs with timing

I'm trying to create a controls system for a cleaning process. I am controlling a pump, heater, and several solenoid valves using relays that I am opening and closing with the +5V from my USB 6008 and each relay goes to one of the digital I/O lines, where I provide a sink to switch the relay. 

 

I am using the front panel as the user interface for the machine, so the user can specify three different processes, so I'm using an event structure to call each process. An example of the steps in the process are as follows:

 

1. Open relay #1 (solenoid valve)

2. Open relay #4 (heater)

3. Wait 30 seconds (while relays #1 and #4 are still open)

4. Close relay #4

5. Close relay #1

6. Open relay #2 (solenoid valve)

7. Wait 5 seconds (while relay #2 is still open)

8. Close relay #2

 

I am trying to use a framed sequence structure within the event cases, with the DAQ Assistant saying which lines are sinks and which are also outputting +5V (no delta, keeps relays closed), but I don't think this is working and will bog down the system if it did. I think inverting the lines will make it so the lines nominally output the +5V so I just need to send it a sink when I want to close the relays, and make sure it keeps doing that while it waits so the process can be completed. 

 

What is the best way to do this? I've used Labview before, but I'm hardly a pro, so any help would be greatly appreciated.

0 Kudos
Message 1 of 5
(2,637 Views)

 

 

Since its a sequential execution,state machine architecture might suit well.When the start trigger is given,check and  execute the states one by one sequentially until the last state.Use the functions in timing palette to control delays.

 

http://zone.ni.com/reference/en-XX/help/371361H-01/glang/wait_ms/

 

A snap of your vi might help us

0 Kudos
Message 2 of 5
(2,627 Views)

As nijams mentioned a state machine architecture is a good place to start.  In case you are unfamiliar in how to implement this in LabVIEW there is a blank state machine template available in LabVIEW.  When you create a new VI select From Template->Frameworks->state machine.  In addition I've included a link to a simple example posted on our NI Community.

 

State Machine Example.zip: https://decibel.ni.com/content/docs/DOC-15515

 

Regards

Regards,
Isaac S.
Applications Engineer
National Instruments
0 Kudos
Message 3 of 5
(2,614 Views)

You can add on to this. It uses cDAQ NI 9178 chassis and NI 9481 module.

0 Kudos
Message 4 of 5
(2,603 Views)

Thanks all for the help! I am using the state machine and it looks like it's working well!

0 Kudos
Message 5 of 5
(2,582 Views)