Campbell Scientific AM16/32B AM16/32B Relay Multiplexer - Page 23
CRBasic P, rogramming
View all Campbell Scientific AM16/32B manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 23 highlights
AM16/32B Relay Multiplexer 5.1 CRBasic Programming The CR5000, CR800, CR850, CR3000, and CR1000 are programmed with CRBasic. The PortSet() instruction enables or disables the multiplexer and the SubScan()/NextSubScan instruction begins/ends the measurement loop. The program must also specifically increment an index variable and use that variable to determine where each measurement is stored. The generalized CRBasic programming sequence follows: ACTIVATE MULTIPLEXER/RESET INDEX Portset (1 ,1) 'Set C1 high to Enable Multiplexer I=0 BEGIN MEASUREMENT LOOP SubScan(0,sec,16) 'Measures 16 sets CLOCK PULSE AND DELAY Portset (2,1 ) 'Set port 2 high Delay (0,20,mSec) Portset (2,0) 'Set port 2 low INCREMENT INDEX AND MEASURE I=I+1 'User specified measurement instruction 'Storing results in Variable(I) END MEASUREMENT LOOP NextSubScan DEACTIVATE MULTIPLEXER Portset (1 ,0) 'Set C1 Low to disable Multiplexer The CRBasic instructions used to program the multiplexer are described below. PortSet Syntax: PortSet( Port, State ) Where, Port: the datalogger control port being used. State: 0 = Set port low; Non-zero = Set port high. NOTE PortSet must appear within a Scan/NextScan loop or a compiler error will occur. This instruction must NOT be placed inside a conditional statement when running in pipeline mode. SubScan/NextSubScan Syntax: SubScan (SubInterval, Units, Count) NextSubScan Where: SubInterval: constant that designates the time interval between subscans. Enter 0 for no delay between subscans. 13