Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Encodeur to generate pulse at every meter

Hello,

 

Here is my problem.  I install optiocal encoder on vehicle and I count the number of pulses for a kilometer (calibration value).  Following that, I want to generate an event for example at every meter.

 

My question, Can I change the preload value of the counter while it is counting.  Doing so, at he end of the count,  the new preload value will be load for the next couunt.  My main goal is to manage the "decimal pulse" adding one in a time one extra pulse to count.

 

Ex:

 

If for a kilometer I have a total of 98857 pulses and I want to generate an event at every meter, I will setup the counter to 98.  I will reach 1000 events after 98000 pulses instead of 98857.  The offset on the road will be about 9 meters.  So I would like to add extra counts sometimes to have interval between events the nearest as possible of 1 meter.

 

Thanks

Ben

 

 

0 Kudos
Message 1 of 4
(3,892 Views)

Hey Ben,

 

Would you be able to measure how many pulses will be in one meter? I believe this will be the most accurate/easiest way to accomplish your goals here, instead of have the measurement for a kilometer and calculating from there.

 

Regards,

Renée M
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,883 Views)

Thaks for the answer.

 

The problem is an accuracy one.  Moving a truck on exactly one meter is almost impossible.  This is the reason why we calibrate over 1000 meters.

 

Regards

Ben

0 Kudos
Message 3 of 4
(3,881 Views)

Ben,

 

That makes sense. In this case, I would have the one counter (98) where your event will occur once reached, and will reset, as you have it. You can add in another counter which will count the total pulses over the 1000 events, where when this is reached it will reset your first counter. This way, your first counter will be partway to what it thinks is another event, but is actually just extra pulses, and will be reset by the second counter to account for the offset in the pulses measurements.

 

 

Regards,

Renée M
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(3,879 Views)