Showing results 1 to 5 of 5

Thread: Linking Rule, several entries sytax

  1. #1
    Join Date
    11.04.2019
    Posts
    9

    Frage Linking Rule, several entries sytax

    Hello

    I have some concern with substitution.
    The unique part of the string that I want to replace occurs twice in the variablename.
    For example I want to replace K1 with K2 in the two example variables below

    VL:22.FDR:K1.CB:S-K1.TAD:INDDP
    VL:22.FDR:K1.GND:F-J-K1.ADA:ONOFF_M

    should look like this

    VL:22.FDR:K2.CB:S-K2.TAD:INDDP
    VL:22.FDR:K2.GND:F-J-K2.ADA:ONOFF_M


    The string between the two "K1" is not consistent in lengt or characters.

    I have tried *K1* and it's only replacing the first occurence.
    I also tried *K1.GND:F-J-K1* and it works but only for object where the string matches.

    It says in the manual that several entries can be separated by a ; but I'm not getting it to work.
    Last edited by Tobiasto : 10th May 2019 at 06:38

  2. #2
    Join Date
    09.03.2011
    Posts
    39

    Default Re: Linking Rule, several entries sytax

    Hello Tobiasto,

    It should work just with "K1" and "K2", if you are directly substituting on variables. The dialog will show you an example of the result of the substitution:



    But, if you are using substitution on switching screens, and if you are using the static substitution, you will need to write almost the whole name:



    There are other options besides the static substitution, like {PARAM} or indexing variables, that may be more useful. You can find more information about this on the help.

    More information could be helpful, like your zenon version, how and where you are actually doing this substitution, or what is your goal.



    Best regards,
    Steffi
    Attached Thumbnails Attached Thumbnails Susbtitution.png   Substitution2.png  

  3. #3
    Join Date
    01.07.2008
    Location
    Salzburg, AT
    Posts
    795

    Default Re: Linking Rule, several entries sytax

    For the substitution the semicolon separator ; works only while substituting in symbols, but not in the screen switch function.

    In the function the variable (function, alias) name are substituted only once - by the first matching rule. So in the function you have to add as many rules as there are possible strings between "K1" parts. And it will be much easier to work in th second tab of the function - in tab 'replace indices' (not 'replace links'). Here an example (using also the {PARAM} mentioned already by Steffi):
    Click image for larger version

Name:	replace_indices_PARAM.png
Views:	7
Size:	49.1 KB
ID:	2575

    An alternative would be to rename variables - or their Identifications - to some strings more comfortable for dynamical substitution. Note: the replace rules in a function can use Name or Identification.

  4. #4
    Join Date
    11.04.2019
    Posts
    9

    Default Re: Linking Rule, several entries sytax

    Thanks for all the advices, I guess the best thing would be to make up some new variable names, but thatís not an option.
    In my case, it is linking of a screen element, and it can be solved, but I need to put in the name to be replaced more than once, se screenshot, but I can live with that.
    The Replace indices with {PARAM} looks interesting, but I guess it canít be used on for linking symbols placed on a screen.

    /Regards Tobias
    Attached Thumbnails Attached Thumbnails Linking.PNG  

  5. #5
    Join Date
    01.07.2008
    Location
    Salzburg, AT
    Posts
    795

    Default Re: Linking Rule, several entries sytax

    The replacement for symbols is done by Editor, then in the compiled project all references by symbols are substituted. The compiler produces as many symbols as you have placed on screens (and, eventually, substituted).
    Alternative: you can define in symbol editor some of the properties - e.g. variables linked to combi-elements there - to be released. Then for symbols placed on a screen you can link the wished variables to the right property.



    The replacement in 'screen switch' functions is done dynamically in the Runtime. The compiler produces only one screen and one function, and the Runtime makes dynamical substitution using the {PARAM}.
    Attached Thumbnails Attached Thumbnails 2019-05-13_09-06-33.png  

Similar Threads

  1. Dynamic Linking of Reaction Metrix Values
    By synergyautomation in forum zenon Operator
    Replies: 1
    Last Post: 10th July 2018, 09:20
  2. Replies: 13
    Last Post: 25th June 2018, 06:53
  3. linking multiple projects
    By talal.mubarak in forum zenon Supervisor
    Replies: 1
    Last Post: 10th June 2013, 23:36
  4. CEL Entries in Milliseconds
    By shikra in forum zenon Energy Edition
    Replies: 2
    Last Post: 7th April 2010, 08:49
  5. CEL entries
    By christian73 in forum zenon Supervisor
    Replies: 5
    Last Post: 30th July 2008, 16:37

Tags for this Thread

Posting Rules

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