Teilen Sie Ihre Erfahrunge und Wünsche mit uns und anderen Usern!
![](https://cdn.userecho.com/characters/84.png?1)
Problems with SignalChanged behaviour of PLCOutput class
Dear game4utomation team,
Recently we bought the Game4Automation Pro Asset in Unity, and so far we really like it.
We set up a simple project in Simit and managed to get the interface working with the shared memory solution.
For this we used the Update() method off Unity, now we would like to use a event based system to reduce the load on the system. In the PLCOutput class the event SignalChanged is available and we tried to implement this.
So in this example we would like to toggle a bool to change the color on a traffic light.
public class Verkeerslicht3 : NetworkBehaviour
{
public Material yellowMaterial;
public PLCOutputBool yellowEnable;
public MeshRenderer yellowMeshRenderer;
void Start()
{
yellowEnable.SignalChanged += OnYellowEnableStateChange;
}
private void OnYellowEnableStateChange(Signal obj)
{
RpcSetGeel(obj);
}
[ClientRpc]
private void RpcSetGeel(bool state)
{
yellowMeshRenderer.material = state ? yellowMaterial : disabledMaterial;
}
But if we toggle the Bool in Simit the OnYellowEnableStateChange is not called.
Can you help with this?
![](/s/cache/9c/03/9c0351d08c5d88f9c079df7cae6a843e.png)
Hi Tim,
there was a problem with the automatic settings of the defines.
Please check if the PLCOutput Script was added to your variable automatically:
If not please set in the defines manually "GAME4AUTOMATION" and reimport all OPCSignals.
Now it should work
![](/s/cache/9c/03/9c0351d08c5d88f9c079df7cae6a843e.png)
No currently I think not. I would propose to use OPC UA. Is there a public API for FactoryTalk Communication. If yes it could be easily integrated with some programming.
Best regards
Thomas
![](https://cdn.userecho.com/characters/65.png?1)
CADLink and Solid Edge
We are having issues with models generated from Solid Edge. Assembly positions and part colours don't always seem to be respected.
I note that the documentation mentions similar issues with NX and that a fix is due soon. Will something similar for Solid Edge available?
Andy
![](/s/cache/9c/03/9c0351d08c5d88f9c079df7cae6a843e.png)
Hi Andy, oh sorry. Yes you can remove this line.
Give us a good feedback in the Unity Store if you are happy with our solution. Thanks.
Thomas
![](https://cdn.userecho.com/characters/76.png?1)
Bidirectional communication with "Starter"- version or other version possible?
Hello,
I would like to create a digital twin of an already existing system, which is using a S7-1500 controller.
Is the basic version capable to create a bidirectional communication between the digital twin and the real system?
Does a change in state of the physical object directly lead to a change in state of the digital twin and the other way around?
Cheers,
Leon
![](/s/cache/9c/03/9c0351d08c5d88f9c079df7cae6a843e.png)
Hi Leon,
1) yes this is the case. In Professional there is the 3MF interface included (since yesterday). You can directly import from all CAD-Systems which are able to export 3MF. Professional will get aditional features fur the 3MF interface like Updating, Mesh reduction .....
2) Yes you only need to buy and use PixYZ if you want to import the mentioned formats. Which CAD System are you using. For Solidworks we will have soon addtional export functions (as Solidworks makro) which will be more than what PIXYZ is able to do (like export kinematics).
3) Yes, 3MF with Game4Automation Professional - the rest is standard unity.
4) Yes it is. The 3MF interface is just a script attached to a GameObject. You can use it also in Runtime (during simulation).
Best regards
Thomas
![](https://cdn.userecho.com/characters/74.png?1)
Subscription fields are mostly null
Dear game4automation team,
so far the OPCUA4Unity asset works very smooth. Great work!
In my project I tried to update my data like you show in the DemoTextWithDelegate example. But the subscription object returned in OPCUA_Interface :
sub = connection.SubscribeNodeDataChange(nodeid,del);
is pretty much empty:
I used UAExpert to test the subscription with the same node id, which worked. As far as I can tell I do not get any warnings or errors. Here is my code how I subscribe:
private OPCUANodeSubscription _safetyLevelSubscription; //subscription is a class member [...] _safetyLevelSubscription = _interface.Subscribe(node.NodeId, SafetyLevelNodeChanged); //this is the call [...] public void SafetyLevelNodeChanged(OPCUANodeSubscription sub, object obj) //this is the delegate signature
Now, I noticed that the OPCUAInterface gameobject holds pretty much all the nodes of the top node as childs and keeps them up to date. At least in the editor. Wouldn't it be best practice then to always access those child OPCUA_Nodes instead of adding an additional subscription?
Thanks for your thoughts!
JG
EDIT:
Maybe I should add, that the delegate is not called when the value on the OPC UA server changes. I assume it is due to the null ptr in the subscription. Also, I use a codesys opc ua stack.
![](/s/cache/9c/03/9c0351d08c5d88f9c079df7cae6a843e.png)
Thanks for the positive feedback. Please give us a review in the Asset Store if you like it.
You have both options. Subscribe in code or use the imported child nodes for accessing the values.
Usually the subscription gets null if the server is not reachable. Some servers are also limiting the number of subscriptions - maybe this is the case on your server. Do you see anything in the console log?
![](https://cdn.userecho.com/characters/74.png?1)
Exception in OPCUAConnection.Connect on Android
Hi all!
I am using the OPCUA4Unity asset in my project. When I run it on android devices an exception is thrown in game4automation.OPCUAConnection.Connect(). Here is the full output:
The type initializer for 'Opc.UaFx.Client.OpcClient' threw an exception. at game4automation.OPCUAConnection.Connect () [0x00000] in <00000000000000000000000000000000>:0 at game4automation.OPCUA_Interface.Connect () [0x00000] in <00000000000000000000000000000000>:0 UnityEngine.Logger:Log(LogType, Object) game4automation.OPCUA_Interface:Connect()
I am able to run it in Unity Editor aswell as Win Standalone App. I am also able to connect with another OPC UA client from the same android device to the server.Is Android not supported?
Please let me know if you need additional infos!
JG
![](/s/cache/9c/03/9c0351d08c5d88f9c079df7cae6a843e.png)
Hi, we tested it also with android and it shoudl workl.
Are you compiling with ILCPP and are you having .Net20 compatibility turned on. Are you allowing Internet Access for your Android Device?
Thomas
![](/s/cache/9c/03/9c0351d08c5d88f9c079df7cae6a843e.png)
It is licensed on a purchase per set basis. Updates are included through the Unity Asset Store. We never tested it, but I am pretty shure that WebGL will not work. We are no planning extra effort to support WebGL.
![](https://cdn.userecho.com/characters/89.png?1)
help for reading values from opcua server
I bought the OPCUA4UNITY asset recently, then I set up a simple opcua server with python-opcua (code is here). It’s able to connect the server, import the nodes, but there is no data showing in the inspector when I click the “Update Node” button.
I tried to debug in VS. It seems the "Value" property of opcNode is missing.
Then I used OPC watch, the value can be read.
I also tried other opcua servers, like UA-.NETStandard has the same problem and another problem is it cannot import all the nodes in unity.
For “OPC UA C++ Demo Server V1.7.0” server, value can be read correctly, but it cannot import all the nodes in unity.
I have struggled several days, please help me, thanks a lot!
![](/s/cache/9c/03/9c0351d08c5d88f9c079df7cae6a843e.png)
I have found the problem. It will be included in the next release. I will send you a patch via mail!
![](https://cdn.userecho.com/characters/97.png?1)
Display NodeID value as text in Unity
Hello. I have since bought your OPCUA4Unity, and followed your tutorials in the YouTube video. I wish to refer to your Text with Delegate text. I tried doing the same thing but i am unable to output anything to my game. I am able to type in the "Text From OPCUA Node" and it comes out in the game. May I know how did you connect the script to the string that you wanted for display?
In my case, I wish to reference it to the "Value". I have tested running your OPCUA_Node and Interface and they work well (sweet!) but as we know it does not show up in the game scene. So I hope you may advise me on what are the steps needed. Thank you!
![](/s/cache/9c/03/9c0351d08c5d88f9c079df7cae6a843e.png)
Hi,
a few questions from my side to understand the problem.
Did you checked the NodeID you want to display the text from with an OPC UA Browser (you can find several in the internet).
Is the text displaying if you use an OPCUA_Node Script - the text should be sown under value?
If both things can be answered yes the communication is correct and it is just a programming issue on your side.
What I am wondering about is, that your NodeID is called "Counter1". It seems more that it is not of type string. Maype you missed to convert the integer to a string?
Best regards
Thomas
Customer support service by UserEcho