Frequently Asked Question
- In this FAQ, we will explain how to install DIS sensors in Codesys. The installation of the Codesys and PLC programming is not included.
- Under Safety PLC-Communication, you will find the communication bus. Select CAN and right click the mouse.
- Click Add Device and select CANbus
- Right click CANbus and select Add Device
- Select CANopen_Manager_SIL2
- Right click CANopen_manager_SIL2 and click add device. Choose DIS sensor under “Safety Remote Device”
- Now you can see the sensor configuration when you click the sensor
- Change sensor parameters via tab "SDOs"
- Configure SRDO parameters via tab "SRDOs "
In this tab, you can define the safety-oriented data objects (SRDOs). The Receive SRDOs are defined on the left side and the Transmit SRDOs are defined on the right side. Our sensor is configured with Transmit SRDOs.
The mapping of the SRDO1 is already configured with the default value in the EDS file.
If you double click the first row, you can see the SRDO properties. The value is already initiated with the default value in the EDS file. Object 1301 is used to configure the communication parameters of SRDO1. - Refresh time is set to 80ms as default. This means every 80ms a new SRDO output is sent.
- SCT time is set to 2x the Refresh time in default in de Codesys.
- Read here for more details over the SCT/SRVT/Refresh time
- CRC
Introduction Codesys
Codesys is a development environment for programming a controller.
It is developed and marketed by the German software company CODESYS GmbH.
The tool is independent of device manufacturers and thus used for hundreds of different controllers, PLCs (programmable logic controllers), PAC (programmable automation controllers), ECUs (electronic control units), controllers for building automation and other programmable controllers mostly for industrial purposes.
The core of the platform is the IEC-61131-3 programming tool "CODESYS Development System".
(source: https://www.codesys.com/the-system.html)
Step 1. Add DIS sensor as a “Device”
CODESYS manages the installed devices in the device repository. A device repository is a defined location in the file system. In the default CODESYS installation, it is defined with an absolute path as the system repository. You install or uninstall devices in the Device Repository dialog. The system installs a device by reading the device description file. The properties of a device are defined in these files regarding configurability, programmability, and possible connections to other devices.
You can later use the devices provided in the device repository by adding them to the device tree of your project.
Choose Tools->Device Repository
Choose the EDS files and install DIS sensors. You can download the EDS files for your DIS sensors here.
The installed sensors will be seen under CiA Remote Device.Reference:https://help.codesys.com/api-content/2/codesys/3.5.13.0/en/_cds_installing_device/
Step2. Build a new project
We use CR711S template as an example to build a new demo project showing you how to set up a CANopen safety sensor in codesys.
CR711S is a safety controller with CANopen Safety support
A new demo project named “DIS” is made and the fold tree is listed on the left side.
Reference:https://help.codesys.com/webapp/_cds_struct_project_creation;product=codesys;version=3.5.17.0
Step 3 Add devices to the project
CANbus is now added as a device under CAN communication
A CANopen SIL2 manager is added.
Two DIS CANS sensors are now added in the project tree.
Step 4. Configure sensors
Panel for CANS devices
Panel for CANopen devices
A detailed documentation of each tab can be found on Codesys website.https://help.codesys.com/webapp/_can_edt_canopen_manager_general;product=core_canbus_configuration_editor;version=3.5.17.0
The object dictionary is defined in the EDS file when you import the device. To understand what each object represents, you need to look it up in the manual of your sensor. You can find the manual here.
Just choose the object and the subindex and write the value you want to send to the sensor. Codesys will generate the SDOs for you.
e.g. change filter time via object 300E sub index 01
Create all SDOs should be unchecked, otherwise the sensor will always be initialized with the default value in the EDS file.
For CANopen Safety device, tab "SRDOs" and "SRDO CRCs" are used.
The mapping of the SRDO1 decides what information is contained in the SRDO1. The SRDO always contains a normal message (0x101) and an inverse message(0x102).
Message 101 has 2 bytes data, 1st byte = 62100108h and 2nd byte = 62100208h.
Message 102 also has 2 bytes data, 1st byte = 62110108h and 2nd byte = 62110208h.
The definition of object 6210 and 6211 can be found in the manual:
Codesys can detect CRC error and generate SDOs to correct it. E.g. after you change the node ID on general page.
Now the sensor is configured and you can log in your PLC to check the live outputs.