Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

If then else examples

Hi:
 
Attached is my flowchart graph. Is there any samples I can look at to write the graph I attached.
0 Kudos
Message 1 of 10
(4,275 Views)

The less than 70 micor ampere is implemented under the current meter in the attached program.

I would like to attach my program to let let you see what is going on.

0 Kudos
Message 2 of 10
(4,269 Views)
There are numerous examples. Open the example finder and do a search for state machine. That will give the greatest flexibility instead of nested case statements.
0 Kudos
Message 3 of 10
(4,254 Views)

Hi Dennis:

 

I made a program with state machine. Do you think there is any problem with it? Is so, I hope you can spot my mistake.

 

Regards,

John

0 Kudos
Message 4 of 10
(4,234 Views)

Aside from the fact that your state machine does abosolutely nothing, it's fine.Smiley Wink

Also, I would recomend you use integers, enums, strings, or a queue to define the states, not DBLs.

0 Kudos
Message 5 of 10
(4,228 Views)

Hi Dennis:

 

I got it. I know that my program using case structure is fine.

I know Event Structure can use with user interaction such as you press a push button in front panel and then the event structure will know which state to go by defining in event structure.

I wonder my program is without push buttons in front panel, could I use event structure instead? If so, would you please explain to me why? There is a timeout case in event structure, pls note.

You said I use case structure is fine in my case. You are not afraid of polling loop in case structure to detect changes. Why? Could you please explain

0 Kudos
Message 6 of 10
(4,210 Views)
I did NOT say your case structure is fine. I said it did nothing. No matter what happens, you end running the same state and I said do NOT write DBLs to your shift register to define the next state.
 
If you have front panel controls, yes you can use a state machine. You can also combine a state machine with an event structure. It's up to you to decide. An event structure uses less resources than polling but as long as you've written the polling routine correctly, you'll probably never notice. Thousands of programs have been written in LabVIEW without the event structure.
0 Kudos
Message 7 of 10
(4,206 Views)

Hi Dennis:

That means DBL (for example: 0.0) with decimal point can not wire this value this shift register. am I getting your meaning?

in your seond paragraph, did you answer my question. I asked if I don't have any push buttons (front banel controls) in case struture state machine, can I use event structure?

In your previous mail,  that means I can use case structure for writing state machine without concerning about polling issue because thousands of programs have been written in LabView without event structure, am I correct?

Sounds like the polling issue is something that you will not probably notice when writing program. Therefore, I don't have to care. Am I correct?

 

Regards,

John

0 Kudos
Message 8 of 10
(4,187 Views)

Hi Dennis:

 

DBL, see attached. is the floating point set it to 0. Is that right? I just read the information that you provided regarding state machine

0 Kudos
Message 9 of 10
(4,183 Views)

Nyborn,

I am not going to get sucked down into the rabbit hole of endlessly confiming questions I have already answered. There's been far to much of that in your previous postings. I will tell you one more time. DO NOT use floating point numbers to wire into your shift register. At some point, you're going to end up writing what you think is (for example) 2.0 to the shifter register but it will actually be 2.000000000001 (because that's the way computers sometimes translate floating point numbers). If you don't know how to specify or change the numeric representation of controls or constants, you have to take a programming course before you go any further.

0 Kudos
Message 10 of 10
(4,174 Views)