LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timing Events for process control with manual override

Greetings:

 

I am writing a labview program to control a set of three time based processes. Each process has 5 digital outputs that activate 1 SSR each and power a moter/pump etc. I have used a set of front panel controls to specify multiple start/stop times for each output. The outputs are within a for loop containing a time delay of one second. So the front panel start/stop times are used in conjunction with the for loop iteration counter and comparison/boolean operators to drive the outputs to the SSRs. This has become onerous. What Labview functions should be the next step in optimizing this type of program? The timing of these state changes is on the order of minutes/hours. Also, I would like to be able to manually override each SSR independently. Currently, using a Case Structure linked to a T/F control I cannot do this in realtime. The program iterates through the entirety of the for loops before it reads the override. How do I fix this? Also, I would like to begin configuring a set of analog and digital inputs into the program for which I would like to control the timing of sample recording and the duration of each recording event while keeping the program running.

 

I can currently do all of these things in a rudimentary fasion, I must abort the VI and reinitialize to make any changes. I'm just looking for some advice on what aspects of Labview and some specific functions that I should begin using, and learn more about.

 

Thank you.

0 Kudos
Message 1 of 7
(2,615 Views)

It will be very difficult to make any suggestions without seeing your code. At a minimum post a stripped down basic version that shows your overall flow and architecture. We need some place to start.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 7
(2,611 Views)

What Mark Yedinak said is true; no one can give much advice without seeing your code.

 

But I will venture a couple of simple suggestions based on the information you gave. You asked "The program iterates through the entirety of the for loops before it reads the override. How do I fix this?" You can add conditional terminals to your For loops, so you can quit the loop before all the iterations have completed.

 

And if you have the Full version or better, the Event structure is great if you want to be able to interrupt or change the path of a program while it's running.  The Producer/Consumer (Events) architecture is very powerful and flexible.

 

Hope this helps,

 

Ed

 

 

Edward Motts
Certified LabVIEW Associate Developer
0 Kudos
Message 3 of 7
(2,594 Views)

Thanks for the information

 

I included state machine architecture in the VI so I can successfully alternate between a time based I/O protocol and a front panel button based override mechanism.

 

I have not yet been able to configure my three loops so that they will all be running at the same time. They do not need to be synchronized and I believe should be offset to allow read/writes to the hardware. I tried converting the while loops in my state machines to for loops so that I could enable loop parallelism. This didn't seem to help. I have attached the code below. The code is basically just three identical state-machines that should be able to run independently of each other. How can I enable this?

 

Thanks,

Rick

0 Kudos
Message 4 of 7
(2,552 Views)

I can't open your code since I don't have 2010 installed. Can you save a copy for 2009?



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 5 of 7
(2,539 Views)

Here it is.

 

I would be interested to hear any extra comments that you have too.

 

I have a question as well. I have a number of user inputs and indicators in tab containers on the front panel. The VI is set up with basic state-machine architecture. Do all of the inputs/indicators receive constant attention and updates or only the ones that are shown on a particular tab?

 

Thanks,

Rick

0 Kudos
Message 6 of 7
(2,534 Views)

Since you have a wire output from one loop as an input to th enext your loops will not run in parallel but rather sequentially. If you want them to run in parallel you cannot have the output of one loop as an input to another.

 

You should also consider making your code a subVI. It is never a good idea to copy and paste blocks of code that will be reused. If you reuse it turn it into a subVI. You should also consider using clusters (use typedefed controls) to organize your data. This definitely makes sense when you turn this into a subVI.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 7 of 7
(2,531 Views)