LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

increasing and decreasing

I am monitoring a certain value. The value has a range from 0 to 1.  I have a moving object that when it moves to the left the value being monitored is decreasing, also when the object moves to the right the value increases.  
 
Kindly teach me how can I show it in LabVIEW that when the value is "DECREASING" then it is moving LEFT and it will remain true even the object has stopped its motion. I want to remain it TRUE so that i can perform other function.
 
Also, when the value is "INCREASING" then it is moving RIGHT and it will remain true even the object has stopped its motion. I also want this to remain TRUE to perform other function.
 
Kindly teach me how can i implement in LabVIEW. I would greatly appreciate your kind reply.
0 Kudos
Message 1 of 10
(4,646 Views)

Hi

Attached is a simple solution how you could do it.

Hope this helps.

Thomas

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 2 of 10
(4,643 Views)
Dear Mr. Thomas,
 
Thank you very much. It is very helpful.
 
If I am going to place this direction.vi inside a big while loop, and i will make this direction.vi as a sub-vi, my STOP function is going to change.
Hence, do you think its better that i will remove the while loop when i make the sub-vi?
How can i make the shift registers without the while loop then?
 
 
0 Kudos
Message 3 of 10
(4,627 Views)
Dear Mr. Thomas,
 
If i will change the while loop to a for loop then i will get the same results right?
0 Kudos
Message 4 of 10
(4,627 Views)

Hi

I changed it to a "LV2-Style Global". Search the forum on this topic to understand how these vi's work.

You can now use it as a sub-vi.

Hope this helps.

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 5 of 10
(4,619 Views)
Dear Mr. Thomas,
 
Thank you very much.
You have been very helpful.
 
 
 
 
0 Kudos
Message 6 of 10
(4,597 Views)

Dear Mr Thomas,

 

I am making some revision or to add some function to the sample VI you had made before

on this old thread.

Kindly see the attached VI.

The VI demonstrates that if the distance decreases it turns ON the LED. And turns OFF if the other way.

I would like to add the following;

1. if the object stops moving the default will be Decreasing.

2. if the object moves to the right (increasing) and moved more than i.e. 0.2 then it must demonstrate

increasing. I want to do this to compensate for the backlash or vibration of the moving object.

 

Always thanks for your kind help.

 

Regards,

0 Kudos
Message 7 of 10
(4,225 Views)

The Sub-vi's comparison should then be >= 0.2 to be true, else false

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 10
(4,216 Views)

thanks for the reply, but i dont get it..its does not satisfy

the function i need.

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

It seems you're asking for a schmitt-trigger function. If so, you'll need to keep track of previous value in a similar fashion. If the measured value is < -0.2 or > 0.2 then it'll (de)activate else it'll use the previous.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 10 of 10
(4,174 Views)