4/16/2020 8:25 AM | |
Joined: 9/8/2010 Last visit: 2/12/2024 Posts: 1 Rating: (0) |
Hi I am trying to create wincc HMI project. I have a requirement of Menu navigation using just two buttons Left&Right. I have main menu(10items) and sub menu further (max 10 items). I have decided to use Script to handle this. I thought of Saving the menu names in multidimensional array format. (a,b) 'a' represent menu and 'b' represent sub menu. Once I save all the screen names hard coded in array elements . I have also created one more set of array as below to store case numbers two dimensional array For A=0 To 10 For B=0 To 10 MenuItems(A,B)=((A+1)*100)+1+B If HmiRuntime.ActiveScreen.ObjectName= MenuNames(A,B) Then If SmartTags("NavigationLeft")= True Then If B>0 Then ScrCase=MenuItems(A,B)-1 SmartTags("ScreenNoInt")=MenuItems(A,B)-1 End If End If End If Next Next My IDea was by using now this array poiters A,B i can determine which screen i am in and increase /decerse the case number so that i can choose to activate correct screen when the navigation left/right buttons are pressed. I have below issues&Questions 1. I have to use cases as i can't use " ActivateScreen (Array pointer(a,b)) . This has increased my code length. 2. Is the two dimensional array works in Wincc tia. This question has come up as i can see only first set of array is functioning. Only the elements from (0,0) to (0,10) only is processed. rest of them are not processed. I have copied my script lines in to attached notepad. Appreciate any feedback /suggestion on this. Thank you all in advance AttachmentLeft Script.txt (65 Downloads) |
Follow us on