Teilen Sie Ihre Erfahrunge und Wünsche mit uns und anderen Usern!

0
Answered

Problems with SignalChanged behaviour of PLCOutput class

Tim Peperkamp 5 years ago in realvirtual.io Starter and Professional updated 5 years ago 19

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?

Answer
Support 5 years ago

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

0
Answered

Bidirectional communication with "Starter"- version or other version possible?

Leon 5 years ago in realvirtual.io Starter and Professional updated by Support 5 years ago 4

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

Answer
Support 5 years ago

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