BMP5 Transparent CommandsRevision: 9/08Copyright © 2005-2008Campbell Scientific, Inc.Campbell Scientific Proprietary Information. Not to be distribut
Section 1. Introduction 1-4 1.4 Encoding and Decoding Packets Reserved characters must be acknowledged and quoted by the application before sending
Campbell Scientific Companies Campbell Scientific, Inc. (CSI) 815 West 1800 North Logan, Utah 84321 UNITED STATES www.campbellsci.com info@campbells
Section 1. Introduction 1-5 processing the packet information, the application should make the following checks: 1. Check the length of the packet.
Section 1. Introduction 1-6 This is a blank page.
2-1 Section 2. Protocols and Packet Types Packet types from three distinct protocols are described in this document. The SerPkt Protcol used to moni
Section 2. Protocols and Packet Types 2-2 Link-State Sub-protocol Packet Format: Name Type Description LinkState bits7..4 The packet type and the l
Section 2. Protocols and Packet Types 2-3 Delivery Failure Message Format (MsgType 0x81): Name Type Description MsgType Byte Message type code (0x
Section 2. Protocols and Packet Types 2-4 Name Type Description HopMetric Byte A code used to indicate the worst case interval for the speed of t
Section 2. Protocols and Packet Types 2-5 Hello Request Message Format (MsgType 0x0e): Name Type Description MsgType Byte Message type code (0x0e)
Section 2. Protocols and Packet Types 2-6 Set Settings Command Message (MsgType 0x08): Name Type Description MsgType Byte Message type code (0x08)
Section 2. Protocols and Packet Types 2-7 As datalogger operating systems are revised, these settings may change or be removed. However, the datalog
Section 2. Protocols and Packet Types 2-8 Name Type Description MoreSettings Boolean Set to true by the datalogger when it has more settings to s
Section 2. Protocols and Packet Types 2-9 Name Type Description SettingsOutcome } Byte Specifies the outcome of the set attempt: 0x01: Setting va
Section 2. Protocols and Packet Types 2-10 DevConfig Set Setting Fragment Command (MsgType 0x12): Name Type Description MsgType Byte Message type
Section 2. Protocols and Packet Types 2-11 Name Type Description Action Byte The action that should be taken by the datalogger 0x01: Commit the c
Section 2. Protocols and Packet Types 2-12 2.3.1 Please Wait Message (MsgType 0xa1) If the datalogger anticipates it will take more than the default
Section 2. Protocols and Packet Types 2-13 Clock Response Body (MsgType 0x97): Name Type Description MsgType Byte Message type code (0x97) TranNbr
Section 2. Protocols and Packet Types 2-14 Name Type Description FileOffset UInt4 Describes the byte offset into the file of this fragment. This
Section 2. Protocols and Packet Types 2-15 Name Type Description RespCode Byte Response Code: 0x00 – Complete 0x01 – Permission denied 0x0d – Inva
Section 2. Protocols and Packet Types 2-16 Name Type Description FileCmd Byte Code that specifies the command to perform with the file: 0x01: Com
Section 2. Protocols and Packet Types 2-17 2.3.3.5 Get Programming Statistics Transaction (MsgType 0x18 & 0x98) The Get Programming Statistics t
i BMP5 Transparent Commands Table of Contents PDF viewers note: These page numbers refer to the printed version of this document. Use the Adobe Acrob
Section 2. Protocols and Packet Types 2-18 Data transaction and to describe what data should be returned when collecting data from a datalogger. 2.3.
Section 2. Protocols and Packet Types 2-19 In order to ensure the integrity of this table information, the application should calculate a signature o
Section 2. Protocols and Packet Types 2-20 When a response comes in from this command, the fields after RespCode exist only if the response indicates
Section 2. Protocols and Packet Types 2-21 Table definitions may be sent from the datalogger to the application prior to the first transmission of a
Section 2. Protocols and Packet Types 2-22 One-Way Data Message Body (MsgType 0x14): Name Type Description MsgType Byte Message type code (0x14) T
Section 2. Protocols and Packet Types 2-23 2.3.5 Get/Set Values Transaction (MsgType 0x1a, 0x9a, 0x1b, & 0x9b) These transactions are used to re
Section 2. Protocols and Packet Types 2-24 Set Values Command Body (MsgType 0x1b): Name Type Description MsgType Byte Message type code (0x1b) Tra
3-1 Section 3. The CR200 Datalogger The CR200 is low-cost, rugged, and versatile measurement device. This small datalogger contains a CPU and both d
Section 3. The CR200 Datalogger 3-2 An example of a “Ready” response from a datalogger with an address of 1 to an application with an address of 4094
Section 3. The CR200 Datalogger 3-3 • PakBusAddress: The PakBus address of the datalogger If the names of the available settings are not known, all
BMP5 Transparent Commands Table of Contents ii 2.3.4 Data Collection and Table Control Transactions ...2-17 2.3.4.1 Table Definit
Section 3. The CR200 Datalogger 3-4 3.7 Creating CR200 Programs and the CR200 Compiler The CR200 datalogger must contain a valid program in order to
Section 3. The CR200 Datalogger 3-5 3.7.2 Sending a Program to the CR200 The compiled datalogger program is sent to the CR200 with the File Download
Section 3. The CR200 Datalogger 3-6
Section 3. The CR200 Datalogger 3-7 Use the File Control Command with a FileCmd parameter of 0x08 to stop the program currently running on the datalo
Section 3. The CR200 Datalogger 3-8 latency varies across different communication mediums but the application should be aware of this variability and
Section 3. The CR200 Datalogger 3-9 Response packet. Calculate the signature by starting with the first byte of the FieldName parameter and ending a
Section 3. The CR200 Datalogger 3-10 3.10.3 Collecting Tables and Specific Records Within the Collect Data Command message there are many options f
Section 3. The CR200 Datalogger 3-11 3.10.4 Getting Values from Specific Records Use either the Collect Data Command or the Get Values transaction w
Section 3. The CR200 Datalogger 3-12 This is a blank page.
4-1 Section 4. The CR1000 Type Datalogger The CR1000 type datalogger (CR1000, CR3000, and CR800) is a rugged and versatile measurement device. This
BMP5 Transparent Commands Table of Contents iii 4.11 Collecting Files from the Datalogger... 4-11 4.12
Section 4. The CR1000 Type Datalogger 4-2 BD AF FE 00 01 5A 89 BD The datalogger may not be aware that a connection has been established from the PC
Section 4. The CR1000 Type Datalogger 4-3 settings for this and other operating systems by reviewing the included Device Description File in Appendix
Section 4. The CR1000 Type Datalogger 4-4 4.7 Sending a Program to the Datalogger The CR1000 type datalogger accepts text programs written with CRBa
Section 4. The CR1000 Type Datalogger 4-5 Use the File Download Command message to send the new program file to the datalogger. The new program fil
Section 4. The CR1000 Type Datalogger 4-6 files, and start the new program on the datalogger. Check the File Control Response. If the RespCode retu
Section 4. The CR1000 Type Datalogger 4-7 4.7.4 Deleting Program Files When loading a new datalogger program to the CR1000 type datalogger, the old
Section 4. The CR1000 Type Datalogger 4-8 4.9 Getting Table Definitions Table definitions are retrieved from the CR1000 type datalogger with the Fil
Section 4. The CR1000 Type Datalogger 4-9 The response packet from the datalogger will contain data that must be parsed. The application uses table
Section 4. The CR1000 Type Datalogger 4-10 4.10.4 Getting Values from Specific records Use either the Collect Data Command or the Get Values transa
Section 4. The CR1000 Type Datalogger 4-11 4.11 Collecting Files from the Datalogger The CR1000 type datalogger can store files in memory for future
BMP5 Transparent Commands Table of Contents iv
Section 4. The CR1000 Type Datalogger 4-12 This is a blank page.
A-1 Appendix A. Data Types Summary Name Code Size Description Byte 1 1 One-byte unsigned integer UInt2 2 2 Two-byte unsigned integer (MSB first
Appendix A. Data Types Summary A-2 This is a blank page.
Appendix B. Calculating Packet Signatures and the Signature Nullifier The CSI signature algorithm, when applied to a block of data, produces a unique
Appendix B. Calculating Packet Signatures and the Signature Nullifier B-2 uint2 new_seed = (sig << 1)&0x1FF; byte null1; uint2 new_s
C-1 Appendix C. Device Description Files Applications that need to deal with device settings must reference a library of device description XML files
Appendix C. Device Description Files C-2 <setting id="2" name="Station Name"> <string name="Station Name&
Appendix C. Device Description Files C-3 <setting id="10" name="Baud Rate SDC7"> <enumi4 name="Baud Rate SDC7
Appendix C. Device Description Files C-4 <setting id="23" name="Beacon Interval COM2"> <uint2 name="Beaco
Appendix C. Device Description Files C-5 <setting id="34" name="Verify Interval COM3"> <uint2 name="Verify I
1-1 Section 1. Introduction This document outlines the structure for a fundamental subset of protocols and packet types used to communicate directly
Appendix C. Device Description Files C-6 <setting id="55" name="IP Port"> <uint2 name="IP Port">
D-1 Appendix D. JAVA Example Code import java.io.*; import java.util.*; import java.net.*; /** * A simple PakBus command line application * that de
Appendix D. JAVA Example Code D-2 /** * Application main */ public static void main(String[] args) { try { socket = new
Appendix D. JAVA Example Code D-3 case (0x9d) : // Response for Upload Command System.out.println("
Appendix D. JAVA Example Code D-4 case '8': System.out.println("Getting 24 hour data");
Appendix D. JAVA Example Code D-5 //SetupDl gets the PakBusAddress by using the GetCommand procedure public static void SetupDL() { Ge
Appendix D. JAVA Example Code D-6 /** * Calculates the signature for a byte. */ static char calcSigForByte(byte buff, char seed) {
Appendix D. JAVA Example Code D-7 send_byte((byte)0xBD); // first synch byte for(int i = 0; i < frame.length; ++i)
Appendix D. JAVA Example Code D-8 /** * GetClock will create the packet to get a clock value from * the DL. Thecode that is commented ou
Appendix D. JAVA Example Code D-9 if(table != null) { // form the command message to poll the table CreateH
Section 1. Introduction 1-2 1.2 Packet Structure The first and last bytes are 0xbd to mark the beginning and end of a packetLink State 4 bitsDestina
Appendix D. JAVA Example Code D-10 catch(Exception e) { flush_io_log(e.toString());
Appendix D. JAVA Example Code D-11 /** * This procedure allows the clock to receive the clock from the logger * and then make the calculat
Appendix D. JAVA Example Code D-12 static void ParseTblDefs() { try { int logger_resp = in_packet.read_byte(); if
Appendix D. JAVA Example Code D-13 static void ParsePublicTbl() { try { int logger_resp = in_packet.read_byte();
Appendix D. JAVA Example Code D-14 table != null) { System.out.println("Querying for more data at reco
Appendix D. JAVA Example Code D-15 private static void log_io(byte val, boolean transmitted) { if(io_last_tx != transmitted && io
Appendix D. JAVA Example Code D-16 /** <!-- elapsed() --> * Returns milliseconds elapsed since start or reset. * * @
Appendix D. JAVA Example Code D-17 public byte link_state; public short dest_address; public byte expect_more_code; public by
Appendix D. JAVA Example Code D-18 // the message type and transaction number may not be present. // We will set them to 0 and then look for them
Appendix D. JAVA Example Code D-19 public void add_short(Short val) { byte[] temp = new byte[2]; temp[0] = (byte)((val
Section 1. Introduction 1-3 To ensure that a SerSyncByte doesn’t appear inadvertently within the message data, it must be recognized and quoted withi
Appendix D. JAVA Example Code D-20 public int read_int() throws Exception { byte[] temp = read_bytes(4); int rtn = (((i
Appendix D. JAVA Example Code D-21 public byte[] to_link_state_packet() { // form the packet header + body (less the framing cha
Appendix D. JAVA Example Code D-22 read_only = false; column_name = msg.read_string(); System.out.println("Reading
Appendix D. JAVA Example Code D-23 columns = new Vector(); while(field_type != 0) { ColumnDef column = new Col
Appendix D. JAVA Example Code D-24 switch(column.field_type) { case type_uint1:
Appendix D. JAVA Example Code D-25 case type_ascii: { // we need to read off all of the possible bytes for the //
Appendix D. JAVA Example Code D-26 // csitype codes public static final byte type_uint1 = 1; public static final byte type_uint2 =
Glossary ASCII: Acronym for the American Standard Code for Information Interchange that represents the English characters as numbers, with each chara
This is a blank page
This is a blank page.
Kommentare zu diesen Handbüchern