LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

help with this pseudo code

Solved!
Go to solution

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”.

 

0 Kudos
Message 1 of 6
(6,189 Views)

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

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 2 of 6
(6,180 Views)

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.

 

0 Kudos
Message 3 of 6
(6,170 Views)

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.

 

 

0 Kudos
Message 4 of 6
(6,166 Views)
Solution
Accepted by topic author Roddy

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

0 Kudos
Message 5 of 6
(6,131 Views)
Thanks Stranman, this is what I was looking for. I was thinking that it was different terminlogy for a labview pseudocode
0 Kudos
Message 6 of 6
(6,108 Views)