01-15-2013 05:47 AM
Dear All,
Since I am new bee for labview, I want to count the no. of rotations that the compass will be rotating. I just did for one count, but I need to measure the count continuosly. Please some one to help me as soon as possible. Attached is me code. Please do the needful.
Thanks and Regards,
Dinsulpri
01-15-2013 09:55 AM - edited 01-15-2013 09:56 AM
Simple state machine is one way to do it...
Note:
Code is not complete. The initial state should be programmatically set depending on initial value of control and not a constant...
01-15-2013 10:10 PM
Dear Sir,
Thanks a lot for your reply.
As we dont have 2012 version of labview, could you please send me the file which is executable in 2010 version ? Please do the needful.
Thanks and Regards,
Dinsulpri
01-15-2013 10:38 PM - edited 01-15-2013 10:39 PM
"The needful" is attached
01-16-2013 12:36 AM
Dear Sir , Thanks a lot for your immediate reply. Actually my question here is, why we need to set the limit from 90 to 270? instead 0 to 360?
And also while executing the program, I couldn't probe the values inside the event structure, may i know , why it was happened? or else am I doing anything wrong? Note - I just given the condition as event triggering prior to the simualtion.
Please clarify my doubts and do the needful.
Thanks and Regards,
Dinsulpri
01-16-2013 11:07 AM
The event structure reads the value and, depending on its last state and current state, makes a decision. You should try to look at the logic in the different states and follow what it happening.
Example -
1> Start at low state and 10 degrees
2> Control moves to 30 degrees. Old state = low. New state = low (no change in count)
3> Control moves to 15 degrees. Old state = low. New state = low (no change in count)
4> Control moves to 100 degrees. Old state = low. New state = medium (no change in count)
4> Control moves to 330 degrees. Old state = medium. New state = high (no change in count)
5> Control moves to 20 degrees. Old state = high. New state = low (going straight from high to low means we made a positive rotation. Increase count by 1)
The limits determine the zones of the low, medium, and high states. While the values I choose to use were arbitrary, you would not want to set them too low (or high) to minimize errors. Try it yourself. Set the low limit to 2 and high limit to 358 (this would make the medium zone from 3 -> 357). If you were quick (or the mouse jumped) it might be possible to move from 356 degrees (medium zone) to 4 degrees (also medium zone). So if set improperly you could complete a rotation but not know you changed zones.
On retrospect though the best values would likely be in thirds (I.E., 120 and 240) to make the zones even? I did not do too much testing.
01-17-2013 12:27 AM
Thanks a lot for your crystal clear reply. I wil try to test with diffrent limits and see the output.
Regards,
Dinesh
01-17-2013 02:29 AM
Dear Sir,
As I checked with different set limits, I have faced the below issues,
When I set the limit as (90, 270) and started the knob @ 240 degrees and moved to 10 degrees, the count displayed as "1", But this is not a complete rotation, hence count should not be incremented in this case.
My actual requirement is , we have a set point , say 90 degree, if the knob rotates from 90 degree and reaches again 90 degree by clock wise direction that time the count has to show as "1", and it has to decrement if it rotates in the anticlock wise direction.
Could you please tell me the way to implement the same scenario.
Please do the needful.
Thanks and Regards,
Dinsulpri
01-18-2013 08:53 AM
Revised
01-21-2013 06:01 AM
Dear Don,
Thanks for your solution.
Today I did the Compass C100 (RT) interface with host via cFP controller, In this scenatio, I hope the event structure is not working in RT, hence I have read the value from compass and stored the same into shared variable and this variable can be accesses in host for further process.
when I am doing the same, the event structure control value doesn't recognise the shared variable values, Is there anyother way to use this shared variable value as a control? Please note, the compass value is dynamaic, that is read continuously from C100.
Please give me some suggestion on this and do the needful.
Thanks and Regards,
Dinsulpri