POWERLINK Communications

Note:
  • POWERLINK is only supported by In-Sight 70xx - 74xx series vision systems running In-Sight firmware version 4.7.2 or later, and In-Sight Explorer software version 4.7.2 or later. It is not supported with firmware version 5.1.0 or later.
  • POWERLINK is not supported on the following In-Sight 70xx - 74xx series color vision systems: In-Sight 7010C, In-Sight 7200C, In-Sight 7400C and In-Sight 7402C.
  • In-Sight vision systems are only supported in B&R Automation Studio, version 3.090 or later, and on Automation Runtime version 3.08 or later.

POWERLINK and In-Sight Vision Systems

POWERLINK is an industrial Ethernet protocol for use in time-critical systems. The POWERLINK Ethernet protocol utilizes a Managing Node (MN), such as a PLC or industrial PC, to divide the Ethernet bandwidth into fixed time cycles (200 µs to 10000 µs). The other devices operating on the network, such as an In-Sight vision system, are operated as Controlled Nodes (CN) and are only allowed to transmit data in response to a message from the MN.

During each cycle, the MN produces data destined for each CN and each CN responds with the data destined for other devices on the network. The data is transferred between nodes using Isochronous Messaging (messaging with guaranteed determinism), and Asynchronous Messaging (messaging without a guarantee of determinism). After all the devices on the network have been synchronized, an asynchronous period is initiated by the MN, which allows one device to send standard TCP/IP traffic on the network.

Note: When connecting POWERLINK nodes together, because the devices never compete for network bandwidth, it is recommended that standard Ethernet hubs are used instead of switches, due to their reduced latency.

Every device on a POWERLINK network is identified by a node ID number (1-240). The MN is always node ID 240, and the CNs may have any of the other node IDs from 1 to 239. The node ID number is combined with the fixed IP subnet of 192.168.100.<NodeID>, which assigns each device on the network a fixed IP address within the POWERLINK network. This IP address can also be used to communicate with other devices outside of the POWERLINK network.

Note:
  • If a POWERLINK enabled vision system is taken off the POWERLINK network and placed on a standard Ethernet network, Ethernet communications may lock up and bandwidth may be limited to 1Mbps. To edit a job, disable POWERLINK communications while on the standard Ethernet network.
  • If an In-Sight vision system is on a POWERLINK network and connected to In-Sight Explorer, attempting to download a change to the PLC, or performing a software reboot of the PLC, may cause the vision system to no longer be able to connect to In-Sight Explorer. It is recommended that you disconnect the vision system from In-Sight Explorer before performing any changes or rebooting the PLC. Power cycle the vision system if this situation has been encountered to restore the connection to In-Sight Explorer.

POWERLINK Cycle

The POWERLINK network is divided into fixed time slices, which are called "cycles" (200 µs to 10000 µs). Each cycle includes a period of Isochronous message transfer, and, if time permits, Asynchronous message transfer. At the beginning of each cycle, the MN broadcasts a Start of Cycle (SoC) message to the network, indicating that the Isochronous phase of the cycle is beginning. After sending the SoC message, the MN proceeds to send a Poll Request (PReq) to each configured CN on that cycle. Each CN responds with a Poll Response (PRes) message. The PReq and PRes messages are used to produce data on the network.

On a POWERLINK network, CNs can perform cross-traffic communication, i.e. exchanging process data with each other, without having to first go through the MN. This type of configuration allows one PLC to be the POWERLINK MN, while a second PLC acts as a CN and controls the In-Sight vision system's acquisition. In-Sight firmware supports cross-traffic communication from two CNs, beside the MN, and is capable of receiving up to 100 bytes of data from each node.

Note: Cross-traffic support requires In-Sight 4.8.0 or later firmware.

After every CN's data has been transferred, the MN sends a Start of Asynchronous (SoA) message to the network, indicating that the Asynchronous phase of the cycle is beginning. During this time, one node (indicated by data contained in the SoA frame) is allowed to transmit one packet to the network. If that node has more data to transmit than the cycle's period has capacity for, the transmission will be spread out over the Asynchronous phase of several cycles.

Asynchronous Data Transfer

The Asynchronous data transfer capabilities of the POWERLINK network are critically important to the In-Sight vision system. The Asynchronous phase is used to perform the following tasks:

  • Configuring and monitoring a vision system using In-Sight Explorer
  • Transferring images and data to In-Sight Explorer or a Cognex VisionView while Online
  • Transferring images to an FTP server via the WriteImageFTP function

The two configuration settings for the POWERLINK network that have the greatest affect on Asynchronous data throughput are the Maximum Transmission Unit (MTU) setting and the Cycle Time.

MTU

The MTU for Asynchronous Packets on a POWERLINK network ranges from 300 bytes to 1500 bytes. By default, B&R PLCs set the MTU to 300 bytes. Increasing the default MTU requires that additional time be reserved in each cycle for Asynchronous data transfers. For example, the default MTU requires that 27 µs be reserved for Asynchronous data transfer, while the maximum size (1500 bytes) would require that 123 µs be reserved.

Note: If the MTU value for Asynchronous Packet transfers is not set to the same MTU value being used by the POWERLINK network, TCP/IP communications will not function correctly.

Cycle Time

The Cycle Time also limits Asynchronous data transfers. The POWERLINK network is configured such that only one Asynchronous packet can be transferred per cycle, so decreasing the Cycle Time allows more Asynchronous packets to be transferred on the network. One of the most common POWERLINK network configurations has a 400 µs Cycle Time, which translates into 2500 cycles per second, or 2500 possible Asynchronous frames transferred per second.

Ideal MTU and Cycle Time Settings for In-Sight Vision Systems

Due to the fact that POWERLINK relies upon Ethernet to transmit data, especially the asynchronous portion, understanding how to calculate the total bandwidth available on the POWERLINK network is an important determinant in establishing optimal performance. The total bandwidth is shared between all CNs communicating via asynchronous transfers on the POWERLINK network.

A general formula for calculating the total bandwidth available on the POWERLINK network is: 

  • Bandwidth (Mbps) = MTU * 8/Cycle Time (µs)

Cognex has determined that optimal settings for an In-Sight vision system on the POWERLINK network require an MTU of 1500 bytes, and a Cycle Time of 400 µs. Any significant decrease in the MTU size or an increase in the Cycle Time will result in substantially reduced performance (for the three bullets, listed in the above section). Please consult the B&R Microsoft Excel spreadsheet (powerlink_cycletime_calculations.xls) for calculating Cycle Time, included with the B&R Automation Studio application.

Note:

The following In-Sight application parameters may impact the performance of the connection:

  • Acquired image and image update settings, such as acquiring full images or sending and recording full resolution images. Within a limited bandwidth environment, the goal is to reduce the rate at which images are acquired. This can be accomplished by:
    • Setting the AcquireImage function's Start Row and Number of Rows parameters to create partial acquisitions. For more information, see AcquireImage.
    • From the Record tab of the Record/Playback Options dialog, setting the Image Resolution parameter to Half or Quarter. For more information, see Record/Playback Options Dialog: Spreadsheet View.

      Configuring the settings in this manner will create more bandwidth for background services, if necessary.

  • Sending images with the WriteImageFTP or WriteImageSFTP functions, regardless of the image resolution settings, will reduce bandwidth available for In-Sight Explorer. For more information, see WriteImageFTP and WriteImageSFTP.
  • If the POWERLINK Cycle Time is set to less than 500µs, this will limit the number of available User Data channels to 16 and the Inspection Results to 24. If the Cycle Time setting is too low, or too much data is configured to be transmitted, the POWERLINK connection will fail.

POWERLINK Network Gateway and In-Sight Vision Systems

B&R PLCs have the ability to act as a gateway for TCP/IP traffic between devices on the POWERLINK network and devices connected through the standard Ethernet port. In-Sight Explorer has the ability to add the POWERLINK network into the In-Sight Network pane. The Explorer Remote Subnet List dialog (accessible from the System menu) can be used to add the POWERLINK network and configure the subnet information. After establishing this configuration, the In-Sight Network pane will display the In-Sight vision systems on the POWERLINK subnet.

Configure In-Sight Vision Systems for POWERLINK Communications

This section describes how to connect a B&R PLC to an In-Sight vision system using POWERLINK communications.

Note:
  • These steps assume that the In-Sight vision system has a job loaded that contains data ready to be transmitted via the POWERLINK network.
  • For application development, Cognex recommends connecting directly to the In-Sight vision system installed on the factory line. This will allow for faster image updates, which makes it easier to adjust focus, align the image and set up the application. Once the application has been developed, save the job and then enable POWERLINK and add a remote subnet. The remote subnet will allow the vision system to be monitored from In-Sight Explorer for potential troubleshooting and additional application development.

Enable POWERLINK Communications on an In-Sight Vision System

Before the In-Sight vision system can be placed on the POWERLINK network, the vision system must be configured to enable POWERLINK, using the Network Settings dialog of the In-Sight vision system.

Note: These steps assume that the POWERLINK network is already functioning, with other devices on the network, and that the MN is a B&R PLC.
  1. Connect the In-Sight vision system to be placed on the POWERLINK network directly to the PC running In-Sight Explorer.
  2. Open In-Sight Explorer and connect to the desired In-Sight vision system.
  3. From the Sensor menu, open the Network Settings dialog.
  4. In the Industrial Ethernet Protocols section of the dialog, select POWERLINK and click the Settings button to launch the POWERLINK Settings dialog.
  5. The POWERLINK Settings dialog is used to define the Node ID of the In-Sight vision system.
  6. At the message prompt, restart the In-Sight vision system, and afterward the POWERLINK protocol will be enabled upon the completion of the power cycle.
  7. Disconnect the vision system from the PC and connect the vision system to the POWERLINK network.

Establish a Cyclic Connection to an In-Sight Vision System

To help integrate In-Sight vision systems onto the POWERLINK network, Cognex has created the In-Sight-7000.xdd file (0000031D_In-Sight-7000.xdd), to import into Automation Studio. The In-Sight-7000.xdd file describes the network interface of the In-Sight vision system to a POWERLINK Master Node, to facilitate the transfer of data over a POWERLINK network.

  1. From within Automation Studio, go to the Tools menu and select the Import Fieldbus Device option.
  2. Navigate to the .xdd file, included with In-Sight Explorer 4.7.1 (e.g., C:\Program Files\Cognex\In-Sight\In-Sight Explorer 4.7.1\XDD), and import the file (0000031D_In-Sight-7000.xdd).
  3. After the In-Sight-7000.xdd file has been imported, the In-Sight vision system will need to be added to the POWERLINK network and assigned a Node ID.

    Note: Please consult the B&R Automation Studio Help Explorer POWERLINK Help Contents for specific information about adding 3rd-party devices to Automation Studio.
  4. Once the In-Sight vision system has been successfully added, enable the Channels that will be transmitted cyclically on the POWERLINK network. Set the Cyclic transmission Value to Write (for output to the vision system) or Read (for input from the vision system) to transfer the data in the Channel once communications with the In-Sight vision system are established.
  5. The enabled Channels can be mapped to system variables, as well.

    Note: Bit-level data, such as the Control and Status blocks, must be accessed by appending the bit position designator to the double-integer variable name. Direct mapping of the bit variables is not possible in this release.
  6. With the project properly configured, it is downloaded to the B&R PLC, and the PLC initiates the cyclic transfer of data with the In-Sight vision system.
  7. Verify that the In-Sight vision system is performing correctly by going into Monitor mode in Automation Studio, opening the I/O mapping of the vision system and validate that the ModuleOK channel is TRUE.

Configure the AcquireImage Trigger Parameter

With the In-Sight vision system integrated into the POWERLINK network, it is possible to trigger the vision system to acquire images over the POWERLINK network. Setting the Trigger parameter in the AcquireImage function to Industrial Ethernet enables a hardware assisted trigger mode when POWERLINK is enabled. For more information, see AcquireImage.

  1. Open the AcquireImage function's property sheet.
  2. Set the Trigger parameter to Industrial Ethernet.
  3. Place the In-Sight vision system Online.
  4. An In-Sight vision system can be triggered by directly manipulating the Trigger Enable and Trigger bits in the Control field of the Inspection Control Object, or monitored through the Trigger Ready, Trigger Ack, Acquiring and Missed Acq bits in the Status structure of the Inspection Status Object.
  5. While in Automation Studio, from the Inspection Control Channel, set the Trigger Enable bit to True and toggle the Trigger bit from False to True, while the Trigger Ready bit is set to True.

Get Data from an In-Sight Vision System

To get data from the In-Sight Explorer spreadsheet to a B&R PLC, the data must be written to the POWERLINK network by using the WriteResultsBuffer function. This function takes a buffer of data created by the FormatOutputBuffer function and writes the data to the configured data table of the B&R PLC. This data is then transferred during the next update cycle, which is synchronized, at most, every 4ms, regardless of the Cycle Time.

The following steps explain how to format the data that will be sent from an In-Sight vision system to a B&R PLC:

  1. To begin, using In-Sight Explorer, create a new job.
  2. From the Palette's Snippets tab, add these two Snippets to the spreadsheet: Acquisition > AcqCounter and Math & Logic > Random.
  3. Open the AcquireImage cell and set the Trigger parameter to Continuous.
  4. Right-click an empty cell and select Insert Function to open the Insert Function dialog. From the left pane, click the Input/Output category, then double-click the FormatOutputBuffer function, from the right pane, to insert it into the spreadsheet.
  5. From the FormatOutputBuffer dialog, click the Add button. This will initiate the cell selection mode; select the Scaled random number cell of the Random snippet.
  6. From the FormatOutputBuffer dialog, click the Add button again. This will initiate the cell selection mode; select the count cell of the AcqCounter snippet.

  7. Click the OK button to close the FormatOutputBuffer dialog.
  8. Right-click an empty cell and select Insert Function to open the Insert Function dialog. From the left pane, click the Input/Output category, then double-click the WriteResultsBuffer function, from the right pane, to insert it into the spreadsheet.
  9. Set the WriteResultsBuffer function's Buffer parameter as a cell reference to the recently created FormatOutputBuffer function's Buffer data structure.
  10. Place the In-Sight vision system Online.
  11. Verify that the In-Sight vision system is performing correctly by going into Monitor mode in Automation Studio, opening the I/O mapping of the vision system and validate that the ModuleOK channel is TRUE.

Send Data to an In-Sight Vision System

In order to send data from the B&R PLC to the In-Sight Explorer spreadsheet, the data must be pulled from the POWERLINK protocol stack by using the ReadUserDataBuffer function. This function takes the data format created within the FormatInputBuffer function, reads the data received from the B&R PLC, and formats this data into the In-Sight Explorer spreadsheet. In order to trigger the In-Sight vision system to read the user data from the B&R PLC, the Set User Data bit in the Control block must be triggered from the PLC. For more information, see Inspection Control Object (0x2000).

EXAMPLE: Send Data to an In-Sight Vision System

For this example, create a new job within In-Sight Explorer and then perform the following steps to configure the data that will be received by the B&R PLC.

  1. Open the AcquireImage cell and set the Trigger parameter to Continuous.

    Note: Continuous trigger mode is intended for demonstration purposes only. In Continuous trigger mode, the vision system acquires as many images as possible, and once an event is initiated from the PLC, the data transfer from the PLC to the vision system can be immediately observed. Once you are ready to deploy the vision system for run time operation, you will need to reconfigure the Trigger parameter based on the source of the image acquisition trigger.
  2. Right-click an empty cell and select Insert Function to open the Insert Function dialog. From the left pane, click the Input/Output category, then double-click the FormatInputBuffer function, from the right pane, to insert it into the spreadsheet.
  3. From the FormatInputBuffer dialog, click the Add button and add a 32-bit float and a 32-bit integer to the list.

  4. Click the OK button to close the FormatInputBuffer dialog.
  5. Right-click an empty cell and select Insert Function to open the Insert Function dialog. From the left pane, click the Input/Output category, then double-click the ReadUserDataBuffer function, from the right pane, to insert it into the spreadsheet .
  6. Set the ReadUserDataBuffer function's Buffer parameter as a cell reference to the recently created FormatInputBuffer function's Buffer data structure.
  7. The Vision Data Access functions will automatically be added to the spreadsheet based on the fields added to the FormatInputBuffer function.
  8. Place the In-Sight vision system Online.
  9. Verify that the In-Sight vision system is performing correctly by going into Monitor mode in Automation Studio, and forcing data into the UserData fields.
  10. Set the Set User Data bit in the Control field of the Inspection Control Object.
  11. Clear the Set User Data bit in the Control field of the Inspection Control Object. Since the vision system is in Continuous trigger mode, the vision system is acquiring images, allowing the data transfer to be observed.

Add a POWERLINK Network to the In-Sight Network

Follow these steps to add a POWERLINK network to the In-Sight Network pane.

  1. On the System menu, click Remote Subnets.
  2. In the Explorer Remote Subnet List dialog, click the Add button to launch the Add Subnet dialog.
  3. In the Name field, enter a descriptive name for the subnet that will be added.
  4. In the IP Address field, the IP address should match the "POWERLINK NAT subnet"  IP address programmed in the PLC for the POWERLINK network.
  5. In the Mask field, enter 255.255.255.0.
  6. If the network infrastructure is incapable of routing to the POWERLINK network, check the Use Custom Gateway option, and set the Gateway field to the IP address of the PLC on the standard Ethernet network. This will establish a route to the remote subnet in the PC's routing table.
  7. Click the OK button to accept the changes and close the Add Subnet dialog.
  8. The newly configured remote subnet will appear in the Explorer Remote Subnet List dialog. Click the OK button to close the dialog.
  9. The POWERLINK network will now be displayed in the In-Sight Network pane.

Disable POWERLINK Communications on an In-Sight Vision System

Follow these steps to disable an In-Sight vision system that was configured to operate on a POWERLINK network.

  1. From a PC running In-Sight Explorer, connect the In-Sight vision system to an available Ethernet port, set to DHCP, on the PC.
  2. On the System menu, click Add Sensor/Device to Network.
  3. In the Add Sensor/Device to Network dialog, select the In-Sight vision system, select the Obtain IP Address Automatically (DHCP) option and then click the Apply button.
  4. After a message prompt altering the successful change of the settings, the vision system should appear in the In-Sight Network pane.
  5. Open a connection to the vision system in either the Spreadsheet or EasyBuilder development environments.
  6. On the Sensor menu, click Network Settings to launch the Network Settings dialog.
  7. For the Industrial Ethernet Protocols, select None and then click the OK button.
  8. Restart the vision system to apply the changes.