SeaI/O User Manual www.sealevel.com PO Box 830 – Liberty, SC 29657 864.843.
Table of Contents INTRODUCTION......................................................................................................................... 1 SEAI/O HARDWARE DESCRIPTION ..................................................................................... 3 SEAI/O BASE AND EXPANSION MODULES ................................................................................... 3 SEAI/O MODULE COMMON FEATURES ........................................................................................
CONFIGURING N-SERIES EXPANSION MODULES ........................................................................ 42 CONFIGURING AN ETHERNET MODULE (E-SERIES).................................................................... 43 MAXSSD CONFIGURATION & DIAGNOSTICS UTILITY ............................................................... 46 Host PC Configuration Tab .................................................................................................. 46 SeaI/O Configuration Tab......................
Introduction SeaI/OTM modules provide a powerful way to add I/O to a variety of computers, controllers, and PLCs. Each SeaI/O model is designed for maximum flexibility and easy field wiring. Ordering options allow connection to the host device via Wireless 802.11b/g (Coming Soon!), Ethernet, USB, RS-485, or RS-232, and multiple units can be daisy chained together using convenient pass-through connectors.
Software Installation SeaI/O modules can be used with industry standard Modbus protocol or easily controlled from application programs using the supplied SeaMAX software libraries. Included are two diagnostic and configuration tools: MaxSSD and Ethernet Config. The SeaMAX library features an object-oriented and functional interface for use with C++ and Visual Basic. Also included is the CEthernet API library for programmatic discovery and configuration of Ethernet enabled SeaI/O modules.
SeaI/O Hardware Description SeaI/O Base and Expansion Modules Base Modules connect to the host via one of the following interfaces: E-Series - Ethernet Modbus TCP U-Series - USB Modbus RTU M-Series - RS-485 Modbus RTU S-Series - RS-232 Modbus RTU After the Base unit is installed, up to 246 additional SeaI/O N-Series Expansion Units can be added to create an I/O network. These expansion modules interface via RS-485 and can be located local to the Base SeaI/O device or remotely located up to 4000 feet away.
SeaI/O Module Common Features All SeaI/O modules include the same connectors and configuration options on the side of the unit: NOTE: RS-485 networks should have termination enabled on each end of the network. Pull-up and pull-down resistors should also be enabled on the last device on the network. The 9-30VDC input barrel connector is center positive. Status LEDs are included on the front of all SeaI/O devices to indicate Communication (Yellow), Fault (Red), and Status (Green). © Sealevel Systems, Inc.
SeaI/O Configurations & Specifications 410 Series – 16 Optically Isolated Inputs/16 Reed Relay Outputs SeaI/O-410 modules provide 16 optically isolated inputs and 16 Reed relay outputs. Inputs can range from 5-24VDC, while the Reed relays provide long life switch closures that are well suited for low current applications. Inputs and outputs are grouped into four-bit segments. Each group shares a common for easy wiring via removable 3.5mm terminal blocks.
420 Series – 16 Optically Isolated Inputs/8 Form C Outputs The SeaI/O-420 provides 16 optically isolated inputs and 8 SPDT Form C relay outputs. Inputs can range from 5-24VDC and provide 300V isolation to ground. Each output offers normally open and normally closed contact connections via 3.5mm field removable terminal blocks. Inputs Type: Voltage Range: Isolation: Input Resistance: Response Time: 16 non-polarized optically isolated inputs 5-24VDC 300V 6.
430 Series – 32 Optically Isolated Inputs SeaI/O-430 modules provide 32 optically isolated inputs with 300V external isolation and high channel-to-channel isolation. Ideal for low voltage monitoring applications, connection to real world signals is made via 3.5mm convenient removable screw terminal connectors. Inputs Type: Voltage Range: Isolation: Input Resistance: Response Time: 32 non-polarized optically isolated inputs 5-24VDC 300V 6.
450 Series – 16 Form C Relay Outputs Control a variety of low voltage, low current devices with the SeaI/O-450. The module’s 16 channels of highly reliable SPDT Form C relay outputs are rated for up to 60VDC @ 2A. Each output offers normally open and normally closed contact connections via 3.5mm field removable terminal blocks. Outputs Type: Power: Contact Voltage: Contact Current: Operate Time: Bounce Time: Release Time: © Sealevel Systems, Inc. 16 SPDT Form C relays DC 30W/ AC 60 VA 60VDC max. 2A max.
462 Series – 96 Channel TTL DB-78 Perfect for driving industry-standard solid-state relay (SSR) racks, the SeaI/O-462 provides 96 bits of buffered drive TTL I/O. Each DB-78 connector brings out 48 I/O bits addressable as six, eight-bit ports. For easy connection to relay racks, Sealevel offers a six-foot cable (Item# CA237) that terminates each DB-78 connector to two industry standard 50-pin IDC connectors. Order part number 462x-KT and receive two CA237 cables with each unit.
SeaI/O-462 Optional Items Depending upon your application, you are likely to find one or more of the following items useful for interfacing the SeaI/O-462 to real-world signals. All items can be purchased from our website (http://www.sealevel.com) or by calling 864-843-4343. For high-current, high-voltage applications: DB-78 to Dual IDC 50 Pin Ribbon Cable (Item Number CA237) − 60” cable connects each SeaI/O-462’s DB-78 connectors to solid-state relay racks equipped with 50-pin header interface.
463 Series – 96 Channel TTL 50-Pin The SeaI/O-463 offers 96 bits of buffered drive TTL I/O via four internal industrystandard 50-pin header connectors. The interface module addresses the 96 channels of I/O as 12 eight-bit ports, each programmable as input or output. Using standard 50-pin IDC ribbon cables, connect up to four industry standard relay racks for PC based control and automation of equipment including sensors, switches, security control systems, and other industrial automation systems.
SeaI/O-463 Optional Items Depending upon your application, you are likely to find one or more of the following items useful for interfacing the SeaI/O-463 to real-world signals. All items can be purchased from our website (http://www.sealevel.com) or by calling 864-843-4343. For TTL applications: Terminal Block Kit - (Item# KT107) − Kit includes the TB07 screw terminal block and CA167 ribbon cable for connecting one of the SeaI/O-463’s 50-pin header connectors to your I/O.
For high-current, high-voltage applications: IDC 50 to IDC 50 Pin Ribbon Cable (Item# CA167) − 40” cable connects the SeaI/O-463 to solid-state relay racks equipped with 50-pin header interface. IDC 50 to IDC 50 Pin Ribbon Cable (Item# CA135) − 40” cable connects the SeaI/O-463 to solid-state relay racks equipped with 50-pin edge connector. Solid-State Relay Racks: • Quad six position relay rack (Item# PB24HQ) − Relay rack can accept up to six QSSRs for a total of 24 channels.
470 Series – 16 A/D, 2 D/A, 8 24V Outputs, 8 Isolated Inputs Designed using the Maxim MAX197 successive approximation-type A/D chip, the SeaI/O-470 provides eight differential or 16 single-ended 12-bit inputs. The A/D inputs can be individually configured for sensing 4-20mA current loop signals. Additionally, the module provides two 12-bit D/A output channels, eight optically isolated inputs, and eight open collector outputs, ideal for driving 24V devices commonly found in industrial environments.
520 Series – 8 Optically Isolated Inputs/8 High-Current Form C Outputs The SeaI/O-520 provides 8 optically isolated inputs and 8 SPDT high-current Form C relay outputs. Inputs can range from 5-30VDC and provide 300V isolation to ground. Each output offers normally open and normally closed contact connections via 3.5mm field removable terminal blocks. Inputs Type: Voltage Range: Isolation: Input Resistance: Response Time: 8 non-polarized optically isolated inputs 5-30VDC 300V 6.
Power Options Base Module Power Connection Base modules are powered from a 9-30VDC source using either the DC jack or screw terminals on the side of the unit. Sealevel offers several power supply choices to make connection easy (see Accessories chapter at the end of this document). SeaI/O Expansion Power Connection Each SeaI/O product, including the expansion modules, contains an onboard switching regulator power supply rated for 9-30VDC.
Sample Power Calculation A typical application for SeaI/O products would use one Base module and several Nseries units in a local expansion configuration. In this arrangement, with power applied to the Base module through either the DC jack or screw terminal connector and passed-through to the expansion units, attention should be given to ensure the input power to the Base module is adequate. Example: Base Unit: Expansion 1: Expansion 2: SeaI/O-430U SeaI/O-410N SeaI/O-440N Power (W) 0.7 1.4 2.5 4.
Hardware Configuration The SeaI/O-463 and SeaI/O-470 are the only two modules that require you to open the enclosure. On all SeaI/O modules, most device settings can be configured on the left side of the SeaI/O module. Refer to the SeaI/O Hardware Description section of this manual for a list of common features available and settings that can be changed on the left side of the SeaI/O module. When connecting more than one SeaI/O module to a host computer, you will need to set the device address (Slave ID).
Step 2 On the front right side of the module, wedge a slotted screwdriver between the top and bottom halves as shown. Pry upwards – a pem in the top half must clear the metal lip in the bottom half of the enclosure. Step 3 Remove the two screws from the metal strain relief, as shown. Step 4 Remove the three screws from the bottom of the module and remove the front plate. Step 5 Install up to four industry standard ribbon cables in the 50-pin header connectors.
Step 7 Replace the metal strain relief. Start both screws and tighten only until snug. Do not over-tighten. Step 8 Replace the top half by starting it on the left side over the connectors and then snapping the right side down into place. Be careful not to pinch fingers. Replace both screws on each side and then replace the terminal block on the left side. Step 9 Continue with the installation of the SeaI/O-463 module.
SeaI/O-470 Jumper and Dipswitch Settings Instructions The SeaI/O-470 module ships factory configured with the D/A outputs set for 0-10V and current loop mode on the A/D inputs disabled. If you need to enable current loop mode or set the D/A outputs to 0-5V, you will need to open the enclosure and access the jumpers (shown on the next page). NOTE: Do not perform these instructions with the power connected. Be sure to follow proper ESD procedures by grounding yourself and the SeaI/O module.
SeaI/O-470 Jumper Locations This detail image of the right side of the SeaI/O-470 circuit board shows the locations of the user configurable jumpers and dipswitches. Refer to the following pages for instructions on properly configuring the jumpers and switches. The colored boxes are shown here for clarity and are not visible on the actual circuit board. © Sealevel Systems, Inc.
D/A Settings The (E1) and (E2) jumpers (shown in the orange boxes on the previous page) configure the D/A outputs for 0-5V or 0-10V. Both channels can be configured independently. The D/A outputs do not support negative voltages. You must also set the correct output voltage in your application or MaxSSD. Refer to the SeaMAX Application Suite section of this manual for help configuring software to work with the SeaI/O-470.
Wiring Options SeaI/O Pass-Through Connector All SeaI/O modules include two RS-485 pass-through connectors on the left side of the unit that are internally connected to the same pins on the screw terminals. This offers two convenient options for adding additional expansion modules.
I/O Wiring – SeaI/O-410, 420, 430, 440, and 450 Modules Optically isolated inputs are arranged such that each group of four shares a single common. The four I/O points and shared common are connected via a five-position removable screw terminal. Input voltage range is 5-24VDC. Like the inputs, each group of four Reed relays also shares a single common and connects via a fiveposition removable screw terminal. Form C Relay outputs are arranged such that each group of two relays shares a common.
I/O Wiring – SeaI/O-462 and 463 Modules SeaI/O-462 DB-78F Connectors The SeaI/O-462’s 96 digital I/O channels are brought out to two DB-78 Female connectors on the front of the enclosure (pinout shown below). Each connector provides 48 bits of digital I/O divided into six eight-bit ports. Each port may be individually configured via software command as an input or an output.
SeaI/O-462 Optional Cable (Item# CA237) Pinout For easy connection to industry-standard solid-state relay racks, Sealevel manufactures a 6’ cable, Item# CA237, that terminates the DB-78 to two industry standard 50-pin header connectors. Two cables and a SeaI/O unit can be order together as a kit using Item# 462x-KT. The pinout for the two 50-pin headers is shown below. © Sealevel Systems, Inc.
SeaI/O-463 50-Pin Header Connectors The SeaI/O-463’s 96 digital I/O channels are accessed via four industry-standard 50pin header connectors. Each header provides 24 bits of digital I/O divided into three eight-bit ports. Each port may be individually configured via software command as an input or an output. You will need to open the SeaI/O-463’s enclosure to access the four header connectors: P2, P3, P4, and P5. The connector designators are silk-screened onto the PCB for easy identification.
I/O Wiring – SeaI/O-470 Modules A/D Wiring Connections The SeaI/O-470 supports single-ended, differential, and current loop A/D inputs. Single-ended and differential modes can be configured in software. Current loop mode requires configuring dipswitches inside the enclosure. Refer to the Hardware Configuration section of this manual for instructions on configuring the current loop dipswitches. The SeaI/O-470 can be configured for up to sixteen 12-bit single-ended A/D inputs.
The SeaI/O-470’s A/D channels can also be configured to provide up to eight 12-bit current loop inputs. Each input has two terminals – one positive and one negative. The input current range is 0-20mA for interfacing commonly used 4-20mA devices. The dipswitches inside the enclosure must be properly configured for each current loop input. D/A Wiring Connections The SeaI/O-470 provides two 12-bit D/A output channels, configured for 0-10V. 0-5V mode requires different jumper settings inside the enclosure.
Digital I/O Wiring Connections The SeaI/O-470 modules include eight optically isolated inputs that are arranged such that each group of four inputs shares a single common. The four I/O points and shared common are connected via a five-position removable screw terminal. The SeaI/O-470 modules provide eight open-collector digital outputs. The outputs do not source any current and must be connected to an external power source, max 30VDC. The outputs act as a switch and the circuit is open until energized.
I/O Wiring – SeaI/O-520 Modules Optically isolated inputs are arranged such that each group of two shares a single common. The four I/O points and shared common are connected via a six-position removable screw terminal. Input voltage range is 5-30VDC. Like the inputs, each group of two Form C relays also shares a single common. The NC and NO contacts of each relay along with the commons are brought out via a six-position removable screw terminal. © Sealevel Systems, Inc.
Connector Pin Outs SeaI/O (RS-232) S-Series Modules SeaI/O S-Series (RS-232) modules have an RJ45 connector on the face of the enclosure. Each S-series module includes a kit (item# KT119) to convert the RJ45 RS-232 pin out to a standard DB9 RS-232 pin out. The kit ships with a DB-9F to RJ45 modular adapter (item# DB109) with RS-232 pin out and a standard 7' CAT5 patch cable (item# CA246). This kit allows SeaI/O S-series modules to be easily connected to a standard DB9 RS-232 serial port.
Mounting Options SeaI/O Mounting Kit Expanding your I/O count is as simple as adding N-Series expansion units to the Base SeaI/O module (or other N-series modules). Each NSeries module includes an expansion and strap kit (Item# KT122), which includes a 5” CAT5 interconnect cable, four metal straps, and four #440 metal screws. The image shows a SeaI/O stack configuration using the expansion kit. DIN Rail Mounting All SeaI/O modules are available with a factoryinstalled DIN-rail mounting clip.
Accessories Power Supplies US Options TR112 – 120VAC to 24VDC 250mA “Wall Wart” Power Supply with 1.3mm Plug (for single SeaI/O module) TR109 – 120VAC to 24VDC 500mA “Wall Wart” Power Supply with 1.3mm Plug (for multiple SeaI/O modules) TR108-US – 100-250VAC to 24VDC 36W 1.5A “Desktop” Power Supply with 1.3mm Plug, includes (CA248) Nema 5-15P 6’ US Power Cord PS101 – 100-240VAC to 24VDC 7.5W 300mA DIN Rail Mount Power Supply (connects via screw terminals, no wire included) PS103 – 100-240VAC to 24VDC 50W 2.
Cabling Options CA239 – 5” CAT5 RS-485 Interconnect Cable, used to connect SeaI/O modules together in a stack (included in 4xxN SeaI/O expansion modules) CA246 – 7’ Blue Ethernet Patch Cable. Can be used to connect SeaI/O Ethernet modules to a hub (included with 4xxE SeaI/O Ethernet modules). Can be used to connect SeaI/O RS-232 modules to both Sealevel and standard RS-232 serial ports (included with 4xxS SeaI/O RS-232 modules as part of p/n: KT119).
SeaMAX Application Suite Introduction The SeaMAX Suite is a collection of software libraries, and configuration and diagnostic utilities that facilitates rapid application development. The following libraries and utilities are included in the SeaMAX Suite: MaxSSD Configuration & Diagnostics utility Ethernet Config utility SeaMAX API CEthernet API Sealevel SeaI/O modules are available in various I/O configurations, each designed for maximum flexibility and easy field wiring.
SeaI/O Architecture The memory map for the I/O listed in the table below describes how to address the SeaI/O modules in both Modbus compliant applications as well as through the SeaMAX API library. SeaI/O Model 410 Type No. 430 440 450 462 Reed Relays Opto. Inputs Form C Relays Opto. Inputs Opto. Inputs Reed Relays Form C Relays Programmable I/O 16 16 8 16 32 32 16 96 463 Programmable I/O 96 470 Outputs Opto. Inputs D/A Outputs A/D Inputs Form C Relays Opto.
Device Address Configuration Before configuring SeaI/O modules using MaxSSD, you must first select a device addressing method. Next, you must properly set termination and pull-up/pull-down resistors. Finally, you must configure the SeaI/O modules one at a time before MaxSSD and any subsequent applications (using the SeaMAX API) will be able to successfully communicate.
Setting Termination & Pull-Up/Pull-Down Resistors A “stack” or “chain” of SeaI/O modules, connected via the pass-through connectors or screw terminals on the left side of the enclosure, communicates via an RS-485 bus, which must be properly terminated to work correctly. A set of three dipswitches is located on the left side of enclosure, next to the “ADDR” rotary switch. These switches control line termination and the RS-485 pull-up and pull-down resistors.
Configuring the “Base” SeaI/O Module After you have decided which address (slave ID) method you intend to use, proceed with installing the SeaMAX Software Suite (discussed in the following section). Once SeaMAX has been installed successfully, start by connecting the E-, U-, M-, or S-series module to your computer. This module will be referred to as the “base” module. If you are chaining multiple SeaI/O modules together, only one SeaI/O module in the chain can be the “base”.
Configuring N-Series Expansion Modules Once you have successfully connected and communicated with a “base” module, you can begin adding expansion modules (N-series). Connect a single expansion module to the “base” module via the RJ45 pass-through connectors or screw terminals on the left side of the enclosure. Expansion modules include a convenient 5” interconnect cable (item# CA239) to simplify daisy-chaining SeaI/O modules together.
Configuring an Ethernet Module (E-Series) NOTE: This section applies only to Ethernet SeaI/O (E-series) modules. For all other SeaI/O modules, refer to the Configuring a “Base” SeaI/O Module and Configuring Expansion Modules sections on the previous pages. Verify that SeaMAX has been installed successfully and that an Ethernet SeaI/O module is connected to your computer. This module will become the “base” module. All Ethernet SeaI/O (E-series) modules are shipped with DHCP enabled.
Configuring an Ethernet Module (Continued) NOTE: If the module does not change or respond, the PC and the module may be on different subnets. Proceed to the Recover Module section on the following page. Start MaxSSD (Start Æ All Programs Æ Sealevel SeaMAX Æ MaxSSD) and choose the correct IP address to communicate with the “base” Ethernet SeaI/O module. Ensure a successful Get operation (refer to the MaxSSD section on the following pages for more information).
Resetting an Ethernet SeaI/O Module An Ethernet SeaI/O module may become no longer visible in the module list in the Ethernet Config utility if the Ethernet SeaI/O module has been configured to use a different subnet than the host computer. In other cases, the Ethernet SeaI/O module doesn’t appear in the module list due to a DHCP discovery failure.
MaxSSD Configuration & Diagnostics Utility The Sealevel Systems configuration utility, MaxSSD, is designed to simplify the installation, configuration, and diagnostics of Sealevel SeaI/O modules. MaxSSD is a Microsoft Windows application and has been tested with Windows 2000 and XP. Host PC Configuration Tab The first time you run the MaxSSD utility (Start Æ All Programs Æ Sealevel SeaMAX Æ MaxSSD) it will default to the “Host PC Configuration” tab.
SeaI/O Configuration Tab Once the host computer is configured correctly, the “SeaI/O Configuration” tab becomes available. Before communicating with a SeaI/O module, the configuration utility must determine if there is a SeaI/O module at that slave ID address, and if so, what type of module it is. This is the purpose of the Get operation. To perform a Get operation, first select the slave ID to which the module is configured.
After the Get command is executed, the “SeaI/O Configuration” tab will display colored labels showing the SeaI/O model number and interface type. The “Set Device Settings” and “Change Slave ID” buttons will also be enabled for this module. In the example shown, the module found at slave ID 247 is a SeaI/O 410 module with an RS-485 interface. After a successful Get operation, additional tabs may be displayed in MaxSSD, depending on the found device model.
Digital I/O Tab The “Digital IO” tab of MaxSSD is displayed when using SeaI/O devices featuring discrete inputs and outputs. It displays the device’s current input and/or output status in an intuitive and usable manner. The “Digital IO” tab displays inputs and outputs in groupings (or banks) of eight. Therefore, a SeaI/O device with 16 inputs and 8 outputs would show two banks of inputs and one bank of outputs. When displaying banks of inputs, the status LEDs update on each of the banks automatically.
Programmable I/O Tab The “Programmable IO” tab of MaxSSD is displayed when using SeaI/O devices featuring programmable inputs or outputs. This tab allows for bank configuration, input/output configuration, as well as bit-level presets. Each bank of programmable I/O can be set as either an 8-bit group of inputs or outputs.
A/D Inputs Tab The “A/D Inputs” tab displays the current state of the analog-to-digital channels for devices that feature A/D inputs. Settings are provided for both device wide and perchannel configuration. The “Device Configuration” selection drop-box adjusts the arrangement and function of the A/D input channels. Input channels are displayed as banks (groups of eight). Each channel is range configurable via the voltage range dropdown list.
D/A Outputs Tab The “D/A Outputs” tab is useful for manually setting the digital to analog output voltages. A preliminary diagnostics utility (see following page) has been provided to verify proper hardware functionality. The D/A outputs of the SeaI/O-470 are factory set for 0-10V. To configure the D/A outputs for 0-5V, you will need to open the enclosure and set the correct jumpers.
Diagnostics To check basic functionality of both the A/D and D/A converters, press the “Diagnostics Utility” button on the “D/A Outputs” tab (shown on the previous page) and then press the “Start” button, as shown below. Any errors will be shown in the “Results” pane. If errors occur, please contact technical support for further help. © Sealevel Systems, Inc.
Communicating Via Modbus Modbus Commands Sealevel SeaI/O modules are designed to integrate seamlessly into existing Modbus networks. The supported command set will vary depending on the SeaI/O model number used. Below is a list of valid commands for each SeaI/O model number.
Modbus RTU The Modbus RTU specification is a serial line style of communication where the packets are determined by a series of timeouts. The last byte of an arriving packet is defined as no more bits have been clocked into the shift registers for 3.5 character times (i.e., no more bytes have been received for at least 3.5 character times). The layout of a Modbus RTU packet is shown below. Address Payload CRC-16 The payload consists of function code, followed by the function specific data.
Extended Modbus Command Set Sealevel SeaI/O modules support an extended Modbus command set that allows an application to easily modify the Slave ID (address) and communication parameters. (0x45) Get Config The Get Config request is designed to obtain model and configuration information for SeaI/O modules and can be used as a mechanism to verify that the unit is operational and responding.
(0x66) Get Extended Module Information When querying SeaI/O modules, perform a standard Get Config (0x45) request. If the Get Config response returns zero (00) for the model number, the module being queried is outside the original SeaI/O 4xx series. Use the Get Extended Module Information request to retrieve the (full two-byte) model number for SeaI/O modules outside the original SeaI/O 4xx series. This transaction shows that the SeaI/O module queried is a SeaI/O-520 (e.g., Hex 0208 = Decimal 520).
(0x46) Set Address SeaI/O modules can be configured to use a software address, which can be any number from 1 to 247. By verifying that the Hexadecimal switch (labeled “ADDR” on the left side of the module) is set to “0”, the module can then be set to respond to any address between 1 and 247. A Get Config transaction must first be issued to obtain the Magic Cookie byte. A sample transaction is shown with an assumed Magic Cookie byte of 0xCA.
(0x47) Set Communication The Set Communication command can be used two different ways. The first method is a direct one-to-one communication with a single SeaI/O module. This requires a Get Config request to obtain the Magic Cookie byte. However, to easily change the communication parameters of multiple SeaI/O modules at the same time, the Set Communication operation can be broadcast to all daisy-chained modules.
(0x41) Read From Programmable I/O (PIO) Modules The Read command is used differently for SeaI/O PIO modules. The data, model number, and configuration are all returned with the state of the module. A sample Read transaction packet is shown.
(0x43) Get PIO Config The Get PIO Config command is used to retrieve the current status of the ports. The SeaI/O module queried will respond with the model number and the port-by-port I/O configuration. The module will not respond with any data contained in those ports; use a Read command to retrieve that information. A sample transaction packet is shown, below.
(0x64) Set A/D, D/A Configuration SeaI/O devices featuring analog to digital or digital to analog conversions can be configured via a Modbus command. Upon a successful operation, the SeaI/O module will respond with the response packet shown below.
(0x65) Get the A/D, D/A Configuration Before setting the configuration, it is often useful to retrieve the current configuration of the SeaI/O module. Modbus command 0x65 will retrieve the settings currently in use, so that they may be altered and set via command 0x64.
Developing Custom Applications Using SeaMAX API The SeaI/O modules are also designed to work with third party applications. In order to supplement this development work, Sealevel Systems provides libraries that are linked into an application and provide an easy interface to the SeaI/O modules. These libraries are provided for Visual C++ and Visual Basic. The interaction of the SeaMAX API with SeaI/O modules is shown in the diagram below. © Sealevel Systems, Inc.
SeaMAX API A functional description of each method in the class, including the possible return values, is provided. All return values less than zero are standard error codes listed and defined in the standard C library header file . In the following, with the Object-Oriented model, the Visual C++ DLL is designed as a single class. This class has the following model: Open CSeaMaxW32::Open( unsigned char* filename ) Description Opens the specified resource.
Read CSeaMaxW32::Read( slave_address_t slaveID, seaio_type_t type, address_loc_t starting_address, address_range_t range, void* data) Description Read performs a Modbus read on an opened SeaIO module and returns the data by reference. The actual Modbus read type is specified by the ‘type’ argument. Since Modbus is actually base one, the starting location should be no less than one. Likewise, the range indicates how many consecutive inputs should be read.
Write CSeaMaxW32::Write( slave_address_t slaveID, seaio_type_t type, address_loc_t starting_address, address_range_t range, unsigned char* data) Description Write performs a Modbus write on an opened SeaIO module and returns the data by reference. The actual Modbus write type is specified by the ‘type’ argument. Since Modbus is actually base one, the starting location should be no less than one. Likewise, the range indicates how many consecutive inputs should be read.
Ioctl CSeaMaxW32::Ioctl( slave_address_t slaveID, IOCTL_t which, unsigned char * data) Description Ioctl has been provided as a muli-function tool to configure and access non-standard Modbus features of the SeaIO module. The actual Modbus transaction (and corresponding action) is specified by the ‘which’ argument. Ioctl can be used to set module parameters, configure state, and access data. Consult the provided example source code for model specific information.
set_intermessage_delay CSeaMaxW32::set_intermessage_delay( int delay) Description This function is used to set the intermessage delay time in effort to optimize the number of messages that can be sent. This time must be at least 4 character times long. The default is a function of the baud rate and should not be changed unless necessary. The parameter ‘delay’ is the delay (in milliseconds) to wait between sending back to back messages.
Non Object-Oriented SeaMAX API The methods following methods have been created to ease use for those more familiar with non-Object-Oriented or functional design. These functions use the same parameters as their method counterparts and are used interchangeably. Before using the functions below, SeaMaxW32Create() should first be called in order to create a global SeaMAX object and return a pointer as a long data type.
SeaMaxW32Open SeaMaxW32Open(CSeaMaxW32* SeaMaxPtr, char* filename) Description See CSeaMaxW32::Open( ) Parameters CSeaMaxW32* char* SeaMaxPointer filename See CSeaMaxW32::Open( ) Return Codes SeaMaxW32Close SeaMaxW32Close(CSeaMaxW32* SeaMaxPointer) Description See CSeaMaxW32::Close( ) Parameters CSeaMaxW32* Return Codes See CSeaMaxW32::Close( ) SeaMaxPointer SeaMaxW32Read SeaMaxW32Read(CSeaMaxW32 *SeaMaxPointer, slave_address_t slaveId, seaio_type_t type, address_loc_t starting_address, addres
SeaMaxW32Write SeaMaxW32Write(CSeaMaxW32* SeaMaxPointer, slave_address_t slaveId, seaio_type_t type, address_loc_t starting_address, address_range_t range, unsigned char* data) Description See CSeaMaxW32::Write( ) Parameters CSeaMaxW32* SeaMaxPointer slave_address_t slaveId seaio_type_t address_loc_t Return Codes type starting_address address_range_t range unsigned char* data See CSeaMaxW32::Write( ) SeaMaxW32Ioctl SeaMaxW32Ioctl(CSeaMaxW32* SeaMaxPointer, slave_address_t slaveId, IOCTL_t whi
IOCTL Calls and Functionality The Ioctl method allows multiple functions to be implemented through a single, convienient call. The last parameter of all Ioctl calls is a void pointer – a pointer that is cast to a particular data type depending on the use of the Ioctl call. Likewise, the actual Modbus traffic generated depends on the ‘which’ parameter and the type of Ioctl functionality desired. The following is a list of the Ioctl call types and their functionality.
Set Module Software-Selectable Address Which Description IOCTL_SET_ADDRESS (2) Sets the SeaIO module’s software selectable address. The last parameter is expected to be a pointer to a ‘seaio_ioctl_s’ structure. Only one field is used in the structure (u.address) and should be populated with a valid address before calling Ioctl.
Retrieve Module PIO Configuration Which Description IOCTL_GET_PIO (4) Requests from the SeaIO module the IO space configuration, as well as the module model. The last parameter is expected to be a pointer to a ‘seaio_ioctl_s’ structure. Firstly, the u.pio.model will be populated on return with an integer representation of the SeaIO module model number. Secondly, depending on the model, several fields may be populated. For the 462/463 models, the u.pio.config_state.PIO96.channel1 and u.pio.config_state.
Set Module PIO Configuration Which Description IOCTL_SET_PIO (5) Sets the SeaIO module IO space configuration. The last parameter is expected to be a pointer to a ‘seaio_ioctl_s’ structure. Depending on the model, several fields should be populated before calling Ioctl. For the 462/463 models, the u.pio.config_state.PIO96.channel1 and u.pio.config_state.PIO96.channel2 fields should each contain a one-byte representation of the IO direction of 6 ports.
Get Module A/D & D/A Configuration Which Description IOCTL_GET_ADDA_CONFIG (6) Requests from the SeaIO module the A/D and D/A configuration. The last parameter is expected to be a pointer to a ‘adda_struct’ structure. On return the adda_struct will contain the software selectable module A/D configuration and individual channel voltage ranges. The ‘Set A/D, D/A Configuration’ section under Modbus commands better describes the returned data format.
Get Module Onboard Hardware Configuration Which Description IOCTL_GET_ADDA_EXT_CONFIG (8) Requests from the SeaIO module the current state of the on-board A/D and D/A jumper configuration. The last parameter is expected to be a pointer to a ‘adda_extended_struct’ structure. On return the structure will contain the state of the hardware jumpers specific to the SeaIO module.
Using SeaMAX with Visual C++ 6.0 Before using SeaMAX within your Visual C++ 6.0 application, you must add the include paths and the library paths to help Visual C++ find the libraries. To configure Visual C++ to use the libraries, open Microsoft Visual C++ 6.0, and click the ‘Tools’ menu. Click on the ‘Options’ item to select the application options, as shown below. © Sealevel Systems, Inc.
To include the SeaMAX library files, choose the ‘Directories’ tab and select the ‘Include files’ option as shown below. Select the bottom blank line, click the new entry button, and add your SeaMAX installation directory. NOTE: The default SeaMAX installation directory is: ‘C:\Program Files\Sealevel Systems\SeaMAX’ Perform the same operation for the “Library files” option. To add a new folder, click on the ‘Add’ button, and then click on the ‘(...)’ button to browse to your installation directory.
Using SeaMAX with Visual Basic 6.0 In order to use the SeaMAX library with your Visual Basic program, it will first be necessary to import the SeaMAX functions using Declare. In each of the example folders, there exists a file named ‘SeaMAX.bas’ which contains the various type and function imports. The following is an example of how to import the various SeaMAX functions into Visual Basic: Public Declare Function SeaMaxW32GetCommHandle Lib "CSeaMaxW32.
Example SeaMAX Programming Tasks The following is a sampling of the various tasks that can be performed with the SeaMAX library. For more complete examples, see the provided Visual C++ and Visual Basic examples installed with the SeaMAX libraries. NOTE: The SeaMAX installation places all these examples in the SeaMAX installation folder. Refer to those examples for more complete and in-depth information.
Reading From Inputs / Outputs In order to read from the inputs or outputs, the SeaIO module must first be opened successfully. The VC++ example below shows how to read in four inputs, starting at input 3 and continuing until input 6. In this case, since we are not reading in a full 8 bits, the data will be present in the lowest order bits of the data array. unsigned char data[1] = {0}; int slaveId = 247 int type = D_INPUTS; int start = 3; int range = 4; result = cw32.
Changing the Programmable I/O Configuration For SeaI/O modules featuring programmable IO, it may be necessary to configure the IO direction and presets from a custom application, rather than through MaxSSD. In such a case, the holding registers hold the module IO configuration. Specifically, holding registers 4 – 9 contain the bit presets for the module. However, these registers must be written singly, rather than performing a multi-register write (i.e. only one register should be written to at a time).
Reading from Analog Inputs In order to read from an A/D channel, SeaMAX requires that an input register read occurs – much like a discreet input read is required to read the digital input. It’s important to note that a read of input register type requires that there be 2 bytes of available space allocated for each register being read. The example below exemplifies an input register read from within Visual C++. result = cw32.
Configuring A/D or D/A Channels In order to read the A/D channels properly, it is often necessary to first configure them to be within the proper voltage ranges. The following VC++ example shows how to get the current device configuration via an Ioctl call, adjust the channel and device settings, and then commit those changes back to the SeaIO module. adda_ext_config extended_configuration; result = cw32.Ioctl(slaveId, IOCTL_GET_ADDA_EXT_CONFIG, &extended_configuration); configuration.device.
CEthernet API The CEthernet API is designed as an extension library that enables programmers to develop applications to automatically find, configure, and use Ethernet-enabled Sealevel devices. This library removes the manual hard-coding requirement of locating a device on the network and replaces it with an automatic search function. The CEthernet Development Libraries support the SeaI/O (Digital I/O) E-series and SeaLINK (Ethernet Serial Servers) product families.
CEthernet Architecture The diagram below is a high-level overview of how the CEthernet Library co-exists with other libraries, such as SeaMAX, to communicate with Ethernet-enabled devices. As stated in the introduction, this is a supplementary library and is not required for the device to be functional. All packets from the CEthernet library are UDP based. Flow Model for Ethernet Enabled Devices © Sealevel Systems, Inc.
CEthernet API The API to CCEthernet is easy to use, straightforward, and designed to be as userfriendly as possible. Looking at the UML diagram, one can determine that there are only six functions that the interface provides. Of those, only four are required for basic operation. Sample code segments are provided in a later section. Each of the methods are documented below, including the parameters and the associated return codes.
set_information Parameters device − The device to modify the parameters of command − which parameters to modify, (SetIPAddress, SetDHCP, SetName). ... − This list is based off the command parameter above. For more information, see below. The variable argument list above, (denoted by the ...) is defined by which command parameter is passed in. The commands can be logically OR'd together to make the sequence easier.
Alloc Parameters number − Number of devices to allocate space for. allocated. Return Values >0 − Valid list. -ENOMEM − Error allocating memory. Free Parameters list − Pointer to the list previously allocated. Return Values None NOTE: © Sealevel Systems, Inc. Because the allocation masks much of the socket communication, the interface provides a mechanism to allocate and free the device structures.
CEthernet Application Development Using Visual C++ To use the CCEthernet Class, simply ensure that the SeaMAX directory is in the include and library path for Visual C++. Once that is complete, simply include the CEthernet.lib file is contained on the link tab settings for the project. Required Code For all of the following examples, the following must be in either the StdAfx.h file if using Precompiled Header Files (PCH) or at the top of the individual C++ file.
Simple Find Using print_info Function This section will show a simple find on all Sealevel Devices. There is a helper function that is used to print out the information discovered about each unit. The source code segment for the helper function is listed below. void print_info(ceth_device_p c) { printf("Type : %s\n", c->type==SeaIO_Ethernet?"SeaIO Ethernet" :c->type==SeaLink_Dev?"SeaLink Device" :"Who Knows?"); printf("Mac : %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", c->mac_address.c[0], c->mac_address.
Finding All Devices This simple code segment issues a find on all devices and then prints out each device using the print_info function code segment from the previous page. This code segment allocates space for ten devices and then performs a find for devices. If the return code is greater than zero, then the function successfully found the number of devices returned. Notice that we have to explicitly Free() the allocated buffers, and then delete the class for proper memory management.
Appendix A – Data Encoding Tables These tables help to decode Get Config responses from Sealevel SeaI/O modules. A Get Config response contains five bytes in the following order: Model Number Baud Rate Bridge Type Parity Magic Cookie For more information, refer to the Get Config request explained in the Extended Modbus Command Set section of this manual.
Appendix B – CRC Calculation To further illustrate the example shown in the CRC-16 section, the algorithm for generating the CRC-16 is shown below. unsigned short calc_crc(int n,unsigned char *outbound_message) { unsigned char carry_flag; unsigned short crc=0xFFFF; for (int i = 0; i < n; i++) { crc = crc ^ outbound_message[i]; for (int j = 0; j < 8; j++) { carry_flag = crc & 0x01; crc = crc >> 1; if (carry_flag == 1) { crc = crc ^ 0xA001; } } } return crc; } © Sealevel Systems, Inc.
Appendix C – SeaIO Model 462/463 Holding Register Set Register 8 bits 1 8 bits Bridge Type Model Number Standard 2 4 bits 4 bits 8 bits Baud Rate Parity Address Port 4 3 4 5 6 7 8 9 0 X X X X X X 0 X X X X X X Port 3 Port 2 C B A C B A X X X X X X X X X X X X 0 B A C B A X X X X X X X X X X X X Port B1 Port A1 Default Default X X X X X X X X X X Port A2 Port C1 Default Default X X X X X X X X X X Port C2 Po
Appendix D – SeaMAX Data Types and Structures PIO Data Structure struct PIO48_s { unsigned unsigned unsigned unsigned unsigned unsigned }; struct PIO96_s { unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned }; char char char char char char portA1; portB1; portC1; portA2; portB2; portC2; char char char char char char char char char char char char portA1; portB1; portC1; portA2; portB2; portC2; portA3; portB3; portC3; portA4; portB4; portC4; PIO Co
Ioctl Structure struct seaio_ioctl_get_params_s { unsigned short model; unsigned char bridge_type; baud_rates_t baud_rate; parity_t parity; unsigned char magic_cookie; }; struct seaio_ioctl_address_s { unsigned char new_address; }; struct seaio_ioctl_comms_s { baud_rates_t new_baud_rate; parity_t new_parity; }; struct seaio_ioctl_s { union { seaio_ioctl_address_s address; seaio_ioctl_comms_s comms; seaio_ioctl_get_params_s params; SeaMAX_PIO_ioctl_s pio; union { PIO48_config_s PIO48; PIO96_config_s PIO96; }
Channel Range Types typedef enum { ZERO_TO_FIVE PLS_MIN_FIVE ZERO_TO_TEN PLS_MIN_TEN = = = = 0, 1, 2, 3 } channel_range_type; Channel Mode Types typedef enum { SINGLE_ENDED = 0, DIFFERENTIAL = 1, CURRENT_LOOP = 2 } channel_mode_type; © Sealevel Systems, Inc.
A/D Voltage Reference Types typedef enum { ANALOG_OFFSET = GND_OFFSET = AD_REF_OFFSET = DA_CHANNEL_1 = DA_CHANNEL_2 = 0, 1, 2, 4, 8 } ad_reference_type; A/D D/A Configuration Structure typedef struct { struct { unsigned char reference_offset; unsigned char channel_mode; } device; struct { unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned unsigned char char char char char char char char char char char char char char char
Appendix E – Troubleshooting Following these simple steps can eliminate most common problems. 1. Read this manual thoroughly before attempting to install the device in your system. 2. Uninstall any previous versions of the SeaMAX software before installing any new versions. 3. Install SeaMAX software first. Installing the software places the necessary files in the proper locations on your system. After installing the software, proceed with adding the hardware. 4. Install the SeaI/O modules one at a time.
Troubleshooting Ethernet (E-series) Modules Problem: The SeaI/O module starts up with a strange IP address (i.e., 169.254.x.x) All Ethernet SeaI/O (E-series) modules are shipped with DHCP enabled. If no DHCP server is available or the DHCP server cannot be reached, the Ethernet SeaI/O module will default to a random IP address in the range 169.254.0.1 to 169.254.255.254. Change the PC’s network settings to place both the SeaI/O module and PC on the same subnet.
Appendix F – How To Get Assistance When calling for technical assistance, please have your user manual and current device settings ready. If possible, please have the device installed and ready to run diagnostics. Sealevel Systems maintains a website on the Internet. Our homepage address is http://www.sealevel.com. The latest software updates and newest manuals are available via our FTP site that can be accessed from our home page.
Appendix G – Compliance Notices Federal Communications Commission Statement FCC - This equipment has been tested and found to comply with the limits for Class A digital device, pursuant to Part 15 of the FCC Rules. These limits are designed to provide reasonable protection against harmful interference when the equipment is operated in a commercial environment.
Warranty Sealevel's commitment to providing the best I/O solutions is reflected in the Lifetime Warranty that is standard on all Sealevel manufactured products. We are able to offer this warranty due to our control of manufacturing quality and the historically high reliability of our products in the field. Sealevel products are designed and manufactured at its Liberty, South Carolina facility, allowing direct control over product development, production, burn-in and testing. Sealevel Systems, Inc.