Campbell SDM-SIO4 Instruction Manual

Campbell SDM-SIO4 Instruction Manual

4-channel serial i/o interface
Hide thumbs Also See for SDM-SIO4:
Table of Contents

Advertisement

Quick Links

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 .

Advertisement

Table of Contents
loading

Summary of Contents for Campbell SDM-SIO4

  • Page 1 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 ,...
  • Page 2 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.
  • Page 3: Table Of Contents

    5.1.2 Parameter 2 — Address .............. 5-1 5.1.3 Parameter 3 — Mode ..............5-1 5.1.4 Parameters 4, 5 and 6 — SDM-SIO4 Command ......5-2 5.1.5 Parameter 7 — Values per Rep ........... 5-2 5.1.6 Parameter 8 — Starting Input Location ........5-2...
  • Page 4 5.2.11 Command 66: Send Single-Byte Data to Datalogger ....5-6 5.2.12 Command 67: Get Return Code ..........5-6 5.2.13 Command 320: Send Data to SDM-SIO4 ......... 5-6 5.2.14 Command 321: Execute Command Line Command ....5-6 5.2.15 Command 1024: Send String to Device ........5-9 5.2.16 Command 1025: Transmit a Byte..........
  • Page 5 SDM-SIO4 Table of Contents 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 Tables 1-1. SDM-SIO4 Serial Port Pin Configuration ........... 1-3 2-1. Address Settings .................. 2-1 2-2. Status LED Error Codes ..............2-3...
  • Page 6 SDM-SIO4 Table of Contents This is a blank page.
  • Page 7: Introduction

    For input, the SDM-SIO4 can transfer data in the same form as received from a sensor to the datalogger, or it can be programmed to filter out critical data from a sensor and only pass back the data the datalogger requires.
  • Page 8: Command Line

    Section 1. Introduction 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. Command Line Status Switch PORT Handshake Line Handshake Tx Buffer Rx Buffer...
  • Page 9: Specifications

    PC ‘AT’ style DTE serial port. Handshaking, to control the flow of data to and from a sensor, can be done by the datalogger or SDM-SIO4 if needed, and can be in the form of hardware or software protocols. TABLE 1-1. SDM-SIO4 Serial Port Pin Configuration Pin No.
  • Page 10: Sdm Port

    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.)
  • Page 11: Environmental Operating Range

    This allows users to communicate with a device connected to one of the four serial ports of the SDM-SIO4 as if they were directly connected to that device. This can be very useful for diagnosis or configuration of the remote device(s).
  • Page 12 Section 1. Introduction This is a blank page.
  • Page 13: Installation And Hardware Set-Up

    Before installation, it is necessary to set up the address of the SDM-SIO4 and also the mode of operation of each serial port. These settings are determined by jumpers inside the case.
  • Page 14: Selecting Rs232 Or 5V Logic For Each Port

    2.3.1 Transient Protection and Grounding The G terminal on the SDM-SIO4 acts both as a ground reference point for digital communications via the SDM port and also as a protective ground for the SDM-SIO4. Usually it can be connected back to the datalogger power ground (G on a CR10/10X).
  • Page 15: Power-On Tests - The Status Led

    RS232 signals is limited to a few tens of meters (the exact length depending on the RS232 driver hardware and the cable used). Short-haul modems can be added to the SDM-SIO4 to allow cables up to several kilometers to be used and in addition providing ground isolation (please contact Campbell Scientific for further details).
  • Page 16 Section 2. Installation and Hardware Set-Up This is a blank page.
  • Page 17: Understanding How The Sdm-Sio4 Handles Data

    Thus when the datalogger needs to send out long or complicated data strings it only needs to send a short command to the SDM-SIO4 to tell it to do this, i.e. it does not have to pass the whole string via the SDM interface. Likewise, by telling the SDM-SIO4 how to process received data, it can strip off the unwanted characters and reduce the data to either binary or floating point numbers.
  • Page 18: Input Filters

    Campbell Scientific floating point format. The SDM-SIO4 continues searching and reading data until it encounters a termination character (if this has been specified in Instruction 113) The filters are as follows:- • Search for an ASCII floating point number to convert to Campbell Scientific floating point format.*...
  • Page 19 Carry out a bit field to floating point conversion. The SDM-SIO4 gets or waits for as many bytes as are required to fulfil the total number of bit fields. ‘n’ can be any number of bits from 0 to 255, but more than 23 bits is beyond the floating point range of the datalogger so the value returned to the datalogger will be invalid.
  • Page 20 A floating point number should be at this position. If it is found, the signed floating point number is sent to the datalogger and removed from the buffer. If no floating point number is found, the SDM-SIO4 sends -99999 to the datalogger.
  • Page 21 4. i[c] waits for the trigger character ‘c’ of ‘current’. 5. n8 discards everything up to 12mA. 6. F converts the number to Campbell Scientific floating point. If a number is not found -99999 is sent to the datalogger. This filter will repeat the above operations on all incoming values.
  • Page 22: Output Formatting

    It would be impractical for the datalogger to store text labels in this way, and so you could use the SDM-SIO4 to send a label to the display along with the data from the datalogger.
  • Page 23: Output Format Strings

    • bn Send a binary number received from the datalogger to the port. ‘n’ can 1, 2 or 3 bytes, i.e. 8-, 16- or 24-bit. If n=4 then it is direct Campbell Scientific floating point format. If the formatter string asks for more values than the datalogger sends then the SDM-SIO4 sends ‘*’...
  • Page 24: Cr10X Program Example

    ‘Overrange’ The ASCII characters: carriage return, linefeed. If the datalogger sends more data than is defined in the SDM-SIO4’s formatter string, the SDM-SIO4 starts at the beginning again unless ‘s’ (stop formatting) is used, in which case any extra data within that transmission is ignored.
  • Page 25 1: 2 Loc [ Batt_v ] ;get panel temperature. 2: Internal Temperature (P17) 1: 1 Loc [ Temp_C ] ;send battery voltage and temperature to port 2 on the SDM-SIO4. 3: SDM-SIO4 (P113) 1: 1 Reps 2: 0 Address 3: 2 Send/Receive Port 2 ;see Section 5 for explanation of...
  • Page 26 Section 3. Understanding How the SDM-SIO4 Handles Data This is a blank page. 3-10...
  • Page 27: Programming The Sdm-Sio4

    • Complicated or long string definitions are best set up by editing a text file which includes the string definition commands. This file can then be sent out to the SDM-SIO4 once it is configured in the command line mode. The SDM-SIO4 can accept multiple configuration strings sent within one file.
  • Page 28: Basic Commands

    Section 4. Programming the SDM-SIO4 The hex. number must always be two ASCII characters. NOTE Control characters can be entered for all commands in a similar way: • ^M is carriage return, ^J line feed etc. • ^^ means ^ •...
  • Page 29: Advanced Commands

    2. Formatter and filter strings cannot be read by this command because they are compiled. exit This command exits the command line and returns port 1 of the SDM-SIO4 to normal operation. 4.4 Advanced Commands version This returns the internal EPROM part number, signature and the string signature if good or 0 if bad.
  • Page 30 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.
  • Page 31 [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.
  • Page 32 Section 4. Programming the SDM-SIO4 This is a blank page.
  • Page 33: Programming The Datalogger

    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.
  • Page 34: Parameters 4, 5 And 6 - Sdm-Sio4 Command

    For many of the command options listed below, it is necessary to leave a small delay before calling another instance of the instruction which communicates with the SDM-SIO4. This is required to allow the SDM-SIO4 to process the instructions it has been given. Failure to allow these delays will probably cause the SDM-SIO4 to return invalid data.
  • Page 35: Understanding Parameter Options And Returned Values

    5.2.2 Command 1: Poll of Available Data This command has no additional options after the command. The SDM-SIO4 returns one Campbell Scientific floating point number to indicate if data is...
  • Page 36: Command 2: Signatures

    Values per repetition = 2 5.2.4 Command 3: Flush all Receive Buffers Stored data in the SDM-SIO4 relevant to the port is also erased with this command. Values per repetition = 0 5.2.5 Command 4: Send Data to Datalogger...
  • Page 37: Command 6: Flush Transmit Buffer

    Section 5. Programming the Datalogger 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 incremented when the program is first compiled.
  • Page 38: Command 9: Flush Converted Data Buffer

    The P113 command 321 would then load the string into the SDM-SIO4 and execute the command. The 321 command is useful for reconfiguring a remote SDM-SIO4 as changes can be made by downloading programs (using the 321 command) which can change the SDM-SIO4 setup.
  • Page 39 P113 Command 67 which will put the return code into a storage location. The return codes are listed at the end of this section. This command requires a 4ms delay before any other SDM-SIO4 instruction from the datalogger is executed...
  • Page 40 3: 1 4: 0 ;get the command line return code. In this case the returned code would be 22 as the SDM-SIO4 would still be executing the command line command. This P113 instruction in most cases would not be required and would generally be used in development of the datalogger program.
  • Page 41: Command 1024: Send String To Device

    Minimum delay = characters*0.26*ports in milliseconds 5.2.16 Command 1025: Transmit a Byte This command transmits a byte (defined in parameter 5) from the SDM-SIO4 to the RS232 device. The byte must be in the range of 0..255 for binary code.
  • Page 42 Overrun errors is a count from 0-99. This count shows how many times characters have been lost due to data being sent too quickly for the SDM-SIO4 to process the data.
  • Page 43: Command 1027: 'Manual' Handshake Mode

    | | | DTR | | | | x x x x XON/XOFF: Leave as set previously XOFF data (stop data transmission from SDM-SIO4) XON data (restart data transmission from SDM-SIO4) RTS: Leave as set previously Clear RTS to low...
  • Page 44 This option is used to set the handshaking delay in units of 50ms. The accuracy is -50ms, +0ms. The range is 0-254, with 255 reserved for XON /XOFF mode. XOFF will force the SDM-SIO4 to wait indefinitely for an XON. When the SDM-SIO4 is reset from the ‘command line’, the ports...
  • Page 45: Command 2054: Set Up Receive Filter

    1 Convert any ASCII numbers to Campbell Scientific floating point up to the termination character if set 2 Convert any ASCII hex pair to Campbell Scientific floating point up to the termination character if set 3 Convert 8-bit binary number to Campbell Scientific floating point up to the...
  • Page 46 1 Convert any ASCII numbers to Campbell Scientific floating point up to the termination character if set 2 Convert any ASCII hex pair to Campbell Scientific floating point up to the termination character if set 3 Convert 8-bit binary number to Campbell Scientific floating point up to the...
  • Page 47: Command 2305: Transmit Byte(S)

    Example CR10X Program This program is an example of how you could set up the SDM-SIO4 serial mode and filter type once on program compilation or if flag 1 was reset. This works on port 1 of the SDM-SIO4.
  • Page 48 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 bit data length, 9600 baud and no handshake delay. 2: SDM-SIO4 (P113) 1: 1 Reps 2: 0 Address...
  • Page 49: Sensors Where The Datalogger Can Request Data By Sending A Prompt Or Using A Handshaking Line

    For the majority of sensor applications where data is returned in only one type of format to the SDM-SIO4, the receive data format filters can also be defined once only by using command 2054. Similarly, some sensors may also require set-up strings to be sent once;...
  • Page 50 1 to command the sensor to transmit its measurements back to the SDM-SIO4, which has a filter set up ready to receive the data. The output formatter is set up to transmit a string as follows: strst 101 "Send Data^J^M"...
  • Page 51 2: 0 Delay W/Ex (units = 0.01 sec) 3: 4 Delay After Ex (units = 0.01 sec) 4: 0 mV Excitation ;get data from SDM-SIO4 and put into locations 1 and 2. 3: SDM-SIO4 (P113) 1: 1 Reps 2: 0 Address...
  • Page 52: Sensors Which Send Data Out Without Prompting

    For sensors which output data relatively slowly data can be collected by using special features of the input filters which tell the SDM-SIO4 only to recognize the start and end of data (using the x and X options – see Section 3). These...
  • Page 53 Delay After Ex (units = 0.01 sec) 4: 0 mV Excitation ;set flag one so setup only happens once. 4: Do (P86) 1: 11 Set Flag 1 High ;end of set up. 5: End (P95) ;get the two floating point values from the SDM-SIO4. 5-21...
  • Page 54 Example CR10X Program using the Polling Method This program will deal with sensors that send data at random intervals. The program polls the SDM-SIO4 to see if data is available and only stores the data then. A typical filter that could be used is as follows: fltst 200 "t[data]A5xff"...
  • Page 55 4: 0 mV Excitation ;set flag one high so the filter set-up is only done once. 4: Do (P86) 1: 11 Set Flag 1 High ;end of IF. 5: End (P95) ;poll SDM-SIO4 to see if data is available. 5-23...
  • Page 56 Section 5. Programming the Datalogger 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...
  • Page 57 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 output from the SDM-SIO4 in combination with an interrupt-driven subroutine in the datalogger (only the CR10/10X currently support this mode).
  • Page 58 Section 5. Programming the Datalogger ;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...
  • Page 59: Outputting Datalogger Data

    5.4 Outputting Datalogger Data The SDM-SIO4 can be used to drive displays, printout devices and other output-only systems. In this case after the initial configuration (as above) either simple data can be sent using commands 0320, 1025 or just data strings using 1024 or strings plus formatted data sent using command 2304.
  • Page 60 01: 2 Execution Interval (seconds) 1: Batt Voltage (P10) 1: 2 Loc [ Batt_v ] 2: Internal Temperature (P17) 1: 1 Loc [ Temp_C ] 3: SDM-SIO4 (P113) 1: 1 Reps 2: 0 Address 3: 2 Send/Receive Port 2 4: 2304...
  • Page 61: Flushing The Input And Output Buffers

    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 that data does not build up in the buffers and as a result either a buffer overflows, or data is collected which relates to a different time than anticipated.
  • Page 62 Section 5. Programming the Datalogger This is a blank page. 5-30...
  • Page 63: Data Error Detection

    This section gives details on how to use filter strings together with datalogger program examples to implement error detection methods. 6.1 Error Detection with the SDM-SIO4 Error detection is carried out to provide confidence that critical data is received/transmitted correctly.
  • Page 64 It also sets the data type to use. When this filter is done, the signature returned from the sensor will be converted into a standard data type, so the SDM-SIO4 can compare the original signature it calculated to the one the sensor returned. If the two signatures...
  • Page 65: Example Of Using Received Data Filters

    C this filter removes the char “H”. C this filter removes the char “z”. G8 this filter tells the SDM-SIO4 that the next ASCII hex is the start of the checksum from the sensor. It also defines the data type to be ASCII hex 16 bit.
  • Page 66: Cr10X Program Example

    A typical CR10X datalogger program to work with the above filter is shown below. Assume the SDM-SIO4 is set to address 0, the sensor is connected to port 1 of the SDM-SIO4 and the port settings, baud rate, etc. have been set. The sensor outputs its string every second.
  • Page 67 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...
  • Page 68 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 you would get -99999 in the locations if data was not available to collect.
  • Page 69: Transmitted Data

    It also sets the data type to use. ‘n’ can be in the range of 0-255 which indicates the data type to use. The data types that the SDM-SIO4 can deal with are as follows: No data type or check.
  • Page 70: Example Of Using Transmitted Data Filters

    Instruction P113 requires. While this string is being processed by the SDM-SIO4 the CRC16 will be calculated on it. G8 is the filter which tells the SDM-SIO4 that this is the position where it should append the CRC16 to the string. Also the number 8 defines the CRC16 output format which in this case is 16 bit ASCII hex.
  • Page 71: Alternative Cr10X Program

    Section 6. Data Error Detection 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 [ _________ ]...
  • Page 72 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 1 3: SDM-SIO4 (P113) 1: 1 Reps 2: 0 Address 3: 1...
  • Page 73 Section 6. Data Error Detection 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 [ _________ ]...
  • Page 74 With the CRC32 and CRC16-CCITT there is a extra 0.19ms for an additional calculation. This is required as part of the CRC algorithm. The total extra processing time above the SDM-SIO4’s normal delays is calculated by the following: Total time in µsec needed before the next P113 is started =...
  • Page 75: Appendix A. Ascii Table

    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. CONTROL @ SPACE CONTROL A CONTROL B " CONTROL C CONTROL D CONTROL E CONTROL F & CONTROL G CONTROL H CONTROL I...
  • Page 76 This is a blank page.
  • Page 77: Appendix B. Serial Port Data Transfer Modes

    The ones listed below are those for the command line mode. B.1 Baud rates The SDM-SIO4 ports can support 16 baud rates if set up from the command line but only 9 are available from datalogger set-up using SDM commands. An...
  • Page 78: Parity Bits

    0. Leave as previously set. 1. DTR is always set as the SDM-SIO4 is always ready for data. RTS is set when data is ready to transmit. Data is transmitted following a delay (n x 50ms) after CTS is set; transmission stops if CTS falls.
  • Page 79: C.1 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 address and y is the port number (0 for the command line mode). See the datalogger manual for further details.
  • Page 80 Appendix C. Limitations of the Talk-Through Mode 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 Scientific Australia Pty. Ltd. (CSA)

Table of Contents