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

Write on a input modbus tcp

Anonymous
2020-02-20
2020-02-20
  • Anonymous - 2020-02-20

    Originally created by: noktan

    Hello,

    I have a new project which consists of verifying the feasibility of migrating a simulator to Codesys, it simulates Premium modicon PLCs from the Schneider Electric range.
    Communication takes place in Modbus TCP.
    On that date, on Codesys, I can only read/write on words (% mw).
    And concerning EANA type variables (% IW) or digital inputs/outputs (% I or% Q), I can't read or write them.

    First, I would like to know if it is possible to directly write to the% IW variables.
    Then ideally, how do I go about it?

    Thank you.

    Pour les français:
    J'ai un nouveau projet qui consiste à vérifier la faisabilité de migrer un simulateur vers Codesys, il simule des automates modicon Premium de la gamme Schneider Electric.
    La communication s'effectue en modbus TCP, à ce jour sur Codesys, je n'arrive qu'à lire/écrire sur des mots(%mw).
    Et concernant les variables de type EANA ( %IW) ou des entrés/sorties TOR (%I ou %Q), je n'arrive pas à les lire ni les écrire.

    Dans un premier temps, je voudrais savoir s'il est possible d'aller directement écrire sur les variables %IW.
    Puis idéalement, comment puis-je m'y prendre.

    Merci

     
  • JAPIB

    JAPIB - 2020-02-20

    Bonsoir,

    En théorie, en Modbus, les adresses correspondants à des entrées ne sont accessibles qu'en lecture.
    En Modbus il y à donc des bits d'entrée et des mots d'entrée (ou registres d'entrée d'après la terminologie Modbus).

    Les mots %MW sont considérés comme des registres internes et sont donc accessible en lecture et en écriture.

    Voici le lien vers un article d'un forum (français) ou sont très bien expliqués les principes de Modbus : http://forum-automatisme.net/viewtopic.php?f=25&t=4174

    Dans les automates Modicon (les vrais pas les Premium Schneider ) ces subtilités de variables d'entrée ou de sorties sont inhérentes au système.
    Dans d'autres automates, c'est le programmeur qui définit des zones de variables d'entrée ou de sortie, ce qui laissent plus de possibilité, mais nécessite de bien connaître la configuration du programme auquel on accède.

    Cordialement.

    Good evening,

    In theory, with Modbus, the addresses corresponding to inputs are only accessible in read mode.
    In Modbus there are therefore input bits and input words (or input registers according to Modbus terminology).

    The words% MW are considered as internal registers and are therefore accessible in read and write.

    Here is the link to an article from a forum (French) where the Modbus principles are very well explained: http://forum-automatisme.net/viewtopic.php?f=25&t=4174

    In Modicon PLCs (The real, not Premiums from Schneider ) these subtleties of input or output variables are inherent in the system.
    In some other PLCs, it is the programmer who defines zones of input or output variables, which leaves more possibilities, but requires knowing the configuration of the program being accessed.

    Best regards

     

Log in to post a comment.