OPTO 22 SNAP Integration Manual

SNAP I/O MODULE
INTEGRATION GUIDE
Form 0876-160623—June 2016
43044 Business Park Drive Temecula CA 92590-3614
Phone: 800-321-OPTO (6786) or 951-695-3000
Fax: 800-832-OPTO (6786) or 951-695-2712
www.opto22.com
Product Support Services
Fax: 951-695-3017
Email: support@opto22.com
Web: support.opto22.com
SNAP I/O Module Integration Guide Form 0876-160623—June 2016
Copyright © 1997–2016 Opto 22. All rights reserved. Printed in the United States of America.
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.
Opto 22 FactoryFloor, groov, Optomux, and Pamux are registered trademarks of Opto 22. Generation 4, groov Server, ioControl, ioDisplay, ioManager, ioProject, ioUtilities, mistic, Nvio, Nvio.net Web Portal, OptoConnect, OptoControl, OptoDataLink, OptoDisplay, OptoEMU, OptoEMU Sensor, OptoEMU Server, OptoOPCServer, OptoScript, OptoServer, OptoTerminal, OptoUtilities, PAC Control, PAC Display, PAC Manager, PAC Project, PAC Project Basic, PAC Project Professional, SNAP Ethernet I/O, SNAP I/O, SNAP OEM I/O, SNAP PAC System, SNAP Simple I/O, SNAP Ultimate I/O, and Wired+Wireless are trademarks of Opto 22.
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.
Opto 22 Automation Made Simple.
ii
SNAP I/O Module Integration Guide
Table of Contents
Chapter 1: Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
SNAP I/O Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Choosing SNAP I/O Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Communicating with SNAP I/O Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2
About this Guide. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
For Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Chapter 2: Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Mechanical Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
All Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Using Modules with an Opto 22 Mounting Rack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Using Modules without an Opto 22 Mounting Rack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Electrical Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4-Channel Digital Input/Output Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Analog Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Resolution and Range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Analog Module Power Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Other Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Serial Communication Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
SNAP Module Power Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10
Chapter 3: Communication Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Serial Protocol (Binary or ASCII) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
Module Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Point Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Serial Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13
Serial Protocol Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Message Field Definitions—Serial Protocol Packet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14
About Data Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14
Calculating a Checksum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14
Calculating a CRC16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Serial Message Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Command Message Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15
SNAP I/O Module Integration Guide iii
iii
Response Message Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
ARCNET Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Point Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
ARCNET Protocol Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Message Field Definitions—ARCNET Protocol Packet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
ARCNET Message Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Command Message Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Response Message Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Global Protocol Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Product Categories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Message Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Error Responses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Module Types, Channel Modes, and Point Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Analog Input Modules with Four Points or Less . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Analog Input Modules with More than Four Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Analog Output, Serial, and High-Density Digital Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Chapter 4: Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Command List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Command Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Read Number of Received Data Bytes Waiting Command 23 . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Read Channel Mode . . . . . . . . . . . . . . . . . . . . . . .Command 32 . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Set Channel Mode . . . . . . . . . . . . . . . . . . . . . . . . Command 3A . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Set Point Configuration . . . . . . . . . . . . . . . . . . . .Command 3C . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Powerup Clear—Current Modules . . . . . . . . . .Command 40 . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Powerup Clear—Legacy Modules. . . . . . . . . . .Command 41 . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Command 42 . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Read Amount of Unused Space in Transmit Buffer Command 42 . . . . . . . . . . . . . . . . . . . . . . . 34
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Save Current Module Configuration in EEPROM Command 45 . . . . . . . . . . . . . . . . . . . . . . . . . 34
iv
SNAP I/O Module Integration Guide
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Identify Module Type . . . . . . . . . . . . . . . . . . . . . . Command 46 . . . . . . . . . . . . . . . . . . . . . . . . . . . .35
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Set Serial Port Configuration . . . . . . . . . . . . . . . Command 47 . . . . . . . . . . . . . . . . . . . . . . . . . . . .35
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Set Serial Port Response Delay . . . . . . . . . . . . . Command 48 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Read Module Firmware Version . . . . . . . . . . . . Command 49 . . . . . . . . . . . . . . . . . . . . . . . . . . . .36
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Group Read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Command 52 . . . . . . . . . . . . . . . . . . . . . . . . . . . .37
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Group Read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Command 52 . . . . . . . . . . . . . . . . . . . . . . . . . . . .37
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Read Status—Latches Not Cleared . . . . . . . . . Command 52 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Receive Serial Data . . . . . . . . . . . . . . . . . . . . . . . . Command 52 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Group Write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Command 53 . . . . . . . . . . . . . . . . . . . . . . . . . . . .39
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Read Status—Latches Cleared . . . . . . . . . . . . . Command 53 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Read HDD Counters—Counters Not Cleared Command 54 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Read HDD Counters—Counters Cleared . . . . Command 55 . . . . . . . . . . . . . . . . . . . . . . . . . . . .40
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Channel Read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Command 55 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Channel Write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Command 56 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Set TPO Period . . . . . . . . . . . . . . . . . . . . . . . . . . . . Command 57 . . . . . . . . . . . . . . . . . . . . . .
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Write Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Command 58 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42
. . . . . . 42
SNAP I/O Module Integration Guide v
v
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Read Status (TPO, Inhibit On/off) . . . . . . . . . . . .Command 58 . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Clear Serial Port Receive Buffer . . . . . . . . . . . . . .Command 63 . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Read Serial Port CTS . . . . . . . . . . . . . . . . . . . . . . . . Command 66 . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Set Serial Port RTS . . . . . . . . . . . . . . . . . . . . . . . . . .Command 66 . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Clear Serial Port RTS . . . . . . . . . . . . . . . . . . . . . . . .Command 66 . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Read Serial Module Info . . . . . . . . . . . . . . . . . . . .Command 69 . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Read Serial Port Configuration . . . . . . . . . . . . . .Command 71 . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Write Serial Port Configuration . . . . . . . . . . . . . .Command 71 . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Write Serial Port Configuration and Store to Flash Command 71 . . . . . . . . . . . . . . . . . . . . . . . 48
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Receive Line of Serial Data . . . . . . . . . . . . . . . . . .Command 72 . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Send & Receive Serial Data . . . . . . . . . . . . . . . . .Command 73 . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Send Serial Data . . . . . . . . . . . . . . . . . . . . . . . . . . . Command 74 . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Command Data Required . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Response Data Received . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
vi
SNAP I/O Module Integration Guide
Chapter 2

1: Introduction

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 sheet Form #
SNAP Digital Input Modules Data Sheet 773 SNAP Digital Output Modules Data Sheet 1144 SNAP Analog Input Modules Data Sheet 1065 SNAP Analog Output Modules Data Sheet 1066 SNAP Isolated Analog Input Modules Data Sheet 1182 SNAP Serial Communication Modules Data Sheet 1184 SNAP High-Density Digital Module Data Sheet 1556 SNAP Load Cell Modules Data Sheet 1590 SNAP Power Monitoring Modules Data Sheet 1453 SNAP pH/ORP Module Data Sheet 1416 HART SNAP I/O Modules Data Sheet 2080 SNAP Mechanical Power Relay Output Module Data Sheet 1967

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 type Interface or protocol
4-Channel Digital 5 VDC logic (No protocol needed)
Analog
High-density digital ARCNET*
Serial ARCNET*
*When used with a Linux-based OEM brain, communication with ana­log, 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 VDC 0 VDC 10 VDC 11 VDC
0x32 -5 to +5 VDC -5.5 VDC -5 VDC 0 VDC 5 VDC 5.5 VDC
Nominal
range
Under-
range limit
-110% -100% 0% 100% 110%
-27,500 -25,000 0 25,000 27,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 scale High scale
Counts
Module Nominal range 0 2047 4095
SNAP-AOV-25
SNAP-AOV-27
0 to +10 VDC 0 VDC 5 VDC 10 VDC
-10 to +10 VDC -10 VDC 0 VDC 10 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

Module Requirements Module Requirements
SNAP-IDC5-SW 5 VDC @ 200 mA SNAP-AIPM 5 VDC @ 100 mA
SNAP-IDC5-SW-NC 5 VDC @ 200 mA SNAP-AIPM-3 5 VDC @ 100 mA
SNAP-OMR6-A 5 VDC @ 160 mA SNAP-AIPM-3V 5 VDC @ 100 mA
SNAP-OMR6-C 5 VDC @ 160 mA SNAP-AIR40K-4 5 VDC @ 190 mA
Other 4-ch. digital modules 5 VDC @ 50 mA SNAP-AIR400K-8 5 VDC @ 190 mA
SNAP-IAC-16 5 VDC @ 150 mA SNAP-AIRATE 5 VDC @ 190 mA
SNAP-IAC-A-16 5 VDC @ 150 mA SNAP-AIRATE-HFi 5 VDC @ 210 mA
SNAP-IAC-K-16 5 VDC @ 150 mA SNAP-AIRTD 5 VDC @ 190 mA
SNAP-IDC-16 5 VDC @ 150 mA SNAP-AIRTD-10 5 VDC @ 190 mA
SNAP-IDC-HT-16 5 VDC @ 150 mA SNAP-AIRTD-1K 5 VDC @ 190 mA
SNAP-IDC-32 5 VDC @ 150 mA SNAP-AITM 5 VDC @ 170 mA
SNAP-IDC-32-FM 5 VDC @ 150 mA SNAP-AITM-i 5 VDC @ 200 mA
SNAP-IDC-32D 5 VDC @ 150 mA SNAP-AITM-2 5 VDC @ 170 mA
SNAP-IDC-32DN 5 VDC @ 150 mA SNAP-AITM2-i 5 VDC @ 200 mA
SNAP-IDC-32N 5 VDC @ 150 mA SNAP-AITM-4i 5 VDC @ 150 mA
SNAP-ODC-32-SNK 5 VDC @ 150 mA SNAP-AITM-8 5 VDC @ 200 mA
SNAP-ODC-32-SNK-FM 5 VDC @ 150 mA SNAP-AIV 5 VDC @ 170 mA
SNAP-ODC-32-SRC 5 VDC @ 150 mA SNAP-AIV-i 5 VDC @ 200 mA
SNAP-ODC-32-SRC-FM 5 VDC @ 150 mA SNAP-AIV-4 5 VDC @ 170 mA
SNAP-AIARMS 5 VDC @ 170 mA SNAP-AIV-8 5 VDC @ 170 mA
SNAP-AIARMS-i 5 VDC @ 200 mA SNAP-AIV-32 5 VDC @ 150 mA
SNAP-AIARMS-i-FM 5 VDC @ 200 mA SNAP-AIV2-i 5 VDC @ 200 mA
SNAP-AICTD 5 VDC @ 150 mA SNAP-AIVRMS 5 VDC @ 170 mA
SNAP-AICTD-4 5 VDC @ 150 mA SNAP-AIVRMS-i 5 VDC @ 200 mA
SNAP-AICTD-8 5 VDC @ 170 mA SNAP-AIVRMS-i-FM 5 VDC @ 200 mA
SNAP-AILC 5 VDC @ 120 mA SNAP-AOA-3 5 VDC @ 140 mA
SNAP-AILC-2 5 VDC @ 120 mA SNAP-AOV-5 5 VDC @ 150 mA
SNAP-AIMA 5 VDC @ 170 mA SNAP-AOA-23 5 VDC @ 150 mA
SNAP-AIMA2-i 5 VDC @ 200 mA SNAP-AOA-23-iH 5 VDC @ 150 mA
SNAP-AIMA-4 5 VDC @ 170 mA SNAP-AOV-25 5 VDC @ 150 mA
SNAP-AIMA-8 5 VDC @ 170 mA SNAP-AOV-27 5 VDC @ 150 mA
SNAP-AIMA-32 5 VDC @ 150 mA SNAP-AOA-28 5 VDC @ 150 mA
SNAP-AIMA-i 5 VDC @ 200 mA SNAP-AOD-29 5 VDC @ 150 mA
SNAP-AIMA-iH 5 VDC @ 150 mA SNAP-AOD-29-HFi 5 VDC @ 300 mA
SNAP-AIMA-iSRC 5 VDC @ 200 mA SNAP-SCM-232 5 VDC @ 250 mA
SNAP-AIMV-4 5 VDC @ 170 mA SNAP-SCM-485-422 5 VDC @ 250 mA
SNAP-AIMV2-4 5 VDC @ 170 mA SNAP-SCM-PROFI 5 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 7 Pin 5 Pin 3 Pin 1
80 Ground Ground Ground Ground
81 Ground Ground Ground +5 Volts
82 Ground Ground +5 Volts Ground
83 Ground Ground +5 Volts +5 Volts
84 Ground +5 Volts Ground Ground
85 Ground +5 Volts Ground +5 Volts
86 Ground +5 Volts +5 Volts Ground
87 Ground +5 Volts +5 Volts +5 Volts
88 +5 Volts Ground Ground Ground
89 +5 Volts Ground Ground +5 Volts
8A +5 Volts Ground +5 Volts Ground
8B +5 Volts Ground +5 Volts +5 Volts
8C +5 Volts +5 Volts Ground Ground
8D +5 Volts +5 Volts Ground +5 Volts
8E +5 Volts +5 Volts +5 Volts Ground
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-6 Reserved -- reserved
CRC method is CRC16 Reverse
with a seed value of 0.
Bit 5 Data Verification
Bit 4 Protocol
Bits 3-0 Baud Rate
0 CRC16
1 Checksum (default)
0 Binary
1 ASCII (default)
0 reserved
1115.2k
2 reserved
3 57.6k
4 38.4k
5 19.2k
6 9600 (default)
7 4800
8 2400
9 1200
A 600
B 300
C reserved
D reserved
E reserved
F reserved

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. Contents Definition/Comments
DEST
SRC Source address of this packet
LEN
PRC Product category
SEQ Sequence ID
MST Message type
CMD / DATA
DVF Data verification
Destination address of this packet
Total number of bytes follow­ing the Length byte, exclud­ing 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: 1 1 1 1 1 1 1 0–1+ 1 or 2
Serial binary DEST SRC LEN PRC SEQ MST
# Bytes: 1 2 2 2 2 2 2 2 0–2+ 2 or 4 1
Serial ASCII > DEST SRC LEN PRC SEQ MST
NOTE: Do not send another command until you have received a response from the previous command or have waited a reasonable timeout period.
DATA
CMD Data
DATA
CMD Data
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 SRC LEN PRC SEQ MST CMD DVF
85 01 04 20 01 00 41 EC
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
à SOH EOT space SOH null A
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 SRC LEN PRC SEQ MST CMD DVF
8A 01 04 20 02 00 52 03
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 SRC LEN PRC SEQ MST CMD DATA DVF
8B 01 08 20 06 00 53 0614 0CCC FF
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: 1 1 1 1 1 1 0–1+ 1 or 2
Serial binary DEST SRC LEN PRC SEQ MST DATA DVF
# Bytes: 1 2 2 2 2 2 2 0–2+ 2 or 4 1
Serial ASCII > DEST SRC LEN PRC SEQ MST 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 SRC LEN PRC SEQ MST CMD DVF
> 85010420010041ECcr
DEST SRC LEN PRC SEQ MST DVF
01 85 03 80 01 01 0B
Again, the checksum is the least significant byte of the sum of the hex values:
01h + 85h + 03h + 80h + 01h + 01h = 10B hex ? 0B hex
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 SRC LEN PRC SEQ MST DATA DVF
01 8A 03 80 01 01 09C4 3F7A 0000 0000 96
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 SRC LEN PRC SEQ MST DVF
> 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)
080 888
181 989
282 108A
383 118B
484 128C
CHAPTER 3: COMMUNICATION PROTOCOLS
585 138D
686 148E
787 158F
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. Contents Definition/Comments
SRC
DEST
CNT Count The number of bytes following this byte, subtracted from 0x100
OSC OS code
PRC Product category
SEQ Sequence ID
BNK / MST
CMD /
SCMD /
PRT / DATA
Source address of this packet
Destination address of this packet
Bank number and Message type
Command, Subcom­mand, 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 nib­ble 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: 1 1 1 1 1 1 1 1 0–2 0–1 0–1+
ARCNET SRC DEST CNT OSC PRC SEQ
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 CNT OSC PRC SEQ
01 85 FB DA 20 00 00 41
SNAP I/O Module Integration Guide
BNK/
MST
CMD SCMD PRT Data
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 CNT OSC PRC SEQ
01 80 F9 DA 20 01 00 63 72 01
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 CNT OSC PRC SEQ
01 8B F7 DA 20 04 00 53 0614 0CCC
BNK/
MST
DATA
CMD DATA
Response Message Format
# Bytes:111111101+
BNK/
ARCNET SRC DEST CNT OSC PRC SEQ
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 CNT OSC PRC SEQ
85 01 FC DA 80 00 01
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 CNT OSC PRC SEQ
8A 01 F4 DA 80 0A 01 09C4 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) Reserved Numbers used by current products
10 - 1F (Hex) Brain Boards or Brains Use 10 for brain boards or brains
20 - 2F (Hex) Controllers Use 20 for controllers
30 - 3F (Hex) Hosts Use 30 for hosts
40 - 7F Future expansion --
80 and above Modules Use 80 for modules

Message Types

Type Description Byte Definition
0 Send Data Command Data [252 Bytes Max]
1 Ack Data [252 Bytes Max]
2 Nack 1-byte error Error [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
Protocol Description
(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 fol­lowing
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
Protocol Description
(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 config­uration 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/Type Module Type
Analog Input Modules
Channel
(Hex)
64 22
Mode (Hex)
2 channels, -20 mA to +20 mA *
SNAP-AIMA-i
SNAP-AIMA-iSRC
SNAP-AIMA-4
SNAP-AIMA2-i 2 isolated channels, -1 to +1 mA 27 22
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
22 22
26 22
40 22
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/Type Module 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
4 channels, -150 - +150 mV * 4 channels, -75 - +75 mV 4 channels, -50 - +50 mV 4 channels, -25 - +25 mV
2 channels, -10 V to +10 V * 2 channels, -5 V to +5 V
2 channels, -10 V to +10 V * 2 channels, -5 V to +5 V
4 channels, -10 V to +10 V * 4 channels, -5 V to +5 V
2 channels, -100 to +100 VDC * 2 channels, -50 to +50 VDC
2 channels, -10 to +10 VDC 2 channels, -100 to +100 VDC
(Hex)
20
09
21
32
12
23
41
24
72 72
Channel
Mode (Hex)
20*
30
20*
30
20*
30
20*
30 A0 B0
22*
32
22*
32
22*
32
22*
32
22 22
SNAP-AIARMS 2 channels, 0 to 10 Amps RMS 71 1A
SNAP-AIARMS-i SNAP-AIARMS-i-FM
SNAP-AIVRMS 2 channels, 0 to 250 V RMS 70 1A
SNAP-AIVRMS-i SNAP-AIVRMS-i-FM
SNAP-AICTD 2 channels, Temperature (ICTD) 04 20
SNAP-AICTD-4 4 channels, Temperature (ICTD) 42 20
SNAP-AIRATE 2 channels, 0 to 25,000 Hz 69 20
SNAP-AIRATE-HFi
SNAP-AIR40K-4
SNAP-AIRTD
SNAP-AIRTD-10
2 channels, 0 to 10 Amps RMS 29 1A
2 channels, 0 to 250 V RMS 28 1A
2 channels, 0.1 s data freshness 2 channels, 1.0 s data freshness
4 channels, 0–40 K ohms * 4 channels, 0–20 K ohms 4 channels, 0–10 K ohms 4 channels, 0–5 K ohms
2 channels, 100 Ohm Pt 3-wire RTD * 2 channels, 100 Ohm Ni 3-wire RTD 2 channels, 0–400 Ohms, Lead Compensated 2 channels, 120 Ohm Ni 3-wire RTD
2 channels, 10 Ohm Cu 3-wire RTD * 2 channels, 0–25 Ohms, Lead Compensated
2B
43
10 10
0E 21
44*
45
10*
20 30 40
22
SNAP-AIRTD-1K
SNAP I/O Module Integration Guide
2 channels, 1000 Ohm Pt 3-wire RTD * 2 channels, 1000 Ohm Ni 3-wire RTD 2 channels, 1–4000 Ohms, Lead Compensated
0F 21
CHAPTER 3: COMMUNICATION PROTOCOLS
SNAP Module Part
Number
SNAP-AIPM** (point 0) SNAP-AIPM (point 1) SNAP-AIPM (point 2) SNAP-AIPM (point 3)
SNAP-AILC
SNAP-AILC-2
SNAP-pH/ORP
* 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/Type Module 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 Number Input Range/Type Module Type
Analog Input Modules
8 channels, -20 mA to +20 mA *
SNAP-AIMA-8
SNAP-AIMA-32
SNAP-AIPM-3** (pts 0,4,8) SNAP-AIPM-3 (pts 1,5,9) SNAP-AIPM-3 (pts 2,6,10) SNAP-AIPM-3 (pts 3,7,11) SNAP-AIPM-3 (pts 12,13)
SNAP-AIPM-3V** (pts 0,4,8) SNAP-AIPM-3V (pts 1,5,9) SNAP-AIPM-3V (pts 2,6,10) SNAP-AIPM-3V (pts 3,7,11) SNAP-AIPM-3V (pts 12,13)
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 Number Input Range/Type Module 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-8 8 channels, Temperature (ICTD) * 4C 4*
* 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.)
Module Description Module Type
Analog Output Modules
SNAP-AOA-3 1 channel, 4–20 mA 83
SNAP-AOV-5 1 channel, 0–10 VDC 85
SNAP-AOA-23 2 channels, current loop 4–20 mA A3
SNAP-AOA-23-iSRC 2 isolated channels, current loop 4–20 mA B3
SNAP-AOV-25 2 channels, 0–10 VDC A5
SNAP-AOV-27 2 channels, -10 to +10 VDC A7
SNAP-AOA-28 2 channels, current loop 0–20 mA A8
SNAP-AOD-29 2 channels, time-proportional digital output 5–60 VDCA9
Serial Modules
SNAP-SCM-232 2 channels, RS-232 F0
SNAP-SCM-485-422 2 channels, RS-485/422 (2-wire or 4-wire) F1
SNAP-SCM-PROFI One electrical interface to PROFIBUS DP® networks.F6
High-Density Digital Modules
SNAP-IDC-32 SNAP-IDC-32-FM
32 channels, digital inputs, 10–32 VDC E0
(Hex)
SNAP-IDC-32N 32 channels, digital inputs, -10 to -32 VDC E6
SNAP-IDC-32D 32 channels, digital inputs, 2.5 to 12 VDC EB
SNAP-IDC-32DN 32 channels, digital inputs, -2.5 to -12 VDC EA
SNAP-IDC-16 16 isolated channels, digital inputs, 10–32 VDC/VAC E5
SNAP-IDC-HT-16 16 isolated channels, digital inputs, 15–28 VDC/VAC E8
SNAP-IAC-16 16 isolated channels, digital inputs, 90–140 VAC/VDC E4
SNAP-IAC-A-16 16 isolated channels, digital inputs, 180–280 VAC/VDC E3
SNAP-IAC-K-16 16 isolated channels, digital inputs, 70–130 VAC/VDC E7
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 sourcing E1
32 channels, digital outputs, 5–60 VDC load sinking E2
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 ARCNET Command
HDD*
Analog
23 X Read Number of Received Data Bytes Waiting X page 30
32 X X Read Channel Mode (Input modules only) X X page 30
3A X X Set Channel Mode (Input modules only) X X page 31
3C X X Set Point Configuration X page 31
40 X X Powerup Clear—Current Modules (Enables watchdog timer) X X X X page 32
41 X X Powerup Clear—Legacy Modules (Disables watchdog timer) X X X X page 33
42 X X Reset X X page 33
42 X Read Amount of Unused Space in Transmit Buffer X page 34
45 X X Save Current Module Configuration in EEPROM (Input modules only) X X page 34
46 X X Identify Module Type X X X X page 35
47 X Set Serial Port Configuration X X X X page 35
48 X Set Serial Port Response Delay X X X X page 36
49 X X Read Module Firmware Revision X X X page 36
52 X Group Read X page 37
52 X X Group Read (Input and SNAP-AOD-29 modules only) X page 37
>4 ch
Analog
=<4-ch
See
Serial**
52 X Read Status—Latches Not Cleared X page 38
52 X Receive Serial Data Only X page 38
53 X X Group Write (Dual-channel output modules only) X page 39
53 X Read Status—Latches Cleared (Input modules only) X page 39
54 X X Read HDD Counters—Counters Not Cleared X page 40
55 X X Read HDD Counters—Counters Cleared X page 40
55 X X Channel Read X page 41
56 X X Channel Write (Output and SNAP-AOD-29 modules only) X page 41
57 X X Set TPO Period (SNAP-AOD-29 modules only) X page 42
58 X Write Outputs X page 42
58 X X Read Status (TPO, Inhibit On/Off) (SNAP-AOD-29 modules only) X page 43
63 X Clear Serial Port Receive Buffer X page 43
66 X Read Serial Port CTS (SCM-232 Rev A modules only) X page 44
66 X Set Serial Port RTS (SCM-232 Rev A modules only) X page 44
28
SNAP I/O Module Integration Guide
CHAPTER 4: COMMANDS
Applies to Modules
Hex Serial ARCNET Command
HDD*
=<4-ch
Analog
>4 ch
Analog
66 X Clear Serial Port RTS (SCM-232 Rev A modules only) X page 45
69 X
71 X Read Serial Port Configuration X page 46
71 X Write Serial Port Configuration X page 47
71 X Write Serial Port Configuration and Store to Flash X page 48
72 X Receive Line of Serial Data X page 48
73 X Send & Receive Serial Data X page 49
74 X Send Serial Data X page 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**
X page 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
CMD 1 byte 23
PRT 1 byte Serial port: 00 for port 0, 01 for port 1
Response Data Received
Data 2 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
CMD 1 byte 32
Data 1 byte Channel (point) number
Response Data Received
Data 1 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
CMD 1 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
CMD 1 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 Modules Command 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
CMD 1 byte 40
Response Data Received
No response data
32
SNAP I/O Module Integration Guide
CHAPTER 4: COMMANDS

Powerup Clear—Legacy Modules Command 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
CMD 1 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
CMD 1 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
CMD 1 byte 42
PRT 1 byte Serial port number: 00 for port 0; 01 for port 1
Response Data Received
Data 4 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
CMD 1 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
CMD 1 byte 46
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
CMD 1 byte 47
Data 1 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.
Command Data Required
CMD 1 byte 48
Data 1 byte Delay byte in hex (Delay = delay byte * 10 milliseconds)
Response Data Received
No response data

Read Module Firmware Version Command 49

(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
CMD 1 byte 49
Response Data Received
Data 2 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
CMD 1 byte 52
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
CMD 1 byte 52
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
CMD 1 byte 52
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
CMD 1 byte 52
PRT 1 byte Serial port number: 00 for port 0; 01 for port 1
Data 1 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
CMD 1 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
CMD 1 byte 53
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
CMD 1 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
CMD 1 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 Data 4095
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
CMD 1 byte 55
Data 1 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
CMD 1 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
CMD 1 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
CMD 1 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
0 TPO 0 LED 1; 1 = Output On
1 TPO 1 LED 2; 1 = Output On
2 Inhibit 0 LED 3; 1 = Inhibit
3 Inhibit 1 LED 4; 1 = Inhibit
4 TPO 0 Status before its inhibit; 1 = Output On
5 TPO 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
CMD 1 byte 58
Response Data Received
TPO status. Bit functions are:
Data 1 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
CMD 1 byte 63
SCMD 1 byte 72
PRT 1 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
CMD 1 byte 66
SCMD
Response Data Received
1 byte 1 byte7263
PRT 1 byte Serial port number: 00 for port 0; 01 for port 1
Data 1 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
CMD 1 byte 66
SCMD
Response Data Received
No response data
1 byte 1 byte7372
PRT 1 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
CMD 1 byte 66
SCMD
Response Data Received
No response data
1 byte 1 byte6372
PRT 1 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
CMD 1 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
CMD 1 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
CMD 1 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
CMD 1 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
CMD 1 byte 72
PRT 1 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
CMD 1 byte 73
PRT 1 byte Serial 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
CMD 1 byte 74
PRT 1 byte Serial 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.
No response data
SNAP I/O Module Integration Guide
49
49
COMMAND DETAILS
50
SNAP I/O Module Integration Guide

Index

A
addressing modules
ARCNET protocol serial protocol, 11
analog module
channel mode configuring points, 31 description, 1 electrical specifications, 8 input module types, 21, 23 mechanical specifications, 5 output module types, 25 reading, 41 reading points, 37 resolution, 9 scaling, 9 wiring, 8 writing to output, 39, 41
ARCNET protocol, 17
communication, 17 message examples, 18 message field definitions, 18
ASCII, 13, 14
message format, 16 response format, 16
, 17
, 21, 23
B
baud rate, 13 binary, 13
format of numeric values, 20 message format, 15 response format, 16
BNK/MST, 20
C
categories for products, 20
channel mode, 21, 23
reading, 30
setting, 31 channel numbering, 12, 17 Channel Read, 41 Channel Write, 41 checksum, 13, 14
calculating, 14, 15
error, 20 Clear Serial Port Receive Buffer, 43 Clear Serial Port RTS, 45 command
list of all commands
message format (ARCNET protocol), 18
message format (serial protocol), 15 communication
ARCNET protocol
default serial port settings, 13
serial protocol, 11
with modules, 2 configuring
point type configuring point type, 23 counters, 40
clearing, 40 CRC16, 13, 14, 15 CTS
modules supported
reading, 44
, 31
, 28
, 17
, 9
D
data sheets for modules, 2 data verification, 13
serial protocol, 14 digital module
description
electrical specifications, 7
mechanical specifications, 5
, 1
SNAP I/O Module Integration Guide 51
51
reading & clearing HDD counters, 40 reading & clearning HDD latches, 39 reading HDD counters, 40 reading HDD latches, 38
wiring, 7 disabling watchdog timer, 33 duty cycle, 41 DVF, 14
calculation example, 15
error, 20
high scale, 9 high-density digital module
description module type, 25 reading & clearing counters, 40 reading & clearing latches, 39 reading counters, 40 reading latches, 38 reading status, 38, 39 writing outputs, 42
, 1
E
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
buffer overrun clearing receive buffer, 43 clearing RTS, 45 description, 1 module types, 25 modules supported, 9 reading bytes waiting, 30 reading configuration, 46 reading CTS, 44 reading hardware and firmware version, 45 receiving data, 38, 48, 49 sending data, 49 setting RTS, 44 writing configuration, 47, 48
serial module
mechanical specifications module types, 25
serial protocol, 11
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
electrical
mechanical, 5
module data sheets, 2
power requirements, 10
, 34
, 5
, 7
SNAP I/O Module Integration Guide 53
53
T
technical support, 3 TPO, 37, 41, 42, 43 troubleshooting
error responses Product Support, 3
types of messages, 20
, 20
U
under range, 9
W
watchdog timer
disabling
enabling, 32 watchdog timer, enabling, 33 wiring, 7
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...