Campbell BMP5 Direct SDK Instruction Manual

Direct sdk

Advertisement

Quick Links

BMP5 Direct SDK
Revision: 12/11
C o p y r i g h t
©
2 0 0 4 - 2 0 1 1
C a m p b e l l
S c i e n t i f i c ,
I n c .

Advertisement

Table of Contents
loading

Summary of Contents for Campbell BMP5 Direct SDK

  • Page 1 BMP5 Direct SDK Revision: 12/11 C o p y r i g h t © 2 0 0 4 - 2 0 1 1 C a m p b e l l S c i e n t i f i c , I n c .
  • Page 3 Scientific may from time-to-time, and without notice, make changes to one or more components of the SDK or make changes to one or more components of other software on which the SDK relies. In no instance will Campbell Scientific be responsible for any costs or liabilities incurred by you or other third parties as a result of these changes.
  • Page 4 • Not to develop applications that compete directly with any application developed by Campbell Scientific, Inc. or its affiliates. • To assure that each application developed with BMP5 Direct Binaries clearly states the name of the person or entity that developed the application.
  • Page 5: Limited Warranty

    Campbell Scientific has been advised of the possibility of such damages. Campbell Scientific is not responsible for any costs incurred as a result of lost profits or revenue, loss of use of the software, loss of data, cost of re-creating lost data, the cost of any substitute program, telecommunication access costs, claims by any party other than licensee, or for other similar costs.
  • Page 6 SDK relies. In no instance will Campbell Scientific be responsible for any costs or liabilities incurred by you or other third parties as a result of these changes. There is no written or implied warranty provided with the SDK software other than as stated herein.
  • Page 7: Table Of Contents

    BMP5 Direct SDK Table of Contents PDF viewers note: These page numbers refer to the printed version of this document. Use the Adobe Acrobat® bookmarks tab for links to specific sections. 1. BMP5 Direct SDK Overview ........1-1 1.1 General Notes on BMP5 Direct SDK Usage ........1-1 1.2 Datalogger Program Table Structure ............
  • Page 9: Bmp5 Direct Sdk Overview

    Section 1. BMP5 Direct SDK Overview The BMP5 Direct Software Development Kit (SDK) is a programming interface that facilitates simple and direct communication with a single datalogger containing a PakBus operating system. This SDK uses a simple call-level API (SimplePB.DLL) that does not need to be registered on the PC. However, the SimplePB.DLL wrapper accesses and therefore requires the included communications engine, CORALIB3D.DLL, to be installed in the same folder.
  • Page 10 Section 1. BMP5 Direct SDK Overview...
  • Page 11: Simplepb.dll Reference

    Section 2. SimplePB.DLL Reference The SimplePB.DLL is a call-level API that does not need to be registered on the PC. However, the SimplePB.DLL wrapper accesses and therefore requires the included communications engine, CORALIB3D.DLL, to be installed in the same folder. The SimplePB wrapper provides an easy interface through the CORALIB3D.DLL communications engine to access a single datalogger.
  • Page 12: Openipport()

    Section 2. SimplePB.DLL Reference 2.3 OpenIPPort() Opens an IP port to allow a connection to a datalogger. Syntax OpenIPPort(ip_address, tcp_port) Parameters ip_address: String – A valid IP address for the datalogger. tcp_port: Integer – The port that will be used when communicating with the datalogger.
  • Page 13: Setclock()

    Section 2. SimplePB.DLL Reference device_ type: Integer – The type of datalogger: • 1=CR200 • 2=CR10XPB, CR23XPB, CR510PB • 3=CR1000 • 4=CR3000 • 5=CR800, CR850 return_data: Char – The location in memory where the data returned from the datalogger exists. return_data_len: Integer –...
  • Page 14: Getvalue()

    Section 2. SimplePB.DLL Reference return_data: Char – The location in memory where the data returned from the datalogger exists. return_data_len: Integer – Number of bytes in the data returned from the datalogger. Return Codes 0 = Successful. -1 = Communication timed out. -2 = Port is not open.
  • Page 15: Setvalue()

    Section 2. SimplePB.DLL Reference return_data_len: Integer – Number of bytes in the data returned from the datalogger. Return Codes 0 = Successful. -1 = Communication timed out. -2 = Port is not open. Example of data returned by function call 12.753,111.9,1.239 (Swath of 3 values from fields) 2.8 SetValue()
  • Page 16: Getdata()

    Section 2. SimplePB.DLL Reference 2.9 GetData() Query the datalogger for column names and data from one of its tables. Syntax GetData(pakbus_address, device_type, table_no, record_no, return_data, return_data_len) Parameters pakbus_address: Integer – The PakBus address of the datalogger. device_type: Integer – The type of datalogger: •...
  • Page 17: Getdataheader()

    Section 2. SimplePB.DLL Reference Example of data returned by function call "2004-04-16 14:18:03",1 (Time stamp, Record number) 1,OSversion,v03A (Field number, Field name, Field value) 2,OSDate,06-Jan-04 3,ProgName,BATT.CR2 4,ProgSig,54451 5,CalOffset,2.625 6,PakBusAddress,1 7,RfInstalled,424 8,RfNetAddr,0 9,RfAddress,0 10,RfHopSeq,0 11,RfPwrMode,RF1_Sec 12,Rf_ForceOn,0 13,RfSignalLevel,0 14,RfRxPakBusCnt,0 15,VarOutOfBounds,0 16,SkipScan,0 17,TrapCode,0 18,WatchDogCnt,0 19,ResetTables,0 20,BattVoltage,12.3943...
  • Page 18: Getcommadata()

    Section 2. SimplePB.DLL Reference return_data_len: Integer – Number of bytes in the data returned from the datalogger. Return Codes 0 = Successful. 1 = Success but more data to collect. -1 = Communication timed out. -2 = Port is not open. Example of data returned by function call "TIMESTAMP","RECORD", OSVersion, OSDate, OSSignature 2.11 GetCommaData()
  • Page 19: File_Send()

    Section 2. SimplePB.DLL Reference return_data: Char – The location in memory where the data returned from the datalogger exists. return_data_len: Integer – Number of bytes in the data returned from the datalogger. Return Codes 0 = Successful. 1 = Success but more data to collect. -1 = Communications timed out.
  • Page 20: Getaddress()

    Section 2. SimplePB.DLL Reference Return Codes 0 = Successful. 1 = Success but more data to transfer. -1 = Communication timed out. -2 = Port is not open. -3 = Cannot open source file. -4 = File name is to long. -5 = Datalogger timed out.
  • Page 21: Getstatus()

    Section 2. SimplePB.DLL Reference Return Codes 0 = Successful. -1 = Communication timed out. -2 = Port is not open. Example of data returned by function call PakBusAddress=1; 2.14 GetStatus() Query the datalogger for its current status. Syntax GetStatus(pakbus_address, device_type, return_data, return_data_len) Parameters pakbus_address: Integer –...
  • Page 22: Gettablenames()

    Section 2. SimplePB.DLL Reference Compile Status: Datalogger Program Running Program Name: BATT.CR2 Program Sig.: 54451 Compile Result: Program Running Batt=12.38V 2.15 GetTableNames() Query the datalogger for its table names and numbers. Syntax GetTableNames (pakbus_address, device_type, return_data, return_data_len) Parameters pakbus_address: Integer – The PakBus address of the datalogger. device_type: Integer –...
  • Page 23: Getdllversion()

    Section 2. SimplePB.DLL Reference 2.16 GetDLLVersion() Get the version of the SimplePB.dll being used. Syntax GetDLLVersion(return_data, return_data_len) Parameters return_data: Char – The location in memory where the data returned from the datalogger exists. return_data_len: Integer – Length of the data returned from the DLL. Return Codes 0 = Successful Example of data returned by function call...
  • Page 24: Return Codes

    Section 2. SimplePB.DLL Reference Parameters pakbus_address: Integer - The PakBus address of the datalogger. device_type: Integer - The type of datalogger: 1=CR200 2=CR10XPB, CR23XPB, CR510PB 3=CR1000 4=CR3000 5=CR800, CR850 file_name: String - The path and file name to be controlled on the datalogger. command: Integer - The command issued to control the file: 1 = Compile and run 2 = Run on power up...
  • Page 25 Appendix A. Sample Program Table Structure The table structure of a PakBus datalogger is given in the example below. This example shows a datalogger with two user defined tables plus the Status table and Public or Inlocs table. The second table in the example below contains three records and the third table contains four records.
  • Page 26: Sample Program Table Structure

    Appendix A. Sample Program Table Structure CR200 Datalogger Program Tables The following tables show the table structure from a program installed in a CR200 datalogger. This program measures and stores the minimum battery voltage and the minimum and maximum temperature over a 60-minute interval.
  • Page 27 Appendix A. Sample Program Table Structure Table Number 2 – Hourly: The Hourly table contains the minimum battery voltage and the minimum and maximum temperature over a 60-minute interval. Field Number Field Name Units Notes: Field 1 Battery_Min Volts Field 2 Battery_Time Time Field 2...
  • Page 28 Appendix A. Sample Program Table Structure WeatherHawk Weather Station Tables The following tables show the table structure from a default WeatherHawk weather station program installed in a CR200 datalogger. When communicating with a datalogger using the BMP5 Direct SDK, knowing the table structure of the running program is necessary for some commands Table Number 1 –...
  • Page 29 Appendix A. Sample Program Table Structure Table Number 2 – SiteVal: The SiteVal table contains values that are stored for calculations by the WeatherHawk program. Data is only stored when field “SaveSite” in the Public table is set to one. Field Number Field Name Units...
  • Page 30 Appendix A. Sample Program Table Structure Table Number 4 – Data2: This table contain daily data values. Field Number Field Name Units Notes: Field 1 BatVolt_V_Min Volts Field 2 AirTemp_C_Max Celsius Field 3 AirTemp_C_Min Celsius Field 4 WindSpeed_ms_Max Field 5 RainYearly_mm Field 6 DailyETo_mm...
  • Page 32 Campbell Scientific Companies Campbell Scientific, Inc. (CSI) 815 West 1800 North Logan, Utah 84321 UNITED STATES www.campbellsci.com • info@campbellsci.com Campbell Scientific Africa Pty. Ltd. (CSAf) PO Box 2450 Somerset West 7129 SOUTH AFRICA www.csafrica.co.za • cleroux@csafrica.co.za Campbell Scientific Australia Pty. Ltd. (CSA)

Table of Contents