LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

feedback control coding

yes, i'm fairly new to labview. i'm more used to visual C++ ....the file can be downloaded at
perhaps you can try download it and take a short look?
 
as you can see, there is a main loop and an inner loop. at first, the main loop "checkstatus" activate the inner loop "needs power", "needs power" will trigger mainloop "power up" if power is less than certain amount, by stopping the inner loop itself. after main loop "power up" is triggered, it gets to "checkstatus" again. again "needs power" is activated but if power is sufficient, it moves on to "default" inner loop, whereby a TRUE is always given to stop the inner loop and gets back to "checkstatus".
 
this is the portion i gets confused, because how does the inner loop ever get to "a bit warm", "fire", too hot" ?? if it keep stopping at the default loop, gets to "checkstatus" , then coming back to "default" again? or the the enumurated cases "nees power","default", "manual shutdown", "too hot" doesn't follow in sequence?
 
 
I'm as happy as i want to be!
0 Kudos
Message 11 of 16
(1,062 Views)

Don't have time to look through the code, but have a little piece of generic advice:

Just for temporary debugging purposes, wire your various case values into an auto-indexing loop tunnel, and create a front panel array indicator to hold them.  This array will hold the whole state transition history.  If that doesn't yet highlight the problem, wire up some other key parameters to autoindex as well.

Don't forget to get rid of this stuff after you've fixed the problem -- auto-indexing a while loop output will eventually bog down your memory / CPU.

-Kevin P.

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 12 of 16
(1,051 Views)
Ok, the inner loop is not going to the 'Needs Power' state first.  That is an instance of a the enum that is simply used as a datatype to typecast the iteration terminal as an instance of the enum.  Thus the iteration terminal is what is selecting which case to execute, thus starting at case 0 (manual shutdown), then case 1 (too hot), etc.  Notice the cases in the enum are listed in order of priority, so the highest priority request would always execute first (manual shutdown, fire, etc).

There is a lot of debugging help in LabVIEW to help you see what is going on.  Techniques include using execution highlighting (the light bulb icon in the toolbar), putting probes on various wires, and single stepping through the code.


Doug M
Applications Engineer
National Instruments
For those unfamiliar with NBC's The Office, my icon is NOT a picture of me 🙂
0 Kudos
Message 13 of 16
(1,046 Views)
ok thank you everybody.
I'm as happy as i want to be!
0 Kudos
Message 14 of 16
(1,025 Views)

refering to my reply at 09-03-2006 10:49 AM

i've done my block similar to the diagram posted. mine can't work. it get trapped in the check status. after highlighting execution (light bulb on toolbar) i find the reason, but can't solve it.

in the working buck roger example, the N in the while loop gets incremented and all the case are run thru, whereas, in my case, the N is always at 0, and "default" is executed first, despite my attempt to try get the other states execute first. what happen is in "default" my loop ended the case, and the check power restarted, N never gets incremented.

PLs help. i don't know what goes wrong...

I'm as happy as i want to be!
0 Kudos
Message 15 of 16
(977 Views)

sorry guys, pls dis regard my last post. just after posting i found out the reason

i have to edit items, and put the other case before "default" in the enumurated list...

I'm as happy as i want to be!
0 Kudos
Message 16 of 16
(975 Views)