rnd_trip

Purpose:

Measure the time intervals for changes in one or two linked variables, recording data such as mean time, maximum and minimum intervals, variance, and standard deviation based on specified parameters.

Enter:

rnd_trip <input_channel> <output_channel> [p=priority] [t=interval] [c=count] [a=increment] [l=limit] [r=range] [s=scale] [i=initial] [f=file_name] [d] [v] OR rnd_trip <input_channel> – [p=priority] [t=interval] [c=count] [d] [v]

Where:

input_channel

Specify variable to read, such as an input channel.

output_channel

Specify the variable to set, such as an output channel. Use “-\” for single variable tracking.

p

Optional. Specify the priority. The default is 13.

t

Optional. Specify the frequency in milliseconds to check for a change. The default is 50 milliseconds.

c

Optional. Specify the number of changes to detect. The default is 1000.

a

Optional.  Specify the amount to increment the output variable. The default is 10000.

l

Optional. Specify the value at which the output variable resets. The default is 10000.

r

Optional. Specify an acceptable range for matching values. The default is 500.

s

Optional. Specify the scaling factor for the input variable. The default is 1.0.

i

Optional. Specify the initial value for the output variable. The default is 0.0.

f

Optional. Specify the output filename. The file will be placed in the /tmp/ directory.

d

Optional. Specify this option to display additional debug information. The default is to suppress additional information.

v

Optional. Specify this option to enable verbose mode to display detailed statistics.

Example:

rnd_trip i_snap_ch3ao_16p=10t=10c=10000l=5000r=250
This tests the speed between the variables ai_snap_ch3 and ao_16. ao_16 is what gets set, then ai_snap_ch3 is connected and changes its value based on ao_16. The ratio between ai_snap_ch3 and ao_16 is 1 to 1. So, when ao_16 is 10000, ai_snap_ch3 is 10000, The 2 values are checked if they are equal every 10 milliseconds because we set t=10. If ai_snap_ch3 is within +/- 250 of ao_16, it is considered a match.

ao_16 is at 2000 and ai_snap_ch3 is at 1800, this would be considered a match. Once the two values have been matched, ao_16 has it value increased by the increment value. Using the above example, once we get the match, ao_16 would be set to 3000 since we are using the default value of 1000. Once ao_16 is greater than the limit, it is set back to the original value. Once ao_16 reaches 6000, it is set to 0 since we are using the default for init. Once we have reached 10000 matches, we report how how long it took.

rnd_trip ai_snap_ch3 ao_16 p=10 t=20 a=5000 l=10000 r=500 i=5000 s=.1
This tests the speed between the variables ai_snap_ch3 and ao_16. ao_16 is what gets set, then ai_snap_ch3 is connected and changes its value based on ao_16. The ratio between ai_snap_ch3 and ao_16 is 10 to 1. So when ao_16 is 1000, ai_snap_ch3 is 10000, we need to adjust ai_snap_ch3 so that the  the ratio is 1 to 1. We do this by using the scale option with [s]. This would take the ai_snap_ch3 value and multiple it by .1. So if ai_snap_ch3 was equal to 10000, it will be read as 1000. he 2 values will be checked if they are equal every 20 milliseconds because we set t=20. If ai_snap_ch3 is within +/- 500 of ao_16, it is considered a match.

ao_16 is at 5000 and ai_snap_ch3 is at 5400; this would be considered a match. Once the two values have been matched, ao_16 has its value increased by the increment value. Using the above example, once we get the match, ao_16 is set to 10000, since we are using a=5000. Once ao_16 would be greater than the limit l=10000, it is set back to the original value.

Once ao_16 reaches 15000, it is set to 5000, since we are using i=5000. Once we have reached 10000 matches, we report how how long it took.

Notes:

The program processes variables until the specified count is reached or interrupted. Ensure variables are properly linked for accurate measurements.

See Also: