LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timed sequences. Is that hte right choice and how does it works!

Solved!
Go to solution

Hi!

I'm a newbie in LV, and I'm trying to create a VI that is capable of controlling a small filtration unit I have build as a part of my engineering studies.

I have to control three magnetive valves which are connected to the digital output port Do0, Do1 and Do2 on my MyDAQ 6009 USB device.

 

I have to control the sequence by which the valves opens / closes as to avoid damage of som sensitive pressure transmitters. How do I manage to programme a time controlled sequence that opens and closes the valves in the right order and , in reverse order, repeats the sequene after a user defined choice of time?

 

I have looked at the "Timed sequence" but cant find a "down to earth" description on how to use it.

 

Maybe my problem is a bit to general. In that case I can surely help with a clarification if needed.

 

I hope someone can help me with my problem. By now I have spent 6 hours in watching different tutorials without any luck.

 

Thanks in advance

 

Henrik

0 Kudos
Message 1 of 18
(3,442 Views)

Hi,

 

I believe that the best to do a project with different states that should go in some sequence is to use a state machine method.

Below are two link that may help you.

 

https://decibel.ni.com/content/docs/DOC-17005

http://zone.ni.com/devzone/cda/tut/p/id/3024

 

Hope this helps

 

 

Message 2 of 18
(3,438 Views)

Hi Henrik

 

Did you succeed in creating a Timed Structure for your design or success in chosing another structural implementation like the case structure?

 

If you still have problems, I will try to help you. But you need to be a bit more specific about what you are asking.

 

The Timed Sequence is pretty simple it is working like a normal sequence, but instead of changing "frame" when the code inside the frame has finished executing, it changes frame when the time specified has expired.

 

You will choose a timed frame if you have some initialization that you wil only run once and allways in the specified order. If you have a state diagram where you will execute the states randomly dependent on some output you will use a statemachine instead, and if you need it build that statemachine inside a timed loop.

 

Best Regards

Anders Rohde

Application Engineer, DK

National Instruments

 

0 Kudos
Message 3 of 18
(3,410 Views)

Hi Anders!

I have looked on the State Machine solution, but couldn't really figure out where to start. As I mentioned, I'm a newbie. All I have done so far is data logging and working with analog signals (temperature logging, controlling a pump and so on). I have build a filtration unit as a part of my studies to become a chemical engineer. In order to clean the ceramic membrane in use, there is a procedure where the fluidstream is pumped back in to membrane to loosen fouled particles etc (called backflush). This is done with high pressure air. I have mounted three magnetic valves to be able to control this process.

Valve one and two has to close approx 0.5 sec before valve three opens. Valve three is allowing the high pressure air to push fluid in reveres direction and valve one is protecting a pressure transmitter with a max. overload pressure [bar] below the required pressure. After a userdefined number of seconds, the process has to be repeated in reverse order. The three valves are connected to digital I/O channel 0,1 and 2 on the USB 6009. With the Measurement and Automation explorer testpanel I can open and close the valves manually, so the connection is established. I don't have access to a PLC, which probably would be the right choice for my problem.

If you could help I would appreciate it a lot. My thesis isn't about building a filtration unit. It is more the process using it, and that is not possible right nowSmiley Indifferent

 

If the above information is insufficient, I will provide any information needed.

 

Best regards

 

Henrik

0 Kudos
Message 4 of 18
(3,381 Views)

Hi Henrik

 

If you create a flowchart for your design (http://en.wikipedia.org/wiki/Flowchart)

 

Then I will help you with how you create a statemachine for it in LabVIEW.

 

This is the normal procedure for designing software in any language. First design face and when you have a good design schematic it is easy to implement in software.

 

 

Best Regards,

Anders Rohde

Application Engineer, DK 

 

0 Kudos
Message 5 of 18
(3,372 Views)

Hi Anders!

Thanks for the helping hand. I have created a simple flowchart describing the different steps. The link you gave to wiki was empty, but I think I managed it anyway.

 

I hope it is understandable.

 

I have another sequence for filling up the backflush tank again, but I think I will be able to make that by my self, after the first state machine. 

 

Best regards

 

Henrik

 

0 Kudos
Message 6 of 18
(3,356 Views)

Hi Henrik

 

I have made an example program to you describing your statemachine and the actions to be taken.

 

Only thing you have to do is to configure the DAQ assistant that I have placed with you device.

 

 

You can test the program by clicking the run button and the press start. You can monitor the current flow on the states indicator. Please let me know if you have any further questions

 

Best regards,

Anders Rohde

Application Engineer

National Instruments, DK

0 Kudos
Message 7 of 18
(3,323 Views)

Hi Anders!

It looks fine. I will try it on the spot. The only question I have is the timing. In my flowchart I have mentioned some delays of 0,3 seconds. If I undestand your block diagram right the timing is set on 0,3 seconds for all states, and not just the two first / last before / after the backflush. It is only the backflushtime that is supposed to be userdefined. Backflushtime depends on the pore size in the membrane in use and therfore has to be variable. The time between the closure / opening of the valves is set to 0,3 second to give the valve a chance to close/open before the next valve changes state.

 

I will return when I have tried the VISmiley Happy

 

Best regards

 

Henrik

0 Kudos
Message 8 of 18
(3,311 Views)

Hi Henrik

 

The front panel item

"Wait user defined #sec", sets the wait time for the state OpenBackflush. This control is wired to the time delay funtion only in this case.

 

The Close Preasure, Close Pipe, Close Backflush and Open Pipe has a constant timedelay of 0,3s as defined per the constant in the block diagram.

 

The OpenPreassure does not have any time delay and will therefore go back to start just after DAQ has finished.

 

Best Regards,

Anders Rohde

Application Engineer

National Instruments, DK

0 Kudos
Message 9 of 18
(3,303 Views)

Hi Anders!

I have tried the state machine you made, and the state machine works fine. It opens and closes the valves as it is supposed to. unfortunately it has some kind of influence on the rest of my control VI. I am not able to control my pump or get readings from my temperature transmitters, flowtransmitters, steam valve or anything else as long as I have the state machine in the VI.

Is there a speciel way to implement a state machine in an existing VI?

 

Best regards

 

Henrik

0 Kudos
Message 10 of 18
(3,267 Views)