Download PWS-600 User Manual - Prairie Wind Systems
Transcript
PWS-600 Data Logger User’s Manual 14-10600 03/17/2014 PWS-600 User’s Manual Copyright © 2014 by Prairie Wind Systems, LLC. All Rights Reserved. No part of this document may be photocopied, reproduced, or translated to another language without the prior written consent of Prairie Wind Systems. The information contained in this document is subject to change without notice. Prairie Wind Systems has made a reasonable effort to ensure that the information contained in this document is accurate as of the date of publication. Prairie Wind Systems makes no warranty of any kind with regards to this material, including, but not limited to, its fitness for a particular application. Prairie Wind Systems will not be liable for errors contained herein or for incidental or consequential damages in connection with the furnishing, performance, or use of this material. In no event shall Prairie Wind Systems be liable for any claim for direct, incidental, or consequential damages arising out of, or in connection with, the sale, manufacture, delivery, or use of any product. 2 PWS-600 User’s Manual 1 2 3 4 5 6 7 Regulatory Information......................................................................................................................... 6 1.1 FCC Statement............................................................................................................................... 6 1.2 Battery Statement......................................................................................................................... 6 Warranty and Assistance ...................................................................................................................... 7 Overview ............................................................................................................................................... 8 Specifications ........................................................................................................................................ 9 Installation .......................................................................................................................................... 13 5.1 Environmental Considerations.................................................................................................... 13 5.2 Mounting the Device................................................................................................................... 13 5.3 Connector Pin-Out ...................................................................................................................... 14 5.4 Terminal Block Accessory............................................................................................................ 15 5.5 Power Requirements .................................................................................................................. 16 5.6 Charging Requirements............................................................................................................... 16 5.7 Status Indicators ......................................................................................................................... 17 5.8 Communication ........................................................................................................................... 18 5.8.1 RS485 Signals ...................................................................................................................... 18 5.8.2 RS232 Signals ...................................................................................................................... 18 Getting Started.................................................................................................................................... 19 6.1 Device Configuration................................................................................................................... 19 6.2 Network Communication Settings .............................................................................................. 19 6.3 Site Identification ........................................................................................................................ 19 6.4 Configure the Sensor Networks .................................................................................................. 20 6.5 Configure the Data Log ............................................................................................................... 20 Register Map ....................................................................................................................................... 21 7.1 Device Configuration Registers ................................................................................................... 21 7.1.1 Register Map Version .......................................................................................................... 21 7.1.2 Device Id .............................................................................................................................. 21 7.1.3 Serial Number ..................................................................................................................... 21 7.1.4 Firmware Version ................................................................................................................ 21 7.1.5 Boot Code Version .............................................................................................................. 21 7.1.6 Hardware Version ............................................................................................................... 22 7.1.7 Site Id .................................................................................................................................. 22 7.1.8 Site Name ............................................................................................................................ 22 7.1.9 Site Information .................................................................................................................. 22 7.1.10 Device Address .................................................................................................................... 22 7.1.11 Low Voltage Warning Threshold ......................................................................................... 22 7.2 Device Command Register .......................................................................................................... 23 7.3 Device Status Registers ............................................................................................................... 25 7.3.1 Device Status ....................................................................................................................... 25 7.3.2 Ambient Temperature ........................................................................................................ 26 7.3.3 Input Voltage....................................................................................................................... 26 7.3.4 Charge Voltage .................................................................................................................... 26 7.3.5 Date and Time ..................................................................................................................... 26 7.4 Communication Configuration Registers .................................................................................... 27 7.4.1 Communication Settings ..................................................................................................... 27 7.4.2 Message Timeout ................................................................................................................ 28 3 PWS-600 User’s Manual 7.4.3 Sleep Timeout ..................................................................................................................... 28 7.4.4 Message Counters............................................................................................................... 28 7.5 Sensor Networks ......................................................................................................................... 29 7.5.1 RS485 Smart Sensor Network ............................................................................................. 29 7.5.2 SDI-12 Smart Sensor Network............................................................................................. 35 7.5.3 Analog Sensor Network....................................................................................................... 37 7.5.4 Discrete Sensor Network .................................................................................................... 38 7.6 Data Log Configuration Registers................................................................................................ 39 7.6.1 Log Enable ........................................................................................................................... 40 7.6.2 Log Pause ............................................................................................................................ 40 7.6.3 Next Scheduled Record ....................................................................................................... 41 7.6.4 Log Interval.......................................................................................................................... 41 7.6.5 Log Offset ............................................................................................................................ 41 7.6.6 Number of Sensor Commands ............................................................................................ 41 7.6.7 Sensor Command Groups ................................................................................................... 42 7.6.8 MODBUS Command Group Format .................................................................................... 42 7.6.9 SDI-12 Command Group Format......................................................................................... 44 7.6.10 Analog Command Group Format ........................................................................................ 46 7.6.11 Discrete Command Group Format ...................................................................................... 49 7.6.12 Last Sensor Readings ........................................................................................................... 51 7.7 Switched Power Outputs ............................................................................................................ 52 7.7.1 Switched Output Status ...................................................................................................... 52 7.7.2 Switched Power Output Configuration ............................................................................... 53 7.8 Discrete Outputs ......................................................................................................................... 55 7.8.1 Discrete Output Status ........................................................................................................ 55 7.8.2 Discrete Output Configuration ............................................................................................ 55 7.9 Data Log Recording Registers ..................................................................................................... 57 7.9.1 Encryption Key .................................................................................................................... 57 7.9.2 Recording Data .................................................................................................................... 57 7.9.3 Recording Speed ................................................................................................................. 58 7.10 Data Log Retrieval Registers ....................................................................................................... 59 7.10.1 Data Log Size ....................................................................................................................... 59 7.10.2 Data Log Used ..................................................................................................................... 59 7.10.3 Lowest and Highest Record Numbers ................................................................................. 59 7.10.4 Download Record Count ..................................................................................................... 60 7.10.5 Record Number ................................................................................................................... 60 7.10.6 Record Size .......................................................................................................................... 60 7.10.7 Record Data......................................................................................................................... 60 7.10.8 Data Decryption .................................................................................................................. 61 7.10.9 Data Retrieval Procedure .................................................................................................... 61 7.10.10 Data Log Download Command ........................................................................................... 61 7.10.11 Last Data Log Record........................................................................................................... 63 7.11 Sensor Network Pass-Through Registers .................................................................................... 64 7.11.1 Sensor Network................................................................................................................... 64 7.11.2 MODBUS Protocol Pass-Through ........................................................................................ 64 7.11.3 SDI-12 Protocol Pass-Through............................................................................................. 64 4 PWS-600 User’s Manual 7.12 Password Security Registers ....................................................................................................... 66 7.12.1 Security Password ............................................................................................................... 66 7.12.2 Login Password ................................................................................................................... 66 7.13 Diagnostic Registers .................................................................................................................... 67 7.13.1 Configuration Flash Writes.................................................................................................. 67 7.13.2 Last Reset Type ................................................................................................................... 67 7.13.3 Fault Information ................................................................................................................ 68 7.13.4 High and Low Temperatures ............................................................................................... 68 7.13.5 Data Log Chip Id .................................................................................................................. 68 7.13.6 Data Log Erasure Count....................................................................................................... 68 8 MODBUS Protocol ............................................................................................................................... 69 8.1 RTU Transmission Mode ............................................................................................................. 69 8.1.1 RTU Character Format ........................................................................................................ 69 8.1.2 RTU Message Format .......................................................................................................... 70 8.2 ASCII Transmission Mode............................................................................................................ 70 8.2.1 ASCII Character Format ....................................................................................................... 70 8.2.2 ASCII Message Format ........................................................................................................ 71 8.3 MODBUS IP ................................................................................................................................. 72 8.4 Device Addressing ....................................................................................................................... 72 8.5 Data Types................................................................................................................................... 72 8.5.1 USHORT: Unsigned Short ................................................................................................... 72 8.5.2 SHORT: Signed Short .......................................................................................................... 73 8.5.3 ULONG: Unsigned Long ...................................................................................................... 73 8.5.4 LONG: Signed Long ............................................................................................................. 73 8.5.5 FLOAT: Floating Point ......................................................................................................... 73 8.5.6 STRING: Character String ................................................................................................... 74 8.5.7 TIME: Date and Time .......................................................................................................... 74 8.6 Function Codes............................................................................................................................ 75 8.6.1 Report Slave Id .................................................................................................................... 75 8.6.2 Read Registers ..................................................................................................................... 75 8.6.3 Write Multiple Registers ..................................................................................................... 77 8.6.4 Write Single Register ........................................................................................................... 78 8.6.5 Exception Response ............................................................................................................ 79 5 PWS-600 User’s Manual 1 Regulatory Information The PWS-600 has been tested and approved to be compliant to the following regulatory standards. EN61326-1: 2006, for immunity in industrial locations (CE) EN55011: 2009, Class A, Group 1, for emissions (CE) CISPR 11, Ed. 5.0, 2009-05, Class A, Group 1, for emissions CFR Title 47: FCC Part 15, Class A, for emissions Any changes or modifications not expressly approved by the party responsible for compliance could void the user's authority to operate the equipment. 1.1 FCC Statement This device has been tested and found to comply with the limits for a Class A digital device, pursuant to part 15 of the FCC Rules. These limits are designed to provide reasonable protection against harmful interference when the equipment is operated in a commercial environment. This device generates, uses and can radiate radio frequency energy and, if not installed and used in accordance with this manual, may cause harmful interference to radio communications. Operation of this device in a residential area is likely to cause harmful interference in which case the user will be required to correct the interference at his own expense. 1.2 Battery Statement This device contains a poly-carbonmonoflouride lithium coin cell battery to preserve the real-time clock when power is not applied. The Department of Transportation requires that the outside of each package that contains primary lithium batteries, regardless of the size or number of batteries, be labeled with the following statement: “PRIMARY LITHIUM BATTERIES – FORBIDDEN FOR TRANSPORT ABOARD PASSENGER AIRCRAFT”. The labeling requirement covers shipping via highway, rail, vessel or cargo-only aircraft and covers all shipments into or out of the United States. The label must be in contrasting color and the letters must be 12 mm (0.5 in) in height for packages weighing more than 30 Kg and 6 mm (0.25 in) in height for packages weighing less than 30 Kg. The lithium battery does not contain enough lithium to qualify as a reactive hazardous waste. The battery is safe for disposal in the normal municipal waste stream. 6 PWS-600 User’s Manual 2 Warranty and Assistance The PWS-600 is warranted by Prairie Wind Systems, LLC to be free from defects in materials and workmanship under normal use and service for twelve (12) months from the date of shipment unless specified otherwise. Prairie Wind Systems’ obligation under this warranty is limited to repairing or replacing, at Prairie Wind Systems’ option, defective products. The customer shall assume all costs of removing, reinstalling, and shipping defective products to Prairie Wind Systems. Prairie Wind Systems will return such products by surface carrier prepaid. This warranty shall not apply to any product which has been subjected to modification, misuse, neglect, accidents of nature, or shipping damage. This warranty is in lieu of all other warranties, expressed or implied, including warranties of merchantability or fitness for a particular purpose. Prairie Wind Systems is not liable for special, indirect, incidental, or consequential damages. Products may not be returned without prior authorization. To obtain a Returned Materials Authorization (RMA) number, contact Prairie Winds Systems at the phone number below. Please write the RMA number clearly on the outside of the shipping container. Prairie Wind Systems’ shipping address is: Prairie Wind Systems, LLC RMA #____________ 7784 Big Sky Court Windsor, CO 80550 Phone: 970.460.6066 Fax: 970.692.2434 7 PWS-600 User’s Manual 3 Overview The PWS-600 is a MODBUS slave device that periodically polls and logs data from a wide variety of analog, discrete, and smart sensors. The current readings from the sensors are available to the MODBUS master device via a block of MODBUS holding registers. Readings are polled and logged at the programmed rate and are automatically time-stamped and checksummed. When the memory is full, recording automatically wraps around to record the newest data over the oldest data. All data are stored in non-volatile flash memory which does not require power for data retention. Standard write and read register commands are used to extract logged data from the device. In addition to the data logging feature, the PWS-600 extends the capabilities of a system with these additional features. Data can be recorded and retrieved securely using the Advanced Encryption Standard with a user-defined key. The PWS-600 includes an accurate, temperature-compensated, real-time clock. Every data record is date and time stamped. Polling and logging are synchronized to the real-time clock, making it easy to align data collection across multiple systems. The PWS-600 includes a built-in solar charge controller compatible with standard 12 volt sealed lead-acid batteries, reducing a system’s overall cost and complexity. The device’s ambient temperature and input voltages are logged with every data record for enhanced data tracking and system troubleshooting, particularly in battery operated systems. The user can track battery and recharging performance in standalone and solar charged systems. The Prairie View Software that comes with the device provides a convenient means to configure the device and manage its data log. 8 PWS-600 User’s Manual 4 Specifications Case Description ABS plastic with integral mounting flanges Dimensions 6.62”L x 3.30”W x 1.30”H (16.8 x 8.4 x 3.3 cm) including flanges and connector Weight 6.1 oz (173.6 g) Ratings IP 66 and NEMA 4X Connector 44-pin D-sub socket Environmental Operating Temperature -40 to 70 °C (-40 to 158 °F) Operating Humidity 5 to 95 %RH non-condensing Storage Temperature -40 to 80 °C (-40 to 176 °F) Battery Input Input Voltage 8 to 32 Vdc Transient Protection 250 Watts Peak Sleep Current < 500 µA typical at 13.5 Vdc, RS485 and RS232 networks inactive Idle Current 500 µA typical at 13.5 Vdc, RS485 and RS232 networks inactive Active Current 30 mA typical at 13.5 Vdc, not including sensor load currents Battery Charge Controller Input Voltage 15 to 32 Vdc Transient Protection 250 Watts Peak Battery Rating 12 Vdc, 2.3 to 7.0 Ahr, Sealed Lead-Acid Peak Charge Current 1A Charging Temperature -15 to 45 °C (5 to 115 °F) charging disabled outside of this range MODBUS RS485 Transceiver Unit Load 1/8 Termination None Common Mode Range +/- 7 Vdc Transient Protection 250 Watts Peak Protocol Half-Duplex, MODBUS over Serial Line Transmission Modes RTU, ASCII, IP Addressing 1 to 247 plus broadcast Baud Rates 1200, 2400, 4800, 9600, 19200, 38400, 57600 Data Bits 7, 8 Parity Odd, Even, None Stop Bits 1, 2 9 PWS-600 User’s Manual MODBUS RS232 Transceiver Type 9-pin DTE (data terminal equipment) Port Power Switched, +5V, 275 mA Input Voltage Swing +/- 25 Vdc absolute maximum Output Voltage Swing +/- 5 Vdc minimum ESD Protection +/- 15 kV Protocol Half-Duplex, MODBUS over Serial Line Transmission Modes RTU, ASCII, IP Addressing 1 to 247 plus broadcast Baud Rates 1200, 2400, 4800, 9600, 19200, 38400, 57600 Data Bits 7, 8 Parity Odd, Even, None Stop Bits 1, 2 Smart Sensor RS485 Port Unit Load 1/8 Termination 4.75K ohm polarity terminations Common Mode Range +/- 7 Vdc Transient Protection 250 Watts Peak Protocol Half-Duplex, MODBUS over Serial Line or SDI-12 Transmission Modes RTU, ASCII Addressing 1 to 247 plus broadcast Baud Rates 1200, 2400, 4800, 9600, 19200, 38400, 57600 Data Bits 7, 8 Parity Odd, Even, None Stop Bits 1, 2 Smart Sensor SDI-12 Port SDI Version 1.3 Data Line Bidirectional, tri-state, 5V logic Transient Protection 250 Watts Peak Analog Voltage Sensor Inputs Inputs 6 single-ended or 3 differential Single-ended Ranges 0 to 5000, 0 to 2000, 0 to 1000, 0 to 500 mVdc Differential Ranges ±2000, ±1000, ±500, ±250, ±125, ±60, ±30 mVdc Resolution 0.002 %FS Accuracy ±0.05% of reading ±0.01 %FS over operating temperature range Voltage Excitation 4.096 Vdc ±0.05%, 30 mA maximum Resistive Excitation 3900 ohms ±0.15%, connected to the voltage excitation 10 PWS-600 User’s Manual Current Loop Terminations Terminations 2 Range 0 to 20 mA Resolution 0.0003 mA Accuracy ±0.3% of reading ±0.002 mA Loop Compliance 1 Vdc at 20 mA RTD Termination RTD Type Pt1000 Range -50 to 200 °C Resolution 0.1 °C Accuracy ±1 °C ± RTD accuracy Discrete Input/Outputs Channels 2 Input/Output Voltage 0 to 32 Vdc Input High Threshold 2.5 Vdc Input Low Threshold 2.0 Vdc Input Modes State, Switch Closure, Pulse Count, Frequency Switch Closure Freq. 100 Hz maximum Pulse Count 65535 pulses per record Frequency Input 65 kHz maximum, ±0.02% of reading ±1 Hz Output Type Open collector Output Current 500 mA maximum Output Modes Remote On/Off, High Alarm, Low Alarm Switched Power Ports Ports 2 switched battery Output Current 500 mA maximum Modes Remote On/Off, Scheduled On/Off, On During Measure Data Storage Memory Type 4 MB non-volatile flash Data Record Size 1 to 64 registers (2 to 128 bytes) Number of Data 131,008 (1 register per record, no encryption) Records to 25,216 (64 registers per record, with encryption) Recording Rate 1 record per second with no wraparound 1 record per 5 seconds after wraparound Recording Endurance 50,000 wraparound and erase cycles Data Security AES-128 Advanced Encryption Standard Data Retention 10 years 11 PWS-600 User’s Manual Real-Time Clock Resolution Accuracy Backup Battery Life Temperature Sensor Resolution Accuracy Voltage Sensor Resolution Accuracy 0.01 seconds +/- 1 minute per month, temperature compensated 10 years 0.1 °C +/- 3 °C 0.01 Vdc +/- 0.05 Vdc 12 PWS-600 User’s Manual 5 Installation 5.1 Environmental Considerations The PWS-600 is specified for operation in a non-condensing humidity environment. When temperature and/or humidity tolerances are exceeded, damage to internal components and/or measurement inaccuracies due to condensation may result. The device must be housed in an enclosure suited for field use. The environmental ratings of the device’s enclosure are intended as a backup to the primary field housing. The field housing should contain desiccant that is replaced or dried frequently enough to control the humidity. Effective control of the humidity is the user’s responsibility. Caution: If the battery charger is used, the field enclosure must be vented so that charge gasses from the battery do not accumulate. Failure to do so may present a risk of explosion. 5.2 Mounting the Device Mounting flanges are integral to the device’s enclosure. Six mounting holes sized for #4 screws are provided. Two or more screws should be used to mount the enclosure. 6.62” (16.81 cm) 3.30” (8.38 cm) 2.78” (7.06 cm) 6.10” (15.49 cm) 13 PWS-600 User’s Manual 5.3 Connector Pin-Out The PWS-600 uses a standard 44-pin D-subminiature socket. The sockets on the face of the connector are numbered as shown below. This is also the pin-out looking at the wiring side of the mating 44-pin Dsub plug. The function of each pin is described in the following table. Pin Name Description 1 CTS RS232 CTS output to pin 8 of a 9-pin D-sub plug 2 DTR RS232 DTR input from pin 4 of a 9-pin D-sub plug 3 GND RS232 GND to pin 5 of a 9-pin D-sub plug 4 CHG+ Positive side of solar panel charge input (parallel with pin 19) 5 CHGNegative side of solar panel charge input (parallel with pin 20) 6 BAT+ Positive side of battery or power input (parallel with pin 21) 7 BATNegative side of battery or power input (parallel with pin 22) 8 SWBAT1 Switched power output 1 (parallel with pin 23) 9 SWBAT2 Switched power output 2 (parallel with pin 24) 10 DIO1 Discrete input/output port 1 11 DIO2 Discrete input/output port 2 12 LED_OK Active low 10 mA constant current LED driver for OK status 13 LED_CHG Active low 10 mA constant current LED driver for charge status 14 LED_LOW Active low 10 mA constant current LED driver for low voltage status 15 LED_LOG Active low 10 mA constant current LED driver for log/scan status 16 TXD RS232 TXD input from pin 3 of a 9-pin D-sub plug 17 RXD RS232 RXD output to pin 2 of a 9-pin D-sub plug 18 DCD RS232 DCD output to pin 1 of a 9-pin D-sub plug 19 CHG+ Positive side of solar panel charge input (parallel with pin 4) 20 CHGNegative side of solar panel charge input (parallel with 5) 21 BAT+ Positive side of battery or power input (parallel with pin 6) 22 BATNegative side of battery or power input (parallel with pin 7) 23 SWBAT1 Switched power output 1 (parallel with pin 8) 24 SWBAT2 Switched power output 2 (parallel with pin 9) 25 SDI-12 DATA SDI-12 smart sensor network data line 26 VEX Analog excitation voltage output 27 REX Analog excitation resistor output 28 AIN5 Analog input 5 29 AIN3 Analog input 3 30 AIN1 Analog input 1 14 PWS-600 User’s Manual Pin 31 32 33 34 35 36 37 38 39 40 41 42 43 44 Name RTS DSR RI/5V WAKE RS485ARS485B+ SEN485ASEN485B+ LOOP2 LOOP1 AGND AIN6 AIN4 AIN2 Description RS232 RTS input from pin 7 of a 9-pin D-sub plug RS232 DSR output to pin 6 of a 9-pin D-sub plug RS232 RI input/5V switched output to pin 9 of a 9-pin D-sub plug WAKE input Master side RS485A- network input/output Master side RS485B+ network input/output Smart sensor RS485A- network input/output Smart sensor RS485B+ network input/output Current loop 2 resistor termination to GND Current loop 1 resistor termination to GND Analog ground reference Analog input 6 Analog input 4 Analog input 2 For reliability of the connection, the mating connector should utilize the mounting standoffs provided. The cable length should be kept as short as practical. The maximum length of cable for an RS485 network is 4000 feet (1200 meters). The maximum length of cable for an SDI-12 network is 200 feet (60 meters). 5.4 Terminal Block Accessory The optional PWS-600T Terminal Block accessory board attaches to the 44-pin connector of the PWS600 and provides terminal block connections for wiring all signals. 15 PWS-600 User’s Manual 5.5 Power Requirements The wide battery input voltage range of the PWS-600 permits operation on a 12 volt or 24 volt DC supply. The device will automatically shut down if the battery input voltage falls below 7 volts and will resume normal operation when the input voltage rises above 8 volts. Sustained operation above 32 volts will damage the device. The input is reverse polarity and transient protected. Connect the positive side of the battery or supply to the BAT+ terminal. Connect the negative side of the battery or supply to the BAT- terminal. Caution: SDI-12 sensors generally do not operate across the same wide input voltage range as the PWS-600. The SDI-12 specification calls for a 12 volt DC supply that operates between 9.6 and 16 volts. Failure to observe the input voltage limits of a sensor can result in permanent damage to the sensor and/or the PWS-600. 5.6 Charging Requirements The PWS-600 contains a built-in charge controller for charging a 12 volt sealed lead acid (SLA) battery rated between 2.3 and 7.0 amp-hours. Caution: Attempting to charge any battery type other than a 12 volt sealed lead acid battery may present an explosion hazard. Caution: Attempting to charge an SLA battery rated less than 2.3 amp-hours may cause the maximum battery charge current to be exceeded which can damage the battery and may present an explosion hazard. Caution: If the battery charger is used, the field enclosure must be vented so that charge gasses from the battery do not accumulate. Failure to do so may present a risk of explosion. Attempting to charge an SLA battery rated greater than 7.0 amp-hours may not fully charge the battery, reducing the battery life and leaving the system susceptible to brown-out conditions. The charge controller is optimized for use with a solar panel in the 10 watt range with a 15 to 32 volt output; however, any comparable DC source, such as a mains connected DC power supply, can be used. Connect the positive side of the solar panel or charging supply to the CHG+ terminal. Connect the negative side of the solar panel or charging supply to the CHG- terminal. If the charging feature is not required, the CHG terminals should be left unconnected. It is not recommended to use the charger without a battery – if a DC power supply is being used instead of a battery, it should be connected to the BAT terminals and the CHG terminals left unconnected. This will result in the lowest possible power consumption. The charger input is reverse polarity and transient protected; however, sustained operation above 32 volts will damage the device. The charger output is protected against a reversed battery and battery voltages higher than 12 volts. 16 PWS-600 User’s Manual 5.7 Status Indicators The PWS-600 provides four system status indicators. The PWS-600T terminal block provides colored LED indicators. When power is applied to the device, all indicators will light in sequence as a lamp test. The status is then displayed for 30 seconds, after which the indicators are turned off to conserve power. Press the WAKE button to display the status for an additional 30 seconds. Note: Jumper the WAKE terminal to GND to display status continuously. This can be useful in an industrial setting when power consumption is less of a concern, or when troubleshooting power problems. Three of the LED indicators provide power supply status as shown below. ON: battery input above low threshold OFF: battery input below low threshold OFF: no charge input detected OFF: no charge input detected OFF: battery input above low threshold ON: battery input below low threshold ON: battery input above low threshold ON: battery input above low threshold FLASHING: battery is charging ON: battery is charged OFF: no charge faults OFF: no charge faults ON: battery input above low threshold OFF: battery input below low threshold ON: charge voltage detected ON: charge voltage detected ON: charging fault ON: charging fault charge input too low temperature outside charge range battery is not accepting charge 17 charge input too low temperature outside charge range battery is not accepting charge PWS-600 User’s Manual The blue LED indicates the logging state of the device as shown below. OFF: Logging is disabled. The LED will pulse ON when a manual scan of the sensors is triggered. ON: Logging is enabled. The LED will pulse OFF when a log scan of the sensors triggered. FLASHING: Logging has been paused for a preset amount of time. 5.8 Communication Communication with the data logger is done using the MODBUS serial line protocol over the RS485 or RS232 interface. The device is preconfigured with the MODBUS standard settings of 19200 baud, 8 data bits, even parity, 1 stop bit, RTU transmission mode, and device address 1. 5.8.1 RS485 Signals RS485 communication is done using signals on terminal block TB10 labeled “PLC”. Three signals are required to be connected to the master device: 485B+ is the positive transceiver signal, 485A- is the negative transceiver signal, and GND is the ground reference. No termination resistor is provided internally. In most applications, no termination resistor is necessary. If required, a resistor may be added externally. The maximum offset of the transceiver signals from GND 7 volts. Both signals are transient protected. 5.8.2 RS232 Signals RS232 communication is done using the 9-pin D-sub connector labeled “MODEM/PLC”. Connection to a PC or equivalent device requires the use of a null modem cable. Connection to a modem requires a regular straight-through cable. 18 PWS-600 User’s Manual 6 Getting Started The PWS-600 communicates as a slave device using the industry standard MODBUS protocol for serial devices. This section provides guidelines to getting the device up and running. If the device is not already wired, follow the installation instructions provided in the previous section. Section 7 describes the device register map. The PWS-600 uses the MODBUS Holding Registers data model exclusively. All of the device functionality is accessed using the MODBUS read and write holding register commands. Section 8 provides the details of the MODBUS protocol for users that are not familiar with MODBUS. Also refer to Section 8 for device-specific implementation information, such as the organization of registers into data types. 6.1 Device Configuration Configuring the device consists of writing user-specific settings to one or more of the device registers. The Prairie View Software supplied with the device provides a convenient, step-by-step means to configure the device and is the recommended place to start. Refer to the software manual for instructions on installing the software on your desktop computer, laptop computer, or mobile device. It is also possible to configure the device by directly writing to the registers using a master device with pass-through capability, or using a third-party software tool. 6.2 Network Communication Settings Before the device is placed on an active RS485 network, it must be configured to match the network’s communication settings and be assigned a unique device address. The device is preconfigured with the MODBUS standard settings of 19200 baud, 8 data bits, even parity, 1 stop bit, RTU transmission mode, and device address 1. Refer to the Device Configuration section of the device register map to change the device address. Refer to the Communication Configuration Registers section of the device register map if any of the communication settings need to be changed. 6.3 Site Identification If the user is collecting data from multiple devices located at different sites, it is recommended that the Site Id register be written with a unique value for each site. The Site Id is recorded with every data record, making it easier to track the data once it has been retrieved from a device. 19 PWS-600 User’s Manual 6.4 Configure the Sensor Networks Refer to section 7.5 to configure the sensor networks to match the sensor requirements. The Prairie View software helps to automate this process; however, the configuration registers can also be written directly using third-party software tools. 6.5 Configure the Data Log The data log configuration registers must be programmed so that the PWS-600 will know how to acquire data from the sensors and at what interval, refer to section 7.6. The Prairie View software helps to automate this process; however, the configuration registers can also be written directly using thirdparty software tools. Once the log is configured, set the Log Enable register to one to start logging. Data is then acquired and logged at the specified interval. The most recent acquisition from the sensors is available in the data log polling registers. 20 PWS-600 User’s Manual 7 Register Map The PWS-600 uses the MODBUS Holding Registers data model exclusively. All of the device functionality is accessed using the MODBUS read and write holding register commands. The organization of the register map is kept consistent among Prairie Wind System devices as much as practical. 7.1 Device Configuration Registers The device configuration registers identify the device, its site location, and its basic configuration. Device Configuration Registers Register Number 1000 1001 1002 1004 1005 1006 1007 1008 1024 1056 1057 Size (Registers) 1 1 2 1 1 1 1 16 32 1 1 Data Type USHORT USHORT ULONG USHORT USHORT USHORT USHORT STRING USHORT USHORT USHORT Access R R R R R R R/W R/W R/W R/W R/W Name Register Map Version Device Id Serial Number Firmware Version Boot Code Version Hardware Version Site Id Site Name Site Information Device Address Low Voltage Warning Threshold Default Value 2 600 0 0 0 1 9600 mV 7.1.1 Register Map Version This is the version of the register map supported by the device. This provides for the modification of the register map at a future date and detection of the difference by the master device. 7.1.2 Device Id This is the model number of the device. It can be used to validate the system configuration and to identify the available feature set. 7.1.3 Serial Number This is the serial number of the device. The master device can read the serial number of the device to provide system traceability. 7.1.4 Firmware Version This register identifies the firmware version of the device. 7.1.5 Boot Code Version This register identifies the boot code version of the device. The boot code supports field upgrades of the device firmware. The boot code on a given device will not change with firmware upgrades. Its version is made available to support field upgrade utilities. 21 PWS-600 User’s Manual 7.1.6 Hardware Version This register contains the hardware version of the device. 7.1.7 Site Id The Site Id is a general-purpose, non-volatile, read/write register. The contents of this register are recorded with each logged data record, permitting data to be traced to a particular site or system. 7.1.8 Site Name The Site Name identifies the site to a user. The 16-register, non-volatile string holds up to 32 characters. 7.1.9 Site Information Site Information is comprised of 32, general-purpose, non-volatile, read/write registers. Use these registers to hold system configuration and/or calibration data. The format of the data contained in the registers is defined by the user. They can be used as individual registers or combined to form ULONG, FLOAT or STRING data types. These registers should not be used to hold data that changes frequently. 7.1.10 Device Address The device address is used to address the PWS-600 on the MODBUS network. The valid range for the device address is 1 to 247. The default value is 1. When this register is written, the response will be returned with the previous address. All subsequent commands must be sent with the new address. The register is non-volatile. The address is used on both the RS485 and RS232 interfaces. 7.1.11 Low Voltage Warning Threshold If the battery input voltage to the device is less than or equal to this threshold, the low voltage warning status bit is set in the device status register. The threshold is set in millivolts and can range from 8000 to 32000 mV (8 to 32 volts). Attempting to write a value outside this range will generate an exception response with the ILLEGAL WRITE VALUE exception code. This threshold also used by the LED indicators to alert the user to a low battery. 22 PWS-600 User’s Manual 7.2 Device Command Register The device command register is used to issue commands to the device. The register is isolated from other registers in the register map to help prevent accidental writing. Device Command Register Register Number 1065 Size (Registers) 1 Data Type USHORT Access R/W Name Device Command Default Value 0 Writing a value shown in the following table will issue the corresponding device command. Attempting to write any other value will generate an exception response with the ILLEGAL WRITE VALUE exception code. Reading the register always returns zero. Device Commands Value 56573 (0xDCFD) Name Factory Defaults 56557 (0xDCED) Erase Data Log 56541 (0xDCDD) Download Data Log 56320 (0xDC00) Security Mode 56480 (0xDCA0) Read Sensors Description Resets device configuration registers to their factory default values. The encryption key is erased and encryption is disabled. Does not affect the communication settings, the data log or the diagnostic registers. This command is not allowed while data logging is enabled. Erases the data log. Data cannot be recovered after issuing this command. The response message is sent after erasure is complete. Typical response time is 30 seconds. The maximum response time is 90 seconds. Erasing the data log does not affect the current encryption key. This command is not allowed while data logging is enabled. Starts the fast data download process. The maximum response time to this command is 1000 milliseconds. Refer to the Data Retrieval Registers section for a description of the command. Places the device in the security mode, requiring a master device to log in with a password to regain access. The command has no effect if password security is disabled. Causes the PWS-600 to read data from its sensors immediately using the command sequence currently specified for data logging. Sensor values are placed in the last sensor reading registers but are not logged. The device status register should be monitored to determine when sensor values are valid. 23 PWS-600 User’s Manual Device Commands (continued) Value 56481 (0xDCA1) Name SDI-12 Command 56482 (0xDCA2) SDI-12 over RS485 Command 56482 (0xDCA2) Clear Sensor Diagnostics Description Sends the command contained in the SDI-12 pass-through registers to a sensor located on the SDI-12 network. The data log must be disabled or paused in order to use this command. Sends the command contained in the SDI-12 pass-through registers to a sensor located on the SDI-12 network. The data log must be disabled or paused in order to use this command. Clears sensor network message counters. 24 PWS-600 User’s Manual 7.3 Device Status Registers The device status registers allow the master device to obtain the current operating status of the device. Device Status Registers Register Number 1070 1071 1072 1073 1074 Size (Registers) 1 1 1 1 4 Data Type USHORT SHORT USHORT USHORT TIME Access R/W R R R R/W Name Device Status Ambient Temperature Input Voltage Charge Voltage Date and Time Default Value 0 °C x 10 mV 0 mV UTC 7.3.1 Device Status This register contains device operational status. Each bit in the register represents a status value as defined in the following table. Device Status Register Bit 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Mask 0x0001 0x0002 0x0004 0x0008 0x0010 0x0020 0x0040 0x0080 0x0100 0x0200 0x0400 0x0800 0x1000 0x2000 0x4000 0x8000 Name Power Outage Low Voltage Clock Battery Clock Fault Clock Adjusted Device Fault Temperature Sensor Busy Encryption Enabled Reserved Reserved Reserved Reserved Reserved Reserved Reserved Description A power outage caused a hardware reset and recovery The input voltage is below the warning threshold Timekeeping backup battery is low Timekeeping restarted at 2000-01-01 00:00:00.00 Date and Time were changed A device fault caused a reset and recovery Device operating temperature range was exceeded Sensor command sequence is busy (new values are not valid) Encryption key is non-zero, data records will be encrypted Always returns 0 Always returns 0 Always returns 0 Always returns 0 Always returns 0 Always returns 0 Always returns 0 The status register is non-volatile: information is retained across a power outage. The status represents events that occurred since the last time the register was cleared. The device status is recorded with each logged data record. The status register can be cleared at any time by writing zero to it. Any conditions that persist or reoccur after being cleared will cause those bits to be set again. Attempting to 25 PWS-600 User’s Manual write any value other than zero to clear the register will generate an exception response with the ILLEGAL WRITE VALUE exception code. 7.3.2 Ambient Temperature This register measures and returns the ambient temperature in degrees Celsius (°C) multiplied by 10. For example, an ambient temperature of 23.7 °C will be read as 237. 7.3.3 Input Voltage This register measures and returns the battery input voltage applied to the device in millivolts (mV). For example, a battery input voltage of 13.54 volts will be read as 13540. 7.3.4 Charge Voltage This register measures and returns the charging voltage applied to the device in millivolts (mV). For example, a charge input voltage of 19.76 volts will be read as 19760. 7.3.5 Date and Time These registers hold the current date and time as a TIME data type. The device is programmed to Universal Coordinated Time (UTC) at the factory and generally does not need to be adjusted. If the clock should require adjustment, it is recommended that UTC continue to be used as the clock does not provide for automatic adjustments for local Daylight Savings Time. The time stamps of stored data may be post-processed to any local time as needed for reporting or analysis. When setting the clock, the year must be in the range 2000 to 2399. Leap years in this range are correctly handled. Attempting to write an invalid date or time will generate an exception response with the ILLEGAL WRITE VALUE exception code. Setting the clock will clear the clock fault bit and set the clock adjusted bit in the status register. 26 PWS-600 User’s Manual 7.4 Communication Configuration Registers These registers specify the communication configuration of the master RS485 and RS232 ports. Register Number 1101 1102 1103 1104 1105 1106 Size (Registers) 1 1 1 1 1 1 Communication Configuration Registers Data Type Access Name USHORT R/W Communication Settings USHORT R/W Message Timeout (ms) USHORT R/W Sleep Timeout (ms) USHORT R/W Good Message Counter USHORT R/W Bad Message Counter USHORT R/W Exception Response Counter Default Value 276 0 0 0 0 0 7.4.1 Communication Settings This register sets the communication parameters of the RS485 and RS232 ports. The default value is 276 (0x114) for RTU mode at 19200 baud, 8 bits, even parity, and 1 stop bit. The register is non-volatile. 15 Reserved 14 13 12 11 (default) RTU protocol ASCII protocol IP protocol (default) 1 stop bit 2 stop bits (default) Even parity Odd parity No parity 7 data bits (default) 8 data bits 1200 baud 2400 baud 4800 baud 9600 baud (default) 19200 baud 38400 baud 57600 baud 10 0 0 1 Register Bits Protocol Stop 9 8 7 0 1 1 0 0 0 0 1 Parity 6 5 0 0 1 Data 4 3 Baud Rate 2 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 1 1 0 0 1 0 1 0 1 0 1 0 When this register is written, the response will be returned at the previous communication settings. All subsequent commands must be sent at the new settings. Attempting to write any combination of bits not listed in the above table will result in an exception response with the ILLEGAL WRITE VALUE exception code. Note that 7 data bits in the RTU transmission mode is an invalid combination; the device will respond with an exception and the ILLEGAL WRITE VALUE exception code. 27 PWS-600 User’s Manual 7.4.2 Message Timeout If RTU or IP is selected, this register specifies the amount of idle time that must elapse before the device recognizes the end of a message. A value of zero specifies a timeout that is selected automatically based on the selected baud rate as described in the RTU Message Format section. If the master device is unable to meet the default timing requirements, a fixed timeout from 5 to 50 milliseconds may be specified. The register is non-volatile. If ASCII mode is selected, this register specifies the maximum time that may elapse between characters within a message when the ASCII transmission mode is selected. Intervals exceeding the timeout value will cause the device to assume an error has occurred and discard the message. The valid range for the timeout in ASCII mode is 1000 to 60000 milliseconds (1 to 60 seconds). The recommended setting for most applications is 1000 milliseconds. 7.4.3 Sleep Timeout This register specifies the amount of time allowed to elapse with no network activity before the device enters its low power sleep mode. The valid range for the timeout is 0, or 1000 to 60000 milliseconds (1 to 60 seconds). A value of zero disables the low power sleep mode. The register is non-volatile. After the device enters its sleep mode, any activity detected on the network will cause the device to wake; however, the contents of the first message will most likely be missed. If this first message was a command addressed to the device, the master device will receive no response and must retry the command. Afterwards, as long as there is network activity more frequent than the sleep timeout setting, the device will remain awake and process commands. Note: The sleep timeout takes precedence over the message timeout. If the sleep timeout is used (non-zero) it should be set greater than or equal to the message timeout. 7.4.4 Message Counters The message counter registers provide diagnostic information for troubleshooting communication problems. Each counter is reset by writing it to zero. The counters roll back to zero after the maximum count value of 65535 is reached. The registers are volatile and will reset to zero if power is removed. The Good Message Counter counts properly formatted messages that are addressed to the device. The Bad Message Counter tracks the number of improperly formatted messages, such as those with a bad CRC. The Exception Response Counter counts the number of messages received that were rejected with an exception response. 28 PWS-600 User’s Manual 7.5 Sensor Networks The PWS-600 uses the concept of sensor networks to organize its sensor data logging features. Four sensor networks are provided, numbered as shown below. 1 – RS485 Smart Sensor Network 2 – SDI-12 Smart Sensor Network 3 – Analog Sensor Network 4 – Discrete Sensor Network Each sensor network has features common to all sensors on that network, and it is these features that are discussed in this section. The data log configuration sensor command group registers specify how to access and log sensors on a network. 7.5.1 RS485 Smart Sensor Network RS485 sensor communication uses the signals on terminal block TB9, labeled “RS485 SENSORS”. The terminal block provides terminals for power, ground, and the RS485 transceiver signals. 485B+ is the positive transceiver signal and 485A- is the negative transceiver signal. The 485B+ signal is provided with a 4.75K ohm resistor to the device’s internal +3.3 volt supply. The 485A- signal is provided with a 4.75K ohm termination resistor to GND. No signal termination resistor is provided internally. In most low power applications, no additional termination resistor is necessary. If required, a resistor may be added externally. The maximum offset of the signals from the GROUND at pin 1 is 7 volts. Both signals are transient protected. The RS485 sensor network can be configured to operate using one of three protocols: MODBUS RTU, MODBUS ASCII, or SDI-12. A group of eight registers define and configure the network protocol. These eight registers must be read and written within a single command. The format of these eight registers varies based on the selected network protocol. The register block may not be written when logging is enabled. Attempting to write the register block when logging is enabled will generate an exception response with the READ-ONLY REGISTER exception code. 7.5.1.1 MODBUS RTU Sensor Network Configuration The following table defines the RS485 sensor network configuration registers when configured to use the MODBUS RTU protocol. Register 1803 1804 1805 1806 1807 1808 Size (Registers) 1 1 1 1 1 1 RS485 Sensor Network Configuration Group Data Type Access Name USHORT R/W Communication Settings USHORT R/W Message Timeout (ms) USHORT R/W Network Wake Delay (ms) USHORT R/W Retries (0 to 5) USHORT R/W Sentinel Value USHORT R/W Good Message Counter 29 Default Value 0 0 1 0xFFFF 0 PWS-600 User’s Manual 1809 1810 1 1 USHORT USHORT R/W R/W Bad Message Counter Exception Response Counter 0 0 7.5.1.2 Communication Settings This register sets the protocol and the communication parameters for the network. Note that 7 data bits in the RTU transmission mode is an invalid combination; the device will respond with an exception and the ILLEGAL WRITE VALUE exception code. 15 0 14 0 13 0 Protocol 12 11 0 0 Register Bits Stop 10 9 8 7 0 0 1 1 stop bit 0 2 stop bits 1 Even parity Odd parity No parity 7 data bits 8 data bits 1200 baud 2400 baud 4800 baud 9600 baud 19200 baud 38400 baud 57600 baud Parity 6 5 0 0 1 Data 4 3 Baud Rate 2 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 1 1 0 0 1 0 1 0 1 0 1 0 For example, to configure the network for MODBUS RTU at 19200 baud, 8 data bits, even parity, and 1 stop bit, set this register to 276. 7.5.1.3 Message Timeout The message timeout register specifies the amount of idle time that must elapse before the device recognizes the end of an RTU message. The default value of zero signifies a timeout that is selected automatically based on the selected baud rate as described in the RTU Message Format section. If any slave device on the network is unable to meet the default timing requirements, a fixed timeout from 5 to 50 milliseconds may be specified. The default setting is zero. 7.5.1.4 Network Wake Delay Some sensors may enter a low power mode if no network activity is detected for some period of time. While in this mode, the sensor may not respond immediately to the first command it receives. To accommodate sensors with this behavior, the device can be programmed to “wake” the sensor network before starting requests for data. 30 PWS-600 User’s Manual If the Network Wake Delay is set to a non-zero value, the device will broadcast a Report Slave Id command on the sensor network. This will generate network activity that will cause sensors to exit their low power mode. Because this is a broadcast of a read command, sensors should not respond to the command. The device will then delay the number of milliseconds specified by the Network Wake Delay register before requesting data from the sensors. If the Network Wake Delay is set to zero, this broadcast message is not sent. 7.5.1.5 Retries This register specifies the number of times the device is to resend a command if a sensor does not respond within the timeout specified for that command. Zero specifies no retries; only one command attempt will be made. If the sensor fails to respond to a command after the allowed number of retries, the sensor will be considered unresponsive and the sentinel value will be substituted for all registers that were expected by the command. 7.5.1.6 Sentinel Value The sentinel value is written in place of the data values for all registers that cannot be read by a command. This will occur if a sensor fails to respond to a read register command, or if the sensor returns an exception response. 7.5.1.7 Message Counters The message counter registers provide diagnostic information for troubleshooting communication problems. Each counter is reset by writing it to zero. The counters roll back to zero after the maximum count value of 65535 is reached. The registers are volatile and will reset to zero if power is removed. The Good Message Counter counts properly formatted messages that are returned to the device. The Bad Message Counter tracks the number of improperly formatted messages, such as those with a bad CRC. The Exception Response Counter counts the number of messages that were rejected with an exception response. 31 PWS-600 User’s Manual 7.5.1.8 MODBUS ASCII Sensor Network Configuration The following table defines the RS485 sensor network configuration registers when configured to use the MODBUS ASCII protocol. Register Offset 1803 1804 1805 1806 1807 1808 1809 1810 Size (Registers) 1 1 1 1 1 1 1 1 RS485 Sensor Network Configuration Group Data Type Access Name USHORT R/W Communication Settings USHORT R/W Message Timeout (ms) USHORT R/W Network Wake Delay (ms) USHORT R/W Retries (0 to 5) USHORT R/W Sentinel Value USHORT R/W Good Message Counter USHORT R/W Bad Message Counter USHORT R/W Exception Response Counter Default Value 1000 0 1 0xFFFF 0 0 0 7.5.1.9 Communication Settings This register sets the protocol and the communication parameters for the network. 15 0 14 0 13 0 Protocol 12 11 0 0 Register Bits Stop 10 9 8 7 0 1 0 1 stop bit 0 2 stop bits 1 Even parity Odd parity No parity 7 data bits 8 data bits 1200 baud 2400 baud 4800 baud 9600 baud 19200 baud 38400 baud 57600 baud Parity 6 5 0 0 1 Data 4 3 Baud Rate 2 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 1 1 0 0 1 0 1 0 1 0 1 0 For example, to configure the network for MODBUS ASCII at 19200 baud, 8 data bits, even parity, and 1 stop bit, set this register to 532. 32 PWS-600 User’s Manual 7.5.1.10 Message Timeout The message timeout register specifies the maximum time that may elapse between characters within a message. Intervals exceeding the timeout value will cause the device to assume an error has occurred and discard the message. The valid range for the timeout is 1000 to 60000 milliseconds (1 to 60 seconds). The default setting is 1000 milliseconds. 7.5.1.11 Network Wake Delay Some sensors may enter a low power mode if no network activity is detected for some period of time. While in this mode, the sensor may not respond immediately to the first command it receives. To accommodate sensors with this behavior, the device can be programmed to “wake” the sensor network before starting requests for data. If the Network Wake Delay is set to a non-zero value, the device will broadcast a Report Slave Id command on the sensor network. This will generate network activity that will cause sensors to exit their low power mode. Because this is a broadcast of a read command, sensors should not respond to the command. The device will then delay the number of milliseconds specified by the Network Wake Delay register before requesting data from the sensors. If the Network Wake Delay is set to zero, this broadcast message is not sent. 7.5.1.12 Retries This register specifies the number of times the device is to resend a command if a sensor does not respond within the timeout specified for that command. Zero specifies no retries; only one command attempt will be made. If the sensor fails to respond to a command after the allowed number of retries, the sensor will be considered unresponsive and the sentinel value will be substituted for all registers that were expected by the command. 7.5.1.13 Sentinel Value The sentinel value is written in place of the data values for all registers that cannot be read by a command. This will occur if a sensor fails to respond to a read register command, or if the sensor returns an exception response. 7.5.1.14 Message Counters The message counter registers provide diagnostic information for troubleshooting communication problems. Each counter is reset by writing it to zero. The counters roll back to zero after the maximum count value of 65535 is reached. The registers are volatile and will reset to zero if power is removed. The Good Message Counter counts properly formatted messages that are returned to the device. The Bad Message Counter tracks the number of improperly formatted messages, such as those with a bad CRC. The Exception Response Counter counts the number of messages that were rejected with an exception response. 33 PWS-600 User’s Manual 7.5.1.15 SDI-12 over RS485 Sensor Network Configuration The following table defines the RS485 sensor network configuration registers when configured to use the SDI-12 protocol. Register Offset 1803 1804 1805 1806 1808 1809 1810 Size (Registers) 1 1 1 2 1 1 1 RS485 Sensor Network Configuration Group Data Type Access Name USHORT R/W Communication Settings USHORT R/W Break Retries (0 to 5) USHORT R/W Command Retries (0 to 5) FLOAT R/W Sentinel Value USHORT R/W Good Message Counter USHORT R/W Bad Message Counter USHORT R/W Retry Counter Default Value 2048 2 2 99999 0 0 0 7.5.1.16 Communication Settings This register sets the protocol and communication parameters for the network. 15 0 14 0 13 0 Protocol 12 11 0 1 Register Bits Stop 10 9 8 7 0 0 0 1 stop bit 0 Even parity 7 data bits 1200 baud Parity 6 5 0 Data 4 3 Baud Rate 2 1 0 0 0 0 0 0 0 This register can only be written with a value of 2048 when the SDI-12 protocol is selected. 7.5.1.17 Retry Registers These registers specify the number of times the device is to resend a break and command if an SDI-12 sensor does not respond within the required timeout. Zero specifies no retries; only one break and one command attempt will be made. If the sensor fails to respond to a command after the allowed number of retries, the sensor will be considered unresponsive and the SDI-12 sentinel value will be substituted for all values that were expected by the command. Each break attempt is followed by the specified number of command attempts. For example, if break retries is set to 1 and command retries is set to 2: 1. The device will first send a break followed by the command. 2. If no response is received, the command will be retried two more times. 34 PWS-600 User’s Manual 3. If still no response is received, the break will be retried, followed by three more attempts to send the command. 4. If still no response is received, all values that we expected to be received will be logged with the SDI-12 sentinel value. 7.5.1.18 Sentinel Value The sentinel value is written in place of the measurement value for all sensor measurements that cannot be read by a command. This will occur if an SDI-12 sensor fails to respond to a command, or if a command is improperly structured to log more measurements than the sensor will return. 7.5.1.19 Message Counters The message counter registers provide diagnostic information for troubleshooting communication problems. Each counter is reset by writing it to zero. The counters roll back to zero after the maximum count value of 65535 is reached. The registers are volatile and will reset to zero if power is removed. The Good Message Counter counts properly formatted messages that are returned to the device. The Bad Message Counter tracks the number of improperly formatted messages, such as those with a bad CRC. The Exception Response Counter counts the number of messages that received no response. 7.5.2 SDI-12 Smart Sensor Network The SDI-12 sensor network is a dedicated SDI-12 port that only supports the SDI-12 protocol. SDI-12 signals are available on terminal block TB8, labeled “SDI-12 SENSORS”. Three signals are used for power, ground, and data. The data line is a bidirectional, tri-state signal using 5 volt logic that is capable of driving up to 10 SDI-12 sensors. The maximum length of cable between the PWS-600 and any SDI-12 sensor is 200 feet (60 meters). A group of eight registers define and configure the network. These eight registers must be read and written within a single command. The register block may not be written when logging is enabled. Attempting to write the register block when logging is enabled will generate an exception response with the READ-ONLY REGISTER exception code. Register Offset 1813 1814 1815 1816 1818 1819 1820 Size (Registers) 1 1 1 2 1 1 1 SDI-12 Sensor Network Configuration Group Data Type Access Name USHORT R/W Communication Settings USHORT R/W Break Retries (0 to 5) USHORT R/W Command Retries (0 to 5) FLOAT R/W Sentinel Value USHORT R/W Good Message Counter USHORT R/W Bad Message Counter USHORT R/W Retry Counter 35 Default Value 2048 2 2 99999 0 0 0 PWS-600 User’s Manual 7.5.2.1 Communication Settings This register sets the protocol and communication parameters for the network. This register must be written with a value of 2048. 15 0 14 0 13 0 Protocol 12 11 0 1 Register Bits Stop 10 9 8 7 0 0 0 1 stop bit 0 Even parity 7 data bits 1200 baud Parity 6 5 0 Data 4 3 Baud Rate 2 1 0 0 0 0 0 0 0 7.5.2.2 Retry Registers These registers specify the number of times the device is to resend a break and command if an SDI-12 sensor does not respond within the required timeout. Zero specifies no retries; only one break and one command attempt will be made. If the sensor fails to respond to a command after the allowed number of retries, the sensor will be considered unresponsive and the SDI-12 sentinel value will be substituted for all values that were expected by the command. Each break attempt is followed by the specified number of command attempts. For example, if break retries is set to 1 and command retries is set to 2: 1. The device will first send a break followed by the command. 2. If no response is received, the command will be retried two more times. 3. If still no response is received, the break will be retried, followed by three more attempts to send the command. 4. If still no response is received, all values that we expected to be received will be logged with the SDI-12 sentinel value. 7.5.2.3 Sentinel Value The sentinel value is written in place of the measurement value for all sensor measurements that cannot be read by a command. This will occur if an SDI-12 sensor fails to respond to a command, or if a command is improperly structured to log more measurements than the sensor will return. 7.5.2.4 Message Counters The message counter registers provide diagnostic information for troubleshooting communication problems. Each counter is reset by writing it to zero. The counters roll back to zero after the maximum count value of 65535 is reached. The registers are volatile and will reset to zero if power is removed. 36 PWS-600 User’s Manual 7.5.3 Analog Sensor Network A group of eight registers define and configure the network. These eight registers must be read and written within a single command. The register block may not be written when logging is enabled. Attempting to write the register block when logging is enabled will generate an exception response with the READ-ONLY REGISTER exception code. Register Offset 1823 1824 1825 1826 1827 1828 1829 1830 Size (Registers) 1 1 1 1 1 1 1 1 Analog Sensor Network Configuration Group Data Type Access Name USHORT R/W Excitation Enable and Delay (ms) USHORT R/W Reserved USHORT R/W Reserved USHORT R/W Reserved USHORT R/W Reserved USHORT R/W Reserved USHORT R/W Reserved USHORT R/W Reserved Default Value 0 0 0 0 0 0 0 0 7.5.3.1 Excitation Enable and Delay Some analog sensors require an excitation signal to be applied in order to make a measurement. The PWS-600 provides a voltage excitation (VEX) on terminal block TB2, and a resistive excitation (REX) on terminal block TB1. In order to conserve power, these excitation outputs are normally turned off. This register specifies how long to allow sensor outputs to stabilize after turning on excitation before taking analog measurements. The delay is specified in milliseconds and can range from 0 to 65535 milliseconds. The amount of delay will have an impact on the fastest log interval that can be achieved. Setting this register to zero disables excitation outputs (they will not be turned on during measurements). 37 PWS-600 User’s Manual 7.5.4 Discrete Sensor Network The discrete sensor network requires no configuration at this time. A group of eight registers is reserved to support future configuration options. These eight registers must be read and written within a single command. The register block may not be written when logging is enabled. Attempting to write the register block when logging is enabled will generate an exception response with the READ-ONLY REGISTER exception code. Register Offset 1833 1834 1835 1836 1837 1838 1839 1840 Size (Registers) 1 1 1 1 1 1 1 1 Discrete Sensor Network Configuration Group Data Type Access Name USHORT R/W Reserved USHORT R/W Reserved USHORT R/W Reserved USHORT R/W Reserved USHORT R/W Reserved USHORT R/W Reserved USHORT R/W Reserved USHORT R/W Reserved 38 Default Value 0 0 0 0 0 0 0 0 PWS-600 User’s Manual 7.6 Data Log Configuration Registers These registers set the polling and data log schedule. All data log configuration registers are nonvolatile. Data Log Configuration Registers Register Number 1500 1501 1502 1506 1507 1508 1509 1517 1525 1533 1541 1549 1557 1565 1573 1581 1589 1597 1605 1613 1621 1629 1637 1645 1653 1661 1669 1677 Size (Registers) 1 1 4 1 1 1 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 Data Type USHORT USHORT TIME USHORT USHORT USHORT USHORT USHORT USHORT USHORT USHORT USHORT USHORT USHORT USHORT USHORT USHORT USHORT USHORT USHORT USHORT USHORT USHORT USHORT USHORT USHORT USHORT USHORT Access R/W R/W R R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W Name Log Enable (0 = disabled, 1 = enabled) Log Pause (seconds) Next Scheduled Record Log Interval (seconds) Log Offset (seconds) Number of Sensor Commands (0 to 32) Sensor Command 1 Sensor Command 2 Sensor Command 3 Sensor Command 4 Sensor Command 5 Sensor Command 6 Sensor Command 7 Sensor Command 8 Sensor Command 9 Sensor Command 10 Sensor Command 11 Sensor Command 12 Sensor Command 13 Sensor Command 14 Sensor Command 15 Sensor Command 16 Sensor Command 17 Sensor Command 18 Sensor Command 19 Sensor Command 20 Sensor Command 21 Sensor Command 22 39 Default Value 0 0 UTC 3600 0 0 PWS-600 User’s Manual Data Log Configuration Registers Register Number 1685 1693 1701 1709 1717 1725 1733 1741 1749 1757 Size (Registers) 8 8 8 8 8 8 8 8 8 8 Data Type USHORT USHORT USHORT USHORT USHORT USHORT USHORT USHORT USHORT USHORT Access R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W Name Sensor Command 23 Sensor Command 24 Sensor Command 25 Sensor Command 26 Sensor Command 27 Sensor Command 28 Sensor Command 29 Sensor Command 30 Sensor Command 31 Sensor Command 32 Default Value 7.6.1 Log Enable This non-volatile register can be set to one of the following values. Attempting to write any other value will result in an exception response with the ILLEGAL WRITE VALUE exception code. 0: Data log disabled. The next scheduled record registers will return zero. The data log configuration can be edited. 1: Data log enabled. The next scheduled record registers will return the date and time of the next scheduled log record per the defined schedule. Data log configuration registers are readonly and cannot be edited. Attempting to write a log configuration register while the data log is enabled or paused will result in an exception response with the READ-ONLY REGISTER exception code. 7.6.2 Log Pause Use this register to pause the data log for a specified period of time, such as when pass-through access to a sensor is necessary for calibration or maintenance. This register can only be written when the data log is enabled. When the data log is disabled, this register will return zero. Writing a value from 1 to 65535 will pause the data log for the specified number of seconds. While paused, the next scheduled record registers will return zero, the data log configuration registers remain read-only and cannot be edited, and pass-through communication is enabled. Data logging will resume when the master device sets Log Pause back to zero, or will resume automatically when Log Pause counts down to zero. Attempting to write a log configuration register while the data log is enabled or paused will result in an exception response with the READ-ONLY REGISTER exception code. 40 PWS-600 User’s Manual 7.6.3 Next Scheduled Record These registers return the date and time of the next scheduled record. These registers return zero if the log is disabled or paused. 7.6.4 Log Interval The log interval specifies the time between data records in seconds. The log interval can range from 0 to 43200 seconds (12 hours or 2 records per day) and must specify a whole number of records per day. Setting the log interval to zero specifies an interval of 86400 seconds (24 hours or 1 record per day). Attempting to write a value that would not result in a whole number of records per day will result in an exception response with the ILLEGAL WRITE VALUE exception code. Data records are synchronized with the real-time clock. The first data record each day is always collected at 00:00:00 plus the log offset value. If, for example, the log interval is set to 21600 seconds (6 hours) and the log offset is zero, the PWS-600 will log 4 records per day at 00:00:00, 06:00:00, 12:00:00, and 18:00:00. 7.6.5 Log Offset The log offset specifies the offset of the first record from 00:00:00 each day. The offset is specified in seconds and can range from 0 to one second less than the log interval. Attempting to write a value outside this range will result in an exception response with the ILLEGAL WRITE VALUE exception code. Note: If writing a new log interval would cause the log offset value to become invalid, the log offset will be automatically reset to zero. The log offset provides some flexibility in synchronizing daily data records with other system activities. For example, if the log interval is set to 21600 seconds (6 hours) and the log offset is set to 7200 seconds (2 hours), the PWS-600 will still collect 4 records per day, but the records will be offset to 02:00:00, 08:00:00, 14:00:00, and 20:00:00. 7.6.6 Number of Sensor Commands This register specifies the number of sensor commands that will be used to read data from the sensors. Up to 32 commands can be used to read up to 64 registers. Sensor commands are executed sequentially beginning with sensor command 1. If zero is specified, no commands will be executed; only local parameters (time, site id, device id, device serial number, device status, ambient temperature, and input voltage) will be recorded. 41 PWS-600 User’s Manual 7.6.7 Sensor Command Groups Each sensor command (1 to 32) consists of a group of 8 registers. Each register in the following table is an offset from the first register of the sensor command group as specified in the Data Log Configuration Registers Table. Sensor Command Group Register Offset 0 1–7 Size (Registers) 1 7 Data Type USHORT --- Access R/W R/W Name Sensor Network (1-4) (sensor network protocol dependent) Default Value --- All 8 registers in a group must be read and written within a single command. The first register in each command group specifies the sensor network on which the sensor is located. The RS485 smart sensor network is sensor network 1, the SDI-12 smart sensor network is sensor network 2, the analog sensor network is network 3, and the discrete network is network 4. The function of the remaining registers in each command group varies depending on the configuration of the selected network. Note: changing the sensor network selection may cause other settings in the command group to become invalid due to a change in the network protocol. Configure sensor networks before selecting a sensor network. 7.6.8 MODBUS Command Group Format The following table defines the sensor command group for a smart sensor network configured to use a MODBUS protocol (RTU or ASCII). Each register in the table is an offset from the first register of the sensor command group as specified in the Data Log Configuration Registers Table. Sensor Command Group Register Offset 0 1 2 3 4 5 6 7 Size (Registers) 1 1 1 1 1 1 1 1 Data Type USHORT USHORT USHORT USHORT USHORT USHORT USHORT USHORT Access R/W R/W R/W R/W R/W R/W R/W R/W Name Sensor Network (network 1 only) Sensor Address (1 to 247) Data Type (1 to 4) Start Register Number (1 to 65535) Number of Registers (1 to 64) Response Timeout (milliseconds) Reserved Reserved Default Value 1 1 3 1 1 1000 0 0 Each sensor command generates a MODBUS read command for the specified data type. The data read from the sensor are added to the current data record. If several non-sequential registers or data types need to be read from a sensor, multiple read register commands can be sent to the same sensor. 42 PWS-600 User’s Manual 7.6.8.1 MODBUS Sensor Address This register specifies the sensor’s network address. 7.6.8.2 MODBUS Data Type This register specifies the data type to be read from the sensor according to the following table. MODBUS Sensor Command Data Types Register Value 1 2 3 4 MODBUS Data Type Coils Discrete Inputs Holding Registers Input Registers The default value is 3, to read holding registers. Attempting to write a value not in the table will result in an exception response with the ILLEGAL WRITE VALUE exception code. 7.6.8.3 MODBUS Start Register Number For coils (1) and discrete input (2) data types, this register specifies the first coil or discrete input to read. For holding register (3) and input register (4) data types, this register specifies the first register number to read. 7.6.8.4 MODBUS Number of Registers For coils (1) and discrete input (2) data types, this register specifies the number of coils or discrete inputs to read. Each coil or discrete input is represented as a single bit and is packed 16 bits per register in the data record, beginning at the least significant bit of each register. For holding register (3) and input register (4) data types, this register specifies the number of registers to read. Each register read is added sequentially to the data record. A maximum of 64 registers can be specified across all read register commands. If the sensor returns an exception to the Read Registers command, the sentinel value will be recorded for each requested register. 7.6.8.5 MODBUS Response Timeout The response timeout specifies the maximum amount of time the device should allow for the sensor to make a measurement and respond to the command. If a response is not received within the specified timeout, the device will retry the command if specified. If no response is received after the specified number of retries, the sentinel value will be recorded for each requested register. 43 PWS-600 User’s Manual 7.6.9 SDI-12 Command Group Format The following table defines the sensor command group for a smart sensor network configured to use the SDI-12 protocol. Each register in the table is an offset from the first register of the sensor command group as specified in the Data Log Configuration Registers Table. SDI-12 Sensor Command Group Register Offset 0 1 2 3 5 6 7 Size (Registers) 1 1 1 2 1 1 1 Data Type USHORT USHORT USHORT ULONG USHORT USHORT USHORT Access R/W R/W R/W R/W R/W R/W R/W Name Sensor Network (1 or 2 in SDI-12 mode) Sensor Address Measurement Command Measurement Selection Bit Mask Reserved Reserved Reserved Default Value 1 48 0 1 0 0 0 Each sensor command generates the specified measurement command, reads the sensor response, then adds a FLOAT type value to the current data record for each selected measurement. 7.6.9.1 SDI-12 Sensor Address This register specifies the sensor’s network address. SDI-12 addresses are ranges of ASCII characters as defined in the following table. Address “0” is the default sensor address initially set by the manufacturer as defined by the SDI-12 specification. All sensors are required to support the address range “0” to “9”. The other address ranges are optional and might not be supported by all sensors. ASCII “0” “1” to “9” “A” to “Z” “a” to “z” Decimal 48 49 to 57 65 to 90 97 to 122 SDI-12 Sensor Address Ranges Hexadecimal 0x30 0x31 to 0x39 0x41 to 0x5A 0x61 to 0x7A Description Default Standard Support Optional Support Optional Support Attempting to write any other value will result in an exception response with the ILLEGAL WRITE VALUE exception code. 44 PWS-600 User’s Manual 7.6.9.2 SDI-12 Measurement Command This register specifies the measurement command to be sent to the sensor. The device supports all of the standard SDI-12 measurement commands as outlined in the following table. Register Value 0 1 to 9 10 11 to 19 20 21 to 29 30 31 to 39 40 to 49 50 to 59 SDI-12 Measurement Command Table SDI-12 Command Description “M” Start measurement “M1” to “M9” Start additional measurement “MC” Start measurement with CRC “MC1” to “MC9” Start additional measurement with CRC “C” Start concurrent measurement “C1” to “C9” Start concurrent additional measurement “CC” Start concurrent measurement with CRC “CC1” to “CC9” Start concurrent additional measurement with CRC “R0” to “R9” Read continuous measurement “RC0” to “RC9” Read continuous measurement with CRC Attempting to write any other value will result in an exception response with the ILLEGAL WRITE VALUE exception code. 7.6.9.3 SDI-12 Measurement Selection Bit Mask This 32-bit register specifies which measurements returned by the sensor are to be logged. Bit 0 corresponds to the first measurement returned. Bit 31 corresponds to the 32nd measurement returned. Any bit set to a one selects the corresponding measurement to be logged. Any bit set to a zero will cause the corresponding measurement to be discarded. Note: Version 1.3 of the SDI-12 specification limits the number of measurements returned by a sensor in response to a given measurement command to a maximum of 20. Future versions of the specification may increase this limit. The PWS-600 will support up to 32 measurement values from a sensor, allowing for some future expansion. For example, a sensor returns three parameters A, B, and C, to measurement command “M” and the measurement selection bit mask is set to 5 (binary 00000000 00000101). Measurements A and C will be logged, and measurement B will be discarded. If a sensor does not return enough measurements to match a set bit, the SDI-12 sentinel value will be recorded in place of the measurement. For example, if a sensor returns three parameters to a measurement command A, B, and C, and the measurement selection bit mask is set to 13 (binary 00000000 00001101), measurements A and C will be logged, measurement B will be discarded, and the SDI-12 sentinel value will be logged in place of the missing 4th measurement. 45 PWS-600 User’s Manual 7.6.10 Analog Command Group Format The following table defines the sensor command group for an analog sensor network. Each register in the table is an offset from the first register of the sensor command group as specified in the Data Log Configuration Registers Table. Analog Sensor Command Group Register Offset 0 1 2 3 4 6 Size (Registers) 1 1 1 1 2 2 Data Type USHORT USHORT USHORT USHORT FLOAT FLOAT Access R/W R/W R/W R/W R/W R/W Name Sensor Network (network 3 only) Analog Channel (1 to 49) Measurements to Average (1 to 25) Output Format Scale Factor (measurement units/mV) Offset (measurement units) Default Value 3 0 1.0 0.0 7.6.10.1 Analog Channel This register specifies the analog channel to be measured. An analog channel defines the physical analog inputs to be used for the measurement, as well as preconfigured ranges and functions. Channel 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 +Input ANI1 AIN2 AIN3 AIN4 AIN5 AIN6 ANI1 AIN2 AIN3 AIN4 AIN5 AIN6 ANI1 AIN2 AIN3 AIN4 AIN5 AIN6 -Input AGND AGND AGND AGND AGND AGND AGND AGND AGND AGND AGND AGND AGND AGND AGND AGND AGND AGND Range 0 to 5000 mV 0 to 5000 mV 0 to 5000 mV 0 to 5000 mV 0 to 5000 mV 0 to 5000 mV 0 to 2000 mV 0 to 2000 mV 0 to 2000 mV 0 to 2000 mV 0 to 2000 mV 0 to 2000 mV 0 to 1000 mV 0 to 1000 mV 0 to 1000 mV 0 to 1000 mV 0 to 1000 mV 0 to 1000 mV Description Single-ended, consider BAT+ or SWBATx for power Single-ended, consider BAT+ or SWBATx for power Single-ended, consider BAT+ or SWBATx for power Single-ended, consider BAT+ or SWBATx for power Single-ended, consider BAT+ or SWBATx for power Single-ended, consider BAT+ or SWBATx for power Single-ended, consider BAT+ or SWBATx for power Single-ended, consider BAT+ or SWBATx for power Single-ended, consider BAT+ or SWBATx for power Single-ended, consider BAT+ or SWBATx for power Single-ended, consider BAT+ or SWBATx for power Single-ended, consider BAT+ or SWBATx for power Single-ended, consider BAT+ or SWBATx for power Single-ended, consider BAT+ or SWBATx for power Single-ended, consider BAT+ or SWBATx for power Single-ended, consider BAT+ or SWBATx for power Single-ended, consider BAT+ or SWBATx for power Single-ended, consider BAT+ or SWBATx for power 46 PWS-600 User’s Manual Channel 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 +Input ANI1 AIN2 AIN3 AIN4 AIN5 AIN6 AIN2 AIN4 AIN6 AIN2 AIN4 AIN6 AIN2 AIN4 AIN6 AIN2 AIN4 AIN6 AIN2 AIN4 AIN6 AIN2 AIN4 AIN6 AIN2 AIN4 AIN6 AIN5 -Input AGND AGND AGND AGND AGND AGND AIN1 AIN3 AIN5 AIN1 AIN3 AIN5 AIN1 AIN3 AIN5 AIN1 AIN3 AIN5 AIN1 AIN3 AIN5 AIN1 AIN3 AIN5 AIN1 AIN3 AIN5 AGND Range 0 to 500 mV 0 to 500 mV 0 to 500 mV 0 to 500 mV 0 to 500 mV 0 to 500 mV ±2000 mV ±2000 mV ±2000 mV ±1000 mV ±1000 mV ±1000 mV ±500 mV ±500 mV ±500 mV ±250 mV ±250 mV ±250 mV ±125 mV ±125 mV ±125 mV ±60 mV ±60 mV ±60 mV ±30 mV ±30 mV ±30 mV 0 to 20.5 mA 47 AIN6 AGND 0 to 20.5 mA 48 AIN4 AGND -50 to 200 °C 49 AIN4 AIN3 -50 to 200 °C Description Single-ended, consider BAT+ or SWBATx for power Single-ended, consider BAT+ or SWBATx for power Single-ended, consider BAT+ or SWBATx for power Single-ended, consider BAT+ or SWBATx for power Single-ended, consider BAT+ or SWBATx for power Single-ended, consider BAT+ or SWBATx for power Differential, consider VEX & AGND for excitation Differential, consider VEX & AGND for excitation Differential, consider VEX & AGND for excitation Differential, consider VEX & AGND for excitation Differential, consider VEX & AGND for excitation Differential, consider VEX & AGND for excitation Differential, consider VEX & AGND for excitation Differential, consider VEX & AGND for excitation Differential, consider VEX & AGND for excitation Differential, consider VEX & AGND for excitation Differential, consider VEX & AGND for excitation Differential, consider VEX & AGND for excitation Differential, consider VEX & AGND for excitation Differential, consider VEX & AGND for excitation Differential, consider VEX & AGND for excitation Differential, consider VEX & AGND for excitation Differential, consider VEX & AGND for excitation Differential, consider VEX & AGND for excitation Differential, consider VEX & AGND for excitation Differential, consider VEX & AGND for excitation Differential, consider VEX & AGND for excitation Current loop, jumper AIN5 to LOOP1, consider BAT+ or SWBATx for power Current loop, jumper AIN6 to LOOP2, consider BAT+ or SWBATx for power 2-wire Pt1000 Platinum RTD, jumper AIN4 to REX One wire to AIN4, one wire to AGND 4-wire Pt1000 Platinum RTD, jumper AIN5 to REX Power pair to AIN5 and AGND Sense pair to AIN4 and AIN3 47 PWS-600 User’s Manual 7.6.10.2 Measurements to Average This register specifies the number of consecutive channel measurements to average. The number of readings averaged will have an impact on the fastest log interval that can be achieved. Setting this register to one disables averaging. 7.6.10.3 Output Format The output format specifies how the sensor measurement is formatted and added to the current data record. Value 0 1 2 Output Format Description USHORT (1 register) SHORT (1 register) FLOAT (2 registers) The internal measurement result is a floating point value; specifying a FLOAT output places the measurement result directly into the current data record as a FLOAT. If an USHORT value is specified, the floating point value is rounded to an unsigned integer value in the range 0 to 65535. If the rounded value is greater than 65535, 65535 is output. If the rounded value is less than zero, then zero is output. If a SHORT value is specified, the floating point value is rounded to a signed integer value in the range -32768 to +32767. If the rounded value is greater than +32767, +32767 is output. If the rounded value is less than -32768, -32768 is output. 7.6.10.4 Scale Factor and Offset The scale factor and offset can be used to convert the measured value to the appropriate sensor parameter units according to the following equation: Measured Output = Scale Factor (Measured Value) + Offset The scale factor and offset are applied before conversion to one of the short formats occurs. Note also that the platinum RTD channels provide temperature in Celsius units. Scaling is only necessary to convert units or improve the resolution when using one of the integer formats. 48 PWS-600 User’s Manual 7.6.11 Discrete Command Group Format The following table defines the sensor command group for a discrete sensor network. Each register in the table is an offset from the first register of the sensor command group as specified in the Data Log Configuration Registers Table. Discrete Sensor Command Group Register Offset 0 1 2 3 4 6 Size (Registers) 1 1 1 1 2 2 Data Type USHORT USHORT USHORT USHORT FLOAT FLOAT Access R/W R/W R/W R/W R/W R/W Name Sensor Network Discrete Channel Reserved Output Format Scale Factor (measurement units/mV) Offset (measurement units) Default Value 0 0 1.0 0.0 7.6.11.1 Discrete Channel This register specifies the discrete channel to be measured. A discrete channel defines the physical discrete inputs to be used for the measurement, as well as preconfigured ranges and functions. Channel 1 2 3 Input DIO1 DIO2 DIO1 4 DIO2 5 DIO1 6 DIO2 7 DIO1 8 DIO2 9 10 DIO1 DIO2 Description Input state (0 or 1) Input state (0 or 1) Positive edge debounced switch counter, counts up to 65535 switch closures between log records, resets back to zero after record is logged Positive edge debounced switch counter, counts up to 65535 switch closures between log records, resets back to zero after record is logged Negative edge debounced switch counter, counts up to 65535 switch closures between log records, resets back to zero after record is logged Negative edge debounced switch counter, counts up to 65535 switch closures between log records, resets back to zero after record is logged Pulse counter, counts up to 65535 pulses between log records, resets back to zero after record is logged Pulse counter, counts up to 65535 pulses between log records, resets back to zero after record is logged Frequency counter, 1 second gate measures from 1 to 65535 Hz. Frequency counter, 1 second gate measures from 1 to 65535 Hz. 49 PWS-600 User’s Manual 7.6.11.2 Output Format The output format specifies how the sensor measurement is formatted and added to the current data record. Value 0 1 2 Output Format Description USHORT (1 register) SHORT (1 register) FLOAT (2 registers) The internal measurement result is a floating point value; specifying a FLOAT output places the measurement result directly into the current data record as a FLOAT. If an USHORT value is specified, the floating point value is rounded to an unsigned integer value in the range 0 to 65535. If the rounded value is greater than 65535, 65535 is output. If the rounded value is less than zero, then zero is output. If a SHORT value is specified, the floating point value is rounded to a signed integer value in the range -32768 to +32767. If the rounded value is greater than +32767, +32767 is output. If the rounded value is less than -32768, -32768 is output. 7.6.11.3 Scale Factor and Offset The scale factor and offset can be used to convert the measured value to the appropriate sensor parameter units according to the following equation: Measured Output = Scale Factor (Measured Value) + Offset The scale factor and offset are applied before conversion to one of the short formats occurs. 50 PWS-600 User’s Manual 7.6.12 Last Sensor Readings These registers allow a master device to read the last sensor readings. The last sensor readings may be generated by the last log record, or by the read sensors device command. The format of the data registers is determined by the sensor command groups. These registers are not encrypted. The registers are volatile and will reset to zero if power is removed. Last Data Log Record Registers Register Number 2300 2304 2305 2306 2308 2309 2310 2311 2312 Size (Registers) 4 1 1 2 1 1 1 1 64 Data Type TIME USHORT USHORT ULONG USHORT SHORT USHORT USHORT USHORT Access R R R R R R R R R Name Date and Time Site Id Device Id Device Serial Number Device Status Ambient Temperature Input Voltage Register Count Data Registers 51 Default Value °C x 10 mV PWS-600 User’s Manual 7.7 Switched Power Outputs The PWS-600 provides two switched battery outputs labeled SWBAT1 and SWBAT2. Each output is capable of switching up to 0.5 amperes and can be programmed to turn on during the measurement time to power sensors, or programmed to turn on and off on a daily schedule to power a radio or cellular modem for remote access. A third switched power output is available on the RS232 connector on pin 9. This +5V, 275 mA supply can be used to power master-side RS232 communication accessories such as a modem or Ethernet adapter. Switched Power Output Registers Register Number 2401 2402 2413 2424 Size (Registers) 1 11 11 11 Data Type USHORT USHORT USHORT USHORT Access R R/W R/W R/W Name Switched Output Status Switched Output SWBAT1 Configuration Switched Output SWBAT2 Configuration RS232 +5V Switched Output Configuration Default Value 0 7.7.1 Switched Output Status This read-only register provides the status of each of the switched outputs. 15 14 reserved 13 12 reserved Switched Output Status Register 11 10 9 8 7 6 5 4 reserved reserved reserved RS232 +5V 3 2 SWBAT2 1 0 SWBAT1 Each switched output is described by a pair of bits, indicating its current output state. The status of unsupported (reserved) switched outputs will always be indicated as off. Bits 00 01 10 11 Switched Output States Description Off Fault (output shorted or overloaded) Marginal (output < 90% of expected) On 52 PWS-600 User’s Manual 7.7.2 Switched Power Output Configuration The following table defines the switched power output configuration group. Each register in the table is an offset from the first register in the group as specified in the Switched Power Output Registers Table. Registers in this group may be accessed individually or as a group. Register Offset 0 1 2 Size (Registers) 1 1 9 Switched Power Output Configuration Group Data Type Access Name USHORT R/W Switched Output Mode USHORT R/W Measurement Warm-up Delay (ms) USHORT R/W Switched Output Schedule Default Value 0 0 0 7.7.2.1 Switched Output Modes The output mode specifies how the switched power output will be controlled. Value 0 1 2 3 Output Mode Description Always Off On to Measure On by Schedule Always On When “On to Measure” is selected, the device will turn on the switched power output prior to taking a sensor measurement of any kind, wait the specified measurement delay, and then take the measurements specified by the log commands. This mode is used to control power to sensors that draw too much current to be left on continuously. When “On by Schedule” is selected, the device will turn the switched power output on and off as specified by the schedule register bits, independent of the log schedule. In this mode, the measurement warm-up delay is not used. This mode may be used to control external interface equipment, such as a cellular modem, that may draw too much power to be left on continuously. “On Always” turns the output on continuously. Combined with the “Off” mode, this mode permits remote control or test of a switched power output. 53 PWS-600 User’s Manual 7.7.2.2 Switched Output Schedule These nine registers comprise 144 bits, each representing a 10 minute interval of the day. Bit 0 of the first register (offset 2) represents 00:00:00 to 00:09:59. Bit 15 of the last register (offset 10) represents 23:50:00 to 23:59:59. For each bit that is set, the output will be turned on during the corresponding 10 minute interval each day. The following table illustrates the bit mapping of the schedule registers. Register Offset 2 3 4 5 6 7 8 9 10 Switched Output Schedule Register Bit Start Times (UTC) Bit 15 Bit 12 Bit 9 Bit 6 Bit 3 Bit 0 02:30 05:10 07:50 10:30 13:10 15:50 18:30 21:10 23:50 00:00 02:40 05:20 08:00 10:40 13:20 16:00 18:40 21:20 02:00 04:40 07:20 10:00 12:40 15:20 18:00 20:40 23:20 01:30 04:10 06:50 09:30 12:10 14:50 17:30 20:10 22:50 01:00 03:40 06:20 09:00 11:40 14:20 17:00 19:40 22:20 00:30 03:10 05:50 08:30 11:10 13:50 16:30 19:10 21:50 As an example, it is desired to have a cellular modem on from 12:00 to 1:00 P.M. (12:00 to 13:00) each day, Mountain Standard Time (MST). Since MST is UTC – 6 hours, that corresponds to 18:00 to 19:00 UTC. Set bits 12 through 15 of register offset 8 (61440 or 0xF000) and bits 0 through 1 of register offset 9 (3 or 0x0003). 54 PWS-600 User’s Manual 7.8 Discrete Outputs The two discrete I/O terminals on the PWS-600 can be used as inputs or outputs. This section describes how to program the discrete I/O as outputs. When programmed as an output, the discrete cannot be used as an input. Discrete Output Registers Register Number 2501 2502 2508 Size (Registers) 1 6 6 Data Type USHORT USHORT USHORT Access R R/W R/W Default Value 0 Name Discrete Output Status Discrete Output 1 Configuration Discrete Output 2 Configuration 7.8.1 Discrete Output Status This read-only register provides the status of each of the discrete outputs. Each discrete output is described by a single bit, indicating its current output state (0 = off, 1 = on). The status of unsupported outputs will always be indicated as off. 15 0 14 0 13 0 12 0 11 0 10 0 Discrete Output Status Register 9 8 7 6 5 0 0 0 0 0 4 0 3 0 2 0 1 0 DIO2 DIO1 7.8.2 Discrete Output Configuration The following table defines the discrete output configuration group. Each register in the table is an offset from the first register in the group as specified in the Discrete Output Registers Table. Registers in this group may be accessed individually or as a group. Discrete Output Configuration Group Register Offset 0 1 2 3 5 Size (Registers) 1 1 1 2 1 Data Type USHORT USHORT USHORT FLOAT USHORT Access R/W R/W R/W R/W R/W Name Discrete Output Mode Data Record Offset (0 to 63) Data Record Data Type Alarm Threshold Hysteresis (0 to 10% in 0.1% increments) 55 Default Value 0 0 0 0 0 PWS-600 User’s Manual 7.8.2.1 Discrete Output Modes The output mode specifies how the discrete output will be controlled. Value 0 1 2 3 Output Mode Description Always Off High Alarm Low Alarm Always On When “High Alarm” is selected, the device will turn on the discrete output if the assigned logged value is greater than or equal to the programmed alarm threshold. The output will be turned off when the assigned logged value returns below the alarm threshold minus the hysteresis setting. When “Low Alarm” is selected, the device will turn on the discrete output if the assigned logged value is less than or equal to the programmed alarm threshold. The output will be turned off when the assigned logged value returns above the alarm threshold plus the hysteresis setting. “On Always” turns the output on continuously. Combined with the “Off” mode, this mode permits remote control or test of a discrete output. 7.8.2.2 Data Record Offset This register specifies the offset into the last logged record where the logged value resides. The offset must be aligned with a valid log value in order for the alarm value comparison to be valid. 7.8.2.3 Data Record Data Type This register specifies the data type of the logged value pointed to by the data record offset. The data type must match the type of the recorded value in order for the alarm value comparison to be valid. The logged value will be converted to a floating point value for comparison to the alarm threshold. Value 0 1 2 Data Types Description USHORT (1 register) SHORT (1 register) FLOAT (2 registers) 7.8.2.4 Alarm Threshold This register specifies the alarm threshold. It must be of the same units and scaling as the recorded log value. 7.8.2.5 Hysteresis Hysteresis can range from 0.0 to 10.0% of the alarm threshold and is specified in 0.1% increments. For example, 2.5% is written as 25. Adding hysteresis prevents chatter of the discrete output if the logged value is moving slowly about the alarm threshold. 56 PWS-600 User’s Manual 7.9 Data Log Recording Registers These registers configure data log security and allow the MODBUS master device to record additional information in the data log such as user notes. Data Log Recording Registers Register Number 1300 1320 1321 Size (Registers) 8 1 64 Data Type STRING USHORT USHORT Access W W W Name Default Value Encryption Key Register Count Data Registers 7.9.1 Encryption Key Write this 8-register string to set a 128-bit encryption key. Afterwards, all data records written to the data log will be encrypted using this key. The registers are write-only so that the key is protected. The registers are non-volatile, so the key need only be written once prior to recording data. When shipped from the factory or after a factory defaults command is issued, the key is erased and encryption is disabled. Issuing a factory defaults command does not remove encryption from data already stored in the data log. It is recommended that the user not mix data recorded with different encryption keys, or mix encrypted and unencrypted data in the same log, as this will make decrypting the log difficult. Changing the encryption key does not change the encryption of previously recorded data. The data log should be erased prior to, or immediately after, changing the encryption key. Note: It is the responsibility of the user to manage encryption keys. Once written, the encryption key cannot be read out of the device. Once data is recorded with encryption, it cannot be decrypted without the original key. 7.9.2 Recording Data Data is recorded in the data log using the following procedure. 1. Write the number of registers to be recorded (1 to 64) to register 1320. Attempting to write a value outside this range will result in an exception response with the ILLEGAL WRITE VALUE exception code. 2. Write data registers beginning at register 1321. Only the number of data registers specified by the register count can be written. Attempting to write more data registers than specified by the register count will result in an exception response with the ILLEGAL ADDRESS VALUE exception code. A single Write Multiple Registers function can be used to write the register count and the data registers in one transaction. 57 PWS-600 User’s Manual 3. When the last data register is written as determined by the register count, the device will write the record to the data log along with the time, site id, device id, device serial number, device status, ambient temperature, and input voltage. The typical response time to this write is less than 100 milliseconds. The maximum response time is 3 seconds. The register count and data registers are write-only to protect unencrypted data from being read. One of the primary purposes of allowing the MODBUS master device to write data asynchronously to the logged sensor data is to be able to insert notes. Notes can be in any suitable format (ASCII, packed ASCII, Unicode, etc.); however, for easy decoding of the log data, the record size (register count) of the notes should be something different than the record size of the sensor data records. Assigning note records to a constant size of 64 registers is recommended. If the defined STRING data type is used, this allows notes to be up to 128 characters long. 7.9.3 Recording Speed The PWS-600 is capable of recording data as fast as 1 record per second provided that the data log has not wrapped around. Once the data log has wrapped around, the recording rate drops to 1 record every 5 seconds. This is necessary in order to provide time for block erasures when the oldest data is erased. In addition, the log configuration settings must be considered. The response timeout value and the number of retries will affect the maximum recording speed. 58 PWS-600 User’s Manual 7.10 Data Log Retrieval Registers These registers allow a master device to retrieve data records from the data log. Data Log Retrieval Registers Register Number 1400 1402 1404 1406 1408 1409 1411 1412 1416 1417 1418 1420 1421 1422 1423 1424 1488 Size (Registers) 2 2 2 2 1 2 1 4 1 1 2 1 1 1 1 64 4 Data Type ULONG ULONG ULONG ULONG USHORT ULONG USHORT TIME USHORT USHORT ULONG USHORT SHORT USHORT USHORT USHORT USHORT Access R R R R R/W R/W R R R R R R R R R R R Name Data Log Size (bytes) Data Log Used (bytes) Lowest Record Number Highest Record Number Download Record Count Record Number Record Size in Registers Date and Time Site Id Device Id Device Serial Number Device Status Ambient Temperature Input Voltage Register Count Data Registers Encryption Padding Registers Default Value 4,194,304 0 0 0 0 0 0 0 0 0 0 0 °C x 10 mV 0 0 7.10.1 Data Log Size This register returns the data log memory size in bytes. 7.10.2 Data Log Used This register returns the number of data log memory bytes currently used. Combined with the data log size, the register can be used to calculate the percent of memory used and percent of memory remaining. 7.10.3 Lowest and Highest Record Numbers If no records have been logged, both the lowest and highest record numbers will be zero. Records are numbered beginning at record one. The highest record number will increment with each record logged (the highest record number is also the total number of records recorded since the log was last erased). As long as the data log hasn’t wrapped, the lowest record number will remain at one. Once the log wraps around, the lowest record number will begin to advance as the oldest data is deleted. Every record will have a unique and always increasing number. If the user keeps track of the last record number that was retrieved, only higher record numbers will need to be retrieved at the next download. 59 PWS-600 User’s Manual 7.10.4 Download Record Count This register specifies the maximum number of records to transfer when the Data Log Download command is used. The default value of zero permits continuous streaming of data records. This record is non-volatile. The content of this register has no effect when reading data records via the Data Log Retrieval registers. 7.10.5 Record Number Write this register to specify the data record number to read. If the write is successful, the remaining registers are filled in with the record data and are ready to be read. The average response time is 500 milliseconds seconds. The maximum response time is 1000 milliseconds. Attempting to write a record number less than the lowest record number or greater than the highest record number will result in an exception response with the ILLEGAL WRITE VALUE exception code. If a data record is found to be corrupt the device will return an exception response with the CORRUPT DATA RECORD exception code. As much of the data record will be retrieved as possible; however, the register count and/or contents of the record are suspect. If the register count returns zero, the record could not be retrieved. A corrupt record can occur if power fails during the time the data record is being written. 7.10.6 Record Size After writing the record number, this register provides the size of the record in registers. The size includes all registers from the first register of the time stamp to the last data register. 7.10.7 Record Data After writing the record number, the record data registers can be read. All data registers may be read, including those beyond the record size. This permits the master device to read all of the data record registers with one command regardless of the record size. Only the data registers specified by the register count will contain valid information. If the data is unencrypted, the register numbers and sizes shown in the table above can be read to extract portions of the data record if not all of the information is needed. If the data is encrypted, reading individual registers from the table will not be useful. A read registers command must be used to read the number of registers specified by the record size. All of the registers in the record are required in the decryption process. The unencrypted record format for logged data is the same as that described for the data polling registers. 60 PWS-600 User’s Manual 7.10.8 Data Decryption The Prairie View Software that comes with the device provides data decryption and the capability to view and export data from encrypted logs. The Advanced Encryption Standard is supported by many operating systems, so it is possible for user applications and third-party software to decrypt logs, providing that the original encryption key is known. 7.10.9 Data Retrieval Procedure The following procedure describes data retrieval using conventional MODBUS register read and write commands. 1. The master device reads the lowest and highest record number registers to determine the valid record number range and selects the range of records to be downloaded. 2. The master device writes a record number to the record number register. The PWS-600 retrieves the record from the data log. 3. The master device reads the record size register to determine the number of registers in the record. 4. The master device reads the number of registers specified by the size registers beginning with the time register. 5. Optionally, after the master device has written the record number, it can simply read all record registers from the register size through the encryption padding registers and decode the record later. 6. The master device repeats steps 2 through 6 until all selected records have been retrieved. 7.10.10 Data Log Download Command The following procedure describes the use of the data log download command. This command provides considerably faster downloads as compared to conventional register access. 1. The master device reads the lowest and highest record number registers to determine the valid record number range. 2. The master device writes the first record number to be downloaded to the record number register. To download all data, set the record number register equal to the lowest record number. The PWS-600 has a maximum response time of 1000 milliseconds to this command. 61 PWS-600 User’s Manual 3. The master device writes the data log download command to the command register. The PWS600 will return a standard response to this write register command with a maximum response time of 1000 milliseconds. 4. After a 500 millisecond delay, the PWS-600 will begin to stream the number of records specified by the download record count, beginning at the record specified by the record number register. If the download record count is set to zero, the download will continue uninterrupted to the highest record number. Each record is constructed as a standard MODBUS read registers response that begins at the record number register and contains all registers in the record. There will be little or no delay between records. 5. After all records have been sent, the PWS-600 will send an exception response with the END DOWNLOAD exception code. 6. The master device must be capable of receiving records back-to-back until it detects the END DOWNLOAD exception. The user should consider the following when using this command to download data. There is no handshaking. The master device must be capable of receiving records back-to-back with little or no delay between records. Since the record number is included in each record sent and each record contains a CRC or LRC, the master device can determine if any records were missed. On the RS485 port, there is no way to cancel the command. The PWS-600 will stream data until it is done. The network is unavailable for any other communication until the download is finished. If the PWS-600 encounters a corrupt record during the download, it will send an exception response with the CORRUPT DATA RECORD exception code in place of the corrupt record and the download will continue. 62 PWS-600 User’s Manual 7.10.11 Last Data Log Record These registers allow a master device to read the last data record from the data log directly. The format and encryption requirements are the same as those for a retrieved record. Last Data Log Record Registers Register Number 2200 2202 2203 2207 2208 2209 2211 2212 2213 2214 2215 2279 Size (Registers) 2 1 4 1 1 2 1 1 1 1 64 4 Data Type ULONG USHORT TIME USHORT USHORT ULONG USHORT SHORT USHORT USHORT USHORT USHORT Access R/W R R R R R R R R R R R Name Record Number Record Size in Registers Date and Time Site Id Device Id Device Serial Number Device Status Ambient Temperature Input Voltage Register Count Data Registers Encryption Padding Registers Default Value °C x 10 mV The last data log record is only valid while data logging is enabled. If the data log is disabled, or if no data record has been recorded since the data log was enabled, the record number will return zero to indicate that the remaining record data is not valid. 63 PWS-600 User’s Manual 7.11 Sensor Network Pass-Through Registers The PWS-600 supports pass-through from its communication port network to a sensor network to assist in the configuration and maintenance of connected sensors. Register Number 2000 2001 Size (Registers) 1 64 Sensor Network Pass-Through Registers Data Type Access Name USHORT R/W Sensor Network USHORT R/W Command/Response string Default Value 0 0 7.11.1 Sensor Network This non-volatile register selects the sensor network for pass-through. Setting this register to zero disables pass-through communication. The data log must be disabled or paused in order to use passthrough commands. 7.11.2 MODBUS Protocol Pass-Through If the selected sensor network is configured for a MODBUS protocol, the PWS-600 passes any MODBUS command on its communication port that is not addressed to the PWS-600 itself to the sensor network, and will pass back the sensor response. The sensor will appear as if it resides on the master network. If the MODBUS protocol or communication setting of the sensor network differs from that of the communication port, the device will translate messages accordingly. 7.11.3 SDI-12 Protocol Pass-Through If the selected sensor network is configured for the SDI-12 protocol, the master device must utilize the SDI-12 Command/Response registers and device command to generate a pass-through message and receive the response. The command and response string is treated as a packed ASCII STRING data type as described in the Data Types section of the manual; however individual registers are read/write accessible so that only the required registers need to be written or read instead of the entire contents of the string. Use the following procedure to pass an SDI-12 command to a sensor and obtain the response. 1. Write the packed ASCII command beginning at register 2001. Each register contains two ASCII characters, with the upper byte of the register holding the leading character. The command must begin with the SDI-12 address, and end with the “!” character. No other validation of the command format is performed, allowing sensor-specific extended commands to be sent. 2. Write device command 56481 to the device command register to send the command to a sensor on the SDI-12 network. All characters up to and including the “!” character will be sent. If the “!” character is not found in the string, the command will not be sent. 64 PWS-600 User’s Manual 3. The Sensor Busy bit in the Device Status register can be monitored to determine when the command/response cycle is finished. Generally, the response of the SDI-12 sensor is faster than the sensor busy status can be checked, allowing this step to be skipped. 4. The device returns the sensor response in the command/response string beginning at register 1801. The original command is overwritten. All characters returned by the sensor, up to and including the carriage return and line feed character are provided. Character positions following the line feed character are padded with zeroes. If no response is received from the sensor, the entire string will be filled with zeroes. 65 PWS-600 User’s Manual 7.12 Password Security Registers Additional module security is available by enabling password protection. When a security password is written to the PWS-600, the master device must log in with the correct password in order to access any of the device registers. When the device is secure, only the read slave id function and the write to the login password registers are possible. Data Log Retrieval Registers Register Number 3000 3010 Size (Registers) 10 10 Data Type STRING STRING Access W W Name Security Password Login Password Default Value 0 0 7.12.1 Security Password This ten-register, non-volatile, register string sets the password for the device. By default, the registers are set to zero, disabling password protection. The device slave id and all device registers are open and accessible. Writing a 10-register, non-zero password to these registers enables password security. If no communication port activity is detected after a period of 60 seconds, or if the Security Mode device command (56320) is issued, the device will enter its secure mode. In the security mode, only the slave id and the login password registers are available. Attempting to perform any other function while in the security mode will result in an exception response with the SECURITY MODE exception code. Note: It is the responsibility of the user to manage passwords. Once written, the security password cannot be read out of the device. Once the device is secured with a password, it cannot be accessed without the original password. 7.12.2 Login Password Writing a 10-register password that matches the Security Password will temporarily take the device out of the security mode. Logging in with a password that does not match the security password will result in an exception response with the ILLEGAL WRITE VALUE exception code and, if the device is in the security mode, the device will remain in the security mode. 66 PWS-600 User’s Manual 7.13 Diagnostic Registers These registers provide device diagnostic and troubleshooting information. Device Description Register Number 9000 9001 9002 9003 9004 9005 9006 9007 Size (Registers) 1 1 1 1 1 1 1 1 Data Type USHORT USHORT USHORT USHORT USHORT SHORT SHORT USHORT Access R R R R R R R R 9008 1 USHORT R Name Configuration Flash Writes. Last Reset Type Fault Count Last Fault Type Last Fault Information High Temperature Low Temperature Data Log Chip Id Data Log Erasure Count Default Value < 50,000 0 0 0 0 °C x 10 °C x 10 8214 or 9538 < 50,000 7.13.1 Configuration Flash Writes This non-volatile register records the number of times the device configuration registers have been written to. Since these registers are intended for occasional configuration of the device, a high number indicates frequent changes and possibly improper use of the registers. 7.13.2 Last Reset Type This register records information about the last reset event that caused the power outage bit to be set in the device status register. Type 0 1 2 3 Reset Types Description None recorded Power outage detected by the CPU – power lost and restored Brownout detected by CPU – marginal power source (e.g. very low battery) Brownout detected by the timekeeping circuit – marginal power source 67 PWS-600 User’s Manual 7.13.3 Fault Information These registers record information about the last fault event that caused the device fault bit to be set in the device status register. The fault count records the number of fault events. An occasional fault may indicate a normal recovery from an unusual power loss sequence or transient event. Frequent faults may indicate hardware damage or a firmware defect. Type 0 4 5 6 Fault Types Description None recorded Invalid interrupt, last fault information register updated with interrupt number Memory access violation Watchdog timeout 7.13.4 High and Low Temperatures These registers record the ambient temperature extremes (in degrees Celsius multiplied by 10) experienced by the device. 7.13.5 Data Log Chip Id This register reports the identification of the internal data log chip. The value may be any one of the values listed in the table. 7.13.6 Data Log Erasure Count This non-volatile register records the number of times the data log has wrapped around and/or has been erased. 68 PWS-600 User’s Manual 8 MODBUS Protocol The PWS-600 utilizes the MODBUS over Serial Line protocol for communication over an RS485 network. The MODBUS Serial Line protocol is a half-duplex, master-slave protocol. One master device controls the network or link, and is connected to one or more slave devices. A MODBUS transaction is always initiated by the master device. Slave devices never transmit data without first receiving a request from the master device. Slave devices never communicate with each other. The master device only initiates one MODBUS transaction with one slave device at a time. The PWS-600 implements the functions of a slave device in the protocol. The MODBUS standard defines two serial transmission modes: RTU mode and ASCII mode. All devices connected to a network must be configured to use the same transmission mode and communication parameters. This device supports both transmission modes. 8.1 RTU Transmission Mode The MODBUS RTU (Remote Terminal Unit) transmission mode is an 8-bit byte-oriented binary protocol with timing-based message framing. The RTU mode is the default transmission mode for the device. 8.1.1 RTU Character Format The standard format for each character in an RTU message is as follows. 1 Start 2 Bit 0 3 Bit 1 4 Bit 2 5 Bit 3 6 Bit 4 7 Bit 5 8 Bit 6 9 Bit 7 10 Parity 11 Stop The 11-bit character is sent least-significant bit first, left to right as shown, with 1 start bit, 8 data bits, a parity bit, and one stop bit. The default parity of the device is even parity. Odd parity and no parity are also supported. When no parity is specified, 2 stop bits should be used so that the 11-bit character size is maintained: 1 Start 2 Bit 0 3 Bit 1 4 Bit 2 5 Bit 3 6 Bit 4 69 7 Bit 5 8 Bit 6 9 Bit 7 10 Stop 11 Stop PWS-600 User’s Manual 8.1.2 RTU Message Format An RTU message is comprised of a sequence of 4 to 256 characters transmitted in a continuous stream. No more than 1.5 character times should be permitted between the characters in a message. The format of a message is as follows. Slave Address 1 byte Function Code 1 byte Data 0 to 252 bytes CRC 2 bytes By default, for baud rates less than or equal to 19200, an idle time of 3.5 character times signifies the end of a message. For baud rates higher than 19200, an idle time of 1.75 milliseconds signifies the end of a message. The RTU mode uses a Cyclical Redundancy Check (CRC) to provide error checking across a message, from the slave address to the last data byte. Only the eight data bits of each character are used in generating the CRC; start and stop bits and the parity bit do not apply. The CRC field is a 16-bit value. The loworder byte is appended first, followed by the high-order byte. The high-order byte of the CRC is the last byte in the message. A slave device will not act on or respond to a message that has an invalid CRC or parity errors. The master device must discard a slave response with an invalid CRC or parity errors and either resend the message or generate an error. Techniques for calculating the CRC can be found in the document MODBUS over Serial Line Specification and Implementation Guide V1.02, available at modbus-ida.org. 8.2 ASCII Transmission Mode In the MODBUS ASCII transmission mode, each 8-bit byte in a message is sent as two hexadecimal ASCII characters. The message is also framed with unique ASCII characters. This mode is preferred when the communication link cannot guarantee the inter-character timing required by the RTU mode, such as a packet-based wireless link. 8.2.1 ASCII Character Format The standard format for each character in an RTU message is as follows. 1 Start 2 Bit 0 3 Bit 1 4 Bit 2 5 Bit 3 6 Bit 4 7 Bit 5 8 Bit 6 9 Parity 10 Stop The 10-bit character is sent least-significant bit first, left to right as shown, with 1 start bit, 7 data bits, a parity bit, and one stop bit. The default parity of the device is even parity; odd parity and no parity are also supported. When no parity is specified, 2 stop bits should be used so that the 10-bit character size is maintained: 1 Start 2 Bit 0 3 Bit 1 4 Bit 2 5 Bit 3 6 Bit 4 70 7 Bit 5 8 Bit 6 9 Stop 10 Stop PWS-600 User’s Manual Although not specified by the MODBUS standard, the PWS-600 will also support the ASCII mode using 8bit characters with or without parity as described for the RTU mode. 8.2.2 ASCII Message Format An ASCII message is comprised of a sequence of 9 to 513 characters. The format of a message is as follows. Start 1 char ‘:’ Slave Address 2 chars (1 byte) Function Code 2 chars (1 byte) Data 0 to 504 chars (0 to 254 bytes) LRC 2 chars End 2 chars CR, LF The ASCII colon character “:” begins a message. The message ends with the ASCII control characters carriage return (CR) and line feed (LF). The byte information of an ASCII message from the slave address to the end of the data is identical to that of an RTU message. Each byte of the message is transmitted as two ASCII hexadecimal characters 0-9, A-F. By default, intervals up to one second may elapse between characters within the message. The device supports a programmable timeout interval up to 60 seconds. Intervals exceeding the timeout value will cause the device to assume an error has occurred and discard the message. Each reception of a colon character signals the beginning of a new message. If a message was in the process of being received when a colon is received, the previous message will be discarded. The ASCII mode uses a Longitudinal Redundancy Check (LRC) to provide error checking across a message, from the slave address to the last data byte. The beginning colon and ending CR-LF pair are not included in the calculation. Only the data bits of each character are used in generating the LRC; start and stop bits and the parity bit do not apply. The LRC is an 8-bit value, encoded with two ASCII characters in the same manner as a data byte. A slave device will not act on or respond to a message that has an invalid LRC or parity errors. The master device must discard a slave response with an invalid LRC or parity errors and either resend the message or generate an error. Techniques for calculating the LRC can be found in the document MODBUS over Serial Line Specification and Implementation Guide V1.02, available at modbus-ida.org. 71 PWS-600 User’s Manual 8.3 MODBUS IP This device also supports the MODBUS IP protocol on its master-side RS485 port. It is provided to support cases where a companion gateway or modem does not support translation between MODBUS IP and either MODBUS RTU or MODBUS ASCII. An IP message is essentially a MODBUS RTU message with an extended header. Transaction Id 2 bytes Protocol Id 2 bytes Length 2 bytes Slave Address 1 byte Function Code 1 byte Data 0 to 252 bytes The transaction id identifies a MODBUS command/response transaction. It is uniquely set by the master device and echoed by the slave device. The protocol id specifies the transaction protocol. It must always be set to zero to specify MODBUS. The length field specifies the length of the remaining bytes in the packet, including the slave address, function code, and data. 8.4 Device Addressing The MODBUS master device has no specific address, only the slave devices have an address. Each slave device on a network must be assigned a unique address. Slave addresses can range from 1 to 247. Address 0 is reserved as the broadcast address. The device will recognize the broadcast address as well as its own address. No response is returned to broadcast requests. 8.5 Data Types The MODBUS Protocol defines four primary data models: Discrete Inputs, Coils, Input Registers, and Holding Registers. The PWS-600 uses the Holding Registers model exclusively. MODBUS uses big endian representation for register numbers and data items – when a numerical quantity larger than a single byte is transmitted, the most significant byte is sent first. Register data are packed as two bytes per register, the first byte contains the high order bits and the second byte contains the low order bits. The device extends the big endian representation to data types requiring multiple registers. The first register contains the high order bytes and subsequent registers contain the lower order bytes. 8.5.1 USHORT: Unsigned Short An unsigned short is a 16-bit unsigned integer value in the range 0 to 65535. The value is contained in a single register. This is the basic MODBUS holding register data type. Register Byte 1 Bits 15 - 8 Byte 2 Bits 7 - 0 72 PWS-600 User’s Manual 8.5.2 SHORT: Signed Short A signed short is a 16-bit two’s complement signed integer value in the range -32768 to +32767. The value is contained in a single register. Register Byte 1 Sign, Bits 14 - 8 Byte 2 Bits 7 - 0 8.5.3 ULONG: Unsigned Long An unsigned long is a 32-bit unsigned integer value contained in two consecutive registers. Values can range from 0 to 4,294,967,295. Register Byte 1 Bits 31 - 24 Register + 1 Byte 2 Bits 23 - 16 Byte 3 Bits 15 - 8 Byte 4 Bits 7 - 0 8.5.4 LONG: Signed Long A signed long is a 32-bit two’s complement signed integer value contained in two consecutive registers. Values can range from -2147483648 to +2147483647. Register Byte 1 Sign, Bits 30 - 24 Register + 1 Byte 2 Bits 23 - 16 Byte 3 Bits 15 - 8 Byte 4 Bits 7 - 0 8.5.5 FLOAT: Floating Point A float is a 32-bit IEEE-754 floating point value contained in two consecutive registers. Register Byte 1 SXXXXXXX Register + 1 Byte 3 Byte 4 MMMMMMMM MMMMMMMM Byte 2 XMMMMMMM S is the sign bit, X is the 8-bit exponent, and M is the 23-bit mantissa. 73 PWS-600 User’s Manual 8.5.6 STRING: Character String A string is a sequence of consecutive registers where each byte within a register represents an 8-bit ASCII-encoded character. A string of N characters requires N / 2 registers. When reading or writing a string, all characters in the string must be transmitted. If the string to be written does not require the full available length, the unused characters must be padded with zeroes. Register Byte 1 Character 1 Byte 2 Character 2 Register + 1 Byte 1 Character 3 Byte 2 Character 4 . . . Register + (N / 2) – 1 Byte 1 Byte 2 Character N - 1 Character N 8.5.7 TIME: Date and Time Time is represented by 16 packed BCD digits contained in 4 consecutive registers. The registers are organized with the most significant temporal digit first, ranging from 1000 years to 0.01 seconds. Only BCD digits ‘0’ to ‘9’ are used. Time is in the 24-hour format. Register Byte 1 1000 years 100 years Byte 2 10 years Year Register + 1 Byte 1 10 Months Month Byte 2 10 Days Day Register + 2 Byte 1 10 Hours Byte 2 10 Minutes Minutes Hour Register + 3 Byte 1 Byte 2 10 Seconds Seconds 0.1 Seconds 0.01 Seconds 74 PWS-600 User’s Manual 8.6 Function Codes The MODBUS Protocol defines a variety of standard function codes for reading and writing data to a device. Only the function codes described in this section are supported by the device. All other function codes will generate an exception response with the ILLEGAL FUNCTION exception code. 8.6.1 Report Slave Id This function code is used to read the device description. All of the device-specific information is also available in the register map and is detailed in that section. Byte Offset 0 1 Command Field Description Device Address Function Code Byte Offset 0 1 2 3 4 5 7 9 13 15 17 19 Field Description Device Address Function Code Byte Count Slave Id Run Status Indicator Slave Id Version Device Id Serial Number Firmware Version Boot Code Version Hardware Version Register Map Version Type BYTE BYTE Value 1-247 17 (0x11) Type BYTE BYTE BYTE BYTE BYTE USHORT USHORT ULONG USHORT USHORT USHORT USHORT Value 1-247 17 (0x11) 18 80 (0x50) ‘P’ 255 (0xFF) = ON 1 600 Response The response to a slave id command is typically returned in less than 50 milliseconds. 8.6.2 Read Registers This function code is used to read the contents of a contiguous block of registers. Byte Offset 0 1 2-3 4-5 6 7 Command Field Description Device Address Function Code Starting Register Address Number of Registers (N) CRC Low CRC High 75 Type BYTE BYTE USHORT USHORT BYTE BYTE Value 1-247 3 (0x03) 0-65535 (0xFFFF) 1-125 (0x007D) PWS-600 User’s Manual Response Byte Offset 0 1 2 3 Field Description Device Address Function Code Byte Count Register Data Type BYTE BYTE BYTE 2 x N BYTES Value 1-247 3 (0x03) 2xN The starting register address is one less than the starting register number. The byte count returned will be two times the number of registers read. If the Read Registers function code is used to read data from a single register, the single register must be a single-register data type such as a USHORT. An attempt to read a single register from within a multiple-register data type will result in an exception response with the ILLEGAL DATA ADDRESS exception code. If the Read Registers function code is used to read a multiple-register data type, the start register address must be of the first register in the field and the number of registers must include all registers in the field. If one or both parameters are invalid, the device will return an exception response with the ILLEGAL DATA ADDRESS exception code. The Read Registers function code can be used to read data from multiple registers of the same or different data types. In this case, the starting register address must be of either a singleregister data type or the first register in a multiple-register data type. The last register read must be either a single-register data type or the last register in a multiple-register data type. Attempting to start or end the read within a multiple-register data type will result in an exception response with the ILLEGAL DATA ADDRESS exception code. Some registers are designated as write-only (W versus R/W in the register map). Attempting to read a write-only register, the device will result in an exception response with the WRITE-ONLY REGISTER exception code. The response to a read registers command is typically returned in less than 50 milliseconds. 76 PWS-600 User’s Manual 8.6.3 Write Multiple Registers This function code is used to write the contents of a contiguous block of registers. Byte Offset 0 1 2 4 6 7 Command Field Description Type Device Address BYTE Function Code BYTE Starting Register Address USHORT Number of Registers (N) USHORT Byte Count BYTE Register Data 2 x N BYTES Byte Offset 0 1 2 4 Field Description Device Address Function Code Starting Register Address Number of Registers Value 1-247 16 (0x10) 0-65535 (0xFFFF) 1-123 (0x007B) 2xN Response Type BYTE BYTE USHORT USHORT Value 1-247 16 (0x10) 0-65535 (0xFFFF) N The starting register address is one less than the starting register number. The byte count must be two times the number of registers to be written. If the Write Multiple Registers function code is used to write data to a single register, the register must be a single-register data type such as a USHORT. An attempt to write a single register within a multiple-register data type will result in an exception response with the ILLEGAL DATA ADDRESS exception code. If the Write Multiple Registers function code is used to write a multiple-register data type, the start register address must be of the first register in the field and the number of registers must include all registers in the field. If one or both parameters are invalid, the device will return an exception response with the ILLEGAL DATA ADDRESS exception code. The Write Multiple Registers function code can be used to write data to multiple registers of the same or different data types. In this case, the starting register address must be of either a single-register data type or the first register in a multiple-register data type. The last register written must be either a single-register data type or the last register in a multiple-register data type. Attempting to start or end the write within a multiple-register data type will result in an exception response with the ILLEGAL DATA ADDRESS exception code. Some registers are designated as read-only (R versus R/W in the register map). Attempting to write data to a read-only register will result in an exception response with the READ-ONLY REGISTER exception code. 77 PWS-600 User’s Manual If an attempt is made to write an out-of-range value to a register, an exception response with the ILLEGAL WRITE VALUE exception code will be returned. If the function returns an exception response with an exception code of ILLEGAL DATA ADDRESS or READ-ONLY REGISTER, no data was written to any of the registers. If the function returns an exception response with an exception code of ILLEGAL WRITE VALUE or DEVICE FAILURE, data was written to registers up to but not including the register that caused the exception. No data was written to registers after the register that caused the exception. There is no provision in the exception response to isolate the problem register. The response to a write multiple registers command is typically returned in less than 100 milliseconds. 8.6.4 Write Single Register This function code is used to write the contents of a single register. Only single-register data types can be written with this function. Writing to a multiple-register data type requires the Write Multiple Registers function code. Byte Offset 0 1 2 4 Command Field Description Device Address Function Code Register Address Register Data Type BYTE BYTE USHORT USHORT Value 1-247 6 (0x06) 0-65535 (0xFFFF) 0-65535 (0xFFFF) Type BYTE BYTE USHORT USHORT Value 1-247 6 (0x06) 0-65535 (0xFFFF) 0-65535 (0xFFFF) Response Byte Offset 0 1 2 4 Field Description Device Address Function Code Register Address Register Data The register address is one less than the register number. An attempt to write a single register within a multiple-register data type will result in an exception response with the ILLEGAL DATA ADDRESS exception code. Some registers are designated as read-only (R versus R/W in the register map). Attempting to write data to a read-only register will result in an exception response with the READ-ONLY REGISTER exception code. If an attempt is made to write an out-of-range value to a register, an exception response with the ILLEGAL WRITE VALUE exception code will be returned. 78 PWS-600 User’s Manual The response to a write single register command is typically returned in less than 100 milliseconds. 8.6.5 Exception Response When the device encounters an error condition in a command from the Master, it will reply to the command with the standard MODBUS exception response. Byte Offset 0 1 2 Exception Response Field Description Type Device Address BYTE Function Code + 128 (0x80) BYTE Exception Code BYTE Value 1-247 128-255 (0x80-0xFF) 0-255 (0xFF) 8.6.5.1 Standard Exception Codes The following exception codes are defined by the MODBUS protocol. Exception Code 1 (0x01) Name ILLEGAL FUNCTION 2 (0X02) ILLEGAL DATA ADDRESS 3 (0x03) ILLEGAL DATA VALUE 4 (0x04) DEVICE FAILURE 10 (0x0A) GATEWAY PATH UNAVAILABLE Description The function code received in the command is not valid for the device. The register address or the register range received in the command is not valid. A value contained in the command is not valid, such as a mismatch between the number of registers and the byte count. This exception indicates an error in the structure of a command. An error occurred in the device while attempting to perform the command. An attempt was made to use pass-through communication while data logging is enabled. 79 PWS-600 User’s Manual 8.6.5.2 Custom Exception Codes The following exception codes are device-specific extensions to the standard codes to help speed command/response troubleshooting. Exception Code 128 (0x80) Name READ-ONLY REGISTER 129 (0x81) WRITE-ONLY REGISTER 130 (0x82) ILLEGAL WRITE VALUE 131 (0x83) 132 (0x84) 133 (0x85) CORRUPT DATA RECORD DOWNLOAD END SECURITY MODE Description The command attempted to write data to a readonly register. The command attempted to read data from a writeonly register. The command attempted to write an illegal or out of bounds value. The requested data record is corrupted. End of fast data log download. The requested function is not available in security mode. 80