Skip to content

An application example, how to use ez-Way with FC6A and ModbusTCP communicaiton

License

Notifications You must be signed in to change notification settings

IDEC-ezWheel/ez-Way_and_FC6A_example

Repository files navigation

Modbus TCP communication between the IPC and the FC6A

Table of contents

Introduction

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.

Prerequisites

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

1 - Wiring

1.1 - Wiring between the FC6A and the Starter Kit

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).

1.2 - FC6A Power supply

In this example, the PLC needs a 24V DC power input.

Power supply on the FC6A

1.3 - Wiring the Buzzer to the FC6A

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.

Wiring buzzer overview

2 - Config file

2.1 - File content

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
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}

2.2 - Content description

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”.

2.3 - Location on the Starter Kit PC

This file is located on the Starter Kit PC at the following location:

/home/ezway/.config/ez-way/

3 - Configuring the FC6A

To configure the PLC and download the program, we will use the WindLDR software.

3.1 - Configuring the FC6A IP and port

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

IP configuration of the FC6A on WindLDR

To configure the FC6A port, go to: Configuration/Connection Settings, then click on “Configure” in the “Modbus TCP Server” line.

Port configuration of the FC6A on WindLDR

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”.

Download on the FC6A with WindLDR

To perform this action, the PLC must be connected to the computer running WindLDR, for example with a USB cable.

3.2 - Starting the PLC

The PLC must be started in WindLDR to work properly. To do this, go to the “Online” tab and click on "Start”.

Start the PLF with WindLDR

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.

3.3 - Error when downloading or starting the PLC

If the following error appears when downloading or attempting to start the PLC.

Download on the FC6A with WindLDR

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.

4 - How to communicate with the FC6A from ez-Way

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}

Node configuration on ez-Way

Important Reminders

Model of FC6A

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.

Port and IP configuration in WindLDR

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.

Download changes with WindLDR

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.

Starting the PLC

The PLC must be started in WindLDR to work properly, as it is described in the following section: Starting the PLC

Error when downloading or 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

About

An application example, how to use ez-Way with FC6A and ModbusTCP communicaiton

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •