You are on page 1of 9

CANopen configuration

using WAGO 750-337


straton user guide – Rev.5

sales@straton-plc.com
CP_R31_006_H
STRATON AUTOMATION, All Rights Reserved
The information contained in this document is the property of STRATON AUTOMATION. The
distribution and/or reproduction of all or part of this document in any form whatsoever is authorized
only with the written authorization of STRATON AUTOMATION. The technical data are used only
for the description of the product and do not constitute a guarantee of quality in the legal sense of
the term. We reserve the right to make technical changes.

2
Content

1. OVERVIEW ............................................................................................................................................4

2. REQUIREMENT AND SETUP .............................................................................................................4

3. CREATE A NEW STRATON PROJECT AND CANOPEN CONFIGURATION.............................4

4. CREATE THE CAN OPEN CONTROL PROGRAM .......................................................................... 7

5. BUILD AND CONNECT ...................................................................................................................... 8

6. OPERATIONS ....................................................................................................................................... 8

7. DIAGNOSTICS DATA .......................................................................................................................... 9

8. CONNECTION TEST ............................................................................................................................ 9

3
Overview

1. Overview

This document explains how to create a straton project to communicate with a Wago device (Wago 750-
337) using the CANopen protocol.

2. Requirement and setup

In this example the KVASER USB to CAN adapter is used.


Download the driver on their website (cable ID: KVASER Leaf Light HS)
Download and install straton IDE and straton runtime from: https://straton-plc.com/telechargements/

3. Create a new straton project and CANopen


configuration

Open the IO Drivers window ( ), insert a configuration ( ) and select the CAN Open driver.

Insert a Master/Port ( ), choose the T5CANKvaser adapter and the baud rate of the Wago device (here:
100 kbauds)

Right-click on the Master > Import EDS file… (Download from www.wago.com)

4|9
Create a new straton project and CANopen configuration

Insert a Slave/Datablock ( ), choose a name, fill in the node ID of the Wago device and choose the EDS
file previously imported

Right-click on the Slave > PDO Mapping, add Digital Output block on the RPDO1

5|9
Create a new straton project and CANopen configuration

Insert variables ( ), the first one will control the 8 outputs (8 bits) and is mapped on RPDO1
Declare it as a USINT.

Insert the three different diagnostic and control variables ( ).


CAN errors is declared as an INT
CAN bus off as a BOOL
Node status as an INT

6|9
Create the CAN Open control program

4. Create the CAN Open control program

Some of CAN Open communications and operations has to be launched manually, one has to create a
LD program allowing to easily send different types of messages.
Create a new LD Program
Use predefined function blocks:
 CONMTSTART send NMT command Start
 CONMTENTERPREOP send NMT command Pre-Operation
 COWRITEPARAM SDO, write single object

 CORPDOSENDNOW send RPDO, configured ‘on request’


 COREADPARAM SDO, read single object
 CANSNDMSG Send CAN bus message

The input pin ‘PORT’ has to be the name of the master, here its initial value is 'T5CANKvaser'
The input pin ‘SLV’ has to be the node number of the Wago device, here its node number 1
‘bSendHB’ allow to send the heartbeat value to the Wago (dwHB initialized to UDINT#1000)
Note: In the Slave properties (Fieldbus Configuration - ): the RPDO can be sent automatically (‘On
Change’), periodically or on request.

7|9
Build and connect

5. Build and connect

Build and download the application to the runtime:


 Select the communication parameters in menu Tools/Communication Parameters
 Establish the connection through menu Project/Online

RESULT IS:

The download is successful and application starts correctly.

The runtime is not started or communication parameters are wrong.

The application is not yet downloaded or an error occurs during startup. More detail can be found in the
output view.

6. Operations

The variables declared in the FBD program allow modifying the state of the Wago device.
Example:
 (Use bit ‘bSendHB’ to initialize the Wago device)
 Use bit ‘bStart’ to enter in Operational mode (declared in the FBD, see part 4.)
 Node status: ‘State’ value returned by the Wago is ‘5’  Operational mode
 Change ‘Outputs’ value to modify the state of the different Wago output.

8|9
Diagnostics data

7. Diagnostics data

Status Meaning

0x00 Bootup (use bit ‘bSendHB’ to initialize the Wago device)

0x04 Stopped: transmission of any messages is blocked

0x05 Operational: all Process Data Objects (PDO) transmissions are


available

0x7F (INT#127) Pre-Operational: reserved for the configuration of the device

8. Connection test

straton allows to test the connection between the computer and the CAN Open device. Open the fieldbus
configuration ( ), right click on the Master ( ) and click on ‘Test CAN node’:

If an error message occurs it’s probably due to the fact that the Runtime is already acceding to the Wago
device, just stop the application and try to ‘Test CAN node’ again.
The following window will be opened and allows to Send/Receive NMT messages for example (eg: click
on Start / Stop buttons to see if the Wago device is well connected)

9|9

You might also like