05-01-2012 03:18 AM
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.
05-01-2012 04:07 AM
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...
05-01-2012 06:57 AM
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.
05-01-2012 07:19 AM
@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
05-01-2012 07:42 AM
ok thanks for replies
05-01-2012 08:09 AM
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.
05-01-2012 08:22 AM
Ok so i need to build a state machine here. Thanks. I dont have an idea about it, but i will try to learn.
05-01-2012 09:56 AM
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.
05-02-2012 03:11 AM
Thank you again Space Cowboy 🙂
05-02-2012 03:19 AM
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.