Cognex CIO-2550-00 Installation Reference

Category
Networking
Type
Installation Reference
DeviceNet
®
Interface Module Installation & Reference
1
Overview
The Cognex In-Sight
®
5000 series and In-Sight 3400 vision sensors can communicate with a PLC using
discrete I/O, DeviceNet, or both. This document describes how to configure communications between the
In-Sight sensor and a PLC using the optional DeviceNet Interface Module (referred to as “the Interface
Module”), and includes the following topics:
Preparing for Installation....................................................................................p. 1
Connecting the Interface Module to a DeviceNet Network................................p. 2
Connecting the Interface Module to In-Sight .....................................................p. 4
Communicating With In-Sight via DeviceNet.....................................................p. 6
Troubleshooting ...............................................................................................p. 11
Specifications...................................................................................................p. 12
The DeviceNet interface module is a serial-to-DeviceNet gateway. The In-Sight sensor communicates to
the Interface Module through a serial port, the Interface Module buffers the serial data and sends it
through DeviceNet to (or from) a DeviceNet scanner attached to a PLC.
To set up this connection, configure two communications channels: one from the In-Sight sensor to the
DeviceNet Interface Module, and the other from the DeviceNet Scanner/PLC to the Interface Module.
Preparing for Installation
The DeviceNet Interface Module kit (Cognex P/N CIO-2550-00) includes the following components:
DeviceNet Interface Module (P/N 147-0001)
DeviceNet Interface Module diskette (P/N 206-6193), containing a copy of the EDS file for use
with the DeviceNet Interface Module and an In-Sight icon.
To complete the installation, you will also need the following:
A configured DeviceNet network that includes a scanner attached to a PLC.
An In-Sight 5000 series vision sensor.
An RS232 serial cable that supports RTS/CTS hardware handshaking.
Finally, you will need the software installed on a PC to configure and run the PLC. To illustrate the
instructions in this manual, the following was used:
Allen-Bradley™ PLC
RSNetworx for DeviceNet
RSLinx
RSLogix 500
DeviceNet
®
Interface Module Installation & Reference
Although an Allen-Bradley PLC and RSNetworx for DeviceNet were chosen to illustrate steps in this
manual, the DeviceNet Interface Module is not limited to this configuration. Other PLC and control
software packages can be used to achieve the same communication. If you are using different PLC or
control software, the instructions provided here are generally applicable.
NOTE: All of the instructions provided in this manual are exclusive to the DeviceNet Interface Module
sold and supported by Cognex.
Connecting the Interface Module to a DeviceNet Network
This section describes how to connect the Cognex DeviceNet Interface Module to a DeviceNet network,
and how to use RSNetworx to configure DeviceNet communications for an In-Sight vision sensor.
Step 1 – Connect the Interface Module to the Network
Attaching the Interface Module to the DeviceNet network:
1. Following Rockwell’s RSNetworx device installation procedure, install the EDS file contained on
the DeviceNet Interface Module diskette supplied, using the EDS Wizard.
2. On the Interface Module, set the two rotary MACID switches to the unused MACID you want to
assign to the module. Similarly, set the BAUD RATE switch to your DeviceNet baud rate.
3. Attach a DeviceNet drop cable to the Interface’s 5-pin male micro connector.
4. Set up DeviceNet to communicate with the Interface:
a) Use Browse or Online in RSNetworx to locate the Interface Module on the network.
b) Confirm that RSNetworx has assigned the Interface Module the correct node number and
type, given by the EDS file that you registered in step 1.
The next step is to configure and assign the Interface Module to a Master Device, typically the PLC/SLC’s
Scanner module.
Step 2 – Configure the Interface
To configure the Interface Module in RSNetworx, go Online and double-click on its graphical
representation; a dialog will open. Select the Parameters tab (see Figure 1) in the property sheet of the
dialog and upload the parameters from the module.
NOTE: If the settings are not already at the default settings, call the default settings and download them
to the module before configuring individual parameters.
2
DeviceNet
®
Interface Module Installation & Reference
Figure 1: EDS file parameters for In-Sight.
1. Configure the Serial I/O parameters (parameters 1-8), including baud rate, bits, and parity. These
settings must agree with the settings for the In-Sight serial port connected to the Interface
Module; usually 9600 baud rate, 8 data bits, parity none, 1 stop bit, CTS/RTS (Hardware) Flow
Control and a Delimiter Mode of Fixed Length. See page 4 for more information on connecting
the Interface Module to the In-Sight vision sensor.
2. Configure the Transmit and Receive sizes.
a) Parameter 8: Packet Length. This is the Module receive packet and In-Sight output size; the
default is 16 bytes.
b) Parameter 25: Data Size Instance 1. Parameter #8 + 1 byte, which defines the length of the
receive byte array.
c) Parameter 69. Data Size Instance 1. Parameter #8 + 1 byte, which defines the length of the
transmit byte array.
d) Parameter 49. Set SYNC off (default).
e) Press Apply then OK to download the changes to the Interface Module.
Step 3 – Configure the Master Device
To configure the Interface Module’s Master Device, use RSNetworx to open the scanner’s property sheet.
1. On the Scanlist property tab, add the Interface Module to the Scanlist, if it is not already present.
2. Select the Interface Module and click the Edit I/O Parameters button. The I/O Parameters dialog
will open.
a) Enable the Polled check box.
b) Set Rx Size to the receive packet size plus 3 bytes (from the EDS file, parameter #8 + 3).
c) Set Tx Size to the transmit packet size plus 3 bytes (from the EDS file parameter #8 + 3).
d) Click OK to close the Edit I/O Parameters dialog.
3
DeviceNet
®
Interface Module Installation & Reference
3. On the scanner’s property sheet:
a) Select the Input Data Table tab and either manually map the Interface or Automap the
Interface.
b) Select the Output Data Table tab and either manually map the Interface or Automap the
Interface.
4. Download the changes to the Scanner.
5. Reboot the PLC. At this point, you should see a solid green light on the Interface Module for both
the MOD and NET lights.
Both input and output mappings allocate the Rx and Tx sizes set in the previous step for the PLC’s data
tables. In the PLC, the first two bytes of the mapping are synchronization and trigger bytes, and the next
byte is the data transmission size. For example, using the default values of 16 for both Input and Output
packet sizes, the Rx and Tx I/O sizes should both equal 19 bytes. In the Rx PLC mapping, the first two
bytes are the synchronization bytes, the next byte is the receive size, 0x10 (16), and the remaining 16
bytes are the data received. In the Tx PLC mapping, the first byte is a trigger to send data (this changes
from a value of 0 to a value of 1, triggering the PLC to send the data to the Interface Module), the second
byte is a sync byte and the third is the size of data being sent (user entered, default 0x10 or 16 bytes
decimal) and the remaining 16 bytes are the data to be sent with each change to a value of 1 of the first
overhead byte.
NOTE: The Allen-Bradley RSLogix Input and Output display windows swap the bytes in each 16-bit word.
Connecting the Interface Module to In-Sight
This section describes how to connect the Interface Module to the In-Sight sensor, and how to configure
the In-Sight serial ports for DeviceNet communication.
Step 1 – Connect the Interface Module to In-Sight
1. Remove the power connector from the In-Sight sensor.
2. Plug the I/O module cable (DB15 connector) from the sensor into a Breakout or CIO module.
3. Plug one end of the RS232 serial cable into a Breakout or CIO module’s RS232 port. Plug the
other end of the RS232 serial cable into the Interface Module’s 9-pin RS232 connector.
4. Re-connect power to the In-Sight sensor and configure the In-Sight user interface for the Interface
Module.
5. From the Sensor menu, select Serial Port Settings to open the Serial Port Settings dialog (see
Figure 2).
4
DeviceNet
®
Interface Module Installation & Reference
Figure 2: Serial Port Dialog
6. In the Serial Port dialog, select DeviceNet from the Mode drop-down.
7. Set the communications parameters on the left side of the dialog to agree with those defined for
the Interface configuration (EDS file default: 9600 baud rate; 8 data bits; 1 stop bit; parity none;
Hardware handshaking).
8. In the Details portion of the dialog (see Figure 3), set the Input Packet Size to the Interface
Module’s DataTransmit Size Instance (EDS parameter #69) value minus 1 byte. Similarly, set the
Output Packet Size to the Interface’s DataReceive Size Instance (EDS parameter #25) value
minus 1 byte. If you want the sensor to trigger acquisitions via the PLC, check the Trigger on First
Byte box. When a value of 1 is in the first data byte sent from the PLC, the sensor will trigger an
acquisition and the PLC will transmit data.
Figure 3: DeviceNet Details Dialog
5
DeviceNet
®
Interface Module Installation & Reference
9. Press the OK button to close the Serial Port dialog.
10. Finally, verify that the In-Sight sensor is Online by looking at the indicator in the lower right corner
of the spreadsheet. If it is Offline, put the sensor Online.
NOTE: For additional information on configuring In-Sight’s serial port settings, refer to the In-Sight®
Explorer Help & Reference, an online HTML Help file provided on the In-Sight CD-ROM (for
In-Sight Explorer software).
At this point, the In-Sight sensor, Interface Module and SLC properties should be configured properly; you
are now ready to send data between the In-Sight and PLC.
Communicating With In-Sight via DeviceNet
Open RSLogix 500 English and go Online. Open the Input and Output tables under Data files. The Input
table shows the data that is received from the In-Sight sensor and written to the PLC. The Output table
shows the data that is sent to In-Sight from the PLC. Data can be sent between the PLC and the In-Sight
sensor via the DeviceNet Interface Module using the Input/Output spreadsheet functions,
ReadDeviceNetBuffer and WriteDeviceNetBuffer. The data to be exchanged is formatted using the
FormatInputBuffer and FormatOutputBuffer functions. In this way, the In-Sight sensor operates like other
nodes on the DeviceNet network along with the PLC.
Using the WriteDeviceNetBuffer function
1. From an empty In-Sight spreadsheet cell, open the Insert menu and select Function… to open
the Insert Function dialog.
2. Highlight Input/Output from the left pane, select FormatOutputBuffer from the right pane and
press the OK button to insert the function into the spreadsheet.
3. The FormatOutputBuffer dialog is displayed (Figure 4). Click the Add button to enter Cell
Selection Mode and select cells in the spreadsheet containing the data you want to write over
DeviceNet to the PLC. Select the correct Data Type for each item using the Data Type drop-
down menu. Continue adding data until all of your data to be written is selected. Click the OK
button.
6
DeviceNet
®
Interface Module Installation & Reference
Figure 4: FormatOutputBuffer Dialog
4. Select another empty cell, highlight Input/Output from the left pane of the Insert Function
dialog, select WriteDeviceNetBuffer from the right pane and press the OK button to open the
WriteDeviceNetBuffer property sheet (Figure 5).
7
DeviceNet
®
Interface Module Installation & Reference
Figure 5: WriteDeviceNetBuffer Property Sheet
5. Enter the required parameter values for the function. For the Buffer parameter, reference the cell
containing the FormatOutputBuffer function created in Step 2.
NOTE: The data referenced in the WriteDeviceNetBuffer function should be dynamic, i.e. updates with
each acquisition as values returned from a function or conditional statements. If the data is static,
then the Cell State of the WriteDeviceNetBuffer function may have to be toggled to initiate a send
to the PLC. Refer to In-Sight® Explorer Help & Reference for more detailed information on the
WriteDeviceNet function parameters.
WriteDeviceNet Example
The following is an example of a WriteDeviceNetBuffer function that will send data from an In-Sight
spreadsheet cell to the PLC via the Module:
WriteDeviceNetBuffer($A$0,1,$D$3), where Cell D3 contains
FormatOutputBuffer(0,"f:il:d:s",$C$3,$C$4,$C$5,$C$6)
NOTE: This example shows floating point, integer, 32-bit integer, and string values being sent. Refer to
the In-Sight® Explorer Help & Reference for more detailed information on setup.
8
DeviceNet
®
Interface Module Installation & Reference
Using the ReadDeviceNetBuffer function
1. From an empty spreadsheet cell, open the Insert menu and select Function… to open the Insert
Function dialog.
2. Highlight Input/Output from the left pane and select Event from the right pane to open the
property sheet for the function.
3. For the Trigger parameter, select the serial port connected to the Interface Module.
4. Click the OK button to close the property sheet and insert the function into the spreadsheet.
5. Select another empty cell, open the Insert menu and select Function… to open the Insert
Function dialog.
6. Highlight Input/Output from the left pane, select FormatInputBuffer from the right pane and
press the OK button to insert the function into the spreadsheet.
7. The FormatInputBuffer dialog is displayed (Figure 6). Click the Add button to select the type of
data you want to read over DeviceNet from the PLC, using the Data Type drop-down menu.
Continue adding data until all of your data to be read is selected. Click the OK button.
Figure 6: FormatInputBuffer Dialog
8. Select another empty cell, highlight Input/Output from the left pane, select
ReadDeviceNetBuffer from the right pane, then press the OK button to open the
ReadDeviceNetBuffer property sheet (see Figure 7).
9
DeviceNet
®
Interface Module Installation & Reference
Figure 7: ReadDeviceNetBuffer Property Sheet
9. Configure the ReadDeviceNetBuffer function parameters. Select the port number attached to the
module for the Port parameter and for the Buffer parameter, reference the cell containing the
FormatInputBuffer function created in Step 3, then press the OK button to accept.
NOTE: Refer to the In-Sight® Explorer Help & Reference for more detailed information on the
ReadDeviceNetBuffer function parameters.
ReadDeviceNetBuffer example
In this example, assume that the incoming data in the FormatInputBuffer function is as follows: An integer
is expected at byte 0 (integers take up 8 bits or 1 byte), to be used for an acquisition trigger (anything but
a 0 will cause an acquisition trigger); a float is expected at byte 1-4 (floats take up 32 bits or 4 bytes); a
string is expected at bytes 5 through 10 (characters take up 8 bits or 1 byte each); and an integer is
expected at byte 11. In this case, the correct function is:
ReadDeviceNetBuffer($A$0,1,$B$10) where B10 contains a FormatInputBuffer function (see Figure 8).
10
DeviceNet
®
Interface Module Installation & Reference
Figure 8: FormatInputBuffer Dialog
NOTE: It is important that the input buffer is configured correctly so that the data written to In-Sight will be
shown correctly. For example, if you expect an integer at byte 0, do not map byte 0 as a string.
Recall that In-Sight will only read data in from the DeviceNet Interface Module in packets up to
the size specified in both the Serial Port Details dialog and the EDS file for the Interface Module.
Troubleshooting
The WriteDeviceNetBuffer function does not send data to the PLC
1. Make sure the Interface Module’s NET and MOD lights are both solid green. If this is not the
case:
a) If either LED is OFF, then the Interface Module is not connected to the DeviceNet network. If
both LEDs are OFF, then either DeviceNet does not have power, or the Interface Module is
not completely attached.
b) If the NET LED is blinking, either the Interface Module was not assigned a Master device, or
the Master device is not polling it. Go into RSNetworx and make sure that it is set up
correctly, and that the Interface Module is an active node on the DeviceNet network. Then
make sure the PLC Master device is in Run mode.
2. Trigger In-Sight to write, while watching the RX light on the Interface Module:
a) If the LED does not go on, In-Sight is not transmitting. Make sure that In-Sight is Online, and
that the cell containing the WriteDeviceNetBuffer function is executing as you expect. Also,
verify that the serial ports are configured correctly in In-Sight, and that the connections are
secure.
b) If the LED does go on, the problem is on the DeviceNet side. Make sure the NET LED stays
solid green during RX transmission. If it does not, the Interface Module is faulting, which
means the configuration is incorrect.
c) Sometimes resetting the data sizes does not “take” with SoftLogix running on a 1784 PCIDS
card. Shut SoftLogix down completely and restart it. You may need to reboot the PC as well.
11
DeviceNet
®
Interface Module Installation & Reference
The WriteDeviceNetBuffer function sends incorrect data to the PLC
1. Check the RS232 settings on the Interface Module (be sure to upload from the device) and in the
Serial Port settings in the In-Sight user interface.
2. Check that the packet size is set the same on both sides of the RS232 connection, and that it is
the same as the packet size sent from the Interface Module to the PLC.
Specifications
Table 1: DeviceNet Interface Module Specifications
Feature Description
DeviceNet Interface
Power requirements: 11 to 28v DC @ 50 mA
Loss of ground: Yes
Reverse polarity: -30v DC
Signal levels: ISO 11898
RS232 Interface
Isolation: 500 volts
ESD protection: ± 10 kv
Overload protection: ± 30 volt
Short circuit: Indefinite
Output levels: ± 7.9 volts (typical)
Data size: 8/7 bits (software configurable)
Parity: Even/Odd/None
Stop bits: 1 (fixed)
Data rate: 300, 1220, 2400, 4800, 9600, 19200
Flow control: None, RTS/CTS, XON/XOFF
Baud Rate
300 to 19,200 kb
Connectors
5-pin micro (DeviceNet). See Table 2 for pin assignments.
9-pin D-sub (RS232). See Table 3 for pin assignments.
LEDs
Two bi-color LEDs for module status
Tow bi-color LEDs for serial channel status
Switches
Two rotary Mac ID switches
Rotary baud rate switch
Dimensions
2.40 in (60 mm) height x 3.25 in (81.3 mm) x 1.10 in (27.5 mm) depth
Mounting
Two ½ in (12.5 mm) tabs with 3/16 in (4.7 mm) diameter thru-holes.
Temperature
0° to 70° C.
Table 2: DeviceNet Connector Pin Assignments (5-pin male micro)
Pin # Assignment Pin # Assignment
1 Drain 2 Bus +
3 Bus 4 CAN H
5 CAN L
12
DeviceNet
®
Interface Module Installation & Reference
Table 3: RS232 Connector Pin Assignments (DB-9)
Pin # Pin # Assignment
1 NC 2
Receive
Data
3
Transmit
Data
4 NC
5 Ground 6 NC
7
Request to
Send
8
Clear to
Send
9 NC
P/N 597-0010-02
© Copyright 2001 - 2008, Cognex Corporation. All
Rights Reserved. All information in this document is
subject to change without notice. Cognex and Vision
for Industry are registered trademarks, and In-Sight
is a trademark of Cognex Corp. All other trademarks
are the property of their respective owners.
13
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13

Cognex CIO-2550-00 Installation Reference

Category
Networking
Type
Installation Reference

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI