Scripts run in the GW for Perspective, but expressions don’t, right? I don’t think i’ve ever bothered to clarify that before…
Nope, gateway as well.
Well then… lucky it’s only my first day using Ignition!
Is there any public documentation that shows this level of detail, for both Vision and/or Perspective?
The only user-provided stuff that can run in the frontend in Perspective are (most) actions.
Hmm. I’m not sure if there’s anything that breaks it down specifically regarding where things run, but it’s actually pretty simple:
In Perspective, EVERYTHING RUNS ON THE GATEWAY. That’s it. What you see in the browser is basically just the view of the current session state being rendered by the browser. The session is synced between browser and gateway. All the logic runs on the gateway and the changes to the session are synced up to the browser, and your input events from the browser are relayed down to the session to react to.
edit: I don’t even know what actions Paul is talking about, but that’s probably my lack of Perspective knowledge. Maybe that in code running on the gateway you can trigger certain things to happen in the browser?
So what’s your elevator speech for Vision then?
Use it if you still need local file system / serial / other access?
Certainly don’t use it if you have any kind of high DPI screen
There’s other things too… Perspective hasn’t reached 1:1 Vision feature parity, but it’s steadily on its way.
We’ve wandered beyond where you should be listening to my advice. I don’t have to use either of these to deploy real world applications. Listen to the other guys here who actually do.
Specifically, by actions, I’m referring to these:
~Most of these are able to execute locally before any roundtrip to the gateway.
Ok … but if an Event has a script attached to it, doesn’t that imply that there is a trip to the GW in its future?
(and isn’t the state of local properties maintained in GW?)
I said most
You asked for hairs to be split, so hairs are being split.
It is still true that all expressions and all scripts in Perspective are actually being executed on the gateway.
I can’t of any practical situations that wouldn’t require a trip to the GW.
BTW are calls to/from the GW asynchronous? (this is my lack of react knowledge here)
Yes, Perspective’s relationship to the gateway is conducted asynchronously over a persistent websocket.
Quick question regarding this. I ran into this a few days ago here:
Where the manual says, in this case that
system.db.runPrepQuery will use the same function signature as you would use in a Vision Client scope, when in Perspective Session Scope. Yet there is no way that I am aware of to set a default DB for a perspective session, and since “all” scripts run in the Gateway I would expect that Gateway Scope is always required.
Is this a difference with Perspective Workstation (I’ve never personally used it) and that is what Perspective Session scope means, or is the manual just a tad misleading?
Perspective is running inside the context of a particular project (by definition), so on the backend, we pass the project’s default database in to the running script’s context automatically. The individual scripting function implementations “know” to look for this context and extract it, so both things are true:
- All Perspective scripts run on the gateway
- Perspective scripts can assume the default database.
See this thread if you’re interested in how that mechanism actually works.
@Kevin.Herron @PGriffith just going back to what runs in the gateway. What about Perspective binding transforms, are “Format” transforms run on the gateway? (just trying to see if there are things I can use to reduce load on the gateway)
Yes - since the rest of the binding inevitably has to run on the gateway anyways, even if we could run some of the simpler transforms client-side, it wouldn’t actually gain much. They’re also running on the backend.
Along the lines of the original question… If I decided on using Perspective as my HMI for an industrial machine what should I use as the front end application?
I guess I would trust the Perspective workstation but I dont like how you cant get a true full screen and remove that white app bar on top. Chrome can go full screen but I trust Chrome to run 24/7? Appreciate any thoughts and or experience!
I think what you are looking for is Perspective Workstation Kiosk mode but I have no experience in this product