Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Several measurement repetitions using the same Pressure Transducer


inzunzam May 2, 2012 07:33 PM

I would like to program a CR10X to execute an hourly average of 5 measurement repetitions taken at the end of each hour. The output is a millivolt signal coming from a full-bridge pressure transducer. I am aware that the Full bridge command has a reps parameter which is used when consequent channel sensors are wired in. How can I incorporate the 5 measurements and average them to output a single average.

I am not sure whether I must write a DO loop? I am also concerned with the time required to take the 5 measurements. By delaying the flag set 1 minute into a 60 minute interval, will it give the 5 desired measurements enough time to execute and record (See P92 command)?

Any ideas. Thank you in advance,

M.

(Program to take single measurement, desire is to take 5 measurements and average into single average output).

;{CR10X}

*Table 1 Program
01: 3600 Execution Interval (seconds)

1: Batt Voltage (P10)
1: 1 Loc [ Voltaje ]

2: Internal Temperature (P17)
1: 2 Loc [ TempInt ]

3: Full Bridge (P6)
1: 1 Reps
2: 23 ±25 mV 60 Hz Rejection Range
3: 1 DIFF Channel
4: 1 Excite all reps w/E1
5: 2500 mV Excitation
6: 3 Loc [ Output ]
7: 1.0 Mult
8: 0.0 Offset

4: If time is (P92)
1: 1 Minutes (Seconds --) into a
2: 60 Interval (same units as above)
3: 10 Set Output Flag High (Flag 0)

5: Set Active Storage Area (P80)
1: 1 Final Storage Area 1
2: 101 Array ID

6: Real Time (P77)
1: 1210 (Same as 1220) Y,D,Hr/Mn

7: Average (P71)
1: 2 Reps
2: 1 Loc [ Voltaje ]

8: Resolution (P78)
1: 1 High Resolution

9: Average (P71)
1: 1 Reps
2: 3 Loc [ Output ]

*Table 2 Program
02: 0.0000 Execution Interval (seconds)

*Table 3 Subroutines

End Program


LoggerNut May 6, 2012 04:43 AM

Hi InZunZam.

The following Campbell recorder code should work. Note the "--" index notation on the P6 Input Location. That notation increments the Input Location by one each time through the Do:Loop. Following the 5 readings a spatial average is performed on the 5 readings for the final processed value. The measurements are done during minute 59 of the hour so that they are ready on the top of the hour output to final storage. The P4 inside the loop is used to delay the loop 10 seconds between each measurement. 5*10, =50seconds total for the 5 readings and they finish 10 seconds ahead of the top of the hour output.

Let me know if it works for you or not.

LoggerNut.

*Table 1 Program
01: 60 Execution Interval (seconds)

1: If time is (P92)
1: 59 Minutes (Seconds --) into a
2: 60 Interval (same units as above)
3: 30 Then Do

2: Beginning of Loop (P87)
1: 0 Delay
2: 5 Loop Count

3: Excite-Delay (SE) (P4)
1: 1 Reps
2: 1 2.5 mV Slow Range
3: 1 SE Channel
4: 1 Excite all reps w/Exchan 1
5: 1000 Delay (0.01 sec units)
6: 0 mV Excitation
7: 7 Loc [ _________ ]
8: 1 Multiplier
9: 0 Offset

3: Full Bridge (P6)
1: 1 Reps
2: 23 25 mV 60 Hz Rejection Range
3: 1 DIFF Channel
4: 1 Excite all reps w/Exchan 1
5: 2500 mV Excitation
6: 1 -- Loc [ Msmt_1 ]
7: 1.0 Multiplier
8: 0.0 Offset

4: End (P95)

5: Spatial Average (P51)
1: 5 Swath
2: 1 First Loc [ Msmt_1 ]
3: 6 Avg Loc [ Msmt_Avg ]

6: End (P95)

7: If time is (P92)
1: 0 Minutes (Seconds --) into a
2: 60 Interval (same units as above)
3: 10 Set Output Flag High (Flag 0)

8: Resolution (P78)
1: 1 High Resolution

9: Sample (P70)
1: 1 Reps
2: 6 Loc [ Msmt_Avg ]


inzunzam May 7, 2012 05:17 PM

Oh that is genius, I never thought to use a spatial average and was not aware of the -- in the P6 command. I am convinced that this code is much more efficient than the one I have posted below. Thank you very much for your time LoggerNut, I like your solution! This is a code I adapted from a similar program found in a National Forest Service write up.

I am implementing an RF Modem to the CR10X. I will post a new thread when if I get stuck. Thank you!

*Table 1 Program
01: 3600 Execution Interval (seconds)


1: Z=F (P30)
1: 1 F
2: 00 Exponent of 10
3: 5 Z Loc [ stg_mult ]


2: Z=F (P30)
1: 0.0 F
2: 00 Exponent of 10
3: 7 Z Loc [ stg_off ]

;Initialize tot_mv
3: Z=F (P30)
1: 0.0 F
2: 00 Exponent of 10
3: 3 Z Loc [ tot_mv ]

;Initialize stage loop counter (n = 0)
4: Z=F (P30)
1: 0 F
2: 00 Exponent of 10
3: 1 Z Loc [ n ]

;loop to read the pressure transducer
5: Beginning of Loop (P87)
1: 0 Delay
2: 5 Loop Count

;Increment counter
6: Z=Z+1 (P32)
1: 1 Z Loc [ n ]

;Reads pressure transducer
7: Full Bridge (P6)
1: 1 Reps
2: 3 25 mV Slow Range
3: 1 DIFF Channel
4: 1 Excite all reps w/Exchan 1
5: 2500 mV Excitation
6: 2 Loc [ mv_stg ]
7: 1 Mult
8: 0.0 Offset

;Adds up total mV stage each time the loop is executed
8: Z=X+Y (P33)
1: 2 X Loc [ mv_stg ]
2: 3 Y Loc [ tot_mv ]
3: 3 Z Loc [ tot_mv ]

;End of loop to read pressure transducer
9: End (P95)

;Compute average mV stage
10: Z=X/Y (P38)
1: 3 X Loc [ tot_mv ]
2: 1 Y Loc [ n ]
3: 4 Z Loc [ avg_mv ]

11: End (P95)

12: Do (P86)
1: 10 Set Output Flag High (Flag 0) ;

13: Set Active Storage Area (P80)
1: 1 Final Storage Area 1
2: 101 Array ID

14: Real Time (P77)
1: 1120 (Same as 1220) Y,D,Hr/Mn ;

15: Resolution (P78)
1: 1 High Resolution

16: Sample (P70)
1: 1 Reps
2: 6 Loc [ avg_mv ]

*Table 2 Program
02: 0.0000 Execution Interval (seconds)

*Table 3 Subroutines

End Program

Log in or register to post/reply in the forum.