Manuel d'utilisation / d'entretien du produit Serial I/O Interface SDM-SIO4 du fabricant Campbell
Aller à la page of 72
SDM-SIO4 4-Channel Serial I/O Interface User Guide Issued 17.3.97 Copyright 1997 Campbell Scientific Ltd..
.
Guarantee This equipment is guaranteed against defects in materials, workmanship, and software. This guarantee applies for twelve months from date of deliv ery. We will repair or replace products which prove to be defective during the guarantee period provided they are returned to us prepaid.
.
i Contents Section 1. Introduction ..................................................... 1-1 1.1 What is the SDM-SIO4? .................................................................................1-1 1.2 Specifications ............................
ii 5.2.6 Command 5: Status ............................................................................. 5-4 5.2.7 Command 6: Flush Transmit Buffer.................................................... 5-5 5.2.8 Command 7: Activate Command Line ........
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.
SDM-SIO4 4-Channel Serial I/O Interface User G uide 1-2 Switches - Go to 1 if command line active To Other Ports To Other Ports 1 PORT Handshak e Control Tx Buffe r Rx B uffer Command Line Control Dat.
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’ style DTE serial port.
SDM-SIO4 4-Channel Serial I/O Interface User Guide 1- 4 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.
Section 1 . Introduction 1- 5 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.
.
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 serial port.
SDM-SIO4 User Guide 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).
Section 2. Installation and Hardware Set-Up 2- 3 • Electrical noise causing possible loss or corruption of serial data. • Electrical noise being transferred back to the datalogger causing errors on analogue measurements. • Long term damage in the form of corrosion caused by current flowing along electro-chemical gradients.
.
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.
SDM-SIO4 User Guide 3-2 The hex. number must always be t wo ASCII characters. Control characters can be entered for all commands in a similar way: • ^M is carriage return, ^J line feed etc.
Section 3. Understanding How the SDM- SIO4 Handles Data 3-3 See Section 5 – ‘P rogramming the Datalogger’. Filter Strings These are used to defin e how to filter incoming data from a port into a format the datalogger can use. This is done by having a user-defined filter s tring pre-stored in the battery-backed memory of the SDM-SIO4.
SDM-SIO4 User Guide 3-4 • i[ ] Scan until any ASCII ch aracters entered between the brack ets are encountered. The maximum number of characters bet ween the brackets is 255. Note that this filter does n ot remove the matche d character from the buffer.
Section 3. Understanding How the SDM- SIO4 Handles Data 3-5 2. n8 discards everyt hing up to 12.65V. 3. F converts the number t o Campbell Scient ific floating poi nt. If a valid number is not found -99999 is sent to t he datalogger. 4. i[c] waits for the trigger character ‘c’ of ‘current’.
SDM-SIO4 User Guide 3-6 • Convert a locati on sent into a 16-bit bi nary word. If this option is selected an extra ASCII character/delimiter can be added to the end of the 16-bit word sent.
Section 3. Understanding How the SDM- SIO4 Handles Data 3-7 Table 4 Fixed Strings Currently Allocated String number String (enclo sed in quotes) 256 ‘+0000000000123.
SDM-SIO4 User Guide 3-8 z273 – This outputs the fixed string ‘C rLf (carriage return line feed)’. *Table 1 Program 01: 2 Execution Interval (seconds) ;get battery voltag e.
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.
SDM-SIO4 User Guide 4- 2 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.
Section 4. Programming the SDM- SIO4 4-3 because they are compiled. exit This command exits the command lin e and returns port 1 of the SDM-SIO4 to normal operation. 4.4 Advanced Commands version This returns t he internal EPROM part number, signature and the stri ng signature if good or 0 if bad.
SDM-SIO4 User Guide 4- 4 WD n WDERR n WDADDR n WD n is a count of the number of watchdog resets, W DERR is the number of the last task that crashed and WDADDR is the address at which the crash was found. NC 0-9 This is t he number of SDM commands the datalogger s ent to the SDM-SIO4 t hat the SDM-SIO4 did not recognise.
Section 4. Programming the SDM- SIO4 4-5 testio [test#] This is used by Camp bell Scientific for test purpo ses. Each test command is carried out for 2 seconds. Tes t# can be in the range 0-255; only five test numbers are currently valid, as s hown below.
.
5-1 Section 5. Programming the Datalogger The datalogger instruction specific to the SDM-SIO4 is P113 (CR7 and C R10/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.
SDM-SIO4 User Guide 5-2 5.1.5 Parameter 7 — Values per Rep This determines how many values to send or receive, starting from the specified input location (paramet er 8). Data can be either 4-byte floati ng point values or single bytes , determined by the SDM-SIO4 command number.
Section 5. Programming the Datalogger 5-3 5.2.1 Understandi ng Parameter Options and Retur ned Val ues In the following examples, ‘ x ’ indicates a s ingle digit from 0 t o 9. When the command requires or returns values, each digit, or combination of digits, can s ignify either a value, flag or s etting.
SDM-SIO4 User Guide 5-4 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 t hen there could be corrupt data.
Section 5. Programming the Datalogger 5-5 If any of these four digits is greater than zero then data is available. Values per repetition = 2 5.2.7 Command 6: Flush Transmit Buffer This command flushes the SDM-SIO4 transmit bu ffer of data it is waiting to send .
SDM-SIO4 User Guide 5-6 5.2.12 Command 67: Get Return Code This command gets the return error code and places it into a specified location. Command 67 is us ed in conjunction wit h command 321 and provides a singl e return code value which indicates if the command was success ful or not.
Section 5. Programming the Datalogger 5-7 P65 Bulk load 1:102 f 2:108 l 3:116 t 4:115 s 5:116 t 6:32 ascii space 7:50 2 8:53 5 9:1 First location to store the first lot of 8 characters. P65 Bulk load 1:32 ascii space 2:34 “ 3:102 f 4:102 f 5:67 C 6:99 c 7:34 “ 8:0 9:9 First location to store second lot of characters.
SDM-SIO4 User Guide 5-8 ;set flag one so that set-up will only be done once. P86 11 ;end of set-up. P95 If you use the RAMTEST command you will have to wait a minimum of 6 s econds for it to compl ete before you try to execute another P113. Some Dataloggers do not support P65 Bulk Load.
Section 5. Programming the Datalogger 5-9 Second Value Returned CTS status (0=CTS low, 1=CTS high) | DSR status (0=DSR low, 1=DSR high) | | RI status (see below) | | | DCD status (0=DCD low, 1=DCD hig.
SDM-SIO4 User Guide 5-10 Break reset: 0 Do nothing 1 Reset line break count to zero Framing reset: 0 Do nothing 1 Reset framing error count to zero Overrun reset: 0 Do nothing 1 Reset overrun error count to zero Parity reset: 0 Do nothing 1 Reset parity error count t o zero 5.
Section 5. Programming the Datalogger 5-11 First Command Option (Paramet er 5) Handshake mode | Stop bits + parity | | Data length | | | Baud rate | | | | x x x x Handshake Mode: 0 Leave as set previo.
SDM-SIO4 User Guide 5-12 5.2.20 Command 2054: Set Up Receive Filter This command clears al l buffers relevant to t he mode number and restarts the filter.
Section 5. Programming the Datalogger 5-13 Output Mode: 0 No output format st ring 1 Convert location t o ASCII floating poi nt. Add character/delimit er between values if enabled. The last value will not have a d elimiter after it. 2 Convert location t o ASCII hex pair.
SDM-SIO4 User Guide 5-14 5.2.22 Command 2305: Transmit Byte(s) By using P 113 command 2305 it is pos sible to tr ansmit either one or t wo bytes from the command options. If any command opt ion is se t to 999 then the byte wi ll not be sent. The number range for each command option is 0-255 and 999.
Section 5. Programming the Datalogger 5-15 ;set ser ial mode to DTR, RTS alw ays set, ignor e CTS, 1 stop bi t no parity, ;8 bit data le ngth, 9600 baud and no handshake delay.
SDM-SIO4 User Guide 5-16 *Table 2 Program 02: 0.0000 Execution Interval (seconds) *Table 3 Subroutines End Program The normal configuration would i nclude setting t he speed and serial data format by calling the dat alogger instruct ion with command 2049 and the relevant parameters.
Section 5. Programming the Datalogger 5-17 ^J^M – this is a way of entering control characters fo r carriage return/linefeed into a string The following program example works as follows: 1. The first P113 sets up a s imple filter to search for floating point numbers.
SDM-SIO4 User Guide 5-18 ;get data from SDM -SIO4 and put into locat ions 1 and 2. 3: 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.
Section 5. Programming the Datalogger 5-19 Example CR10X Program without Polling or Interrupts This simpl e program is an example for sens ors that send data at random intervals. If no data was available when the datalogger asked for it then -99999 will be put into locations 1 and 2.
SDM-SIO4 User Guide 5-20 ;end of set up. 5: End (P95) ;get the two fl oating point values from the SDM-SIO4. 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.
Section 5. Programming the Datalogger 5-21 x – this filter marks the start o f the data set. In this case the da ta set is two floating point numbers. f – this filter searches for the first ASC II floating point number to convert. f – this filter searches for the second ASC II floating point number to convert.
SDM-SIO4 User Guide 5-22 ;if value returned from poll is >=1 then data must be a vailable. 7: IF (X<=>F) (P89) 1: 2 X Loc [ poll ] 2: 3 >= 3: 1 F 4: 30 Then Do ;get voltages i nto locations 3 and 4 if poll was true.
Section 5. Programming the Datalogger 5-23 – see ‘SDM Port’ i n Section 1 for details . This should be connected t o control port 8 for this example.
SDM-SIO4 User Guide 5-24 ;end of IF 6: End (P95) *Table 2 Program 02: 0.0000 Execution Interval (seconds) *Table 3 Subroutines ;interr upt routine for control port 8 1: Beginning of Subroutine (P85) 1.
Section 5. Programming the Datalogger 5-25 5.4 Outputting Datalogger Data The SDM-SIO4 can be used t o drive displays, printout devices and other output- only systems.
SDM-SIO4 User Guide 5-26 *Table 2 Program 02: 0.0000 Execution Interval (seconds) *Table 3 Subroutines End Program 5.5 Flushing the Input and Output Buffers One importan t aspect of the SDM-SIO4 is that it will contin ue to collect data and store it i n its buffers even if the dat alogger program stops running.
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 w ith datalogger program examples to implem ent error detection methods.
SDM-SIO4 User Guide 6-2 3 CRC16-CCITT-IB M (Tag Receiver). 4 CRC32 st andard. 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 +x+1. 5 CSI Signature (see Appendi x C of the CR10X Manual ). 6 Checksum using modul o 256.
Section 6. Data Error Detection 6-3 6.2.1 Example of Using Received Data Filters If a sensor transmitted th e following string: Frequency=12.34567HzBB3DCrLf then a user defined filter string would have to be used. The BB3D part of the string is the CRC sent in hex.
SDM-SIO4 User Guide 6-4 *Table 1 Program 01: 1.0 Execution Interval (seconds) ;test flag 1 – if n ot set tell the SDM-SIO4 to use filter string 100 1: If Flag/Port (P91) 1: 21 Do if Flag 1 is Low 2:.
Section 6. Data Error Detection 6-5 ;if the value in locat ion 1 is greater than zero then ther e must be data ;this ass umes only one sensor is connected to the SDM-SIO4 7: IF (X<=>F) (P89) 1: .
SDM-SIO4 User Guide 6-6 1,2 CRC 16 and CRC16-C CITT 0.159ms/char. 3 CRC 16-CCITT-IBM 0.159ms/char. 4 CRC32 0.369ms/ char. 5 CSI Signature 0.077ms/char. 6 Checksum using modulo 256 0.066ms/char. 7 Checksum using modulo 8192 0.071ms/char. c The time for the differen t data types is shown belo w.
Section 6. Data Error Detection 6-7 5 CSI Signature (CR 10X user manual secti on C-4). 6 Check sum using modulo 256. 7 Check sum using modulo 8192 (C R10X user manual s ection 5-2).
SDM-SIO4 User Guide 6-8 6.3.2 CR10X Program Example A typical CR 10X datalogger program to work with the above format ter is shown below. The program assumes that the SDM-SIO4 is set to address 0, the sensor is connected to port 1 of the SDM-S IO4 and the port setti ngs, baud rate etc have been set.
Section 6. Data Error Detection 6-9 *Table 1 Program 01: 1.0 Execution Interval (seconds) ;use form atter st ring 100 to se t up the CRC16 on por t 1 1: SDM-SIO4 (P113) 1: 1 Reps 2: 0 Address 3: 1 Sen.
SDM-SIO4 User Guide 6-10 ;use for matter string 102 and out put datalogger location 1 as ASC II floati ng point ;to port 1 and then out put the calculat ed ASCII hex CRC16 6: SDM-SIO4 (P113) 1: 1 Reps.
Section 6. Data Error Detection 6-11 1 8 bit binary 0.155ms 2,3 16 bi t binary 0.216ms 4,5 32 bi t binary 0.334ms 6 ASCII decimal 1.125ms 7 8 bit ASCII hex 0.226ms 8 16 bit ASCII hex 0.355ms 9 32 bit ASCII hex 0.613ms The above timings are preli minary.
.
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.
.
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.
SDM-SIO4 4-Channel Serial I/O Interface B- 2 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.
Un point important après l'achat de l'appareil (ou même avant l'achat) est de lire le manuel d'utilisation. Nous devons le faire pour quelques raisons simples:
Si vous n'avez pas encore acheté Campbell Serial I/O Interface SDM-SIO4 c'est un bon moment pour vous familiariser avec les données de base sur le produit. Consulter d'abord les pages initiales du manuel d'utilisation, que vous trouverez ci-dessus. Vous devriez y trouver les données techniques les plus importants du Campbell Serial I/O Interface SDM-SIO4 - de cette manière, vous pouvez vérifier si l'équipement répond à vos besoins. Explorant les pages suivantes du manuel d'utilisation Campbell Serial I/O Interface SDM-SIO4, vous apprendrez toutes les caractéristiques du produit et des informations sur son fonctionnement. Les informations sur le Campbell Serial I/O Interface SDM-SIO4 va certainement vous aider à prendre une décision concernant l'achat.
Dans une situation où vous avez déjà le Campbell Serial I/O Interface SDM-SIO4, mais vous avez pas encore lu le manuel d'utilisation, vous devez le faire pour les raisons décrites ci-dessus,. Vous saurez alors si vous avez correctement utilisé les fonctions disponibles, et si vous avez commis des erreurs qui peuvent réduire la durée de vie du Campbell Serial I/O Interface SDM-SIO4.
Cependant, l'un des rôles les plus importants pour l'utilisateur joués par les manuels d'utilisateur est d'aider à résoudre les problèmes concernant le Campbell Serial I/O Interface SDM-SIO4. Presque toujours, vous y trouverez Troubleshooting, soit les pannes et les défaillances les plus fréquentes de l'apparei Campbell Serial I/O Interface SDM-SIO4 ainsi que les instructions sur la façon de les résoudre. Même si vous ne parvenez pas à résoudre le problème, le manuel d‘utilisation va vous montrer le chemin d'une nouvelle procédure – le contact avec le centre de service à la clientèle ou le service le plus proche.