opening numpad in Structured Code ST

vincent.v
2021-12-10
2021-12-20
  • vincent.v - 2021-12-10

    Hi,
    I'm new to the codesys and to forge.
    I'm searching a way to open the numpad with ST code and given the value to be overwritten and the min and max value is may be.
    It's being a while i searching for it . but still doesn't find it

    Kind regards
    Vincent

     
  • vincent.v - 2021-12-14

    HI,
    Now i can open the dialog with the values 'min' 'max' in it ( see image), but i'm stuck with 1 problem, and this is write the value parameter.
    Anyone who can help?
    many thanks

     
  • m.prestel - 2021-12-14

    Hey,

    First of all you really should not use GetNextClient and OpenDialog.
    This can cause real issues when incorrectly accessed, in the worst case an exception stopping the whole application.

    Could you help me understand what you are trying to do and why you want to open the numpad from IEC and not by a mouse click?

    Thanks a lot
    Best regards,
    Marcel

     
    • vincent.v - 2021-12-15

      Hi Marcel,

      I'm programming now an HMI of a machine

      I used to do it with a mouse click, and this was a lot easier. Now I have written a function where I can block the parameter of the machine (as administrator) on long-click the parameter and on short-click change the parameter. so now this has to be done via code

      can you help me further? how to do it right? as it should

      Many Thanks
      Vincent

       
  • m.prestel - 2021-12-16

    Hey,

    First of all sorry to disappoint you here.
    There is no clean API which you can use to open a numpad/keypad from IEC.
    You can of course open your own dialog, but then you would have to do the parsing of inputs etc yourself...
    I raised an improvement to address your use case.

    Apart from this, I think you could also achieve this with the attached example.
    One known limitation of the example is that the numpad will be opened when you leave the visualization with the mouse. That is dont ideal, but that can be solved as well (e.g. closing all numpads when the lock is active etc).

    Best regards,
    Marcel

     
    • vincent.v - 2021-12-20

      Hi Marcel,

      Thank you very much for you answer. You have certainly helped me further.
      I keep looking for the final result.

      happy holidays!

      Kind regards,
      Vincent

       

Log in to post a comment.