Page 1 of 1

How to open an additional scene from the main scene?

Posted: Wed 19. Jun 2024, 09:17
by CheolsoonKwon
Hello,

I would like to know how to open an additional Scene2 when pressing a Button during the operation of the main Scene in PCAN Explorer's Instrument Panel.

It seems like using a macro would work. I tried finding the method in the Help by pressing F1, but it only explains how to add a completely new scene, not how to open an existing Scene2 that has already been created.

Thank you for your assistance.

Best regards

Re: How to open an additional scene from the main scene?

Posted: Wed 19. Jun 2024, 10:18
by PEAK-Support
Please send us a E-mail to support[at]peak-system.com we will send you a sample project that shows how to switch between different scenes in a panel in VBS.
Please also add your PE6 license number to the E-mail (please do not post such infos here in public)

As a simple info up in front see this script:

Code: Select all

' Get Panel Referenze      
 Set panel = Documents("Scene_Object_Sample.ipf").ActiveWindow.Object
 
' Set the current active scene to a variable 
 Set activescene = panel.ActiveScene
 PrintToOutputWindow("Active is " + activescene)

' Is scene 1 active - if not set scene 1 active
 if activescene.Index <> 1 then
  PrintToOutputWindow("Set Scene 1 to active")
  panel.Scenes.Item(1).IsActive = true
 end if
So switching between different Scenes could be done by script (" panel.Scenes.Item(X).IsActive = true") or in the Panel Property by simply change a Signal Value:
Scene_Switch.png
Scene_Switch.png (12.22 KiB) Viewed 1490 times