Showing results 1 to 3 of 3

Thread: Switching between 2 functions

  1. #1

    Default Switching between 2 functions

    Hi Everyone,
    I wish you a great new year in 2021.
    I am on the subject how to switch between 2 functions via a button or combined element.
    I am gonna use that switching functionality b/w languages English and German.
    I already created functions for language change for both languages and now looking for a script or function
    which I can toggle b/w those languages. I am planning to have a button or combined element and this combined element is going to run a script
    and the script will first switch the current language and then will stop and wait until next time the same button is clicked.
    Could you please recommend me sthg to start with ?

    thank you

    Warm Regards
    Volkan GŁndogdu


  2. #2

    Default Re: Switching between 2 functions

    Hi Everyone,
    I have figured out to link Reaction Matrix to the variables.
    I have created a solution as followint;
    1. A bool type variable as Languagebit is created.
    2. A binary reaction matrix is created and named as LanguageSwitch.
    3. Inside of this binary REMA; default condition is linked to a function which is already created as English
    4. Inside of this binary REMA a new condition is created and the Function Language switch to German is linked.
    5. Do not forget to configure the first bit of New condition as "1" since when the variable changes to 1 related function then will be called.
    6. Finally create a either a switch or a combined element which is linked to variable that created in step 1 (Languagebit)
    7. When you select the switch under Fill properties change the graphichs file off and graphics file On with the related country flags.
    8. When you design with combined element which seems more elegant than configere the things under Represantation ->configuration and test; here add the variable Languagebit and assign related country flags under display element Graphics file


    Now my new challange will be to create numerical REMA and will try to link every press of the same button to the related fucntions in this REMA.

    Best Regards
    Volkan

    Warm Regards
    Volkan GŁndogdu


  3. #3

    Default Re: Switching between 2 functions - Cycling Counter

    Hi Everyone,
    The situation is more evoluted and the second question was; How to select multiple language functions just by clicking the same button.
    After I consulted to one of my collegue, I come up with below solution.
    That sounds like a cyclic counter and each value of the counter a new function is selected. At the limit of the variable the counter is resetted so the operation turns to inital state.

    1. Create a LanguageSelector variable as byte datatype
    2. Create a write/set function . Set value --> 0 and name this function as LanguageSelectorReset with the prop---> direct to the hardware is selected
    3. Create a Numeric Reaction Matrix and name it as LanguageSelectionMatrix
        3.1 Default condition  -- choose function English (language switch function) --- of course English function should be prepared prior to this step.
        3.2 New condition "Equal=1" --> Function --> German
        3.3 New condition "Equal=2" --> Function --> Turkish
        3.4 New condition "Equal=3" --> Function --> Portugese
        3.5 New condition "Greater>3-->Function -->LanguageSelectorReset (which is created in step2)

    4. Create a write/set function --> Set value settings: Changed by 1 And using  following properties; Named as LanguageCountUp
        4.1 Use set value limits of the variable  (optional you can also here define the limits)
        4.2 Propose current value
        4.3 Direct to the hardware

    5. Create a combined element with type of display -->Graphics file and screen symbol
       5.1 Here add same number of conditions as you have in LanguageSelectionMatrix.
       5.2 Here the order of conditions should be the reverse since e.x: Default is English and if you wanna go to German the symbol should show German flag while all the text is English
       and for example after German if you wanna skip to Turkish you should show Turkish flag while all the text in screen is German.
       5.3 Under Variable/Function property of the combi element choose variable as -->LanguageSelector (created in the 1st step)
       5.4 Under Variable/Function property of the combi element choose function as -->LanguageCountUp (created in the 4th step)
       5.5 Under Write/Set value property make sure that Binary value is deactivated and Write set value + without dialog is activated.

    6. Of course this is kind of predefined and  is not a combo or list box where you can choose any item you wish. if your desired item is at the end of the list then you should click several times.

    At the end, this solution is good when you only have several language options and you dont wanna create a combo box for it.
    Please comment since I am quite new in Zenon.




    Warm Regards
    Volkan GŁndogdu


Similar Threads

  1. Language Switching DIALOGKBD
    By EdgyUsername in forum zenon Service Engine Supervisor
    Replies: 3
    Last Post: 5th February 2019, 09:45
  2. Driver Mode Switching recommendation?
    By Srikanthg in forum zenon Service Engine Supervisor
    Replies: 3
    Last Post: 27th August 2018, 09:50
  3. Modbus Driver not switching between adapters
    By Mustafa.SA in forum zenon Energy Edition
    Replies: 5
    Last Post: 16th May 2018, 10:49
  4. automatic switching (substation automation)
    By elsoportar in forum zenon Energy Edition
    Replies: 3
    Last Post: 14th April 2015, 12:20
  5. Switching variables in Report
    By a.oprean in forum zenon Service Engine Supervisor
    Replies: 4
    Last Post: 15th January 2013, 02:05

Posting Rules

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