LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

picomotor driver

okie. besides fomr other problems I will just say my main concern. In the attached program original code is Application.vi and my changes are in Application_change.vi and more the changes added in the name the lastest is the file.
Well rit now I need help in the Application_change_change_change.vi (I guess, or the one which has most no. of change in its name). and if you open the block diagram this is my problem area:
last row. First loop: TRUE
second loop:< no choice. >
3rd Loop: False
4th Loop;
5th : choose 3.
6th :true or false< doesn't matter>
OK so now you are in my problem area. here you will see I am passing the Current Position variable outside
the loop and comparing it to some no. and then that boolean result goes to while loop condition.

now my problem is : I thought that this program make this loop stop after Current Position is 5. but it's not what it is doing. I know it is pretty easy problem but I am sorry I am not that quick.
So please help me guys.

I also tried to see whether it's checking the condition or not. and I guess it's not checking the condition thats why you will see "boolean to no." converter near the condition.

Well I hope I wil get the solution here.

In anticipation of quick reply

thanks in advance
priiyank Shukla
0 Kudos
Message 1 of 2
(2,787 Views)
Priiyank,
I took a look at your code and I believe the issue is the behavior of sequence structures. Data is not passed out of a sequence structure until all the sequence frames finish. Therefore even though in frame 3 you want to end the structure must still execute frames 4, 5 and 6, after that occurs the loop can finish.

In addition let me be honest with you for a second. It is apparent that you are a relatively new programmer to LabVIEW and you may want to look into LabVIEW training courses. You have figured out some of the higher level functions, however I think you are missing more the philosophy or general understanding of how LabVIEW executes. Search the site for tutorials on dataflow programming, and you can see what I am talking about.

I think if
the code utilized the features of the dataflow programming structure, it could be significantly simplified and 'cleaned up,' and troubleshooting the issue would also be simplified. You may consider using sequence structures and local variables significantly less, it is suggested that they be used rarely. You used it correctly when you initialized the Default states of your buttons. However the sequence structure around the LDCN Init VI has no purpose. Another example of a sequence structure you don't need is the sequence in the case structure you directed us to, the one around the Pos Mode case. That structure has no effect on the way the program runs and only makes the code harder to read.

I hope these suggestions can help with your current application as well as in the future as you strive to improve your overall LabVIEW programming technique.
0 Kudos
Message 2 of 2
(2,787 Views)