数据记录仪pro CR1000X系列数据记录仪的例子gram for Apogee Instruments SQ-422/522-SS PAR Sensors 'date: April 8, 2020 'Revised: December 31, 2020 'program author: John Huber 'For more technical information regarding the SP-422-SS operation as well as default settings and register address lists, please consult the sensor's manual, which can be found online: '//www.huiyzt.com/product-manuals/ 'Wiring: 'White -> C6 Comm port (RS485 +) 'Blue -> C5 Comm port (RS485-) 'Black -> G port (Ground) 'Green -> G port (Communication mode selector wire. Powered = RS232, Grounded = RS485) 'Red -> 12V port (Input power) 'Clear -> Shield ground 'If using a datalogger model other than the CR1000X, some adjustments to commands will be necessary 'Explanation of Constants and Variables Used in Datalogger Program 'BattV = datalogger battery voltage 'PanelT = datalogger panel temperature 'Quantum = Sensor PAR reading (umol/m2/sec) 'Errorcode = Modbus error code value (Check CRBasic help menu for a list of error codes) 'Declare Public Variables Public PTemp, Batt_volt Public Quantum Public Errorcode 'Define Data Tables. DataTable (Solar,1,-1) 'Set table size to # of records, or -1 to autoallocate. DataInterval (0,1,Min,10) Minimum (1,Batt_volt,FP2,False,False) Sample (1,PTemp,FP2) Average(1,Quantum,IEEE4,False) EndTable 'Main Program BeginProg Scan (1,Sec,0,0) PanelTemp (PTemp,60) Battery (Batt_volt) 'Open modbus serial port in RS232 mode SemaphoreGet(3) SerialOpen(ComC5,19200,2,0,256,3) SerialFlush(ComC5) SemaphoreRelease(3) 'Obtain SWi measurement SemaphoreGet(3) ModbusMaster(Errorcode,ComC5,19200,1,3,Quantum,1,1,2,100,2) SemaphoreRelease(3) CallTable Solar NextScan EndProg