Campbell Scientific CR10 CR10 Measurement and Control - Page 119
Final Storage Areas, Saving Data
View all Campbell Scientific CR10 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 119 highlights
SECTION 8. PROCESSING AND PROGRAM CONTROL EXAMPLES 8.8 USE OF 2 FINAL STORAGE AREAS . SAVING DATA PRIOR TO EVENT One of the uses of 2 Final Storage Areas is to save a fixed amount of data before and after some event. ln this example,,a load cell is measured every second. lt is assumed that at some random intervalthe load willexceed 25 pounds for less than 10 seconds. Exceeding 25 pounds is the event to be captured. The data from the 10 seconds before the event and 10 seconds after the event is to be saved (21 seconds including the scan in which the load first exceeds 25 pounds). Every second the load cell is measured; hoursminutes, seconds, and the load are output to Final Storage Area 2 (4 values with the Array lD). 84 locations are allocated to Final Storage Area2. Thus, Area 2 holds 21 seconds (4 values/second x 21 seconds = 84 locations). When 25 pounds is exceeded, 10 is loaded into an input location and flag 1 is set high. The input location is used as a down counter. The flag indicates an event has occurred and prevents the input location from being reloaded until 11 seconds have passed. The down counter is decremented by 1 each time the table is executed. When it equals 0 all the data in Final Storage Area2 is transferred to Final Storage Area 1 (using lnstruction 96) and Flag 1 is set low. The down counter is set to 10 instead of 11 because it is decremented after checking to see if it is 0. Input Location Labels: 1:FORCE LBS 2:DOWN CNT * 1 01: 1 TablelPrograms Sec. Execution lnterval 01: 01: 02: 03: 04: 05: 06: Q7: 08: PG FullBridge 1 Rep 22 7.5 mV 60 Hz rejection Range 1 lN Chan 1 Excite all reps w/EXchan 1 25OO mV Excitation 1 Loc [:FORCE LBSI 33.333 Mult 0 Offset 02: P86 01: 10 03: P80 01: 2 O2: 10 04: P77 01: 11 05: P70 01: 1 02: 1 06: P89 01: 1 02: 3 03: 25 04; 30 07: P91 01: 21 02: 30 0081: : P86 11 09: P30 01: 02: 10 0 03: 2 10: P95 11: P95 12: P89 01: 2 02: 1 03: 0 04: 30 13: P91 01: 11 02: 30 14: P96 01: 81 15: P86 01: 21 16: P95 17: P94 18: P34 01: 2 Q2: -1 03: 2 19: P95 Do Set high Flag 0 (output) Set Active Storage Area FinalStorage Area2 Anay lD or location RealTime Hour-Minute,Seconds Sample Reps Loc FORCE LBS lf XF X Loc FORCE LBS >= F Then Do lf Flag/Port Do if flag 1 is low Then Do Do Set high Flag 1 Z=F F Exponent of 10 Z Loc [:DOWN CNT ] End End lf XF X Loc DOWN CNT F Then Do lf Flag/Port Do if flag 1 is high Then Do SerialOutput All data to other FS Area Do Set low Flag 1 End Else Z=X+F X Loc DOWN CNT F Z Loc [:DOWN CNT ] End End Table 1 8-9