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 .
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. CAMPBELL SCIENTIFIC, INC.'s obligation under this warranty is limited to repairing or replacing (at CAMPBELL SCIENTIFIC, INC.'s option) defective products.
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? ....................................................................... 1-1 1.2 Specifications........................................................................................ 1-3 1.2.1 Serial Ports ...............
SDM-SIO4 Table of Contents 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: Signatures ............................................................. 5-4 5.2.4 Command 3: Flush all Receive Buffers...................................... 5-4 5.2.5 Command 4: Send Data to Datalogger ..............
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. 2-1. 2-2. 3-1. SDM-SIO4 Serial Port Pin Configuration ........................................... 1-3 Address Settings ..................................................................................
SDM-SIO4 Table of Contents This is a blank page.
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 is designed to send data to and receive data from the sensors, and process it in parallel with the datalogger’s own program sequence, thus making the complete datalogging system faster and more efficient.
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.
Section 1. Introduction 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’ 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.
Section 1. Introduction 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 This serial port is to connect to the SDM port of the datalogger, e.g. via C1, C2 and C3 on a CR10X. The port is a set of screw terminals marked C1, C2, C3, I/O, +12 and G.
Section 1. Introduction 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 built-in system watchdog which will reset the processor in the event of a crash caused by transients, etc. • A multi-tasking operating system allowing concurrent transmission and receipt of data on all ports.
Section 1. Introduction This is a blank page.
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 serial port. These settings are determined by jumpers inside the case. To access these, remove the four M3 screws and lift the lid off.
Section 2. Installation and Hardware Set-Up 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 logic level output is used when driving a logic level compatible device, e.g. an SC32A, or where quiescent current is a concern.
Section 2. Installation and Hardware Set-Up 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 should also be considered. Ground loops formed by secondary return earth paths can lead to various problems including: • Electrical noise causing possible loss or corruption of serial data.
Section 2. Installation and Hardware Set-Up This is a blank page.
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. More complicated applications require configuration of the SDM-SIO4 using the ‘command line’ function on a PC running a terminal emulator.
Section 3. Understanding How the SDM-SIO4 Handles Data 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 FF. For example, ‘&de’ would be character 222 decimal. To use ‘&’ within the string you must type ‘&&’ (i.e. && = & when in a string). NOTE The hex. number must always be two ASCII characters.
Section 3. Understanding How the SDM-SIO4 Handles Data • 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 Scientific floating point format. * Non-numeric characters are ignored. See Section 5 – ‘Programming the Datalogger’.
Section 3. Understanding How the SDM-SIO4 Handles Data • 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 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.
Section 3. Understanding How the SDM-SIO4 Handles Data • 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 hexadecimal value(s) and converts them to Campbell Scientific floating point format. Terminates when a string between [ ] is seen. n=1,2,3 number of hexadecimal pairs to convert into value LSByte first.
Section 3. Understanding How the SDM-SIO4 Handles Data Predefined Filter Strings A small number of fixed filter strings are pre-defined as follows: Filter No. Filter String Used 256 257 258 259 r1 r2 r3 r4 3.3 Output Formatting The output formatters are used to format data from the datalogger into English text messages, send strings/commands to sensors and to output text to a display. For example, you may have a display on which you want to show air temperature and humidity.
Section 3. Understanding How the SDM-SIO4 Handles Data 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 user definable strings are referenced by a number in the range 0..255. The string is entered as a series of the following formatter commands: • Send ASCII space.
Section 3. Understanding How the SDM-SIO4 Handles Data TABLE 3-1. Fixed Strings Currently Allocated String number String (enclosed in quotes) 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 ‘+0000000000123.45670000000000CrLf’ ‘Voltage’ ‘Amps’ ‘Watts’ ‘Joules’ ‘Temperature’ ‘Pressure’ ‘Speed’ ‘Power’ ‘Depth’ ‘Length’ ‘Height’ ‘Enter’ ‘Password’ ‘Correct’ ‘Incorrect’ ‘Overrange’ The ASCII characters: carriage return, linefeed.
Section 3. Understanding How the SDM-SIO4 Handles Data 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 characters. There is 1 decimal place available within the field. z273 – This outputs the fixed string ‘CrLf (carriage return line feed)’. *Table 1 Program 01: 2 Execution Interval (seconds) ;get battery voltage.
Section 3. Understanding How the SDM-SIO4 Handles Data This is a blank page.
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 SDMSIO4. The computer should run a terminal emulation program (e.g. GraphTerm) which is set to 9600 baud, 8 data bits and 1 stop bit. If connecting to a PC you will need a null modem cable.
Section 4. Programming the SDM-SIO4 NOTE 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 enter 2-character hex. codes (0-9, A-F) 4.3 Basic Commands fltst [string number] ["filter definition"] This command stores a filter definition to a string number 0..255.
Section 4. Programming the SDM-SIO4 strrd [string number] This command outputs the stored string or definition 0..255 to the command line. NOTE 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 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.
Section 4. Programming the SDM-SIO4 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 value is 1 the battery is good. ADDR 0 to 15 This is the current SDM-SIO4 hardware address.
Section 4. Programming the SDM-SIO4 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 command returns the last reported error to the command line. This command can be used, for instance, to get the return code from the ramtest command when in talk-through mode.
Section 4. Programming the SDM-SIO4 This is a blank page.
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 02 03 04 05 06 07 08 09 10 Reps (number of adjacent addressed SDM-SIO4s) Address of SDM-SIO4 (0..15) Mode (0..5) Command (0..9999). First command option (0..9999) Second command option (0..
Section 5. Programming the Datalogger 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 how many values to send or receive, starting from the specified input location (parameter 8). Data can be either 4-byte floating point values or single bytes, determined by the SDM-SIO4 command number.
Section 5. Programming the Datalogger NOTE 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 NOTE In the following examples, ‘x’ indicates a single digit from 0 to 9. When the command requires or returns values, each digit, or combination of digits, can signify either a value, flag or setting.
Section 5. Programming the Datalogger Port 4 data available | Port 3 data available | | Port 2 data available | | | Port 1 data available | | | | x x x x If any of these four digits is greater than zero then data is available. Values per repetition = 1 5.2.3 Command 2: Signatures This command gets the SDM-SIO4 EPROM signature and the string memory area signature; the two values are written into consecutive input locations. If the signatures are zero then there could be corrupt data.
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. Lithium battery level: 0 Lithium battery low and must be replaced. 1 Lithium battery good.
Section 5. Programming the Datalogger 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 per repetition = 0 5.2.11 Command 66: Send Single-Byte Data to Datalogger This command requests the SDM-SIO4 to send single-byte binary data, which is written one byte per location for all values/rep.
Section 5. Programming the Datalogger 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 codes are listed at the end of this section.
Section 5. Programming the Datalogger P113 1: 2: 3: 4: 5: 6: 7:1 8: 9: 10: 1 0 1 21 0 0 5 1 1 0 Command to execute command line command. Length of command line string. ;no. of datalogger input locations ;delay large enough (10ms) to allow SDM-SIO4 instruction 321 to finish. P22 1: 2: 3: 4: 1 0 1 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.
Section 5. Programming the Datalogger 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 transmitted from the specified port to the RS232 device. If the specified string has not been allocated then ‘string not allocated’ is transmitted. Values per repetition = 0 NOTE Minimum delay = characters*0.
Section 5. Programming the Datalogger Third Value Returned Framing errors | | Overrun errors | | | | x x x x Framing errors is a count from 0-99. This count shows how many times there has been a receive error, caused by a character corruption or incorrect set-up. 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.
Section 5. Programming the Datalogger Parity reset: 0 Do nothing 1 Reset parity error count to zero 5.2.18 Command 1027: ‘Manual’ Handshake Mode In this mode, the datalogger can set DTR, RTS and XON/XOFF as required. Not used - set to zero.
Section 5. Programming the Datalogger 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 control 9 No automatic handshake (leaves lines in previous state) Stop Bits and Parity: 0 Leave as set previously. 1 1 stop bit no parity. 2 1 stop bit even parity. 3 1 stop bit odd parity. 4 1.5/2 stop bits no parity.
Section 5. Programming the Datalogger 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 NOTE With the string filter type the SDM-SIO4 buffers are not cleared.
Section 5. Programming the Datalogger First Command Option (Parameter 5) Output mode | String number or termination character | | | | x x x x Output Mode: 0 No output format string 1 Convert location to ASCII floating point. Add character/delimiter between values if enabled. The last value will not have a delimiter after it. 2 Convert location to ASCII hex pair. Add character/delimiter between values if enabled. The last value will not have a delimiter after it. 3 Convert location to 8-bit binary.
Section 5. Programming the Datalogger the termination character as an ASCII code 0..255; 999 means character not enabled. NOTE 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 command 2305 it is possible to transmit either one or two bytes from the command options. If any command option is set to 999 then the byte will not be sent.
Section 5. Programming the Datalogger *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 bit data length, 9600 baud and no handshake delay.
Section 5. Programming the Datalogger 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 *Table 2 Program 02: 0.
Section 5. Programming the Datalogger 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 other sensors connected to another port. 3. Finally the SDM-SIO4 instruction is used to read the collected data back from the SDM-SIO4. Commands 4 or 66 are used for this function.
Section 5. Programming the Datalogger *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 [ ] 9: 1.0 Mult 10: 0.0 Offset ;wait long enough for sensor to send data. 2: Excitation with Delay (P22) 1: 1 Ex Channel 2: 0 Delay W/Ex (units = 0.01 sec) 3: 4 Delay After Ex (units = 0.
Section 5. Programming the Datalogger ;Instantaneous sample form the sensor. 6: Sample (P70) 1: 2 2: 1 Reps 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 Program 5.3.2 Sensors Which Send Data Out Without Prompting It can be very difficult to acquire data from this type of sensor because of the lack of synchronization with the datalogger program.
Section 5. Programming the Datalogger 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: If Flag/Port (P91) 1: 21 Do if Flag 1 is Low 2: 30 Then Do ;set the filter up.
Section 5. Programming the Datalogger 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 to -99998. 7: IF (X<=>F) (P89) 1: 1 X Loc [ Voltage ] 2: 3 >= 3: -99998 F 4: 10 Set Output Flag High (Flag 0) ;Time stamp.
Section 5. Programming the Datalogger 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 searches for the first ASCII floating point number to convert. f – this filter searches for the second ASCII floating point number to convert.
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 Mult 10: 0.0 Offset ;if value returned from poll is >=1 then data must be available. 7: IF (X<=>F) (P89) 1: 2 X Loc [ poll 2: 3 >= 3: 1 F 4: 30 Then Do ] ;get voltages into locations 3 and 4 if poll was true.
Section 5. Programming the Datalogger *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 output from the SDM-SIO4 in combination with an interrupt-driven subroutine in the datalogger (only the CR10/10X currently support this mode).
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 Mult 10: 0.0 Offset ;delay required by filter setup command 4: Excitation with Delay (P22) 1: 1 Ex Channel 2: 0 Delay W/Ex (units = 0.01 sec) 3: 1 Delay After Ex (units = 0.
Section 5. Programming the Datalogger 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 storage. 3: Do (P86) 1: 10 Set Output Flag High (Flag 0) ;time stamp. 4: Real Time (P77) 1: 1111 Year,Day,Hour/Minute,Seconds ;instantaneous readings stored into final storage.
Section 5. Programming the Datalogger 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 123 – This is the command word for storing the formatter sting in area 123. z261 – This outputs the fixed string ‘Temperature’. space –This outputs an ASCII space.
Section 5. Programming the Datalogger *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 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.
Section 5. Programming the Datalogger This is a blank page.
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 Detection with the SDM-SIO4 Error detection is carried out to provide confidence that critical data is received/transmitted correctly.
Section 6. Data Error Detection 0 No Signature type used. 1 CRC16 standard. Polynomial x16+x15+x2+1. 2 CRC16-CCITT standard. Polynomial x16+x12+x5 +1. 3 CRC16-CCITT-IBM (Tag Receiver). 4 CRC32 standard. Polynomial x32+x26+x23+x22+x16+x12+x11+x10+x8+x7+x5+x4+x2+x+1. 5 CSI Signature (see Appendix C of the CR10X Manual). 6 Checksum using modulo 256. 7 Checksum using modulo 8192 (See Section 5 of the CR10X Manual).
Section 6. Data Error Detection 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 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.
Section 6. Data Error Detection 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 above example is just one way of using a filter to achieve the required result. 6.2.2 CR10X Program Example A typical CR10X datalogger program to work with the above filter is shown below.
Section 6.
Section 6. Data Error Detection *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 you would get -99999 in the locations if data was not available to collect.
Section 6. Data Error Detection 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 Transmitted Data The SDM-SIO4 can also do transmission signature generation with the calculated signature appended to the end of the string. This is done by the formatter types ‘g’ and ‘G’.
Section 6. Data Error Detection 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 of Using Transmitted Data Filters A sensor requires the string ‘123456789’ but also requires a CRC16 appended to the end in 16 bit ASCII Hex which, in this case, would be ‘123456789BB3D’.
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 [ _________ ] 9: 1 Mult 10: 0 Offset *Table 2 Program 02: 0.0000 Execution Interval (seconds) *Table 3 Subroutines End Program The program shown above will output to port 1 the string ‘123456789BB3D’. 6.3.
Section 6. Data Error Detection ;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.
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 [ _________ ] 9: 1 Mult 10: 0 Offset *Table 2 Program 02: 0.0 Execution Interval (seconds) *Table 3 Subroutines End Program The string transmitted from port one might be ‘some dataYZ+234.34FFFF’. where FFFF would be the hex CRC16 for the string ‘some dataYZ+234.34’.
Section 6. Data Error Detection 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 2,3 4,5 6 7 8 9 8 bit binary 16 bit binary 32 bit binary ASCII decimal 8 bit ASCII hex 16 bit ASCII hex 32 bit ASCII hex 0.155ms 0.216ms 0.334ms 1.125ms 0.226ms 0.355ms 0.613ms The above timings are preliminary. d 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.
Appendix A. ASCII Table American Standard Code for Information Interchange Decimal Values and Characters (X3.4-1968) Dec. Char.
This is a blank page.
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 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 asterisk indicates not available in SDM command mode:0.
Appendix B. Serial Port Data Transfer Modes 0. 1. 2. 3. 5 data bits 6 data bits 7 data bits 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 handshaking from none at all, hardware (DTR, CTS etc.) and XON/XOFF. On modes 0 and 1 there is a user-set delay (0..254 x 50ms) between CTS being set and data being sent; this allows time for sensors to power up. 0.
Appendix C. Limitations of the TalkThrough 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 address and y is the port number (0 for the command line mode). See the datalogger manual for further details.
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.
This is a blank page.
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) PO Box 444 Thuringowa Central QLD 4812 AUSTRALIA www.campbellsci.com.au info@campbellsci.com.au Campbell Scientific do Brazil Ltda.