03-29-2010 12:44 AM
Hello all,
Can anyone help me generating a pseudo code for this? I have created the program but I have no idea how to write the pseudo code.
Thanks,
Roddy
There are 3 button:
“Program”
“Run”
“Clear”
Functionality:
· Control panel starts by displaying “Ready”.
· If you press “Program”, then you go into the programming mode, which displays “Programming”, and where you can modify two variables: a bool ‘InAutoMode’, and a float ‘SetPoint’. In Auto mode, ‘SetPoint’ must be set above 0. In manual mode, ‘SetPoint’ is ignored. After programming in the variables, pressing “Clear” will make it display “Ready” again (pressing “Clear” at any time will make it display “Ready” again).
· If you instead press “Run”, it will check to see if the programming is valid (i.e. ‘SetPoint’ is greater than 0 if you are in Auto mode, always valid in manual mode). If the programming is not valid, then it displays “Programming Invalid” until you press “Clear” or “Program”. If the programming was valid, then it checks to see if you are in Auto mode. If in manual mode, then it displays “Running” and you are finished with the start process. If you are in Auto mode, then it prompts the user with the following display “Open Valve”. The user then opens the valve and presses the “Run” button. If the valve was opened properly, then it displays “Running” and the start process is finished. If the valve wasn’t open when the “Run” button was pressed last, then it prompts the user again, displaying “Open Valve”.
Solved! Go to Solution.
03-29-2010 01:26 AM
Sounds like a typical Event driven program.
In Program you show some text and open 2 controls for change (disable property).
Clear can be a Invoke node - Reinitialize default values.
Run is the only one that requires some actual programming, you'll have to do some boolean comparisons. 🙂
/Y
03-29-2010 01:46 AM
Right, I have no problem wrting the code in labview, but I can not figure out how to do the pseudo code.
EX:
Boolean1="program"
Boolean2="Run'
Boolean3="Clear"
Case
Bool1=T, ...
how do I pseudo code this for labview or tradiona code.
03-29-2010 01:52 AM
pseudo code is essentially writing a step by step procedure in english http://www.google.com/search?q=define%3A+pseudo+code
If someone has asked you to write it specifically in any way, I guess you'll have to comply with that person's "rules". Otherwise, just type out what your labview code is doing, in english and you'll more or less have a pseudo code.
Hope it helps.
03-29-2010 07:39 AM
START
Display = “Ready”
If PROGRAM button
Then, Programming Mode
Display = “Programming”
Prompt for AutoMode?
Yes, AutoMode
InAutoMode = True.
Prompt SetPoint = ?
While entry,
If Clear button,
Then Return START
Else SetPoint entered
No, Manual Mode.
If CLEAR button
Then Return START
If RUN button
Then, Check Programming
If AutoMode
Then, Check SetPoint
If SetPoint <= 0
Then, Display = “Programming Invalid”
Wait indef for PROGRAM or CLEAR buttons
Else Programming Valid.
Loop:
Prompt Open Valve?
Yes
Wait for RUN or CLEAR button
If RUN, Then Display = “Running” & END
Else If CLEAR, Return START.
No, then re-loop.
Else Manual Mode
Display = “Running”
END
03-29-2010 09:56 AM