- Table of contents
- Introduction
- Prerequisites
- 1 - Wiring
- 2 - Config file
- 3 - Configuring the FC6A
- 4 - How to communicate with the FC6A from ez-Way
- Important Reminders
This example implements the control of a PLC output during a mission performed by ez-Way. A Modbus TCP communication is established in between the IPC with ez-Way and the PLC. The example controls a PLC output, to turn ON and OFF an illuminated buzzer.
- ez-Way 1.3 or higher
- PLC - IDEC FC6A
- WindLDR software
- Illuminated buzzer - HW1Z
This example is implemented on an ez-Way Starter Kit, with an FC6A-D16P1CEE PLC communicating with Modbus TCP protocol via an Ethernet cable. Output Q0 of the FC6A is connected to the buzzer. The FC6A can be programmed in LADDER using WindLDR software.
Depending on FC6A reference, the following characteristics may vary:
- Location, type and number of connection ports
- Power supply type and voltage
- Number and type of input / output
The wiring is made using an RJ45 Ethernet cable connecting an Ethernet port on the Starter Kit to an Ethernet port on the PLC (not to be mistaken with a Serial port).
In this example, the PLC needs a 24V DC power input.
In this example, the PLC has source outputs and those must be powered by the -V and COM(+) ports with 24V DC. Note that some FC6A may have sink outputs and other voltage.
In this example, the configuration file “modbus_tcp_gateway_manager.json” will contain the following text:
{
"devices": [
{
"name": "PLC1",
"type": "ModbusTCP",
"IP": "10.1.0.100",
"port": 502,
"managers": [
{
"id": "BUZZER_MANAGER",
"description": "Buzzer Manager",
"actions": [
{
"id": "TURN_ON",
"description": "TURN ON BUZZER",
"cmd": 400001,
"cmd_params": [
{
"parameter": "cmd_param",
"address": 400002
}
],
"state": 400042,
"progress": 400043,
"error": 400044,
"state_params": [
{
"parameter": "state_param",
"address": 400045
}
]
},
{
"id": "TURN_OFF",
"description": "TURN OFF BUZZER",
"cmd": 400101,
"cmd_params": [
{
"parameter": "cmd_param",
"address": 400102
}
],
"state": 400142,
"progress": 400143,
"error": 400144,
"state_params": [
{
"parameter": "state_param",
"address": 400045
}
]
}
]
}
]
}
]
}This file contains important information for communicating with the PLC, which are “name,” “type,” “IP,” and “port.” The ‘IP’ and “port” fields must be the same as those configured on the PLC.
This file also describes the “managers” (e.g., “id”: “BUZZER_MANAGER”) which enable “actions” to be performed (e.g., ‘id’: “TURN_ON”).
These actions contain the address of the associated activation value in the PLC (e.g., “cmd”: 400101), as well as the return values “state”, “progress” and “error”.
They also contain a list of activation parameters “cmd_params” and a list of return parameters “state_params”.
This file is located on the Starter Kit PC at the following location:
/home/ezway/.config/ez-way/
To configure the PLC and download the program, we will use the WindLDR software.
Reminder: The IP and port must be the same as those in the “modbus_tcp_gateway_manager.json” configuration file.
To configure the FC6A IP, go to: Configuration/Network Settings
To configure the FC6A port, go to: Configuration/Connection Settings, then click on “Configure” in the “Modbus TCP Server” line.
Important: The “Allow Access by IP Address” box must NOT be checked.
Each time the configuration or the LADDER program is modified in WindLDR, the changes must be downloaded to the FC6A. To do this, go to the “Online” tab and click on “Download”.
To perform this action, the PLC must be connected to the computer running WindLDR, for example with a USB cable.
The PLC must be started in WindLDR to work properly. To do this, go to the “Online” tab and click on "Start”.
To perform this action, the PLC must be connected to the computer running WindLDR, for example with a USB cable.
If the PLC has started correctly, the "RUN" LED on the physical PLC should be lit in green.
If the following error appears when downloading or attempting to start the PLC.
It means that the physical "Function Switch" on the PLC is turned OFF (on the state 0).
It must be turned ON (on the state 1) to start the PLC on WindLDR.
In this example, this switch is located under the "SD" cartridge.
On ez-Way, to turn ON and OFF the buzzer, we added on a node a "generic action" named "custom_action_modbus_tcp_gateway" with the following parameters:
- To turn ON the buzzer:
{"cmd":"PLC1.BUZZER_MANAGER.TURN_ON","cmd_param": 0}
- To turn OFF the buzzer:
{"cmd":"PLC1.BUZZER_MANAGER.TURN_OFF","cmd_param": 0}
Make sure you are using the same model of FC6A as us. If it is not the case, refer to the correct datasheet for wiring and power supply. There is a link to this product range of IDEC at the beginning of this document in the Introduction. Each product page includes the corresponding data sheets.
The IP and port must be the same as those in the “modbus_tcp_gateway_manager.json” configuration file.
In the Port configuration on WindLDR, the “Allow Access by IP Address” box must NOT be checked.
Each time the configuration or the LADDER program is modified in WindLDR, the changes must be downloaded to the FC6A. To do this, go to the “Online” tab and click on “Download.”
To perform this action, the PLC must be connected to the computer running WindLDR, for example with a USB cable.
The PLC must be started in WindLDR to work properly, as it is described in the following section: Starting the PLC
If an error appears when downloading or attempting to start the PLC, see the following section: Error when downloading or starting the PLC







