Changing submodules parameters via visualization

arek1996
2022-08-19
2022-08-26
  • arek1996 - 2022-08-19

    Hello guys,

    Is it possible to refer to Profinet submodules parameters via HMI? I want to change this parameters without connecting by PC and I want to make "Text Field" in visualization to change this variables.

     
  • hermsen

    hermsen - 2022-08-20

    Yes this is possible with the server and the devices. However there is no cookie cutter 1 size fits all solution for this.
    There is however a simple recipe you can follow.

    You must do the following; Access the server (master) FB instance programmatically, then search in the dynamic namespace of master for the child device you would like to access and do your operations on the device.

    Some hints and tips;
    Mostly it will depend on the used network protocol stack API. Expect to read/reference the server FB /Client FB api lib a lot.

    In your code you must figure out the correct path to your point of interest by either hardcoding the path or building this path dynamicly. Both options have pro's and con's. The static path option is easier to program but is not generic and not flexible. It can only deal with this specific setup. The dynamic option is more difficult but also flexible and thus usable with any hardware tree. If you are new with this go with the static path option and get some feeling for it. You can always rewrite your solution to a dynamic path solution.

    Master 1 FB Instance()
    points to childs;

    • slave 1 Instance()
      points to childs of slave 1;

      • slave 1 Submodule 1 Instance()
      • slave 1 Submodule 2 Instance()

        points to child of slave 1 submodule 2;
        + slave 1 Submodule 2 SubSubmodule 1 Instance()

    • slave 2 Instance()
      etc etc.

    So in the above example the path to slave1 sub2 subsub1 is;
    master1.slave1.sub2.subsub1

    If you wish to code this algoritm, better use ST, as LD will not allow you to create FOR or WHILE loops which you will need for itteration. Also try to AVOID recursive programming and if you must, never call that code sequentially but run it on some event once.

    I hope you have enough hints.

     

    Last edit: hermsen 2022-08-20
    • arek1996 - 2022-08-26

      Could you provide some example how to do that? I'm struggling with this whole week and I don't have more idea. Some example could help me :)

       
  • arek1996 - 2022-08-25

    Thank you for your comment.

    I have another problem. Even when I try to read values using "Read all values" I Receive error that access is denied. Writing is possible but reading is impossible. Is it because of device? Maybe I set some parameters wrong?

     
  • arek1996 - 2022-08-25

    Thank you for your comment.

    I have another problem. Even when I try to read values using "Read all values" I Receive error that access is denied. Writing is possible but reading is impossible. Is it because of device? Maybe I set some parameters wrong?

     
  • arek1996 - 2022-08-26

    Could you provide some example how to do that? I'm struggling with this whole week and I don't have more idea. Some example could help me :)

     

Log in to post a comment.