With WinCC Unified V19 we got the feature to read history values of logged tags with GraphQL đ I have now added this functionality to the GraphQL for Unity Pro Asset đ¤
đĨ With that done it is now also very easy to read the history of logged tags in Unity3D. See the video, there we read and visualize the history values of a tag when the application starts. And then the 3D chart gets updated with real-time values coming from a GraphQL tag subscription.
âšī¸ The GraphQL for Unity Pro Asset has a WinCC Unified interface on top of GraphQL to make the access to WinCC Unified data in Unity even more easier, you do not need to implement the GraphQL queries by your own.
đ You can try the demo in the browser! This is possible because the asset als supports WebGL builds and because GraphQL is transported over HTTP&Websockets. Here it is. But it might happen that this link will not work anymore when you read this post.
Note: Use the PWA WebGL Template so that the application adjusts to the size of your browser window. Or adjust the settings in the generated index.html page:
<canvas id="unity-canvas" width=auto height=auto tabindex="-1" style="width: 100%; height: 100%; background: #231F20"></canvas>
đĄ Get a copy of WinCC Unified, connect your machines to it and build your Unity3D application with the data from WinCC Unified!
Example code how to read the last 100 values of a tag.
Connection.LoggedTagValues("PV-Vogler-PC::HMI_Tag_1:LoggingTag_1",
endTime: DateTime.Now,
maxNumberOfValues: 100
).ContinueWith((task) => {
Debug.Log(task.Result.Count);
}