GET realtime function
-
For values from the past you should continue to use the point-values endpoint. Iirc, the majority of your queries were only for the current, latest value, which the websocket can keep up to date for you.
-
@phildunlap Ok, so I get it wrong... The function that I showed here was the function for my points for my graphic because that was the most time consuming, the function for the points only wasn't so time consuming and I thought that I can use WebSockets to reduce the time for the function that get my points for the graphics...
-
So I tried to modify the function that get my point values like below and I get some errors.
param.points* get my xid's.
Maybe I've done something wrong there.
-
You can subscribe to the points in the loop, but you only need one websocket to service all the points you would subscribe to.
-
@phildunlap I've made the changes like in the picture from below, but when I try to print into console it give me undefined.
-
Nothing is returned from the subscribe function, so the command you have stopped on wouldn't have anything to print. Because the JavaScript in a browser executes in a single threaded way, the onmessage function couldn't log anything if execution is paused.