Page 1 of 2 1 2 LastLast
Showing results 1 to 10 of 15

Thread: Manipulate DynProperties during Runtime

  1. #1
    joulz Gast

    Default Manipulate DynProperties during Runtime

    Is it possible to manipulate the DynamicProperties (SubstituteDestination) of the "linking Rule" of a symbol in Runtime mode

    Situation

    I have a symbol inserted in a faceplate with SubstituteSource = X1*
    and SubstituteDestination "V63"

    The variables are V1_MVAR >> V70_MVAR and are defined

    I have a main picture that containes 70 fileds
    When I click on a field, a faceplate is opend with the inserted symbol.

    What I want is that when you click on a cirtain field is that the Fieldnumber is copied to the property SubstitutionDestination

    example :

    in case I click on Field 2 the property "SubstituteDestination" becomes V02_MVAR
    in case I click on Field 63 the property"SubstituteDestination" becomes V63_MVAR

    Is this possible

    Thanks in advance

  2. #2
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    879

    Default Re: Manipulate DynProperties during Runtime

    It is possible to achieve this with substitution of the pictureswitch-function (to your "face-plate").

    In the VBA help documentation (which can be downloaded here) there is such an example given (at RtFunction -> scroll down to the bottom)

    '########################################################################'
    '# Procedure to change the properties of a function with replacing...   #'
    '# -------------------------------------------------------------------- #'
    '# In the picture to show there are several linked variables,           #'
    '# beginning with 'Dummy/Dummy' this string will be replaced with the   #'
    '# given parameter 'strDest' and the function will be executed.         #'
    '########################################################################'
    Sub ChangeFunction(strName As String, strDest As String)
    Dim zFCT As RtFunction
    Dim strTemp As String
    Dim i As Integer
    
        Set zFCT = thisProject.RtFunctions.Item(strName)
        If zFCT Is Nothing Then
            MsgBox "A function called: " & strName & " is missing!"
            Exit Sub
        End If
        With zFCT
            For i = 0 To CLng(.DynProperties("PictSwitch.SubstiVar")) - 1
                strTemp = .DynProperties("PictSwitch.SubstiVar[" & i & "].Source")
                strTemp = Replace(strTemp, "Dummy/Dummy", strDest)
                .DynProperties("PictSwitch.SubstiVar[" & i & "].Destination") = strTemp
            Next i
            For i = 0 To CLng(.DynProperties("PictSwitch.SubstiFkt")) - 1
                strTemp = .DynProperties("PictSwitch.SubstiFkt[" & i & "].Source")
                strTemp = Replace(strTemp, "Dummy/Dummy", strDest)
                .DynProperties("PictSwitch.SubstiFkt[" & i & "].Destination") = strTemp
            Next i
        End With
    End Sub

  3. #3
    joulz Gast

    Default Re: Manipulate DynProperties during Runtime

    Thanks for the fast response

    I will try out.

    concerning the help document :

    For some reason I can not open the help document. My internet browser oes not support this. Is there not a PDF document .

    Best regards,

    Thanks in advance

  4. #4
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    879

    Default Re: Manipulate DynProperties during Runtime

    For some reason I can not open the help document. My internet browser oes not support this. Is there not a PDF document .
    If a help documentation (*.chm file) is downloaded on some OS (i.e. WinVista) combined with its security settings it is possible that you have to explicit "unblock" this file (see attachment). Also it is not possible to view *.chm files via the network. Such files have to be stored on the local computer.
    Attached Thumbnails Attached Thumbnails Chm_unblock.jpg  

  5. #5
    joulz Gast

    Default Re: Manipulate DynProperties during Runtime

    Thanks

    Helpdocument is now OK

    about substitution:

    Your solution will only work for Linked variables. What about the "linking rule" of a "linked symbol".

    I have a linked symbol in my faceplate that contains 3 linked variables. After I have inserted the symbol, there are some properties " Source and Target" what you than can configure. These properties Im not able to see in the replace tool of the RTFunction

    So is there an other way to access these properties via VBA

    I hope you have an answer for me

    thanks in advance

  6. #6
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    879

    Default Re: Manipulate DynProperties during Runtime

    Hello joulz,

    Is it possible for you to create a sample project and send this together with a short description to support@copadata.at ?

    Please also tell us which zenOn version you are using (including SP and Build Version).

    Regards,
    Herbert

  7. #7
    joulz Gast

    Default Re: Manipulate DynProperties during Runtime

    I dont no what the zenon version is .....it is embedded in the V460 editor 6.22 (Sprecher Automation)

    When you start the runtime after selecting at the top the 10kV button
    a display with to bays are presented. When you press Bay of 61 a fixed faceplate (Closeupdisplay)is opend on the second monitor.

    Now for every Bay we have to create its own faceplate. In case there is a change we have to edit all faceplates. We like to have one faceplate for all bays. How can we do this. Remark in the faceplate we have three linked symbols.

    Do you have an solution

    Attached you will find the project
    Attached Files Attached Files

  8. #8
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    879

    Default Re: Manipulate DynProperties during Runtime

    The functionality of a substituion (aka "linking rule") to a picture in which "linked symbols" are used has been implemented with zenOn 6.22 SP0 Build6. Therefore please contact your Sprecher Automation contact person to get this Build Version.

    To get the built in functionality afterwards working you need to rename your variables. The problem in this case is, that your variablenames differs at 2 places (i.e.):

    ERP.INTERN.V61!ERPJ1Q61.I.RESET
    ERP.INTERN.V63!ERPJ1Q63.I.RESET

    With the linking rule you can substitute only 1 part. This means either V61 (-> V63) or Q61 (-> Q63).

    If you can not rename the variables for some reasons it would be possible to make the substitution via VBA. As mentioned in post#2 you can modifiy a function (i.e. dummy function) within VBA before executing.

    Using InStr in combination with Replace it should be possible to simultaneously swap V61->V63 and Q61->Q63

    The information which faceplate (closeupdisplay) should be openend can be retreived from the "invisible button" (Object name). With this information you would feed the VBA macro in which you make the substition of the function before executing.

    Regards,
    Herbert

  9. #9
    joulz Gast

    Default Re: Manipulate DynProperties during Runtime

    Thank you for your response

    That's great about SP0 build 6 . That will save some faceplatebuilding

    about the renaming of the variable:

    In our application the V and Q are allways equal

    that means in case V61, then Q61 ; V100>>Q100 and so on

    so the source is V61!ERPJ1Q61 and destination for example V62!ERPJ1Q62

    e.g.
    ERP.V61!ERPJ1Q61.I.RESET.I.RESET >> ERP.V62!ERPJ1Q62.I.RESET.I.RESET


    So I guess we dont hav to change the variables isnt it

    about replace in VBA.

    is this also applicable for linked symbols then ????? .
    Which variable do I have to adress to???

    can you give an example ? (example post #2 is for pictures not for linked symbols isnt it? )


    thanks in advance

  10. #10
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    879

    Default Re: Manipulate DynProperties during Runtime

    e.g.
    ERP.V61!ERPJ1Q61.I.RESET.I.RESET >> ERP.V62!ERPJ1Q62.I.RESET.I.RESET

    So I guess we dont hav to change the variables isnt it
    As your variablename differs at 2 locations (namely V61 and Q61) the built-in substitution (via the wildcard functionality "*" or "?") in zenOn will not work, because this functionality only works if the variablename differs at 1 location.

    If you do not have the possibility to change the variablename it is possible to assign the substitution for each variable -> see screenshot in the attachment (Substitution.jpg). If you to this once for your pictureswitch function (i.e. with PICTURE SWITCH 25KV_FEEDER_V63) you will have a working pictureswitch function using the same faceplate but with the variables V63/Q63. This function you then export to .xml to see which substitutions (function properties) have been done. Open the .xml i.e. with "XML Notepad" which is available on the zenOn DVD.

    You will see in this file that for each substitution an entry exists (i.e. Function -> PictureSwitch_0 -> SubstiVar_0):
    Source: ERP.INTERN.V61!ERPJ1Q61.I.RESET
    Destination: ERP.INTERN.V63!ERPJ1Q63.I.RESET

    In VBA you then would replace the "Destination" property for each "SubstiVar" (and/or also function "SubstiFkt") as mentioned in the given VBA example.
    Note: PictureSwitch_0 will be in VBA PictureSwitch[0] .... (also SubstiVar[0])

    Note: to execute the modified function then via VBA you have to put a zFCT.Start at the end.


    is this also applicable for linked symbols then ?????
    yes - if the runtime files are created (compiled) all variables, functions, aso which are linked via the symbol to the picture are then "hardcoded" and thus it acts like a "normal" picture with "numerical elements".

    So at the end you will have:
    1 faceplate
    1 pictureswitch function
    1 VBA macro -> which is called via ChangeFunction(strName As String, strDest As String)

    Happy coding

    Regards,
    Herbert
    Attached Thumbnails Attached Thumbnails Substitution.jpg  

Similar Threads

  1. Replies: 1
    Last Post: 1st April 2008, 11:58
  2. the runtime crashes every time during the runtime start
    By sebastiank in forum zenon Operator
    Replies: 0
    Last Post: 27th August 2007, 10:27

Posting Rules

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