LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Output value from while-loop after each iteration

I am creating a VI that switches solid-state relays (SSRs) on for up to 3 hrs (specified by the user - see front panel) and then automatically switches them off when the time has expired.  The SSRs are turned on/off using the 'Call Library Function Node' to call functions from a DLL. 

 

The problem is, I need to send the binary representation of a boolean array to my SSR-module every time one of the timers runs out.  For example, I might turn on 2 of my relays (#1, #2), set for 5 min and 10 min.  The VI sends the binary rep of the boolean array {1 1 0 0 0}, then after 5 min {0 1 0 0 0}, and after 10 min {0 0 0 0 0}.  I have attached my VI and the c-file of the DLL functions to this message.  ANy assistance would be appreciated, thank you.

 

Austin

0 Kudos
Message 1 of 2
(2,428 Views)

One, try not to use the sequence frames. Learn how to use data flow which is the basis of LabVIEW. Also, you might consider looking into state machines. Try to use clean wiring. You have wires running backwards and under objects. This makes it very difficult to follow the flow of  your code. You will also want to learn about using subVIs. Your two while loops are identical and are a good candidate for a subVI.

 

As for passing data out of loops generally you will use a queue, a notifier or an user event. You could also update the indicator directly within the loop. (If you use subVIs queues, notifiers or events are a better apporach. It is unclear from your code exactly what you want to do. Are you using the Run Continuous to run this code? If so, don't. Thta should only be used for specific types of debugging. In fact, I never use it. Again, a state machine woudl be a good 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 2
(2,422 Views)