Access a Vision Window from Perspective?

Hi, is there any way to access a Vision Window or client scripts from a Perspective View on the same project?

Nope, they’re completely independent. However you can run a perspective session inside of Vision using the Web browser component. You still have no methods for them to talk to each other though

Okay, I figured so. I tried the Web Browser, but the Starting URL doesn’t seem to load. It just shows a white, blank screen. Any thoughts on why that might be? Thanks for the response by the way!

What url are you using?

I was using a Perspective URL, but that wasn’t working so I tried just https://www.google.com/ and unfortunately couldn’t get that to work either. I am using this on a RPi 4, so it’s possible that could be causing some issues?

you can let them talk with messages, if you provide some vision props(user, client id) through the url with “:params”, its not very practical/save though…

https://docs.inductiveautomation.com/display/DOC81/system.util.sendMessage

@Brit for the url you should use the correct ip and not ‘localhost’ for testing

I’ll check out the system.util.sendMessage, thanks! As for the correct ip and not ‘localhost’, what do you mean by that?

configure the starting url like this:
ofc with the right ip, port , project ect
http://172.16.13.4:8020/data/perspective/client/Project/view

to add in the params to easily send messages you will have to use a binding and a script in an expression

'http://172.16.13.4:8020/data/perspective/client/Project/view/'+ runScript('projectScriptLocation.getConfigs()')

this projectScriptLocation.getConfigs should return “clientId” (system.util.getClientId()) and maybe window or page or something (extra params seperated by /)
then you will have to change the url in perspective to pass in these params
https://docs.inductiveautomation.com/display/DOC81/Pages+in+Perspective
https://inductiveuniversity.com/videos/passing-parameters-to-pages/8.0/8.1
So you can use them in system.util.sendMessage() becuase if you dont add in (atleast) a client id it will send to all clients, (which is probably not what you want)

Doing it like this i was able to send a message on a perspective button click to open a popup in vision, idk if this is the best way xd

Would you mind sharing a little bit of how you configured your scripts to open a popup? No worries if not! Most of this is fairly new to me and while the document pages are helpful, I’m still struggling with how to go about this. The binding and script in an expression makes perfect sense and I understand how to get the Client ID, but I get lost on the sendMessage part

Lets back up a step, what exactly is it you are trying to accomplish? Someone does something in perspective (what action?) and that’ is supposed to cause what sort of change in the vision window?

Basically I want a vision popup window to be open at all times on a perspective project. There is a button in Perspective that someone presses. This button writes a “1” to a boolean tag which is tied to a toggle button in the Vision window. When the toggle button is true, it will run a script that writes a 1 to a GPIO pin on a RPi. When it is false, it will run that same script to write a 0 to the pin. I have a project in Vision that works great with this, but we’re wanting to use Perspective for this project and need to be able to write to the GPIO pins on the pi. Which can’t be done with just Perspective from what I’ve seen.

If you know anything about Java, you could give this a try:

Hello!
I want to do the same thing, be able to launch the Vision Client Launcher and run an application from there, all that by pressing a button in Perspective. Have you be able to do that or somebody from here?

You cannot. Browsers cannot open arbitrary executables reliably. At most, you could register a protocol handler (individually, on every machine you control) and 'deep-link' from Perspective into Vision.

A Vision Client can run an external browser to open a Perspective, and in most environments, can use the Web Browser module to run Perspective inside Vision. Vision can also directly access files in the local file system, access local devices, access unique local device identifiers, make any kind of network connection to any reachable target system, and run other arbitrary executables.

Perspective can do none of this, and as a browser UI, it should never be expected. (Though there is hope for some of it, in the future, in Perspective Workstation.)

How did you decide to use Perspective over Vision, with requirements like this?