How do I set up the E+PLC as a modbus TCP slave?

We are trying to add the Modbus TCP slave functionality to the E+PLC400.

I have added Modbus_TCP_Slave_Device and configured it to show a few registers, and set the Unit ID to 1.

Modbus_TCP_Slave_Device has a green "running" indication next to it, but attempts to poll this data are so far not successful.

Am I missing something?

Paul Scott
1 person has
this problem
+1
Reply
  • Stephen Daly (Software Support Engineer) November 21, 2014 09:02
    Hi Paul, if you send your project to Support, we can get it up and running and see what's missing.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited indifferent, undecided, unconcerned kidding, amused, unsure, silly

  • Thanks Stephen,

    In fact with some help from Eurotherm India, it is now working. My key learnings were as follows:

    1) YOU HAVE TO ENABLE Modbus TCP Slave mode by editing the file FW4.CFG on the E+PLC400 SD Card by un-commenting (removing the # from) the line that says:
    #pass in on motetsec0 proto tcp from any to any port = 502.

    Be sure to eject the SD card when finished otherwise it will probably stop working. (from my experience with T2550/T2750).

    2) Only two address ranges are supported; Input Registers (3X,XXX) and Holding Registers (4X,XXX).

    3) Holding Registers cannot be written to by the application

    4) Even though CODESYS views and presents the registers as single words, it is possible to use 32 bit floating variables, by declaring REAL values into the desired word address, e.g.
    ModReal1 AT %QD1: REAL;
    ModReal2 AT %QD2: REAL;
    ModReal3 AT %ID1: REAL;
    ModReal4 AT %ID2: REAL;

    Kind Regards

    Paul
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited indifferent, undecided, unconcerned kidding, amused, unsure, silly

  • Paul, I need some help with this topic. Can you help me?

    Regards
    Arv
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited indifferent, undecided, unconcerned kidding, amused, unsure, silly

  • 1
    Hi Arv,

    I have finished that one project with E+PLC about 18 months ago. Still I can give you a few pointers.
    The E+PLC software is now in a newer version and so hopefully it would be easier.
    Firstly look at the four tips above, then introduce a Modbus_TCP_Slave_Device as mentioned in the first post above.
    You will have to add two blocks of registers - Input Registers and Holding Registers.
    The Modbus TCP Master will be able to read but not write the Input Registers, and write but not read the Holding Registers (unless the new version is more flexible).
    You can test the function from a PC with Modbus TCP software such as Modbus View TCP.

    Regards
    Paul
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited indifferent, undecided, unconcerned kidding, amused, unsure, silly

  • 1
    Hello Paul,
    Thanks for the reply...Yes I'm using the latest version "CODESYS V3.5 SP5 Patch 4"

    And yes, I am able to read/write the holding register through Modscan IP software. But when I write any values, its always changes to 0 in few seconds. I think its trying to write Input registers. Here is the start address of the holding registers and input address. Pl check.



    Regards
    Arv
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited indifferent, undecided, unconcerned kidding, amused, unsure, silly