03-31-2015 04:56 PM
Hello people
I need to developt a code that reads data from an encoder and a laser distance.
I tryed with repack values module to repack all laser values each 10cm, then gives mean, min and max from packed values, reset and do the same next 10cm and again....but no success.
The readings from laser will be near from 1000 each 10cm.
Can some one suggest a easy way?
Best regards
cp
03-31-2015 05:14 PM
04-01-2015 02:51 AM
Hi Mike
In attach is a printscreen from repack values modules, but this only amounts a predefined number of data and what I need is keep data between 0cm and 10cm, then calculate mean, min and max values, do de same between 11cm and 20cm, etc....
Best regards
cp
04-01-2015 07:45 AM
04-01-2015 11:15 AM
Hi Mike
From 0cm to 10cm the program needs to store data from a distance laser(maybe in an array, i not familiarized with it), after this segment he calculates mean, max and min, then reset data in array or else, do the same in next 10cm. I expect that the laser each 10cm gives about 1000 readings.
In my old program I use the repack values module, because at the first time I count how much readings the laser make in 10cm, then i input this number of readings in repack module, and works more or less.
I would to coordinate it with the encoder signal, I can divide the distance with 10 and it can gives a true signal each 10cm but the rest, keeping data each 10cm..... 😞
Best
cp
04-01-2015 03:55 PM - edited 04-01-2015 03:59 PM
Here is a small example of repack values vi
It works, but with a pre-defined number of data points
I do not understand for what is the Data index control? If it is 0 the repack vi counts the 10 data points and gives the output, with other number it does not work.....
Best
cp
04-01-2015 04:44 PM
@cpalka wrote:
Here is a small example of repack values vi
It works, but with a pre-defined number of data points
I do not understand for what is the Data index control? If it is 0 the repack vi counts the 10 data points and gives the output, with other number it does not work.....
Best
cp
Peeking under the hood that is the intended behavior and the value of data index should be -1 and never have been exposed to the user.
But what intern used Trigger and gate with block diagram constant sentinal values under the hood? Its nearly write only code
Replace that repak with this:
04-01-2015 05:07 PM
Hi Jeff
Many thanks
I try to build this vi in 2010 but I couldnt find all components.
Can you send the vi for 2010 or it is only valid in 2013?
Best
cp
04-01-2015 06:18 PM
04-02-2015 01:52 AM
I found it, thanks
CP