Campbell BMP5 Instruction Manual - 2.15  Gettablenames()

Manual is about: Direct SDK

Summary of BMP5

  • 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: License For Use

    License for use this bmp5 direct software development kit software, hereinafter referred to as the bmp5 direct sdk, is protected by both united states copyright law and international copyright treaty provisions. The installation and use of this software constitutes an agreement to abide by the provi...

  • Page 4

    Ii • 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. This information...

  • Page 5: Limited Warranty

    Limited warranty the following warranties are in effect for ninety (90) days from the date of shipment of the original purchase. These warranties are not extended by the installation of upgrades or patches offered free of charge: campbell scientific warrants that the installation media on which the ...

  • Page 6

    Campbell 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...

  • Page 7

    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 ....

  • Page 9

    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 ...

  • Page 10

    Section 1. Bmp5 direct sdk overview 1-2.

  • Page 11: 2.1  Openport()

    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...

  • Page 12: 2.3  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 datalog...

  • Page 13: 2.6  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 – number of bytes i...

  • Page 14: 2.7  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. Exam...

  • Page 15: 2.8  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 se...

  • Page 16: 2.9  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...

  • Page 17: 2.10   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,rfne...

  • Page 18: 2.11  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...

  • Page 19: 2.12  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...

  • Page 20: 2.13  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. -6 = file offset does not match. -7 = datalogger reported an ...

  • Page 21: 2.14  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, retu...

  • Page 22: 2.15  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_dat...

  • Page 23: 2.16  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...

  • Page 24

    Section 2. Simplepb.Dll reference 2-14 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 dat...

  • Page 25: Structure

    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 thi...

  • Page 26

    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. Whe...

  • 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 temp_min deg c...

  • 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 ...

  • 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 notes: field 1 altitude_m met...

  • Page 30

    Appendix a. Sample program table structure a-6 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 m/s field 5 rainyearly_mm mm field 6 dail...

  • 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 sc...