LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

False/True Case is not working. Please Help!

Dear all,

 

I attached my block diagram, one attachment refers to true case and the other refers to false case.

 

My program runs like this: when i run the vi , after homing the motor (there is home.vi), DAQ is collecting the values in the while loop, and according to the DAQ's value, motor should run the False/True case but it does not

 

As a result: true/false case is not working which is located at the outside of the loop(bottom side of the block diagram)

 

When i put the the True/false inside the Loop(DAQ's loop) , then it is working. But this brings lots of problem, two of them is: 

1-) When the DAQ values goes below to "50" then it turns to true case again,

2-) The false case has stop.vi which cause to motor stop every iteration of the loop.

 

So that is why i put True/False case out of the loop but now it is not working at all.

 

Please answer, waiting response.

Thank you,

Have a nice day,

Kind Regards.

 

 

Download All
0 Kudos
Message 1 of 10
(3,903 Views)

Hi Salander,

 

"So that is why i put True/False case out of the loop but now it is not working at all."

As long as the case structure is located outside the loop it will not be called before the loop stops. THINK DATAFLOW!

 

"motor should run the False/True case but it does not"

Did you check this? Used probes? Used execution highlighting to verfiy the behaviour? Any error messages and, if found, checked the errors?

 

Btw. it would be much more useful to attach real pictures or, even better, the VI...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 10
(3,892 Views)

Dear GerdW,

 

Thank you for reply, You can see my answers written with red.

 

"As long as the case structure is located outside the loop it will not be called before the loop stops. THINK DATAFLOW!"

 

- The case structure need to run same time with the loop, because as you can see from the attachments the case structure is also integrated with DAQ values.. loop is continuous till i press the stop button.  So what i understand that this case structure will not work because loop is continuous?? Cant we upgrade the vi. or do smthg that it can be able to work same time with the loop??

 

"Did you check this? Used probes? Used execution highlighting to verfiy the behaviour? Any error messages and, if found, checked the errors?"

 

Of course i check it because motor is in front of me and i can see if it is moving or not!

 

Btw. it would be much more useful to attach real pictures or, even better, the VI...

 

Because most of the people dont have my "motor controller's labview drivers"  I attached as a PDF file which is very popular.

 

Kind Regards.

0 Kudos
Message 3 of 10
(3,872 Views)

@Salander wrote:

Dear GerdW,

 

Thank you for reply, You can see my answers written with red.

 

"As long as the case structure is located outside the loop it will not be called before the loop stops. THINK DATAFLOW!"

 

- The case structure need to run same time with the loop, because as you can see from the attachments the case structure is also integrated with DAQ values.. loop is continuous till i press the stop button.  So what i understand that this case structure will not work because loop is continuous?? Cant we upgrade the vi. or do smthg that it can be able to work same time with the loop??

 

 

Kind Regards.


You have to place the case structure inside the while loop ( Any significance is there on placing the case outside the loop? ).


@Salander wrote:

Dear GerdW,

 

Btw. it would be much more useful to attach real pictures or, even better, the VI...

 

Because most of the people dont have my "motor controller's labview drivers"  I attached as a PDF file which is very popular.

 


 

Not Really * .png file ( vi snippet ) is much more popular here in Discussion Forum

 

 

-----

The best solution is the one you find it by yourself
0 Kudos
Message 4 of 10
(3,867 Views)

ok thanks for replies

0 Kudos
Message 5 of 10
(3,861 Views)

Gerd is right.  What will prevent your case structure from executing is the boolean from your while loop going to your selector terminal.  It will only send the selection once the while loop is complete.  In order to execute the case structure at the same time, you need to run then in parallel.  You're set up for a sequential operation.  You might consider a different design archetecture for this part of your program.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
Message 6 of 10
(3,846 Views)

Ok so i need to build a state machine here. Thanks. I dont have an idea about it, but i will try to learn.

0 Kudos
Message 7 of 10
(3,840 Views)

That's the best way.  Also, you can find help in looking at the webcasts and video tutorials that can help you out along the way.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
Message 8 of 10
(3,818 Views)

Thank you again Space Cowboy 🙂

0 Kudos
Message 9 of 10
(3,782 Views)

Side note: Another one of these cases where "auto-insert feedback nodes in cycles" made a real mess, just to "fix" the broken run arrow. A broken wire would have been much more obvious.

Message 10 of 10
(3,778 Views)