Showing results 1 to 4 of 4

Thread: Textbox and Send Button symbol

  1. #1
    Join Date
    27.10.2011
    Location
    Verona
    Posts
    29

    Default Textbox and Send Button symbol

    Hello,
    I'd like to create a symbol like this:



    I need not to send a value to the driver when it's write in the textbox, but when you press the button.

    I'm almost at the end of the problem but I still need a little help. These are the steps I've made:

    1) I've created the variable linked to the driver and a variable where put the textbox value
    2) I've created the image with the numerical value object
    3) I've created a combined elemet with 3 variables: the first one is a useless variable boolean(called junkvar) just for enabling the button function, the second and the third are the two varaibles I've created in point 1
    4) I've write VBA code and linked to the LeftClickUp event
    Public Sub LeftClickUp_ShowName(obElem As Element)
    Dim IndexItem As Integer
    obElem.ItemVariable(1).Value = obElem.ItemVariable(2).Value
    obElem.LeftClickUp
    End Sub
    5) Linked the code to the combined object event
    6) Created the symbol
    7) Insert the symbol in page and test

    And here all works.
    When I create the second button I've got (obviusly) the problem that when I press the combined element button all button change color (because the junkvar) is the same, I only use the linking rule editor for replacing the two variables working with field.

    How can I resolve the problem? I've noticed that I can't use a normal button, can I? If I use it the VB code is referenced to the button which has only one variables inside.

    Thanks and best regards
    Luca

  2. #2
    Join Date
    01.07.2008
    Location
    Salzburg, AT
    Posts
    810

    Default Re: Textbox and Send Button symbol

    You can use normal buttons. But you need anyway more bool variables - as many as you have variables to be written to PLC. You can use button working as Switch - then it can be linked directly with this bool internal variable.

    And you don't need VBA. You can use this bool variable as trigger in an Allocation from variable with new value (linked with your numerical/text element) to variable the driver writes to PLC.

    If you have many variables that you want to first edit and next write to PLC maybe take a look on Recipe Group Manager. Using RGM, without any additional variables, you can prepare a recipe with the set of new values and write the whole list to PLC.

  3. #3
    Join Date
    27.10.2011
    Location
    Verona
    Posts
    29

    Default Re: Textbox and Send Button symbol

    First of all thank you for your suggestion, then I try to answer
    Quote Originally Posted by ursulap View Post
    You can use normal buttons. But you need anyway more bool variables - as many as you have variables to be written to PLC. You can use button working as Switch - then it can be linked directly with this bool internal variable.

    And you don't need VBA. You can use this bool variable as trigger in an Allocation from variable with new value (linked with your numerical/text element) to variable the driver writes to PLC.
    You suggest me to try Allocation triggered by boolean variables and skip VBA part? Ok, I'll try it then

    Quote Originally Posted by ursulap View Post
    If you have many variables that you want to first edit and next write to PLC maybe take a look on Recipe Group Manager. Using RGM, without any additional variables, you can prepare a recipe with the set of new values and write the whole list to PLC.
    I've got a lot of variables, I work in the company that hold hydric service in the city and in Zenon we'll insert a lot of plant each with 10-15 parameters to be sent (for small site) or even with 30-40 parameter in case of big plants.
    I've never used Recipe Group Manager (and we're starting the sistem and we don't have it in license for the RT, only for the CDDN developer station. Do you think this is a better solution?
    I'll try to take a look on the documentation to see if I can understand something better.
    Thanks for help

    EDIT
    The parameters that have to be sent to the field device are not always the same even in description, maybe sometime Parameter 1 is a set point for a level of a tank and sometime Parameter 1 can be a Pressure setopint.
    Last edited by luca.bardon : 17th October 2012 at 13:17

  4. #4
    Join Date
    01.07.2008
    Location
    Salzburg, AT
    Posts
    810

    Default Re: Textbox and Send Button symbol

    From your description i suppose RGM could exactly be what you need.

    You can start the Runtime in demo-mode to check how then it works.

Similar Threads

  1. Send Value to hardware
    By anahita in forum VBA
    Replies: 3
    Last Post: 7th August 2011, 22:54
  2. Textbox navigation with tab key
    By gralex in forum zenon Supervisor
    Replies: 14
    Last Post: 6th April 2010, 11:17
  3. Textarea / multiline Textbox
    By gralex in forum zenon Supervisor
    Replies: 6
    Last Post: 3rd March 2010, 23:53
  4. Send To Hardware in 6.22
    By madphilly in forum VBA
    Replies: 4
    Last Post: 22nd September 2008, 15:06
  5. send value to hardware
    By dak2483 in forum Drivers
    Replies: 7
    Last Post: 19th September 2008, 16:33

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •