Campbell BMP5 Informations techniques

Naviguer en ligne ou télécharger Informations techniques pour Logiciel Campbell BMP5. Campbell BMP5 System information Manuel d'utilisatio

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer

Résumé du contenu

Page 1 - BMP5 Transparent Commands

BMP5 Transparent CommandsRevision: 9/08Copyright © 2005-2008Campbell Scientific, Inc.Campbell Scientific Proprietary Information. Not to be distribut

Page 2

Section 1. Introduction 1-4 1.4 Encoding and Decoding Packets Reserved characters must be acknowledged and quoted by the application before sending

Page 3 - Table of Contents

Campbell Scientific Companies Campbell Scientific, Inc. (CSI) 815 West 1800 North Logan, Utah 84321 UNITED STATES www.campbellsci.com info@campbells

Page 4

Section 1. Introduction 1-5 processing the packet information, the application should make the following checks: 1. Check the length of the packet.

Page 5

Section 1. Introduction 1-6 This is a blank page.

Page 6

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

Page 7

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

Page 8 - 1.2 Packet Structure

Section 2. Protocols and Packet Types 2-3 Delivery Failure Message Format (MsgType 0x81): Name Type Description MsgType Byte Message type code (0x

Page 9 - 1.3 PakBus Packet Headers

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

Page 10 - 1.4.3 Signature Nullifier

Section 2. Protocols and Packet Types 2-5 Hello Request Message Format (MsgType 0x0e): Name Type Description MsgType Byte Message type code (0x0e)

Page 11

Section 2. Protocols and Packet Types 2-6 Set Settings Command Message (MsgType 0x08): Name Type Description MsgType Byte Message type code (0x08)

Page 12 - This is a blank page

Section 2. Protocols and Packet Types 2-7 As datalogger operating systems are revised, these settings may change or be removed. However, the datalog

Page 14

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

Page 15

Section 2. Protocols and Packet Types 2-9 Name Type Description SettingsOutcome } Byte Specifies the outcome of the set attempt: 0x01: Setting va

Page 16

Section 2. Protocols and Packet Types 2-10 DevConfig Set Setting Fragment Command (MsgType 0x12): Name Type Description MsgType Byte Message type

Page 17 - 0x87, 0x08, 0x88)

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

Page 18

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

Page 19

Section 2. Protocols and Packet Types 2-13 Clock Response Body (MsgType 0x97): Name Type Description MsgType Byte Message type code (0x97) TranNbr

Page 20

Section 2. Protocols and Packet Types 2-14 Name Type Description FileOffset UInt4 Describes the byte offset into the file of this fragment. This

Page 21 - 0x12 & 0x92)

Section 2. Protocols and Packet Types 2-15 Name Type Description RespCode Byte Response Code: 0x00 – Complete 0x01 – Permission denied 0x0d – Inva

Page 22

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

Page 23

Section 2. Protocols and Packet Types 2-17 2.3.3.5 Get Programming Statistics Transaction (MsgType 0x18 & 0x98) The Get Programming Statistics t

Page 24

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

Page 25

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.

Page 26

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

Page 27

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

Page 28

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

Page 29 - 2.3.4.1 Table Definitions

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

Page 30

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

Page 31

Section 2. Protocols and Packet Types 2-24 Set Values Command Body (MsgType 0x1b): Name Type Description MsgType Byte Message type code (0x1b) Tra

Page 32

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

Page 33

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

Page 34

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

Page 35

BMP5 Transparent Commands Table of Contents ii 2.3.4 Data Collection and Table Control Transactions ...2-17 2.3.4.1 Table Definit

Page 36

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

Page 37 - Commands from the CR200

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

Page 38 - BD AF FE 00 01 5A 89 BD

Section 3. The CR200 Datalogger 3-6

Page 39 - 04 FA BD

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

Page 40 - Compiler

Section 3. The CR200 Datalogger 3-8 latency varies across different communication mediums but the application should be aware of this variability and

Page 41

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

Page 42

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

Page 43 - 3.7.4 Handling Rejection

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

Page 44 - Signatures

Section 3. The CR200 Datalogger 3-12 This is a blank page.

Page 45 - 00 3C 00 00 C7 DF BD

4-1 Section 4. The CR1000 Type Datalogger The CR1000 type datalogger (CR1000, CR3000, and CR800) is a rugged and versatile measurement device. This

Page 46

BMP5 Transparent Commands Table of Contents iii 4.11 Collecting Files from the Datalogger... 4-11 4.12

Page 47

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

Page 48

Section 4. The CR1000 Type Datalogger 4-3 settings for this and other operating systems by reviewing the included Device Description File in Appendix

Page 49 - Establishing a Baud Rate

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

Page 50

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

Page 51 - 4.6 The Program Structure

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

Page 52

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

Page 53

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

Page 54 - 4.7.2 Handling Rejection

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

Page 55

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

Page 56 - 4.10 Retrieving Data

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

Page 57

BMP5 Transparent Commands Table of Contents iv

Page 58

Section 4. The CR1000 Type Datalogger 4-12 This is a blank page.

Page 59

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

Page 60

Appendix A. Data Types Summary A-2 This is a blank page.

Page 61

Appendix B. Calculating Packet Signatures and the Signature Nullifier The CSI signature algorithm, when applied to a block of data, produces a unique

Page 62

Appendix B. Calculating Packet Signatures and the Signature Nullifier B-2 uint2 new_seed = (sig << 1)&0x1FF; byte null1; uint2 new_s

Page 63

C-1 Appendix C. Device Description Files Applications that need to deal with device settings must reference a library of device description XML files

Page 64

Appendix C. Device Description Files C-2 <setting id="2" name="Station Name"> <string name="Station Name&

Page 65 - CR1000.dd

Appendix C. Device Description Files C-3 <setting id="10" name="Baud Rate SDC7"> <enumi4 name="Baud Rate SDC7

Page 66

Appendix C. Device Description Files C-4 <setting id="23" name="Beacon Interval COM2"> <uint2 name="Beaco

Page 67

Appendix C. Device Description Files C-5 <setting id="34" name="Verify Interval COM3"> <uint2 name="Verify I

Page 68

1-1 Section 1. Introduction This document outlines the structure for a fundamental subset of protocols and packet types used to communicate directly

Page 69

Appendix C. Device Description Files C-6 <setting id="55" name="IP Port"> <uint2 name="IP Port">

Page 70

D-1 Appendix D. JAVA Example Code import java.io.*; import java.util.*; import java.net.*; /** * A simple PakBus command line application * that de

Page 71

Appendix D. JAVA Example Code D-2 /** * Application main */ public static void main(String[] args) { try { socket = new

Page 72

Appendix D. JAVA Example Code D-3 case (0x9d) : // Response for Upload Command System.out.println("

Page 73

Appendix D. JAVA Example Code D-4 case '8': System.out.println("Getting 24 hour data");

Page 74

Appendix D. JAVA Example Code D-5 //SetupDl gets the PakBusAddress by using the GetCommand procedure public static void SetupDL() { Ge

Page 75

Appendix D. JAVA Example Code D-6 /** * Calculates the signature for a byte. */ static char calcSigForByte(byte buff, char seed) {

Page 76

Appendix D. JAVA Example Code D-7 send_byte((byte)0xBD); // first synch byte for(int i = 0; i < frame.length; ++i)

Page 77

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

Page 78

Appendix D. JAVA Example Code D-9 if(table != null) { // form the command message to poll the table CreateH

Page 79

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

Page 80

Appendix D. JAVA Example Code D-10 catch(Exception e) { flush_io_log(e.toString());

Page 81

Appendix D. JAVA Example Code D-11 /** * This procedure allows the clock to receive the clock from the logger * and then make the calculat

Page 82

Appendix D. JAVA Example Code D-12 static void ParseTblDefs() { try { int logger_resp = in_packet.read_byte(); if

Page 83

Appendix D. JAVA Example Code D-13 static void ParsePublicTbl() { try { int logger_resp = in_packet.read_byte();

Page 84

Appendix D. JAVA Example Code D-14 table != null) { System.out.println("Querying for more data at reco

Page 85

Appendix D. JAVA Example Code D-15 private static void log_io(byte val, boolean transmitted) { if(io_last_tx != transmitted && io

Page 86

Appendix D. JAVA Example Code D-16 /** <!-- elapsed() --> * Returns milliseconds elapsed since start or reset. * * @

Page 87

Appendix D. JAVA Example Code D-17 public byte link_state; public short dest_address; public byte expect_more_code; public by

Page 88

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

Page 89

Appendix D. JAVA Example Code D-19 public void add_short(Short val) { byte[] temp = new byte[2]; temp[0] = (byte)((val

Page 90

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

Page 91

Appendix D. JAVA Example Code D-20 public int read_int() throws Exception { byte[] temp = read_bytes(4); int rtn = (((i

Page 92

Appendix D. JAVA Example Code D-21 public byte[] to_link_state_packet() { // form the packet header + body (less the framing cha

Page 93

Appendix D. JAVA Example Code D-22 read_only = false; column_name = msg.read_string(); System.out.println("Reading

Page 94

Appendix D. JAVA Example Code D-23 columns = new Vector(); while(field_type != 0) { ColumnDef column = new Col

Page 95

Appendix D. JAVA Example Code D-24 switch(column.field_type) { case type_uint1:

Page 96

Appendix D. JAVA Example Code D-25 case type_ascii: { // we need to read off all of the possible bytes for the //

Page 97 - Glossary

Appendix D. JAVA Example Code D-26 // csitype codes public static final byte type_uint1 = 1; public static final byte type_uint2 =

Page 98

Glossary ASCII: Acronym for the American Standard Code for Information Interchange that represents the English characters as numbers, with each chara

Page 99

This is a blank page

Page 100

This is a blank page.

Commentaires sur ces manuels

Pas de commentaire