Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Read/Write Modbus register from Scada/HMI

TiakTiak
2019-02-26
2020-07-08
  • TiakTiak - 2019-02-26

    Hi Everyone

    In CodeSys 2.x it was possible to just to declare a variable like this. PLCTag AT %MW0 :INT; ( Variable Int modbus addr 12288)
    Then it was possible to access this variable from a Scada/HMI via Modbus.
    If a counter in the controller is counting on PLCTag register, it was possible to read that value in the Scada/HMI but also possible to change from the SCADA/HMI side.

    Now in CodeSys 3.x it seems that this is not possible anymore. CAN THAT really be true???
    Thx

     
  • dFx

    dFx - 2019-02-27

    If your scada dont cyclically writes, it's still possible. (This implies your plc supports modbus RTU slave or modbus TCP server)

     
    👍
    1
  • johant - 2020-07-08

    Hello,
    I am working on a Project that consists on controlling IAI axis via MODBUS RTU with a Raspberry pi based on codesys, and I need some support. I would like to know if there is any function to write variable´s values directly in modbus communication channels. Instead of linking them in the Reading and writing channels, I want to know if there is any function to write these variable´s values in the communication channels automatically.
    I will be waiting for your answer.

    Thank you.

     
  • Morberis

    Morberis - 2020-07-08

    @johant

    Sorry I'm a bit confused, entirely on my end. Do you mean writing a variable to a channel without using the modbus function codes?

    As in instead of writing register 100 with function code 6 you want to send 6x0100 or something like that? I'm not sure if I'm correct about it being 6x0100 so I apologize if I'm incorrect.

    I honestly don't know. Try looking at the IoDrvModbus library.

    https://help.codesys.com/webapp/_mod_f_libraries;product=core_modbus_configuration_editor;version=3.5.15.0

     

    Last edit: Morberis 2020-07-08

Log in to post a comment.