The information in this manual has been checked carefully and is believed to be accurate; however, Opto 22 assumes no
responsibility for possible inaccuracies or omissions. Specifications are subject to change without notice.
Opto 22 warrants all of its products to be free from defects in material or workmanship for 30 months from the
manufacturing date code. This warranty is limited to the original cost of the unit only and does not cover installation, labor,
or any other contingent costs. Opto 22 I/O modules and solid-state relays with date codes of 1/96 or newer are guaranteed
for life. This lifetime warranty excludes reed relay, SNAP serial communication modules, SNAP PID modules, and modules
that contain mechanical contacts or switches. Opto 22 does not warrant any product, components, or parts not
manufactured by Opto 22; for these items, the warranty from the original manufacturer applies. Refer to Opto 22 form
1042 for complete warranty information.
Wired+Wireless controllers and brains are licensed under one or more of the following patents: U.S. Patent No(s). 5282222,
RE37802, 6963617; Canadian Patent No. 2064975; European Patent No. 1142245; French Patent No. 1142245; British Patent
No. 1142245; Japanese Patent No. 2002535925A; German Patent No. 60011224.
ActiveX, JScript, Microsoft, MS-DOS, VBScript, Visual Basic, Visual C++, Windows, and Windows Vista are either registered
trademarks or trademarks of Microsoft Corporation in the United States and other countries. Linux is a registered
trademark of Linus Torvalds. ARCNET is a registered trademark of Datapoint Corporation. Modbus is a registered trademark
of Schneider Electric, licensed to the Modbus Organization, Inc. Wiegand is a registered trademark of Sensor Engineering
Corporation. Allen-Bradley, CompactLogix, ControlLogix, MicroLogix, SLC, and RSLogix are either registered trademarks or
trademarks of Rockwell Automation. CIP and EtherNet/IP are trademarks of ODVA.
groov includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit. (http://www.openssl.org)
All other brand or product names are trademarks or registered trademarks of their respective companies or organizations.
This guide provides information needed by original equipment manufacturers (OEMs) and others
who use SNAP input/output (I/O) modules without a SNAP serial or Ethernet-based brain.
This guide also applies to OEMs using SNAP I/O modules with an Opto 22 OEM brain such as the
SNAP-ARL-ASDS. I/O module physical and electrical interfaces and specifications are included, as
well as details of the protocols necessary for communication.
SNAP I/O Modules
SNAP I/O modules were designed as OEM products and also as components of Opto 22 SNAP I/O
systems. SNAP module types include:
•Four-channel SNAP digital modules—Each module provides four input or four output points.
AC and DC models are available with a wide variety of voltages; dry contact models are also
available.
•SNAP high-density digital modules, each providing more than four input or output points.
•SNAP analog modules—Analog modules provide
one to 32 input or output points, depending on the
model. Inputs include voltage, current, thermocouple,
RTD, and others. Outputs are current, voltage, or
time-proportional output.
•SNAP serial communication modules, each with two
channels for RS-232 or RS-485/422 communication,
depending on the model. (Other SNAP serial modules
are not documented in this guide; see their data sheets
for information.)
SNAP I/O Module Integration Guide 1
1
SNAP I/O MODULES
Choosing SNAP I/O Modules
To choose modules for your application, see our website, www.opto22.com, or refer to the following
data sheets, which are available on our website. Follow the link below or search on its form number.
Data sheetForm #
SNAP Digital Input Modules Data Sheet773
SNAP Digital Output Modules Data Sheet1144
SNAP Analog Input Modules Data Sheet1065
SNAP Analog Output Modules Data Sheet1066
SNAP Isolated Analog Input Modules Data Sheet1182
SNAP Serial Communication Modules Data Sheet1184
SNAP High-Density Digital Module Data Sheet1556
SNAP Load Cell Modules Data Sheet1590
SNAP Power Monitoring Modules Data Sheet1453
SNAP pH/ORP Module Data Sheet1416
HART SNAP I/O Modules Data Sheet2080
SNAP Mechanical Power Relay Output Module Data Sheet1967
Communicating with SNAP I/O Modules
Many SNAP I/O modules can be used either with or without an Opto 22 mounting rack and with or
without an Opto 22 brain.
If you are using a Linux-based OEM brain, you must use an Opto 22 rack, because the brain’s only
method of communicating with analog and serial modules is via the ARCNET communication built
into the rack.
The following table shows the methods of communication available for each type of module.
Module typeInterface or protocol
4-Channel Digital5 VDC logic (No protocol needed)
Analog
High-density digitalARCNET*
SerialARCNET*
*When used with a Linux-based OEM brain, communication with analog, high-density digital, and serial modules is via ARCNET on an
Opto 22 mounting rack. A driver is available for this brain; see the
readme file included with the driver for details.
Serial binary or serial ASCII
ARCNET*
2
SNAP I/O Module Integration Guide
About this Guide
NOTE: Email messages and phone
calls to Opto 22 Product Support
are grouped together and
answered in the order received.
This guide covers hardware, electrical, and protocol interfaces to SNAP digital, analog, and serial
modules. This guide assumes that you are already familiar with the communication protocols you
will use.
The following sections are included in this guide:
Chapter 1: Introduction—Information about the guide and how to reach Product Support
Chapter 2: Interfaces—Mechanical interface, including board layout and module mounting; and
electrical interface, including signal, power, ground, and data connections
Chapter 3: Communication Protocols—Details of the serial (binary or ASCII) and ARCNET
protocols used to communicate with SNAP I/O modules, including addressing, communication
details, and packet information
Chapter 4: Commands—Complete list of commands and the protocols they are used with, plus
details of the data required for each command.
For Help
CHAPTER 1: INTRODUCTION
If you have problems using SNAP I/O modules and cannot find the help you need in this guide or on
our Web site, contact Opto 22 Product Support.
Phone:800-TEK-OPTO (800-835-6786
toll-free in the U.S. and Canada)
951-695-3080
Monday through Friday,
7 a.m. to 5 p.m. Pacific Time
Fax:951-695-3017
Email:support@opto22.com
Opto 22 website:www.opto22.com
SNAP I/O Module Integration Guide
3
3
FOR HELP
4
SNAP I/O Module Integration Guide
Chapter 3
2: Interfaces
Mechanical Interface
All Modules
The following figure shows the mechanical interface for all SNAP modules. All dimensions are with
reference to pin 1 of the electrical connector.
Using Modules with an Opto 22 Mounting Rack
If you are using an Opto 22 mounting rack, the retention rail is built into the rack. The following
graphic shows a mounting rack with the retention rail.
SNAP I/O Module Integration Guide 5
5
MECHANICAL INTERFACE
IMPORTANT: The mounting rack connector has 24 pins; the module connector has 20 pins. The extra pins
on the mounting rack connector prevent misalignment of the module when installing.
Using Modules without an Opto 22 Mounting Rack
If you are not using an Opto 22 rack, lengths of retention rail suitable for mounting four modules or
six modules are available from Opto 22 distributors. The rails come in packs of 25:
•SNAP-RETN4B (4-Module retention rail, 25 pack)
•SNAP-RETN6B (6-Module retention rail, 25 pack)
Connectors and PEM nuts can be ordered from the following sources:
RS2-24-GPC Board mount 24-pin connector
Adam Tech
909 Rahway Ave.
Union, New Jersey 07083
Phone: (908) 687-5000
Fax: (908) 687-5710
Email: info@adam-tech.com
PEM NUT 4-40PC Board mount PEM nut for 4-40 screws
Penn Engineering & Mfg
5190 Old Easton Rd.
Danboro, PA 18916
Phone: 800-342-5736
Fax: (215) 766-3633
Email: info@pennfast.com
6
SNAP I/O Module Integration Guide
Electrical Interface
4-Channel Digital Input/Output Modules
The bottom view of the module in the following diagram shows the electrical interface pin
assignments for 4-channel digital modules. You read or write to each digital point using simple 5
VDC discrete signals.
CHAPTER 2: INTERFACES
4-channel digital modules require only 5-volt power and TTL level data connections to signals D0
through D3 on pins 2, 4, 6, and 8. Like earlier Opto 22 digital modules, SNAP 4-channel digital
modules use low-true logic (also called negative-true logic). A digital input point that is on returns a
logic 0 signal. A logic 0 control signal turns on a digital output point.
Most 4-channel digital modules require approximately 50 mA for all four channels. SNAP-ICD5-SW
and SNAP-IDC5SW-NC modules require 200 mA. “SNAP Module Power Requirements” on page 10
lists requirements for all modules.
SNAP I/O Module Integration Guide
7
7
ELECTRICAL INTERFACE
Notes:
1. Pins 1, 3, 5, and 7 set the module address. See “Module
Addresses” on page 12 for details.
2. An Opto 22 AC37 adapter card connection is shown as
typical. Any RS-485 serial port may be used.
3. Optional shielding may be used to reduce noise on
communications. Shields must not be grounded on
both ends of the communication link, but should be
grounded on one end only. Do NOT tie shield to signal
common or 5 VDC return.
4. Optional COM (common) wire is recommended to
reduce common-mode noise. Note that the COM
connection is not connected to Earth ground.
Analog Modules
The following figure shows the bottom view of the module with the electrical interface pin
assignments for analog modules.
If you are using the serial protocol, the serial ± connection is 2-wire RS-485. These data lines must be
multidropped to corresponding connector pins for each analog module on the bus. Serial data lines
must be terminated with a 220 Ohm resistor on the end of the communication network. The host
end of the communication line must also be biased and terminated. Since the address range of the
modules is 80 through 8F (hex), only 16 modules can be installed per data link.
If you are using ARCNET, NET+ and NET– are the ARCNET connections.
Other mandatory connections to the module are for +5 volt power, 5-volt return, Earth ground, and
connections to pins 1, 3, 5, and 7, which set the module’s address. For more information on
addressing, see page 11 for the serial protocol or page 17 for the ARCNET protocol.
The diagram below shows a typical serial data link connection to an analog module.
8
SNAP I/O Module Integration Guide
CHAPTER 2: INTERFACES
Resolution and Range
SNAP analog input modules have approximately 15.5-bit resolution in the nominal range,
supporting counts from -25,000 to +25,000. These modules support 10% over range and 10%
under range. The following example illustrates resolution and range for a SNAP-AIV module:
Module Channel
mode
SNAP-AIV
SNAP-AIV
0x22-10 to +10 VDC-11 VDC-10 VDC0 VDC10 VDC11 VDC
0x32-5 to +5 VDC-5.5 VDC-5 VDC0 VDC5 VDC5.5 VDC
Nominal
range
Under-
range limit
-110%-100%0%100%110%
-27,500-25,000025,00027,500
Low
scale
Counts
High
scale
Over-
range limit
SNAP analog output modules have 12-bit resolution, supporting counts from 0 to 4095 for a total
of 4096 counts. There are no under-range or over-range limits. Unipolar and bipolar modules both
receive zero counts at low scale, as shown in the examples below:
Low scaleHigh scale
Counts
ModuleNominal range020474095
SNAP-AOV-25
SNAP-AOV-27
0 to +10 VDC0 VDC5 VDC10 VDC
-10 to +10 VDC-10 VDC0 VDC10 VDC
Analog Module Power Requirements
See the table on page 10.
Other Modules
Serial communication modules and high-density digital modules must be used with the ARCNET
protocol. They cannot be used with the serial protocol.
See the table on page 10 for power requirements.
Serial Communication Modules
IMPORTANT: Commands available for the ARCNET protocol apply only to the following serial
communication modules:
•SNAP-SCM-232 Revision A modules (manufactured in June 2003 or after) with firmware R1.1e
or higher. These modules support optional RTS/CTS flow control.
•SNAP-SCM-232 modules manufactured before June 2003 with firmware R1.1o. These modules
do not support RTS/CTS flow control.
•SNAP-SCM-485-422 modules. (Modules manufactured before June 2003 with the part number
SNAP-SCM-485 do not work with the commands in this guide.)
SNAP I/O Module Integration Guide
9
9
ELECTRICAL INTERFACE
SNAP Module Power Requirements
ModuleRequirementsModuleRequirements
SNAP-IDC5-SW5 VDC @ 200 mASNAP-AIPM5 VDC @ 100 mA
SNAP-IDC5-SW-NC5 VDC @ 200 mASNAP-AIPM-35 VDC @ 100 mA
SNAP-OMR6-A5 VDC @ 160 mASNAP-AIPM-3V5 VDC @ 100 mA
SNAP-OMR6-C5 VDC @ 160 mASNAP-AIR40K-45 VDC @ 190 mA
Other 4-ch. digital modules 5 VDC @ 50 mASNAP-AIR400K-85 VDC @ 190 mA
SNAP-IAC-165 VDC @ 150 mASNAP-AIRATE5 VDC @ 190 mA
SNAP-IAC-A-165 VDC @ 150 mASNAP-AIRATE-HFi5 VDC @ 210 mA
SNAP-IAC-K-165 VDC @ 150 mASNAP-AIRTD5 VDC @ 190 mA
SNAP-IDC-165 VDC @ 150 mASNAP-AIRTD-105 VDC @ 190 mA
SNAP-IDC-HT-165 VDC @ 150 mASNAP-AIRTD-1K5 VDC @ 190 mA
SNAP-IDC-325 VDC @ 150 mASNAP-AITM5 VDC @ 170 mA
SNAP-IDC-32-FM5 VDC @ 150 mASNAP-AITM-i5 VDC @ 200 mA
SNAP-IDC-32D5 VDC @ 150 mASNAP-AITM-25 VDC @ 170 mA
SNAP-IDC-32DN5 VDC @ 150 mASNAP-AITM2-i5 VDC @ 200 mA
SNAP-IDC-32N5 VDC @ 150 mASNAP-AITM-4i5 VDC @ 150 mA
SNAP-ODC-32-SNK5 VDC @ 150 mASNAP-AITM-85 VDC @ 200 mA
SNAP-ODC-32-SNK-FM5 VDC @ 150 mASNAP-AIV5 VDC @ 170 mA
SNAP-ODC-32-SRC5 VDC @ 150 mASNAP-AIV-i5 VDC @ 200 mA
SNAP-ODC-32-SRC-FM5 VDC @ 150 mASNAP-AIV-45 VDC @ 170 mA
SNAP-AIARMS5 VDC @ 170 mASNAP-AIV-85 VDC @ 170 mA
SNAP-AIARMS-i5 VDC @ 200 mASNAP-AIV-325 VDC @ 150 mA
SNAP-AIARMS-i-FM5 VDC @ 200 mASNAP-AIV2-i5 VDC @ 200 mA
SNAP-AICTD5 VDC @ 150 mASNAP-AIVRMS5 VDC @ 170 mA
SNAP-AICTD-45 VDC @ 150 mASNAP-AIVRMS-i5 VDC @ 200 mA
SNAP-AICTD-85 VDC @ 170 mASNAP-AIVRMS-i-FM5 VDC @ 200 mA
SNAP-AILC5 VDC @ 120 mASNAP-AOA-35 VDC @ 140 mA
SNAP-AILC-25 VDC @ 120 mASNAP-AOV-55 VDC @ 150 mA
SNAP-AIMA5 VDC @ 170 mASNAP-AOA-235 VDC @ 150 mA
SNAP-AIMA2-i5 VDC @ 200 mASNAP-AOA-23-iH5 VDC @ 150 mA
SNAP-AIMA-45 VDC @ 170 mASNAP-AOV-255 VDC @ 150 mA
SNAP-AIMA-85 VDC @ 170 mASNAP-AOV-275 VDC @ 150 mA
SNAP-AIMA-325 VDC @ 150 mASNAP-AOA-285 VDC @ 150 mA
SNAP-AIMA-i5 VDC @ 200 mASNAP-AOD-295 VDC @ 150 mA
SNAP-AIMA-iH5 VDC @ 150 mASNAP-AOD-29-HFi5 VDC @ 300 mA
SNAP-AIMA-iSRC5 VDC @ 200 mASNAP-SCM-2325 VDC @ 250 mA
SNAP-AIMV-45 VDC @ 170 mASNAP-SCM-485-4225 VDC @ 250 mA
SNAP-AIMV2-45 VDC @ 170 mASNAP-SCM-PROFI5 VDC @ 250 mA
10
SNAP I/O Module Integration Guide
Chapter 4
3: Communication Protocols
Introduction
Opto 22 4-channel digital I/O modules require no protocol; they are simply read or written to using
5 VDC signals. Analog, high-density digital (HDD), and serial I/O modules, however, are “smart”
modules. Each one includes a processor. As shown in the table on page 2, the type of module
determines the methods available to communicate with it.
This chapter includes detailed descriptions of the Serial (binary or ASCII) and ARCNET protocols.
Serial Protocol (Binary or ASCII)
Each analog (or HDD or serial) input or output module is actually an addressable analog processor
that you can communicate with using either ASCII or binary serial modes. It is this on-module
intelligence that makes these SNAP modules such a powerful OEM tool.
Addressing
Each I/O module has its own address. Sixteen modules can be addressed per communications link.
Modules are addressed 80 through 8F hex.
Voltage to the module’s pins 1, 3, 5, and 7 determine the address, as shown in the table on the
following page.
SNAP I/O Module Integration Guide 11
11
SERIAL PROTOCOL (BINARY OR ASCII)
Module Addresses
Address (hex)Pin 7Pin 5Pin 3Pin 1
80GroundGroundGroundGround
81GroundGroundGround+5 Volts
82GroundGround+5 VoltsGround
83GroundGround+5 Volts+5 Volts
84Ground+5 VoltsGroundGround
85Ground+5 VoltsGround+5 Volts
86Ground+5 Volts+5 VoltsGround
87Ground+5 Volts+5 Volts+5 Volts
88+5 VoltsGroundGroundGround
89+5 VoltsGroundGround+5 Volts
8A+5 VoltsGround+5 VoltsGround
8B+5 VoltsGround+5 Volts+5 Volts
8C+5 Volts+5 VoltsGroundGround
8D+5 Volts+5 VoltsGround+5 Volts
8E+5 Volts+5 Volts+5 VoltsGround
8F+5 Volts+5 Volts+5 Volts+5 Volt
Point Numbers
Opto 22 point numbers on each module start with zero. The points on a four-channel analog input
module, for example, are referred to as point 0, point 1, point 2, and point 3.
12
SNAP I/O Module Integration Guide
CHAPTER 3: COMMUNICATION PROTOCOLS
Serial Communication
Default settings for the serial communication baud rate and protocol are shown in the following
table. To change serial port communication settings, use the bits shown in this table in the Data
byte of command 47 (see page 35).
Bits 7-6Reserved--reserved
CRC method is CRC16 Reverse
with a seed value of 0.
Bit 5Data Verification
Bit 4Protocol
Bits 3-0Baud Rate
0CRC16
1Checksum(default)
0Binary
1ASCII(default)
0reserved
1115.2k
2reserved
357.6k
438.4k
519.2k
69600(default)
74800
82400
91200
A600
B300
Creserved
Dreserved
Ereserved
Freserved
Serial Protocol Details
Unlike earlier Opto 22 protocols (such as mistic), every message in the SNAP I/O serial protocol
contains the address of both the source and the destination. A sequence identifier has also been
added to keep track of sequences of commands and responses. This provision allows smart devices
to perform with reduced communication overhead, resulting in higher performance.
Serial data can be transmitted in binary mode or ASCII mode. ASCII messages contain the same
information in the same order as binary messages, but they must start with the > (greater than)
character and end with a carriage return character. Each byte of ASCII data is transmitted as the ASCII
characters represented in the binary message. For example, binary data represented by 41 hex (the
character A) is transmitted as the two ASCII characters 4 and 1.
13
SNAP I/O Module Integration Guide
13
SERIAL PROTOCOL (BINARY OR ASCII)
85 01 04 20 01 00 41 EC
Add (in hex):
85+01+04+20+01+00+41 = EC
Take the least significant byte: EC
Message Field Definitions—Serial Protocol Packet
Abbrev.ContentsDefinition/Comments
DEST
SRCSource address of this packet
LEN
PRCProduct category
SEQSequence ID
MSTMessage type
CMD /
DATA
DVFData verification
Destination address of this
packet
Total number of bytes following the Length byte, excluding DVF and carriage return
Command or Data
or both
See “Addressing” on page 11.
For the host source address in an OEM application, use a value of
1. For module addressing, see page 11.
Length calculation starting with Product category and ending with
the last byte of the Command/Data fields. For ASCII, divide by 2.
The ASCII message is just the binary message (including LEN and
DVF) converted to ASCII.
Opto 22-defined classification of the message source. See “Product
Categories” on page 20.
A unique ID assigned by the host application to identify the order of
messages. Possible values: 0–255. Each message transmitted
from the host should increment the Sequence ID to distinguish it
from the previous message. The response sequence ID identifies
the message being responded to.
Opto 22-defined classification of the message type. See “Message
Types” on page 20.
Command number, data sent or received, or error code. For error
codes, see “Error Responses” on page 20.
Data verification field. Checksum requires 1 byte in binary mode or
2 bytes in ASCII mode. CRC requires 2 bytes in binary mode or 4
bytes in ASCII mode. See “About Data Verification” on page 14.
The ASCII version of the message is simply the binary message converted to ASCII format and then
encapsulated between the start-of-message character (>) and end-of-message character (carriage
return).
About Data Verification
The data verification field (DVF) is calculated on the complete binary message. (For ASCII, the
complete binary message including DVF is converted to ASCII.)
In the serial protocol, SNAP modules allow two types of data verification to be used on message
transactions, checksum and CRC16.
Calculating a Checksum
Here is a serial binary message sending a Powerup Clear Command (41) to a module at address
85 hex. The last byte is the checksum; it is calculated as shown:
14
SNAP I/O Module Integration Guide
CHAPTER 3: COMMUNICATION PROTOCOLS
Calculating a CRC16
CRC16 calculation is more complex. For CRC calculations, the method used is CRC16 Reverse, and
the seed (or starting) value is zero. Please see Opto 22 form #270, the Mistic Analog and Digital Command Manual, for more information.
Serial Message Examples
Command Message Format
# Bytes:11111110–1+ 1 or 2
Serial binaryDEST SRCLENPRCSEQMST
# Bytes:122222220–2+ 2 or 41
Serial ASCII>DEST SRCLENPRCSEQMST
NOTE: Do not send another command until you have received a response from the previous command or
have waited a reasonable timeout period.
DATA
CMDData
DATA
CMDData
DVF
DVF<cr>
Serial Binary Examples. The following is an example of Command 41 (Powerup Clear) sent to
the module at address 85 hex using the serial protocol in binary mode. All numbers are in hex.
DEST SRCLENPRCSEQMSTCMD DVF
85010420010041EC
This message is a total of 8 bytes. The checksum was calculated by taking the least significant byte of
the sum of the hex values:
85h + 01h + 04h + 20h + 01h + 00h + 41h = EC hex
If this message were viewed as a string of characters, not all of the characters would be printable. It
would look something like this:
Character
Description
à
Hex85010420010041EC
àSOHEOT space SOHnullA
The next example shows Command 52 (Group Read) used to read the point values on a SNAP-AIV
analog input module at address 8A.
DEST SRCLENPRCSEQMST CMDDVF
8A01042002005203
The following example shows how to write values to a SNAP-AOV-25 analog output module at
address 8B. Command 53 (Group Write) writes two 16-bit values for each point, but only 12 bits are
needed (see “Resolution and Range” on page 9). This example sets point 0 to 3.8 volts, which is 1556
counts in decimal, or 614 in hex. Point 1 is set to 8 volts, which is 3276 decimal counts, or 0xCCC.
A
DEST SRCLENPRCSEQMST CMDDATADVF
8B0108200600530614 0CCCFF
SNAP I/O Module Integration Guide
15
15
SERIAL PROTOCOL (BINARY OR ASCII)
Serial ASCII Example. The following example shows Command 41 (Powerup Clear) sent to the
module at address 85 hex using the serial protocol in ASCII mode. All numbers are in hex.
As you can see, the ASCII command is very similar to the binary command in the previous example.
Each nibble of binary data has been converted to an ASCII character, and the prefix (>) and suffix
(carriage return) have been added. The resulting message totals 18 bytes.
Response Message Format
# Bytes:1111110–1+ 1 or 2
Serial binaryDEST SRCLENPRCSEQMST DATA DVF
# Bytes:12222220–2+ 2 or 41
Serial ASCII>DEST SRCLENPRCSEQMST DATA DVF<cr>
Serial Binary Examples. The following shows an ACK response packet received after sending
Command 41 in the example above. This response uses the serial protocol in binary mode, and all
numbers are in hex.
DEST SRCLENPRCSEQMST CMD DVF
> 85010420010041ECcr
DEST SRCLENPRCSEQMSTDVF
0185038001010B
Again, the checksum is the least significant byte of the sum of the hex values:
The next example is a response to the Command 52 sent above, which read the values of the two
points on a SNAP-AIV analog input module. The response returns four 16-bit values, but since the
module has only two points, only the upper four bytes are significant.
DEST SRCLENPRCSEQMSTDATADVF
018A0380010109C4 3F7A 0000 000096
The response data indicates that point 0 has a value in counts of 0x09C4, or 2500 decimal, which for
a SNAP-AIV module equals 1 volt. (See “Resolution and Range” on page 9.) Point 1 has a value of
0x3F7A, or 16,250 decimal, which equals 6.5 volts.
Serial ASCII Example. The following is an ACK response packet received after sending
Command 41 in the example above. This response uses the serial protocol in ASCII mode. All
numbers are in hex.
DEST SRCLENPRCSEQMSTDVF
> 0185038001010Bcr
16
SNAP I/O Module Integration Guide
ARCNET Protocol
Addressing
Sixteen modules can be addressed per communications link. Every module is automatically
assigned an address when it is plugged into a position on the mounting rack.
The address is an offset of 80 hex added to the module’s position number on the rack (0 through 15
decimal, as shown on the rack, or 0 through F hex). For example, module 12 (decimal) is C in hex, so
its address is 8C. The following table shows the address assigned to each module position number.
Module #Address (hex)Module #Address (hex)
080888
181989
282108A
383118B
484128C
CHAPTER 3: COMMUNICATION PROTOCOLS
585138D
686148E
787158F
Point Numbers
Opto 22 point numbers on each module start with zero. The points on a four-channel analog input
module, for example, are referred to as point 0, point 1, point 2, and point 3.
Communication
The physical connections required for ARCNET communication are built into the Opto 22 SNAP
mounting rack. If you are using a SNAP-ARL-ASDS brain, you need to use the Opto 22 rack in order to
communicate with analog and serial modules.
SNAP I/O Module Integration Guide
17
17
ARCNET PROTOCOL
ARCNET Protocol Details
Message Field Definitions—ARCNET Protocol Packet
Abbrev.ContentsDefinition/Comments
SRC
DEST
CNTCountThe number of bytes following this byte, subtracted from 0x100
OSCOS code
PRCProduct category
SEQSequence ID
BNK / MST
CMD /
SCMD /
PRT / DATA
Source address of this
packet
Destination address of
this packet
Bank number and
Message type
Command, Subcommand, Port, Data, or
combination
For the host source address in an OEM application, use a value of 1.
For module addressing, see page 17.
See “Addressing” on page 17.
ARCNET Trade Association-defined vendor code (always DA for
Opto 22)
Opto 22-defined classification of the message source. See “Product
Categories” on page 20.
A unique ID assigned by the host application to identify the order of
messages. Possible values: 0–255. Each message transmitted from
the host should increment the Sequence ID to distinguish it from the
previous message. The response sequence ID identifies the message
being responded to.
Upper nibble is bank number (for SNAP modules, always 0); lower nibble is Opto 22-defined classification of the message type. See “Mes-
sage Types” on page 20.
Command and optional subcommand number, port if required (usually
for serial modules), data sent or received, or error code. For error
codes, see “Error Responses” on page 20.
ARCNET Message Examples
18
Command Message Format
# Bytes:111111110–20–10–1+
ARCNET SRC DEST CNTOSCPRCSEQ
NOTE: Do not send another command until you have received a response from the previous command or
have waited a reasonable timeout period.
Command Examples. The following is an example of Command 41 (Powerup Clear) sent to the
module at address 0x85 using the ARCNET protocol. All numbers are in hex.
SRC DEST CNTOSCPRCSEQ
0185FBDA20000041
SNAP I/O Module Integration Guide
BNK/
MST
CMD SCMD PRTData
BNK/
DATA
MST
DATA
CHAPTER 3: COMMUNICATION PROTOCOLS
Here’s an example of Command 63 (Clear Serial Port Receive Buffer) sent to port 1 on the serial
module at address 80:
SRC DEST CNTOSCPRCSEQ
0180F9DA200100637201
BNK/
MST
DATA
CMD SCMD PRT
Another example: This time Command 53 (Group Write) is used to write to the two points on a
SNAP-AOV-25 analog output module at address 8B. This command writes two 16-bit values, but
only 12 bits are used for each point (see “Resolution and Range” on page 9). The command sets
point 0 to 3.8 volts, which is 1556 counts in decimal, or 614 in hex. Point 1 is set to 8 volts, which is
3276 decimal counts, or 0xCCC.
SRC DEST CNTOSCPRCSEQ
018BF7DA200400530614 0CCC
BNK/
MST
DATA
CMDDATA
Response Message Format
# Bytes:11111110–1+
BNK/
ARCNET SRC DEST CNTOSC PRCSEQ
MST
DATA
Response Examples. The following shows the ACK response that might be received after the
sample Command 41 (Powerup Clear) is sent using the ARCNET protocol. All numbers are in hex.
SRC DEST CNTOSCPRCSEQ
8501FCDA800001
BNK/
MST
Here is an example of a response to a Command 52 (Group Read) reading the values of the two
points on a SNAP-AIV analog input module at address 8A. The response returns four 16-bit values,
but since the module has only two points, only the upper four bytes are significant.
SRC DEST CNTOSCPRCSEQ
8A01F4DA800A0109C4 3F7A 0000 0000
BNK/
MST
DATA
The data indicates that point 0 has a value in counts of 0x09C4, or 2500 decimal, which for a
SNAP-AIV module equals 1 volt. (See “Resolution and Range” on page 9.) Point 1 has a value of
0x3F7A, or 16,250 decimal, which equals 6.5 volts.
SNAP I/O Module Integration Guide
19
19
GLOBAL PROTOCOL DEFINITIONS
Global Protocol Definitions
The following tables define Opto 22 product categories, message types, and error responses. These
tables apply to both serial and ARCNET protocols.
Product Categories
0 - F (Hex)ReservedNumbers used by current products
10 - 1F (Hex)Brain Boards or BrainsUse 10 for brain boards or brains
20 - 2F (Hex)ControllersUse 20 for controllers
30 - 3F (Hex)HostsUse 30 for hosts
40 - 7FFuture expansion--
80 and aboveModulesUse 80 for modules
Message Types
TypeDescriptionByte Definition
0Send Data CommandData [252 Bytes Max]
1Ack Data [252 Bytes Max]
2Nack 1-byte errorError [1 Byte] Data [251 Bytes Max]
NOTE: All binary numeric values are Little Endian (Intel) format. For example, the decimal value 35,243
would be AB 89 in hex.
Error Responses
If an error occurs, the response shows 2 in the MST or BNK/MST byte (see “Message Types” on
page 20) and the error number in the DATA byte. Error numbers are listed below.
Error
ProtocolDescription
(hex)
Undefined command.
01
02
Serial or
ARCNET
Serial
only
This error occurs when the command does not match the situation, for example, if a write
command is used with an input module, or if a command 40 is sent to an older module that
does not support it. See notes on commands 40 (page 32) and 41 (page 33).
DVF (checksum or CRC) error
This error code indicates a problem with the communications link, which caused a DVF
error when a message from the host was sent to the I/O module. DVF errors often occur
when the RS-485 network is not wired, terminated, or biased properly. Make sure of the following
1. The link is terminated at the end points and NOT in the middle.
2. The link is biased in only one location, typically at the host end.
3. Twisted-pair cable is used.
4. The link is routed in a daisy-chain fashion, NOT a “star” type distribution.
20
SNAP I/O Module Integration Guide
Error
ProtocolDescription
(hex)
Device lost power since last message
04
Serial or
ARCNET
This error indicates that the module has reset. Configuration parameters may have been
lost. This error can only be cleared by issuing a Powerup Clear command (40 or 41). See
notes on commands 40 (page 32) and 41 (page 33).
CHAPTER 3: COMMUNICATION PROTOCOLS
Invalid length
This error occurs when the module receives a message that does not contain enough data
characters for that command.
Invalid data—limits sent are out of range
This error indicates that at least one of the data fields in the command message contains
an illegal value. Make sure that the values sent are within the range allowed by the configuration for that channel.
05
07
Serial or
ARCNET
Serial or
ARCNET
Module Types, Channel Modes, and Point Types
Analog Input Modules with Four Points or Less
The following table shows module types and channel modes for SNAP analog input modules with
four points or less. All numbers are shown in hex. Defaults are indicated by an asterisk (*). To change
channel mode, use command 3A, Set Channel Mode (see page 31).
SNAP Module Part
Number
SNAP-AIMA
2 channels, -20 mA to +20 mA *
2 channels, 0–20 mA
2 channels, 4–20 mA
Input Range/TypeModule Type
Analog Input Modules
Channel
(Hex)
6422
Mode (Hex)
2 channels, -20 mA to +20 mA *
SNAP-AIMA-i
SNAP-AIMA-iSRC
SNAP-AIMA-4
SNAP-AIMA2-i2 isolated channels, -1 to +1 mA2722
SNAP-AIMV-4
SNAP-AIMV2-4
SNAP-AITM
2 channels, 0–20 mA
2 channels, 4–20 mA
2 isolated channels, -20 mA to +20 mA *
2 channels, 0–20 mA
2 channels, 4–20 mA
4 channels, -20 mA to +20 mA *
4 channels, 0–20 mA
4 channels, 4–20 mA
4 channels, -150 mV to +150 mV *
4 channels, -75 mV to +75 mV
4 channels, -50 mV to +50 mV *
4 channels, -25 mV to +25 mV
2 channels, -150 mV to +150 mV *
2 channels, -75 mV to +75 mV
2222
2622
4022
44
45
66
20*
30
20*
30
20*
30
SNAP I/O Module Integration Guide
21
21
MODULE TYPES, CHANNEL MODES, AND POINT TYPES
SNAP Module Part
Number
SNAP-AITM-i
SNAP-AITM-2
SNAP-AITM2-i
SNAP-AITM-4i
SNAP-AIV
SNAP-AIV-i
SNAP-AIV-4
SNAP-AIV2-i
SNAP-AIV-72 (point 0)
SNAP-AIV-72 (point 1)
Input Range/TypeModule Type
2 channels, -150 mV to +150 mV *
2 channels, -75 mV to +75 mV
2 channels, -50 mV to +50 mV *
2 channels, -25 mV to +25 mV
2 channels, -50 mV to +50 mV *
2 channels, -25 mV to +25 mV
* Default
** The SNAP-AIPM module monitors one device from point 0 (volts) and point 1 (amps). Points 2 and 3 return
calculated values. See form #1453, the SNAP AIPM Modules Data Sheet, for details.
0 to 250 V RMS
0 to 10 Amps RMS
True Power
Vol t-A mps
2 channels, -2 to +2 mV/V *
2 channels, -3 to +3 mV/V
2 channels, -4 to +4 mV/V *
2 channels, -3 to +3 mV/V
2 channels, –1 to +1 VDC (high impedance) *
2 channels, –0.5 to +0.5 VDC (high impedance)
Input Range/TypeModule Type
(Hex)
0A
0B
0C
25
Channel
Mode (Hex)
57
57
Don’t set
mode
8C*
8D
8C*
8D
20
30
Analog Input Modules with More than Four Points
The following table shows module types and point types for SNAP analog input modules with more
than four points. (Channel modes are not used with these modules.)
All numbers are shown in hex. Defaults are indicated by an asterisk (*). To assign point type, use “Set
Point Configuration Command 3C” on page 31).
SNAP Module Part NumberInput Range/TypeModule Type
8 channels, 0 mA to +20 mA
8 channels, 4 mA to +20 mA
32 channels, -20 mA to +20 mA *
32 channels, 0 mA to +20 mA
32 channels, 4 mA to +20 mA
0 to 300 V RMS
0 to 5 Amps RMS
True Power
Volt-Am ps
True Power
0 to 300 V RMS
0 to 0.333 VAC from CT
True Power
Volt-Am ps
True Power
(Hex)
4A
4D
49
48
Point Type
(Hex)
40*
2
3
40*
2
3
46
47
52
53
56
64
59
5A
5A
B8
SNAP I/O Module Integration Guide
23
23
MODULE TYPES, CHANNEL MODES, AND POINT TYPES
SNAP Module Part NumberInput Range/TypeModule Type
0 to 400K Ohms *
0 to 400K Autorange
0 to 200K Ohms
0 to 100K Ohms
0 to 50K Ohms
0 to 40K Ohms
SNAP-AIR400K-8
SNAP-AITM-8
0 to 20K Ohms
0 to 10K Ohms
0 to 5K Ohms
0 to 4K Ohms
0 to 2K Ohms
0 to 1K Ohms
0 to 500 Ohms
8 channels, -75 mV to +75 mV *
8 channels, -50 mV to +50 mV
8 channels, -25 mV to +25 mV
8 channels, type B thermocouple
8 channels, type C thermocouple
8 channels, type D thermocouple
8 channels, type E thermocouple
8 channels, type G thermocouple
8 channels, type J thermocouple
8 channels, type K thermocouple
8 channels, type N thermocouple
8 channels, type R thermocouple
8 channels, type S thermocouple
8 channels, type T thermocouple
(Hex)
54
4F
Point Type
(Hex)
69
BC
6A
6B
6C
4A
4B
4C
4D
26
27
28
29
44*
9
43
18
20
21
13
1F
5
8
1E
11
17
12
SNAP-AIV-8
SNAP-AIV-32
SNAP-AICTD-88 channels, Temperature (ICTD) *4C4*
* Default
** The SNAP-AIPM-3 and SNAP-AIPM-3V modules monitor three phases from points 0, 4, and 8 (volts)
and points 1, 5, and 9 (amps). All other points return calculated values. See form #1453, the SNAP AIPM Modules Data Sheet, for details.
8 channels, -10 V to +10 V *
8 channels, -5 V to +5 V
32 channels, -10 V to +10 V *
32 channels, -5 V to +5 V
4B
4E
C*
B
C*
B
24
SNAP I/O Module Integration Guide
CHAPTER 3: COMMUNICATION PROTOCOLS
Analog Output, Serial, and High-Density Digital Modules
The following table shows module types for analog output modules, serial modules, and
high-density digital modules. Module types are shown in hex. (Neither channel modes nor point
types are used with these modules.)
ModuleDescriptionModule Type
Analog Output Modules
SNAP-AOA-31 channel, 4–20 mA83
SNAP-AOV-51 channel, 0–10 VDC85
SNAP-AOA-232 channels, current loop 4–20 mAA3
SNAP-AOA-23-iSRC2 isolated channels, current loop 4–20 mAB3
SNAP-AOV-252 channels, 0–10 VDCA5
SNAP-AOV-272 channels, -10 to +10 VDCA7
SNAP-AOA-282 channels, current loop 0–20 mAA8
SNAP-AOD-292 channels, time-proportional digital output 5–60 VDCA9
Serial Modules
SNAP-SCM-2322 channels, RS-232F0
SNAP-SCM-485-4222 channels, RS-485/422 (2-wire or 4-wire)F1
SNAP-SCM-PROFIOne electrical interface to PROFIBUS DP® networks.F6
High-Density Digital Modules
SNAP-IDC-32
SNAP-IDC-32-FM
32 channels, digital inputs, 10–32 VDCE0
(Hex)
SNAP-IDC-32N32 channels, digital inputs, -10 to -32 VDCE6
SNAP-IDC-32D32 channels, digital inputs, 2.5 to 12 VDCEB
SNAP-IDC-32DN32 channels, digital inputs, -2.5 to -12 VDCEA
SNAP-IDC-1616 isolated channels, digital inputs, 10–32 VDC/VACE5
SNAP-IDC-HT-1616 isolated channels, digital inputs, 15–28 VDC/VACE8
SNAP-IAC-1616 isolated channels, digital inputs, 90–140 VAC/VDCE4
SNAP-IAC-A-1616 isolated channels, digital inputs, 180–280 VAC/VDCE3
SNAP-IAC-K-1616 isolated channels, digital inputs, 70–130 VAC/VDCE7
SNAP-ODC-32-SRC
SNAP-ODC-32-SRC-FM
SNAP-ODC-32-SNK
SNAP-ODC-32-SNK-FM
32 channels, digital outputs, 5–60 VDC load sourcingE1
32 channels, digital outputs, 5–60 VDC load sinkingE2
SNAP I/O Module Integration Guide
25
25
MODULE TYPES, CHANNEL MODES, AND POINT TYPES
26
SNAP I/O Module Integration Guide
Chapter 5
4: Commands
Introduction
This chapter starts with a list of all commands and then details individual commands.
In this chapter, only the data required for each command is illustrated. For complete packet
information and examples, see “Serial Protocol Details” on page 13 or “ARCNET Protocol Details” on
page 18.
CAUTION: Notice that some commands have the same command number but apply to different types of
modules. For example, command 52 takes a different action depending upon what type of module
(analog input, TPO, high-density digital, or serial module) it is sent to. Make sure you address modules
carefully, so that commands will have the effect you intend.
IMPORTANT: The commands in this chapter support the following serial communication modules
only:
•SNAP-SCM-232 Revision A modules (manufactured in June 2003 or after) with firmware R1.1e
or higher. These modules support optional RTS/CTS flow control.
•SNAP-SCM-232 modules manufactured before June 2003 with firmware R1.1o. These modules
do not support RTS/CTS flow control.
•SNAP-SCM-485-422 modules. (Modules manufactured before June 2003 with the part number
SNAP-SCM-485 do not work with the commands in this guide.)
SNAP I/O Module Integration Guide 27
27
COMMAND LIST
Command List
Commands are shown in numerical order, in hex. Some commands have the same number; be sure
to choose the one that applies to your module.
Applies to Modules
Hex Serial ARCNETCommand
HDD*
Analog
23XRead Number of Received Data Bytes Waiting Xpage 30
54XXRead HDD Counters—Counters Not Cleared Xpage 40
55XXRead HDD Counters—Counters Cleared Xpage 40
55XXChannel Read Xpage 41
56XXChannel Write (Output and SNAP-AOD-29 modules only)Xpage 41
57XXSet TPO Period (SNAP-AOD-29 modules only)Xpage 42
58XWrite Outputs Xpage 42
58XXRead Status (TPO, Inhibit On/Off) (SNAP-AOD-29 modules only) Xpage 43
63XClear Serial Port Receive Buffer Xpage 43
66XRead Serial Port CTS (SCM-232 Rev A modules only)Xpage 44
66XSet Serial Port RTS (SCM-232 Rev A modules only)Xpage 44
28
SNAP I/O Module Integration Guide
CHAPTER 4: COMMANDS
Applies to Modules
Hex Serial ARCNETCommand
HDD*
=<4-ch
Analog
>4 ch
Analog
66XClear Serial Port RTS (SCM-232 Rev A modules only)Xpage 45
69X
71XRead Serial Port Configuration Xpage 46
71XWrite Serial Port Configuration Xpage 47
71XWrite Serial Port Configuration and Store to Flash Xpage 48
72XReceive Line of Serial Data Xpage 48
73XSend & Receive Serial Data Xpage 49
74XSend Serial Data Xpage 49
*HDD = high-density digital
**SNAP-SCM-232 and SNAP-SCM-485-422 modules only
Read Serial Module Info (SCM-232 Rev A, SCM-485-422 modules
only)
See
Serial**
Xpage 45
SNAP I/O Module Integration Guide
29
29
COMMAND DETAILS
Command Details
Read Number of Received Data Bytes Waiting Command 23
(SNAP-SCM-232 and SNAP-SCM-485-422 modules only)
ARCNET protocol only.
This command reads the quantity of bytes waiting in the serial port’s receive buffer.
Command Data Required
CMD1 byte 23
PRT1 byte Serial port: 00 for port 0, 01 for port 1
Response Data Received
Data2 bytes
Number of bytes of received data in the specified serial port’s receive buffer (2-byte
value in Big Endian format—most significant byte at lowest memory address)
Read Channel Mode Command 32
(Analog input modules with four points or less)
For analog input modules with 4 points or less, this command reads the current input channel
(point) mode. For possible channel modes, see “Module Types, Channel Modes, and Point Types” on
page 21.
To set channel mode, see command 3A on page 31
Command Data Required
CMD1 byte 32
Data1 byte Channel (point) number
Response Data Received
Data1 byte
Channel mode value for specified point (See “Module Types, Channel Modes, and Point
Types” on page 21.)
30
SNAP I/O Module Integration Guide
CHAPTER 4: COMMANDS
Set Channel Mode Command 3A
(Analog input modules with 4 points or less)
For analog inputs for 4 points or less, this command sets the channel (point) mode. For possible
modes, see “Module Types, Channel Modes, and Point Types” on page 21.
To save this information to EEPROM, use command 45.
For analog input modules with more than 4 channels, see “Set Point Configuration Command 3C,”
below.
Command Data Required
CMD1 byte 3A
MSB
LSB
1 byte
1 byte
Data
Response Data Received
No response data
Channel (point) number
Channel mode value
Set Point Configuration Command 3C
(Analog input modules with more than four points)
For analog inputs with more than 4 points, this command configures the specified point. For
possible configurations, see “Analog Input Modules with More than Four Points” on page 23.
If the point configuration data sent with the command is not valid, the default configuration for the
module is used. Non-existing channels are ignored.
For a similar command to use with 4-channel analog input modules, see “Set Channel Mode
Command 3A,” above.
Command Data Required
CMD1 byte 3C
MSB
LSB
1 byte
1 byte
Data
Response Data Received
No response data
Channel (point) number
Point configuration (see page 23)
SNAP I/O Module Integration Guide
31
31
COMMAND DETAILS
Powerup Clear—Current ModulesCommand 40
This initialization command is used to acknowledge that the modules has powered up since the last
time the brain communicated with it. This command also enables the command watchdog timer
on the module (see notes, below). The command watchdog timer monitors commands received via
Arcnet for that module address; if a command is received by the module via Arcnet at least once
every 6 seconds, the module will function as normal. However, if the module does not receive a
command via Arcnet within a 6 second period, it will assume there is a problem with Arcnet
communication, and it initiate an Arcnet bus reconfiguration.
This command must be sent before any other commands will be recognized. This command clears
the “Powerup Clear expected” error flag.
Notes: Normal Arcnet command/response times are on the order of milliseconds, so 6 seconds without any
Arcnet communication would indicate an abnormal condition.
The command watchdog timer is available on most SNAP I/O modules manufactured after 2004. It is
strongly recommended that you use command 40 with modules that support the command watchdog
timer. For example, you can initially send command 40 and see if you get a valid response. If you do, then
you know that module supports the command watchdog feature. However, you will receive a NAK
response if the module does not support this feature. In that case, use command 41 instead.
Command Data Required
CMD1 byte 40
Response Data Received
No response data
32
SNAP I/O Module Integration Guide
CHAPTER 4: COMMANDS
Powerup Clear—Legacy ModulesCommand 41
This initialization command is used to acknowledge that the modules has powered up since the last
time the brain communicated with it. This command also disables the command watchdog timer
on the module. It should be used only for legacy modules; for newer modules that contain a
watchdog, we strongly recommend that you enable the command watchdog feature by using
command 40 instead.
A Powerup Clear must be sent before any other commands will be recognized. This command clears
the “Powerup Clear expected” error flag. If used on a module with a watchdog timer, it disables the
timer.
Note: See notes on command 40 for information about the command watchdog feature.
Command Data Required
CMD1 byte 41
Response Data Received
No response data
Reset Command 42
(Analog input and output modules only)
This command causes a soft reset of the module’s microprocessor.
Like the automatic reset upon powerup, this Reset command must be followed by a Powerup Clear
command (41) to restore normal operation.
Command Data Required
CMD1 byte 42
Response Data Received
No response data
SNAP I/O Module Integration Guide
33
33
COMMAND DETAILS
Read Amount of Unused Space in Transmit Buffer Command 42
(SNAP-SCM-232 and SNAP-SCM-485-422 modules only)
ARCNET protocol only.
This command reads the number of bytes of available space in the specified serial port’s transmit
buffer. This command can be used to prevent overrun of the buffer.
Command Data Required
CMD1 byte 42
PRT1 byte Serial port number: 00 for port 0; 01 for port 1
Response Data Received
Data4 bytes
Number of bytes that can be added to the serial port’s transmit buffer without overrunning it
(4-byte value in Big Endian format—most significant byte at lowest memory address)
Save Current Module Configuration in EEPROM Command 45
(Analog input modules only)
This command saves channel mode (set with command 3A) and serial port settings (command 47)
to EEPROM. Settings are then used automatically upon powerup or reset.
Command Data Required
CMD1 byte 45
Response Data Received
No response data
34
SNAP I/O Module Integration Guide
CHAPTER 4: COMMANDS
Identify Module Type Command 46
This command reads a 2-byte identification number. The upper byte identifies the product as a
module; the lower byte indicates the module type. For more information, see “Module Types,
Channel Modes, and Point Types” on page 21.
Command Data Required
CMD1 byte46
Response Data Received
MSB
Data
LSB
1 byte
1 byte
80 = module
Module type. See “Module Types, Channel Modes, and Point Types” on page 21.
Set Serial Port Configuration Command 47
Serial protocol only.
This command sets or resets the module’s serial port parameters for communication using the serial
protocol. See “Serial Communication” on page 13.
Command Data Required
CMD1 byte 47
Data1 byte Serial port configuration. See “Serial Communication” on page 13.
Response Data Received
No response data
SNAP I/O Module Integration Guide
35
35
COMMAND DETAILS
Set Serial Port Response Delay Command 48
Serial protocol only.
This command sets a time delay after command execution before a response or ack is returned. This
feature may be useful when switching times of modems or if protocol delays need a dead time
between serial transmissions.
(All modules except SNAP-SCM-232 and SNAP-SCM-485-422)
This command is used for troubleshooting, usually with the help of Opto 22 Product Support; it
reads the version number of the module’s firmware.
Command Data Required
CMD1 byte 49
Response Data Received
Data2 bytes Firmware version number
36
SNAP I/O Module Integration Guide
CHAPTER 4: COMMANDS
Group Read Command 52
(Analog modules with more than four points)
ARCNET protocol only.
For analog modules with more than four channels, this command returns two 16-bit values,
corresponding to points 0–31 on the module. The first 16-bit value, “field terminal counts,” applies to
all these modules. The second 16-bit value, “cold junction counts,” applies only to modules used as
thermocouples; ignore these bytes for other modules. The data is unmodified from the ADC
(analog-to-digital converter—sign plus 15 bits).
Command Data Required
CMD1 byte52
Response Data Received
Point 0 field terminal counts
Point 0 cold junction counts (thermocouples only)
Point 1 field terminal counts
Point 1 cold junction counts (thermocouples only)
:
:
Point 31 field terminal counts
Point 31 cold junction counts (thermocouples only) (Total of 128 bytes for 32 points)
Data
MSB
LSB
2 bytes
2 bytes
2 bytes
2 bytes
2 bytes
2 bytes
Group Read Command 52
(Analog 4-channel input and SNAP-AOD-29 TPO modules only)
For analog input modules, this command returns four 16-bit values, corresponding to points 0–3 on
the module. The data is unmodified from the ADC (analog-to-digital converter); however, offset and
gain modifications are applied.
For the TPO module, this command returns the TPO and period for both channels.
Command Data Required
CMD1 byte52
Response Data Received
Point 0 data (or TPO percent for point 0)
Point 1 data (or TPO period for point 0)
Point 2 data (or TPO percent for point 1)
Point 3 data (or TPO period for point 1)
Data
MSB
LSB
2 bytes
2 bytes
2 bytes
2 bytes
SNAP I/O Module Integration Guide
37
37
COMMAND DETAILS
Read Status—Latches Not Cleared Command 52
(High-density digital input modules only)
ARCNET protocol only.
For high-density digital input modules, this command reads status, on latches, and off latches for all
points. Latches remain as read; they are not cleared. The command returns four 32-bit values, each
corresponding to points 0–31 on the module.
To read and clear latches, see “Read Status—Latches Cleared Command 53” on page 39.
Command Data Required
CMD1 byte52
Response Data Received
Status of all points (1 = On; 0 = Off)
On-latches set (1 = latch set; 0 = latch clear)
Off-latches set (1 = latch set; 0 = latch clear)
(Future use)
Data
MSB
LSB
4 bytes
4 bytes
4 bytes
4 bytes
Receive Serial Data Command 52
(SNAP-SCM-232 and SNAP-SCM-485-422 modules only)
ARCNET protocol only.
This command receives up to the number of serial bytes specified on the specified port, to a
maximum of 249. This command does not look for an end-of-line (EOL) character. To receive a line of
serial data, see Command 72 (page 48).
Command Data Required
CMD1 byte 52
PRT1 byte Serial port number: 00 for port 0; 01 for port 1
Data1 byte Number of bytes to be received (cannot be more than 249)
38
Response Data Received
Data
0 249
bytes
SNAP I/O Module Integration Guide
Serial data from specified port’s receive buffer. Up to 249 received data bytes can be
included in the response.
CHAPTER 4: COMMANDS
Group Write Command 53
(Dual-channel analog output modules only)
This command writes two 16-bit values (12 bits used) to point 0 and point 1 of a dual-channel
output module. For examples of how to write data, see “Serial Message Examples” on page 15 or
“ARCNET Message Examples” on page 18.
Sending this command to a single-channel output module results in an undefined command error
(error 01; see “Error Responses” on page 20).
Command Data Required
CMD1 byte 53
MSB
LSB
2 bytes
2 bytes
Data
Response Data Received
No response data
Data to write to point 0
Data to write to point 1
Read Status—Latches Cleared Command 53
(High-density digital input modules only)
ARCNET protocol only.
For high-density digital input modules, this command reads status, on latches, and off latches for all
points, and it clears all latches after reading. The command returns four 32-bit values, each
corresponding to points 0–31 on the module.
To read without clearing latches, see “Read Status—Latches Not Cleared Command 52” on page 38.
Command Data Required
CMD1 byte53
Response Data Received
Status of all points (1 = On; 0 = Off)
On-latches set (1 = latch set; 0 = latch clear)
Off-latches set (1 = latch set; 0 = latch clear)
(Future use)
Data
MSB
LSB
4 bytes
4 bytes
4 bytes
4 bytes
SNAP I/O Module Integration Guide
39
39
COMMAND DETAILS
Read HDD Counters—Counters Not Cleared Command 54
(High-density digital modules only)
For high-density digital (HDD) modules, this command reads counters for all points on the module
but does not clear counters. The command returns two 16-bit values, corresponding to points 31–0
on the module.
To read and clear counters at the same time, see “Read HDD Counters—Counters Cleared
Command 55,” below.
Command Data Required
CMD1 byte 54
Response Data Received
Point 31 counter
Point 30 counter
:
:
Point 0 counter
Data
MSB
LSB
2 bytes
2 bytes
2 bytes
Read HDD Counters—Counters Cleared Command 55
(High-density digital modules only)
For high-density digital (HDD) modules, this command reads and clears counters for all points on
the module. The command returns two 16-bit values, corresponding to points 31–0 on the module.
To read counters without clearing them, see “Read HDD Counters—Counters Not Cleared
Command 54,” above.
Command Data Required
CMD1 byte 55
Response Data Received
40
etc.
Point 31 counter
Point 30 counter
Point 29 counter
Point 28 counter
etc. to Point 0
Data
2 bytes
2 bytes
2 bytes
2 bytes
SNAP I/O Module Integration Guide
CHAPTER 4: COMMANDS
OnTime
OutputData
4095
-------------------------------
Period=
Output Data4095
DesiredOnTime
Period
------------------------------------------
=
Channel Read Command 55
(Analog modules with more than four points)
For analog modules with more than four points, this command returns two 16-bit values for the
specified point on the module. The data is unmodified from the ADC (analog-to-digital converter—
sign plus 15 bits); however, offset and gain modifications are applied.
Command Data Required
CMD1 byte 55
Data1 byte Point number (00 to 03 hex)
Response Data Received
Data
2 bytes
2 bytes
Field terminal counts for specified point
Cold junction counts for specified point
Channel Write Command 56
(Analog output and SNAP-AOD-29 TPO modules only)
On an analog output module, this command writes a 16-bit value (12 bits used) to the specified
output channel (point) on the module.
On a TPO module, this command writes the TPO “on” time (duty cycle) for the period.
Note: On Time and Period are both in units of seconds.
To set the period, use command 57.
Command Data Required
CMD1 byte 56
1 byte
Data
2 bytes
Response Data Received
No response data
Point number (00 or 01)
Output data for point
SNAP I/O Module Integration Guide
41
41
COMMAND DETAILS
Value
Period
0.251
-----------------
1–=
Set TPO Period Command 57
(SNAP-AOD-29 TPO modules only)
This command sets the time-proportional output (TPO) period for a single channel (point) on a
SNAP-AOD-29 output module. Use command 56 to set the TPO “on” time.
Command Data Required
CMD1 byte 57
1 byte
Data
2 bytes
Determine the value to set the period as shown below. “Period” in the equation is the desired period
in units of seconds.
Valid limits: period of 0.251 seconds at 0; 16,449.536 seconds at 65,535.
Response Data Received
Point number (00 or 01)
Value to set the period. See equation below.
No response data
Write Outputs Command 58
(High-density digital output modules only)
ARCNET protocol only.
For high-density digital output modules, this command writes status to all 32 output points on the
module at once. The command uses two masks: one determines which points to write to, and the
other determines whether to write “on” or “off.”
NOTE: Sending this command to a 32-channel input module will result in an undefined command error.
Command Data Required
CMD1 byte 58
4 bytes
Data
4 bytes
4 bytes
Response Data Received
Set output points (1 = On; 0 = Off)
Points to write to (1 = ignore point; 0 = write to point)
Future use
42
SNAP I/O Module Integration Guide
No response data
CHAPTER 4: COMMANDS
0TPO 0 LED 1; 1 = Output On
1TPO 1 LED 2; 1 = Output On
2Inhibit 0 LED 3; 1 = Inhibit
3Inhibit 1 LED 4; 1 = Inhibit
4TPO 0 Status before its inhibit; 1 = Output On
5TPO 1 Status before its inhibit; 1 = Output On
6–7 Reserved
Read Status (TPO, Inhibit On/off) Command 58
(SNAP-AOD-29 TPO modules only)
This command reads an 8-bit value from the SNAP-AOD-29 TPO module. The 8-bit value contains
the output status, the inhibit status, and the output status just prior to inhibit. Only the first six bits
are used. See table below.
Command Data Required
CMD1 byte 58
Response Data Received
TPO status. Bit functions are:
Data1 byte
Clear Serial Port Receive Buffer Command 63
(SNAP-SCM-232 and SNAP-SCM-485-422 modules only)Subcommand 72
ARCNET protocol only.
This command clears any received data from the specified serial port’s receive buffer.
Command Data Required
CMD1 byte 63
SCMD 1 byte 72
PRT1 byte Serial port number: 00 for port 0; 01 for port 1
Response Data Received
No response data
SNAP I/O Module Integration Guide
43
43
COMMAND DETAILS
Read Serial Port CTS Command 66
(SNAP-SCM-232 Rev A modules only)Subcommand 72-63
ARCNET protocol only.
This command reads the state of the CTS signal for the specified serial port.
NOTE: If this command is used on a serial module with hardware prior to Rev A, an undefined command
error is returned. (Older hardware does not support RTS/CTS.)
Command Data Required
CMD1 byte 66
SCMD
Response Data Received
1 byte
1 byte7263
PRT1 byte Serial port number: 00 for port 0; 01 for port 1
Data1 byte CTS: 01 = asserted; 00 = deasserted
Set Serial Port RTS Command 66
(SNAP-SCM-232 Rev A modules only)Subcommand 73-72
ARCNET protocol only.
This command sets (asserts) the RTS signal for the specified serial port. This command has no effect
on RTS if the serial port is configured for hardware flow control.
Command Data Required
CMD1 byte 66
SCMD
Response Data Received
No response data
1 byte
1 byte7372
PRT1 byte Serial port number: 00 for port 0; 01 for port 1
44
SNAP I/O Module Integration Guide
CHAPTER 4: COMMANDS
Clear Serial Port RTS Command 66
(SNAP-SCM-232 Rev A modules only)Subcommand 63-72
ARCNET protocol only.
This command clears (deasserts) the RTS signal for the specified serial port. This command has no
affect on RTS if the serial port is configured for hardware flow control.
Command Data Required
CMD1 byte 66
SCMD
Response Data Received
No response data
1 byte
1 byte6372
PRT1 byte Serial port number: 00 for port 0; 01 for port 1
Read Serial Module Info Command 69
(SNAP-SCM-232 Rev A and SNAP-SCM-485-422 modules only)Subcommand 72
ARCNET protocol only.
This command reads module type and hardware and firmware versions.
NOTE: If this command is used on a serial module with older hardware (SNAP-SCM-232 prior to Rev A or
SNAP-SCM-485), an undefined command error is returned.
Command Data Required
CMD1 byte 69
SCMD 1 byte 72
Response Data Received
1 byte
1 byte
4 bytes
4 bytes
Data
4 bytes
Module type; see page 25.
Module subtype = 01 for Revision A
Hardware revision date. Format is DDMMYYYY in hex (1B0A07D4 = 27 October 2004)
Loader version number in the format MMmmTTbb (in hex), where:
MM = Major version
mm = Minor version
TT = Type (00 = alpha; 01 = beta; 02 = release)
bb = Build number (00–FF)
Example: 0103020E = R1.3o
Firmware version number in same format as loader revision
SNAP I/O Module Integration Guide
45
45
COMMAND DETAILS
Read Serial Port Configuration Command 71
(SNAP-SCM-232 and SNAP-SCM-485-422 modules only)Subcommand 67
ARCNET protocol only.
This command reads the port configuration for all serial ports on the module.
Command Data Required
CMD1 byte 71
SCMD 1 byte 67
Response Data Received
Data
(total
51
bytes)
4 bytes
1 byte
1 byte
1 byte
1 byte
1 byte
4 bytes
1 byte
1 byte
1 byte
1 byte
1 byte
5 bytes
1 byte
10 bytes
5 bytes
1 byte
10 bytes
1 byte
Port 0: Data rate, bps (32-bit integer in Big Endian format)
Port 0: Parity. N = none, O = odd, E = even, M = mark, S = space
Port 0: Number of data bits (5–8)
Port 0: Stop bits (1, 2)
Port 0: Handshake. 0 = none, 1 = hardware (RTS/CTS full duplex flow control)
Port 0: Port greeting enabled on powerup. 1 = yes, 0 = no
Port 1: Data rate, bps (32-bit integer in Big Endian format)
Port 1: Parity. N = none, O = odd, E = even, M = mark, S = space
Port 1: Number of data bits (5–8)
Port 1: Stop bits (1, 2)
Port 1: Handshake. 0 = none, 1 = hardware (RTS/CTS full duplex flow control)
Port 1: Port greeting enabled on powerup. 1 = yes, 0 = no
Port 0: End-of-line terminating character list. Contains a null-terminated string of up to 4 EOL
terminating characters.
Port 0: Filter out sequential duplicate lines. 1 = yes, 0 = no
Port 0: Reserved
Port 1: End-of-line terminating character list. Contains a null-terminated string of up to 4 EOL
terminating characters.
Port 1: Filter out sequential duplicate lines. 1 = yes, 0 = no
Port 1: Reserved
Mode. 0 = 2-wire, 1 = 4-wire (SCM-485-422 modules only)
46
SNAP I/O Module Integration Guide
CHAPTER 4: COMMANDS
Write Serial Port Configuration Command 71
(SNAP-SCM-232 and SNAP-SCM-485-422 modules only)Subcommand 6E
ARCNET protocol only.
This command writes port configuration to all serial ports on the module. Configuration is not
stored to flash; to write the configuration and store it to flash, use command 71 with subcommand
73 (page 48).
Command Data Required
CMD1 byte 71
SCMD 1 byte 6E
Port 0: Data rate, bps (32-bit integer in Big Endian format)
Port 0: Parity. N = none, O = odd, E = even, M = mark, S = space
Port 0: Number of data bits (5–8)
Port 0: Stop bits (1, 2)
Port 0: Handshake. 0 = none, 1 = hardware (RTS/CTS full duplex flow control)
Port 0: Port greeting enabled on powerup. 1 = yes, 0 = no
Port 1: Data rate, bps (32-bit integer in Big Endian format)
Port 1: Parity. N = none, O = odd, E = even, M = mark, S = space
Port 1: Number of data bits (5–8)
Port 1: Stop bits (1, 2)
Port 1: Handshake. 0 = none, 1 = hardware (RTS/CTS full duplex flow control)
Port 1: Port greeting enabled on powerup. 1 = yes, 0 = no
Port 0: End-of-line terminating character list. Contains a null-terminated string of up to 4 EOL
terminating characters.
Port 0: Filter out sequential duplicate lines. 1 = yes, 0 = no
Port 0: Reserved
Port 1: End-of-line terminating character list. Contains a null-terminated string of up to 4 EOL
terminating characters.
Port 1: Filter out sequential duplicate lines. 1 = yes, 0 = no
Port 1: Reserved
Mode. 0 = 2-wire, 1 = 4-wire (SCM-485-422 modules only; has no effect on SCM-232)
Data
(total
51
bytes)
4 bytes
1 byte
1 byte
1 byte
1 byte
1 byte
4 bytes
1 byte
1 byte
1 byte
1 byte
1 byte
5 bytes
1 byte
10 bytes
5 bytes
1 byte
10 bytes
1 byte
Response Data Received
No response data
SNAP I/O Module Integration Guide
47
47
COMMAND DETAILS
Write Serial Port Configuration and Store to Flash Command 71
(SNAP-SCM-232 and SNAP-SCM-485-422 modules only)Subcommand 73
ARCNET protocol only.
This command writes port configuration to all serial ports on the module and stores configuration to
flash. If you don’t want to store to flash, use command 71 with subcommand 6E (page 47).
Command Data Required
CMD1 byte 71
SCMD 1 byte 73
Data 51 bytes Same details as command 71, subcommand 6E (see page 47)
Response Data Received
No response data
Receive Line of Serial Data Command 72
(SNAP-SCM-232 and SNAP-SCM-485-422 modules only)
ARCNET protocol only.
This command receives one line of data (or 249 bytes, whichever is shorter) from the specified serial
port. A line ends when one of the configured end-of-line (EOL) terminating characters for the serial
port appears.
If an EOL character is found in data received by the serial port, all data bytes up to the EOL character
are returned in the response. The EOL character itself is thrown away. This command cannot return
more than 249 bytes of received data. If an EOL character is not detected within 249 bytes, the first
249 bytes received are returned. If there are less than 249 bytes and no EOL, the response comes
back immediately with no characters. (To retrieve data in this situation, use Command 52, Receive
Serial Data.)
Command Data Required
CMD1 byte 72
PRT1 byte Serial port number: 00 for port 0; 01 for port 1
Response Data Received
Data
0 to 249
bytes
One line of data from the serial port’s receive buffer, ending at EOL character or at
249 bytes, whichever is shorter
48
SNAP I/O Module Integration Guide
CHAPTER 4: COMMANDS
Send & Receive Serial Data Command 73
(SNAP-SCM-232 and SNAP-SCM-485-422 modules only)
ARCNET protocol only.
This command transmits up to 247 data bytes out the specified serial port and immediately returns
any data in the serial port’s receive buffer in response. This command is the same as using command
74, Send Serial Data Only (page 49) followed by command 52, Receive Serial Data Only (page 38),
but it is more efficient since it requires only one command/response transaction.
Command Data Required
CMD1 byte73
PRT1 byteSerial port number: 00 for port 0; 01 for port 1
0 to 247
Data
bytes
Response Data Received
Data to transmit out serial port. Maximum 247 bytes.
Data
1 byte to
249 bytes
Serial data from specified port’s receive buffer. Up to 249 received data bytes can be included
in the response.
Send Serial Data Command 74
(SNAP-SCM-232 and SNAP-SCM-485-422 modules only)
ARCNET protocol only.
This command transmits up to 247 data bytes out the specified serial port.
To transmit and receive in the same command, use command 73, Send & Receive Serial Data.
Command Data Required
CMD1 byte74
PRT1 byteSerial port: 00 for port 0, 01 for port 1
1 byte to
Data
247 bytes
Response Data Received
Data to transmit out serial port. Maximum 247 bytes.
EEPROM, saving to, 34, 48
electrical specifications, 7
enabling watchdog timer, 32, 33
error numbers, 20
error responses, 20
example
ARCNET protocol message
reading input (ARCNET protocol), 19
reading input (serial protocol), 16
serial protocol message, 15
writing to output (ARCNET protocol), 19
writing to output (serial protocol), 15
, 18
F
field definitions
ARCNET protocol
serial protocol, 14
firmware, reading version, 36, 45
flash memory
saving to
storing serial module configuration, 48
format
ARCNET protocol message
binary numeric values, 20
serial protocol message, 15
, 18
, 34
, 18
G
Group Read, 37
Group Write, 39
H
hardware
reading version
serial modules supported, 9
help
Product Support
, 45
, 3
I
Identify Module Type, 35
inhibit status (TPO), 43
input
reading values, ARCNET protocol example
reading values, serial protocol example, 16
interface
electrical
mechanical, 5
, 7
L
latches, 38, 39
Linux brain, 2, 17
list of commands, 28
low scale, 9
M
mechanical specifications, 5
message field definitions
ARCNET protocol
serial protocol, 14
message types, 20
module
addressing for ARCNET protocol
addressing for serial protocol, 11
choosing modules, 2
communicating with, 2
mounting rack, 5
power requirements, 10
types, 1, 21
, 18
, 17
identifying, 35
mounting rack, 5
MST, 20
O
Opto 22 Product Support, 3
, 19
52
SNAP I/O Module Integration Guide
output
writing values to, ARCNET protocol example
writing values to, serial protocol example, 15
over range, 9
, 19
P
packet
ARCNET protocol
serial protocol, 14
point
configuring
numbering, 12, 17
types, 23
port settings for serial protocol, 13
power requirements for modules, 10
Powerup Clear, 32, 33
PRC, 20
product categories, 20
Product Support, 3
protocol
ARCNET
, 17
choosing, 2
serial, 11
, 18
, 23
R
rack, 5
range, 9
Read Amount of Unused Space in Transmit Buffer,
34
Read and Clear HDD Counters, 40
Read Channel Mode, 30
Read HDD Counters, 40
Read Module Firmware Version, 36
Read Number of Received Data Bytes Waiting, 30
Read Serial Module Info, 45
Read Serial Port Configuration, 46
Read Serial Port CTS, 44
Read Status (TPO, Inhibit On/Off), 43
Read Status—Latches Cleared, 39
Read Status—Latches not Cleared, 38
reading analog input points, 16, 19, 37, 41
Receive Line of Serial Data, 48
Receive Serial Data, 38
Reset, 33
resolution, 9
response
errors
, 20
message format (ARCNET protocol), 19
message format (serial protocol), 16
RTS, 45
modules supported, 9
setting, 44
S
Save Current Module Configuration in EEPROM, 34
scaling, 9
Send & Receive Serial Data, 49
Send Serial Data, 49
serial communication module
ASCII, 13
ASCII examples, 16
binary, 13
binary examples, 15, 16
communication settings, 13
data verification, 14
message examples, 15
message field definitions, 14
setting port configuration, 35, 36
Set Channel Mode, 31
Set Point Configuration, 31
Set Serial Port Configuration, 35
Set Serial Port Response Delay, 36
Set Serial Port RTS, 44
Set TPO Period, 42
SNAP-ARL-ASDS brain, 17
SNAP-SCM-232 serial module, 9
SNAP-SCM-485 serial module, 9
SNAP-SCM-485-422 serial module, 9
specifications
module addresses for serial protocol, 12
Write Outputs, 42
Write Serial Port Configuration, 47
Write Serial Port Configuration and Store to Flash, 48
writing to analog output, 39, 41
, 33
54
SNAP I/O Module Integration Guide
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.