Campbell SDM-SIO4 Instruction Manual

Other manuals for SDM-SIO4: User Manual
Manual is about: 4-channel serial I/O Interface

Summary of SDM-SIO4

  • Page 1

    Instruction manual sdm-sio4 4-channel serial i/o interface revision: 2/04 c o p y r i g h t ( c ) 1 9 9 6 - 2 0 0 4 c a m p b e l l s c i e n t i f i c , i n c ..

  • Page 2: Warranty and Assistance

    Warranty and assistance the sdm-sio4 4-channel serial i/o interface is warranted by campbell scientific, inc. To be free from defects in materials and workmanship under normal use and service for twelve (12) months from date of shipment unless specified otherwise. Batteries have no warranty. Campbel...

  • Page 3: Sdm-Sio4 Table of Contents

    I sdm-sio4 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. Introduction.................................................................... 1.1 what is the sdm-sio4? ...........

  • Page 4

    Sdm-sio4 table of contents ii 5.2 commands and options (parameters 4, 5 and 6) .................................. 5-2 5.2.1 understanding parameter options and returned values ............ 5-3 5.2.2 command 1: poll of available data........................................... 5-3 5.2.3 command 2: sig...

  • Page 5

    Sdm-sio4 table of contents iii appendix c. Limitations of the talk-through mode. C-1 c.1 limitations ...........................................................................................C-1 figures 1-1. Schematic diagram of the sdm-sio4 ................................................ 1-2 tabl...

  • Page 6

    Sdm-sio4 table of contents iv this is a blank page..

  • Page 7: Section 1.  Introduction

    1-1 section 1. Introduction the sdm-sio4 has four configurable serial rs232 ports which allow it to be connected to intelligent serial sensors, display boards, printers or satellite links. It can also be used in many other applications where the data is transferred in a serial fashion. This device i...

  • Page 8

    Section 1. Introduction 1-2 write-protected memory, which allows you to set up the sdm-sio4 in the office and then move it to the site of installation in an unpowered state. ¿ ¾ ½ ¾ ¿ À ¿ À ¾ switches - go to 1 if command line active ½ ½ ½ ¾ ¾ ¿ ¿ ¿ ¿ ¿ ¿ ¿ À À À À À ¿ ¿ to other ports to other port...

  • Page 9: 1.2  Specifications

    Section 1. Introduction 1-3 1.2 specifications 1.2.1 serial ports the sdm-sio4 has four serial ports which can be configured independently to use different serial data formats and baud rates (from 25 to 115,200 baud). These ports are 0-5v logic or ±5v for rs232 and are configured similar to a pc ‘at...

  • Page 10

    Section 1. Introduction 1-4 there is one more buffer, which is used only when the datalogger outputs floating point data via the sdm-sio4. This buffer is 241 bytes — long enough for 60 floating point values. (the size of this buffer is rarely a limitation as it is emptied quickly.) 1.2.2 sdm port th...

  • Page 11

    Section 1. Introduction 1-5 1.2.5 environmental operating range -25°c to +50°c (contact campbell scientific for extended temperature requirements) 0 - 95% rh (non-condensing) 1.2.6 other key features • an internal lithium battery which retains configuration information (estimated life 10 years) • a ...

  • Page 12

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

  • Page 13: Set-Up

    2-1 section 2. Installation and hardware set-up the sdm - sio4 is designed to be mounted on an enclosure chassis plate using the two mounting holes in the tabs on the side of the case . Before installation, it is necessary to set up the address of the sdm-sio4 and also the mode of operation of each ...

  • Page 14

    Section 2. Installation and hardware set-up 2-2 2.2 selecting rs232 or 5v logic for each port the output voltage levels of each serial port can be set to either: • logic level output: +5v (high) / 0v (low) or • rs232 output: +5v (high) / -5v (low) (compatible with rs232 driver requirements). The log...

  • Page 15

    Section 2. Installation and hardware set-up 2-3 lightning protection is recommended on all lines connected to the serial ports (contact campbell scientific for further details). The possibility of ground loops being set up between the datalogger and the remote rs232 device via the serial cable shoul...

  • Page 16

    Section 2. Installation and hardware set-up 2-4 this is a blank page..

  • Page 17: Sdm-Sio4 Handles Data

    3-1 section 3. Understanding how the sdm-sio4 handles data for simple applications the sdm-sio4 can be configured and controlled from the datalogger alone, using the datalogger program instruction p113 (cr10x and cr7 dataloggers only). Future developments will include support for other dataloggers. ...

  • Page 18: 3.2  Input Filters

    Section 3. Understanding how the sdm-sio4 handles data 3-2 to enter a control character in the range of 0-255 decimal in a filter string, formatter string or a user string you must use the ‘&hh’ format, where ‘&’ defines the following two characters, ‘hh’, to be a hexadecimal number between 00 and f...

  • Page 19

    Section 3. Understanding how the sdm-sio4 handles data 3-3 • search for an ascii hex pair to convert to campbell scientific floating point format.* • search for an 8-bit binary number to convert to campbell scientific floating point format. • search for a 16-bit binary number to convert to campbell ...

  • Page 20

    Section 3. Understanding how the sdm-sio4 handles data 3-4 • e[ ] scan until any ascii character not entered between the brackets is encountered. The maximum number of non-trigger characters is 255. Note that this filter does not remove the non-matching character from the buffer. • f a floating poin...

  • Page 21

    Section 3. Understanding how the sdm-sio4 handles data 3-5 • vn[ ] convert ‘n’ ascii hex pairs into campbell scientific floating point format until the termination character/string between [ ] is seen. ‘n’ can be 1-3. The termination character/string is removed from the buffer. • vn searches for hex...

  • Page 22: 3.3  Output Formatting

    Section 3. Understanding how the sdm-sio4 handles data 3-6 predefined f ilter s trings a small number of fixed filter strings are pre-defined as follows: filter no. Filter string used 256 r1 257 r2 258 r3 259 r4 3.3 output formatting the output formatters are used to format data from the datalogger ...

  • Page 23

    Section 3. Understanding how the sdm-sio4 handles data 3-7 3.3.2 output format strings these allow either just long strings to be sent from the sdm-sio4 or a combination of string data plus data from a datalogger input location. This type of format is normally set up from the ‘command line’. The use...

  • Page 24

    Section 3. Understanding how the sdm-sio4 handles data 3-8 table 3-1. Fixed strings currently allocated string number string (enclosed in quotes) 256 ‘+0000000000123.45670000000000crlf’ 257 ‘voltage’ 258 ‘amps’ 259 ‘watts’ 260 ‘joules’ 261 ‘temperature’ 262 ‘pressure’ 263 ‘speed’ 264 ‘power’ 265 ‘de...

  • Page 25

    Section 3. Understanding how the sdm-sio4 handles data 3-9 i[battery ] – this outputs the word between the brackets [ ]. Z257 – this outputs the fixed string ‘voltage’. Space – this outputs an ascii space. F6:1 – this takes the value from location 2 and outputs it in a field with a total width of 6 ...

  • Page 26

    Section 3. Understanding how the sdm-sio4 handles data 3-10 this is a blank page..

  • Page 27: 4.2  Entering Commands

    4-1 section 4. Programming the sdm-sio4 this section gives both the basic commands and advanced command line options which allow testing and advanced configuration of the sdm-sio4. 4.1 command line operation and structure to use the command line mode, connect a computer to port 1 of the sdm- sio4. T...

  • Page 28: 4.3  Basic Commands

    Section 4. Programming the sdm-sio4 4-2 the hex. Number must always be two ascii characters. Control characters can be entered for all commands in a similar way: • ^m is carriage return, ^j line feed etc. • ^^ means ^ • "" means " • ]] means ] • && means & • &0d means line feed • &hex,hex used to en...

  • Page 29: 4.4  Advanced Commands

    Section 4. Programming the sdm-sio4 4-3 strrd [string number] this command outputs the stored string or definition 0..255 to the command line. 1. When string definitions are stored, all control characters are converted and so the string may not be identical to the one you typed in. 2. Formatter and ...

  • Page 30

    Section 4. Programming the sdm-sio4 4-4 port is chosen or power is removed and then re-applied, in which case the command line reverts to port 1. Status this outputs the general status of the sdm-sio4. The results are as follows: batt 0 or 1 if the value is 0 the battery needs replacing. If the valu...

  • Page 31

    Section 4. Programming the sdm-sio4 4-5 hexdump [start address] [number of bytes] this is used by campbell scientific for test purposes and outputs a hex dump of the sdm-sio4’s internal address space. The start address and number of bytes to dump must be in base 10, decimal integer. Lasterror this c...

  • Page 32

    Section 4. Programming the sdm-sio4 4-6 this is a blank page..

  • Page 33

    5-1 section 5. Programming the datalogger the datalogger instruction specific to the sdm-sio4 is p113 (cr7 and cr10/10x only). (please check with campbell scientific to see if your version of the operating system supports this.) the instruction has the following format: parameter no. Description 01 ...

  • Page 34

    Section 5. Programming the datalogger 5-2 5.1.4 parameters 4, 5 and 6 — sdm-sio4 command this command (with up to two options) defines exactly what the instruction will do. Where no options are needed, enter values of 0000 for parameters 5 and 6. 5.1.5 parameter 7 — values per rep this determines ho...

  • Page 35

    Section 5. Programming the datalogger 5-3 the delay required in the program can either be forced using instruction p22, or by using the time to execute other measurement or processing instructions. 5.2.1 understanding parameter options and returned values in the following examples, ‘x’ indicates a s...

  • Page 37

    Section 5. Programming the datalogger 5-5 number of invalid commands executed: this is a count from 0-9 and indicates that the command you have tried to execute is not a current sdm-sio4 command. Because some dataloggers carry out auto speed detection for the sdm interface, this counter may be incre...

  • Page 38

    Section 5. Programming the datalogger 5-6 if any of these four digits is greater than zero then the buffer has data. Values per repetition = 1 5.2.10 command 9: flush converted data buffer this command flushes the converted data buffer of data that is available for the datalogger to collect. Values ...

  • Page 39

    Section 5. Programming the datalogger 5-7 there would be no point executing some commands, for example status, from the datalogger, as there would be no status output to be seen. To get the return code you can use the p113 command 67 which will put the return code into a storage location. The return...

  • Page 40

    Section 5. Programming the datalogger 5-8 p113 1: 1 2: 0 3: 1 4: 21 command to execute command line command. 5: 0 6: 0 7:1 5 length of command line string. ;no. Of datalogger input locations 8: 1 9: 1 10: 0 ;delay large enough (10ms) to allow sdm-sio4 instruction 321 to finish. P22 1: 1 2: 0 3: 1 4:...

  • Page 41

    Section 5. Programming the datalogger 5-9 5.2.15 command 1024: send string to device this command requests the sdm-sio4 to transmit a user-defined text string (entered in the command line mode) number 0..255 or a fixed string 256..511. The string number is defined in parameter 5. The string is trans...

  • Page 44

    Section 5. Programming the datalogger 5-12 handshake mode: 0 leave as set previously 1 dtr always set, set rts when data is available to transmit, only transmit if cts is set 2 dtr always set, rts always set, only transmit if cts is set 3 dtr and rts always set, ignore cts 4 xon/xoff data flow contr...

  • Page 45

    Section 5. Programming the datalogger 5-13 5.2.20 command 2054: set up receive filter this command clears all buffers relevant to the mode number and restarts the filter. Values per repetition = 0 with the string filter type the sdm-sio4 buffers are not cleared. First command option (parameter 5) in...

  • Page 47

    Section 5. Programming the datalogger 5-15 the termination character as an ascii code 0..255; 999 means character not enabled. Min. Delay for floating point data = floats*3*(characters*0.26*ports). Min. Delay for strings = characters*0.26*ports. 5.2.22 command 2305: transmit byte(s) by using p113 co...

  • Page 48

    Section 5. Programming the datalogger 5-16 *table 1 program 01: 2 execution interval (seconds) ;if flag one is not set then set up the serial mode and filter. 1: if flag/port (p91) 1: 21 do if flag 1 is low 2: 30 then do ;set serial mode to dtr, rts always set, ignore cts, 1 stop bit no parity, ;8 b...

  • Page 49

    Section 5. Programming the datalogger 5-17 6: end (p95) ;get two floating point numbers into locations 1 and 2. 7: sdm-sio4 (p113) 1: 1 reps 2: 0 address 3: 1 send/receive port 1 4: 4 command 5: 0 1st parameters 6: 0 2nd parameters 7: 2 values per rep 8: 1 loc [ number ] 9: 1.0 mult 10: 0.0 offset *...

  • Page 50

    Section 5. Programming the datalogger 5-18 by using instruction 22, or a delay loop, or more efficiently by running some of the other measurement tasks required of the datalogger. After the minimum delay, these tasks could also include further communications with the sdm-sio4 to deal with one of the...

  • Page 51

    Section 5. Programming the datalogger 5-19 *table 1 program 01: 2 execution interval (seconds) ;set up the filter and then send string 101. 1: sdm-sio4 (p113) 1: 1 reps 2: 0 address 3: 1 send/receive port 1 4: 2304 command 5: 8101 1st parameters 6: 1999 2nd parameters 7: 0 values per rep 8: 0 loc [ ...

  • Page 52

    Section 5. Programming the datalogger 5-20 ;instantaneous sample form the sensor. 6: sample (p70) 1: 2 reps 2: 1 loc [ number ] ;average over the 10 minute interval. 7: average (p71) 1: 2 reps 2: 1 loc [ number ] *table 2 program 02: 0.0000 execution interval (seconds) *table 3 subroutines end progr...

  • Page 53

    Section 5. Programming the datalogger 5-21 f – this filter searches for the first ascii floating point number to convert. F – this filter searches for the second ascii floating point number to convert. *table 1 program 01: 2 execution interval (seconds) ;test flag one to see if set up is required. 1...

  • Page 54

    Section 5. Programming the datalogger 5-22 6: sdm-sio4 (p113) 1: 1 reps 2: 0 address 3: 1 send/receive port 1 4: 4 command 5: 0 1st parameters 6: 0 2nd parameters 7: 2 values per rep 8: 1 loc [ voltage ] 9: 1.0 mult 10: 0.0 offset ;only set the output flag when the voltage is ;greater than or equal ...

  • Page 55

    Section 5. Programming the datalogger 5-23 a5 – this filter sets up a 250ms filter time-out; this time-out should be long enough for the sensor to transmit all of its data. X – this filter marks the start of the data set. In this case the data set is two floating point numbers. F – this filter searc...

  • Page 56

    Section 5. Programming the datalogger 5-24 6: sdm-sio4 (p113) 1: 1 reps 2: 0 address 3: 1 send/receive port 1 4: 1 command 5: 0 1st parameters 6: 0 2nd parameters 7: 1 values per rep 8: 2 loc [ poll ] 9: 1.0 mult 10: 0.0 offset ;if value returned from poll is >=1 then data must be available. 7: if (...

  • Page 57

    Section 5. Programming the datalogger 5-25 *table 2 program 02: 0.0000 execution interval (seconds) *table 3 subroutines end program example cr10x program using interrupts sensors with fast data output or where very close time stamping is required would need to be read using the hardware interrupt o...

  • Page 58

    Section 5. Programming the datalogger 5-26 ;set up string filter 3: sdm-sio4 (p113) 1: 1 reps 2: 0 address 3: 1 send/receive port 1 4: 2054 command 5: 9200 1st parameters 6: 0 2nd parameters 7: 0 values per rep 8: 0 loc [ _________ ] 9: 1.0 mult 10: 0.0 offset ;delay required by filter setup command...

  • Page 59

    Section 5. Programming the datalogger 5-27 2: sdm-sio4 (p113) 1: 1 reps 2: 0 address 3: 1 send/receive port 1 4: 4 command 5: 0 1st parameters 6: 0 2nd parameters 7: 2 values per rep 8: 3 loc [ voltage1 ] 9: 1.0 mult 10: 0.0 offset ;set the output flag so that readings can be stored into ;final stor...

  • Page 60

    Section 5. Programming the datalogger 5-28 the user-defined formatter used is: fmtst 123 "z261 f6:2 i[battery ]z257 f6:1z273" an example of typical output from this formatter string might be: temperature 27.23 battery voltage 12.6 here is a description of what each part of the formatter does: fmtst ...

  • Page 61: 5.6  Return Error Codes

    Section 5. Programming the datalogger 5-29 *table 3 subroutines end program 5.5 flushing the input and output buffers one important aspect of the sdm-sio4 is that it will continue to collect data and store it in its buffers even if the datalogger program stops running. Care must be taken to ensure t...

  • Page 62

    Section 5. Programming the datalogger 5-30 this is a blank page..

  • Page 63: 6.2  Received Data

    6-1 section 6. Data error detection error detection by checksum, crc or signatures is a way of detecting errors in data, either transmitted or received. This section gives details on how to use filter strings together with datalogger program examples to implement error detection methods. 6.1 error d...

  • Page 64

    Section 6. Data error detection 6-2 0 no signature type used. 1 crc16 standard. Polynomial x 16 +x 15 +x 2 +1. 2 crc16-ccitt standard. Polynomial x 16 +x 12 +x 5 +1. 3 crc16-ccitt-ibm (tag receiver). 4 crc32 standard. Polynomial x 32 +x 26 +x 23 +x 22 +x 16 +x 12 +x 11 +x 10 +x 8 +x 7 +x 5 +x 4 +x 2...

  • Page 65

    Section 6. Data error detection 6-3 3 16-bit binary most significant byte first. Expects 2 bytes 4 32-bit binary least significant byte first. Expects 4 bytes 5 32-bit binary most significant byte first. Expects 4 bytes 6 ascii decimal. Waits until non ascii 0-9 received 7 8-bit ascii hex. Expects 2...

  • Page 66

    Section 6. Data error detection 6-4 on the received data. If they match then the value converted with the “f” filter is made available for the datalogger to get. If the checksums do not match then the value is discarded as soon as any error is detected. ” marks the end of the filter string. The abov...

  • Page 67

    Section 6. Data error detection 6-5 4: do (p86) 1: 11 set flag 1 high ;end of filter setup 5: end (p95) ;poll sdm-sio4 to see if data is available for the datalogger to collect ;the value from the poll is read into location 1 6: sdm-sio4 (p113) 1: 1 reps 2: 0 address 3: 1 send/receive port 1 4: 1 co...

  • Page 68

    Section 6. Data error detection 6-6 *table 3 subroutines end program the program shown above will only put data into the storage locations if any data was available. Data being available is detected by polling the sdm-sio4 to see if any data is waiting. If you decided not to poll the sdm-sio4 then y...

  • Page 69: 6.3  Transmitted Data

    Section 6. Data error detection 6-7 the total extra processing time over and above the sdm-sio4’s normal delay is calculated by the following: the extra time, in milliseconds, you must wait before trying to get the data from the sdm-sio4 = a+(one from b)+(one from c)+(d if applicable) 6.3 transmitte...

  • Page 70

    Section 6. Data error detection 6-8 7 8 bit ascii hex. Expects 2 ascii bytes, if not 0-9,a-f,a-f then fail. 8 16 bit ascii hex. Expects 4 ascii bytes, if not 0-9,a-f,a-f then fail. 9 32 bit ascii hex. Expects 8 ascii bytes, if not 0-9,a-f,a-f then fail. 10-255 reserved for future use. 6.3.1 example ...

  • Page 71

    Section 6. Data error detection 6-9 1: sdm-sio4 (p113) 1: 1 reps 2: 0 address 3: 1 send/receive port 1 4: 2304 command 5: 9100 1st parameters 6: 0 2nd parameters 7: 0 values per rep 8: 0000 loc [ _________ ] 9: 1 mult 10: 0 offset *table 2 program 02: 0.0000 execution interval (seconds) *table 3 sub...

  • Page 72

    Section 6. Data error detection 6-10 ;a minimum delay of 1ms is required after this command 2: excitation with delay (p22) 1: 1 ex channel 2: 0 delay w/ex (units = 0.01 sec) 3: 1 delay after ex (units = 0.01 sec) 4: 0 mv excitation ;use formatter string 101 to transmit the string ‘get data’ to port ...

  • Page 73

    Section 6. Data error detection 6-11 6: sdm-sio4 (p113) 1: 1 reps 2: 0 address 3: 1 send/receive port 1 4: 2304 command 5: 9102 1st parameters 6: 0 2nd parameters 7: 1 values per rep 8: 0000 loc [ _________ ] 9: 1 mult 10: 0 offset *table 2 program 02: 0.0 execution interval (seconds) *table 3 subro...

  • Page 74

    Section 6. Data error detection 6-12 is for a number with ten digits – if the number is less than this the 1.125ms figure would reduce by 0.1ms per digit. 1 8 bit binary 0.155ms 2,3 16 bit binary 0.216ms 4,5 32 bit binary 0.334ms 6 ascii decimal 1.125ms 7 8 bit ascii hex 0.226ms 8 16 bit ascii hex 0...

  • Page 75: Appendix A.  Ascii Table

    A-1 appendix a. Ascii table american standard code for information interchange decimal values and characters (x3.4-1968) dec. Char. Dec. Char. Dec. Char. Dec. Char. 0 control @ 32 space 64 @ 96 ` 1 control a 33 ! 65 a 97 a 2 control b 34 " 66 b 98 b 3 control c 35 # 67 c 99 c 4 control d 36 $ 68 d 1...

  • Page 76

    This is a blank page..

  • Page 77: Modes

    B-1 appendix b. Serial port data transfer modes this appendix describes the serial port set-up in some detail. Please note that the numerical option codes vary between the command line set-up and the datalogger command set-up. The ones listed below are those for the command line mode. B.1 baud rates...

  • Page 78: B.4  Parity Bits

    Appendix b. Serial port data transfer modes b-2 0. 5 data bits 1. 6 data bits 2. 7 data bits 3. 8 data bits b.4 parity bits parity can be enabled and set to either odd or even. 0. No parity set 1. Odd parity set 2. Even parity set b.5 serial handshake modes you can select different kinds of handshak...

  • Page 79: Through Mode

    C-1 appendix c. Limitations of the talk- through mode when using talk-through mode, other aspects of the sdm-sio4 can be affected or limited. This appendix lists these limitations. C.1 limitations the talk-through mode is entered by issuing a command of the form t x:y, where x is the sdm-sio4 addres...

  • Page 80

    Appendix c. Limitations of the talk-through mode c-2 to complete and then start a new talk-through session and use the command lasterror to get the result code – see section 4.4..

  • Page 81

    This is a blank page..

  • Page 82

    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 sales@csafrica.Co.Za campbell scientif...