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

0
Answered

ABB Word mapping

Bo Adam 2 years ago updated 2 years ago 2

Hello,

A small time ago we had a conversation about adding bytes into the device mapping of ABB, now i needs words (16bits). 

We are trying to get the Word option to work as well, we have changed the code to the following:

Only thing we are not sure about is the line with accessor.Write(posheader, (byte) 10).

Is this correct or should we change it?

Sorry for the formatting, couldn't find the code button.

if (signal.OriginDataType.ToUpper() == "BYTE")

{

if (signal.GetType() == typeof(PLCInputInt) || signal.GetType() == typeof(PLCOutputInt))

{

if (lastbit)

posmemory = posmemory + 1;

bit = 0;

shm.bit = 0;

lastbit = false;

signal.Comment = $"M{posmemory}";

accessor.Write(posheader, (byte) 8);

shm.type = SIGNALTYPE.BYTE;

posmemory = posmemory + 1;

}

}

else if (signal.OriginDataType.ToUpper() == "WORD")

{

if (signal.GetType() == typeof(PLCInputInt) || signal.GetType() == typeof(PLCOutputInt))

{

if (lastbit)

posmemory = posmemory + 1;

bit = 0;

shm.bit = 0;

lastbit = false;

signal.Comment = $"M{posmemory}";

accessor.Write(posheader, (byte) 10);

shm.type = SIGNALTYPE.WORD;

posmemory = posmemory + 2;

}

}

else

{ if (signal.GetType() == typeof(PLCInputInt) || signal.GetType() == typeof(PLCOutputInt))

{

if (lastbit)

posmemory = posmemory + 1;

bit = 0;

shm.bit = 0;

lastbit = false;

signal.Comment = $"M{posmemory}";

accessor.Write(posheader, (byte) 10);

shm.type = SIGNALTYPE.INT;

posmemory = posmemory + 4;

}

}

Sorry if you saw my answer on the last message, but i thought it would be good to make a new topic! 

Answer
Support 2 years ago

I will add this in one of the next release. For Words you need to write a 9 as Type ID.

0
Fixed

OPCUA problems - doesnt Import any In-/Outputs

AndreS2 2 years ago in OPCUA4Unity updated by Support 1 month ago 8

Hey there,

first of all - the example Project provided with the Unified Automation OPCUA Server is working fine. 

Im using the latest Release of G4A which is 2020.16-beta-1123 and Unity Version 2020.3.19

The PLC is created in TIA Portal v17 which sends it to PLCSimAdvanced v4.0.

(Yes(!) i know i could use the PLCSimAdvanced Interface, but for now i have to stick to the OPCUA Interface)

This is what OPC Watch looks like when connected to my PLC which has an OPCUA Server:

Image 565



You can see the Inputs and Outputs. 

When trying to import these Nodes into Unity with the G4A Framework im getting

Image 566


In the "PLCOutputBool.cs", when changing from

Image 567


to

Image 568

The import finishes with no more errors.

Image 569

But now looking into Unitys Hierarchy, no In-/Outputs where generated.(No Dropdown available at the Input & Ouput Gameobject)

Image 570


Even then whole "PLC_1" Node is missing in Unity.

Image 571

Answer
Support 1 month ago

It is solved @Robin: thanks a lot for your help.

It will be included in release 2022.12.

For everybody having same issue before - please integrate this into OPCUA_Interface.cs:

Image 1081

0
Answered

Problems with Transformation of Chains

Nicola Lienhöft 2 years ago in realvirtual.io Starter and Professional updated by Support 2 years ago 5

Hello,

I created a chain with chain elements and it is working fine. Now I tried to make a copy and turn it around 90°Z. Some of the chain elements are now moving in a wrong direction, but not reproduceable. Even if I create a new spline and replace all scripts, it is not working corrrectly. Shifting along the axes works, but turning is not possible.
Does someone know a trick?

Answer
Support 2 years ago

Can you send us your example and we will check it.

0
Under review

OPCUA doesnt connnect on unity executable

mcouso 2 years ago in realvirtual.io Starter and Professional updated by Support 2 years ago 7

Hello,


i have been working on a project that uses OPCUA to get some data from a server and when I execut it on the editor of Unity everything works fine but when I try to make the executable for windows platforms, in the executable doesn't connect to the server. Do I need to use any special settings to do the build on Windows?


Please if someone could help me with this I would really apreciate it. Thank you

Answer
Support 2 years ago

Hard to say. Are you able to get the Log data when you start it as a compiled version. There should be no special settings you need to consider. You could also use this Asset to get  the Console Log in the Unity Player Window:

https://assetstore.unity.com/packages/tools/gui/in-game-debug-console-68068

0
Answered

OPCUA with 2020.15 Doesn't Import Arrays

Neil 2 years ago in OPCUA4Unity updated by Support 2 years ago 2

Hello. I have setup an OPCUA Client without issue on several versions of Unity (2019.4.18f1, 2020.3.25f1) with game4automation 2020.13. 


I now seem to have an issue Importing array nodes after an update to game4automation 2020.15. 

The nodes import, but the arrays are only a single gameobject without a list of value, instead of a hierarchy array of game objects that it does with 2020.13. 

Is this a known issue, or does it work differently with arrays now? Possibly because of the OPCUA change in 2020.14?

Answer
Support 2 years ago

Yes, arrays are not supported currently. We will add this in one of the next releases. If you need it at this moment you should go back to the old version.

0
Not a bug

Build

Filip D 2 years ago updated 2 years ago 2

UnityEnginy 2020.2.6f1

Building the project end with error. "ArgumentException: The Assembly ZeroFormatter is referenced by PREspective ('Assets/Plugins/PREspective/PREspective.dll'). But the dll is not allowed to be included or could not be found.

UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1[T] alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2[TKey,TValue] cache, UnityEditor.BuildTarget target) (at <8c48e4bc2ff34638b69095cbb65e2e27>:0)

UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1[T] alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2[TKey,TValue] cache, UnityEditor.BuildTarget target) (at <8c48e4bc2ff34638b69095cbb65e2e27>:0)

UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch, UnityEditor.BuildTarget target) (at <8c48e4bc2ff34638b69095cbb65e2e27>:0)

UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)"

I Change Global functions "public static List GetGroups()" and "GetAllWithGroup(string group)" But, In corpasion it was witout differences.

I tried to build with differed API settings .NET 2.0 ant .NET 4.x

Probably there is probably problem with PREspective.dll, that doesn't properly connected to Unity, but I am not sure.

Do anybody has an idea ? thank you all.

Answer
Support 2 years ago

You have PREspective in your project (Prespective is another Digital Twin product). It is not a part of Game4Automation which is causing your problems. Please delete everything of Prespective or start with an empty project.

0
Started

OPCUA4Unity can't connect to opcua server with username and password

penjami rantakangas 2 years ago in OPCUA4Unity updated by Support 2 years ago 5

Anonymous connection works fine, but when using a username and password, the console doesn't show any errors in creating the connection, but I am not able to read or write to nodes. Also the server doesn't acknowledge the connection. Even when using application certificates the connection doesn't work properly. Using OPC Watch or UaExpert I can easily connect to the server with the username and password.

Answer
Support 2 years ago

Unity is connecting successfully but afterwards no nodes are available when the connection is done with a username and password. Are there any special security settings on the nodes itself in the server which could prevent the reading when loggin in with a user?

0
Fixed

Problem after import game4automation assert

Tobias Berle 2 years ago in realvirtual.io Starter and Professional updated 2 years ago 7

Hello,

I have a problem with the game4automation assets. My first project works very well but now I started a new one and after I installed the game4automation again I could add the game4automation asset again to this new project. But I have no tab in the menu bar from game4automation and in the console following errors:

Assets\game4automation\Professional\LogicStep_CinemachineCamera.cs(5,7): error CS0246: The type or namespace name 'Cinemachine' could not be found (are you missing a using directive or an assembly reference?)

Assets\game4automation\private\Game4AutomationController.cs(17,7): error CS0246: The type or namespace name 'Cinemachine' could not be found (are you missing a using directive or an assembly reference?)

Assets\game4automation\Professional\LogicStep_CinemachineCamera.cs(21,42): error CS0246: The type or namespace name 'CinemachineBlendDefinition' could not be found (are you missing a using directive or an assembly reference?)


1. Question:
Do I must install the game4automation asset every time when I start a new project?

After I saved it and opened the cell again I got following error:

Image 555

If I press "Enter Safe Mode" it shows me the same error.

After I close the safe mode it loads some parts from game4automation. In the tab I have the new one with game4automation but only one entry and in the project I lose my game4automation asset.

Image 556

What can I do to bring game4automation to run?

Or what do I wrong?

Best Tobias

Answer
Support 2 years ago

I see, you seem to use latest beta - which has a bug and is not working without Cinemachine - please use the latest official release (2020.15).

0
Answered

Problem with collisions

Bo Adam 2 years ago in realvirtual.io Starter and Professional updated by Support 2 years ago 7

Hello,

It's me again, I have a problem with a MU, I "spawn" This mu onto a transport surface in g4atransport. It stays in position and can be gripped by the gripper. But when the gripper places it into a warehouse (With a mesh collider) It just falls through the warehouse and floor.
Below are the warehouse settings and the carrier (MU) settings

Image 551

Image 552

Image 553

Answer
Support 2 years ago

It is hard to say what your problem is - everything should work out the box. Can you send your project with a description where the problem occurs and I will directly check in your projet.

0
Fixed

Unity Editor NullReferenceException when clicking on GameObjects

AndreS 2 years ago in realvirtual.io Starter and Professional updated by Support 2 years ago 3

Hello,

i am experiencing NullReferenceExceptions and out of Bounds - Debug.LogErrors in the Unity Editor with the Game4Automation Professional Package installed.

Steps to recreate the behaviour are 

- take a empty project

- import the G4A Professional 2020.15 package

- click on the "PlasticBox" Gameobject

You will be flooded with following errors:

Image 548


Retrieving array element that was out of bounds
UnityEditor.SerializedProperty:GetArrayElementAtIndex (int)
NaughtyAttributes.Editor.ReorderableListPropertyDrawer/<>c__DisplayClass6_0:b__2 (int) (at Assets/game4automation/private/Tools/NaughtyAttributes/Editor/PropertyDrawers_SpecialCase/ReorderableListPropertyDrawer.cs:78)
UnityEditorInternal.ReorderableList:CacheIfNeeded ()
UnityEditorInternal.ReorderableList:GetListElementHeight ()
UnityEditorInternal.ReorderableList:DoLayoutList ()
NaughtyAttributes.Editor.ReorderableListPropertyDrawer:OnGUI_Internal (UnityEngine.Rect,UnityEditor.SerializedProperty,UnityEngine.GUIContent) (at Assets/game4automation/private/Tools/NaughtyAttributes/Editor/PropertyDrawers_SpecialCase/ReorderableListPropertyDrawer.cs:89)
NaughtyAttributes.Editor.SpecialCasePropertyDrawerBase:OnGUI (UnityEngine.Rect,UnityEditor.SerializedProperty) (at Assets/game4automation/private/Tools/NaughtyAttributes/Editor/PropertyDrawers_SpecialCase/SpecialCasePropertyDrawerBase.cs:32)
NaughtyAttributes.Editor.NaughtyEditorGUI:PropertyField_Implementation (UnityEngine.Rect,UnityEditor.SerializedProperty,bool,NaughtyAttributes.Editor.NaughtyEditorGUI/PropertyFieldFunction) (at Assets/game4automation/private/Tools/NaughtyAttributes/Editor/Utility/NaughtyEditorGUI.cs:47)
NaughtyAttributes.Editor.NaughtyEditorGUI:PropertyField_Layout (UnityEditor.SerializedProperty,bool) (at Assets/game4automation/private/Tools/NaughtyAttributes/Editor/Utility/NaughtyEditorGUI.cs:29)
NaughtyAttributes.Editor.NaughtyInspector:DrawSerializedProperties () (at Assets/game4automation/private/Tools/NaughtyAttributes/Editor/NaughtyInspector.cs:87)
NaughtyAttributes.Editor.NaughtyInspector:OnInspectorGUI () (at Assets/game4automation/private/Tools/NaughtyAttributes/Editor/NaughtyInspector.cs:47)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)


NullReferenceException: Object reference not set to an instance of an object
UnityEditor.PropertyHandler.GetHeight (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren) (at <3371b3e2e5754acd87e600e068350da5>:0)
UnityEditor.EditorGUI.GetPropertyHeightInternal (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren) (at <3371b3e2e5754acd87e600e068350da5>:0)
UnityEditor.EditorGUI.GetPropertyHeight (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren) (at <3371b3e2e5754acd87e600e068350da5>:0)
UnityEditor.EditorGUI.GetPropertyHeight (UnityEditor.SerializedProperty property) (at <3371b3e2e5754acd87e600e068350da5>:0)
NaughtyAttributes.Editor.ReorderableListPropertyDrawer+<>c__DisplayClass6_0.b__2 (System.Int32 index) (at Assets/game4automation/private/Tools/NaughtyAttributes/Editor/PropertyDrawers_SpecialCase/ReorderableListPropertyDrawer.cs:78)
UnityEditorInternal.ReorderableList.CacheIfNeeded () (at <3371b3e2e5754acd87e600e068350da5>:0)
UnityEditorInternal.ReorderableList.GetListElementHeight () (at <3371b3e2e5754acd87e600e068350da5>:0)
UnityEditorInternal.ReorderableList.DoLayoutList () (at <3371b3e2e5754acd87e600e068350da5>:0)
NaughtyAttributes.Editor.ReorderableListPropertyDrawer.OnGUI_Internal (UnityEngine.Rect rect, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at Assets/game4automation/private/Tools/NaughtyAttributes/Editor/PropertyDrawers_SpecialCase/ReorderableListPropertyDrawer.cs:89)
NaughtyAttributes.Editor.SpecialCasePropertyDrawerBase.OnGUI (UnityEngine.Rect rect, UnityEditor.SerializedProperty property) (at Assets/game4automation/private/Tools/NaughtyAttributes/Editor/PropertyDrawers_SpecialCase/SpecialCasePropertyDrawerBase.cs:32)
NaughtyAttributes.Editor.NaughtyEditorGUI.PropertyField_Implementation (UnityEngine.Rect rect, UnityEditor.SerializedProperty property, System.Boolean includeChildren, NaughtyAttributes.Editor.NaughtyEditorGUI+PropertyFieldFunction propertyFieldFunction) (at Assets/game4automation/private/Tools/NaughtyAttributes/Editor/Utility/NaughtyEditorGUI.cs:47)
NaughtyAttributes.Editor.NaughtyEditorGUI.PropertyField_Layout (UnityEditor.SerializedProperty property, System.Boolean includeChildren) (at Assets/game4automation/private/Tools/NaughtyAttributes/Editor/Utility/NaughtyEditorGUI.cs:29)
NaughtyAttributes.Editor.NaughtyInspector.DrawSerializedProperties () (at Assets/game4automation/private/Tools/NaughtyAttributes/Editor/NaughtyInspector.cs:87)
NaughtyAttributes.Editor.NaughtyInspector.OnInspectorGUI () (at Assets/game4automation/private/Tools/NaughtyAttributes/Editor/NaughtyInspector.cs:47)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.b__0 () (at :0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)




My Setup:


- Unity 2020.3.33f1 LTS ( this also occures at the newest released Unity 2021.3 LTS Version )

- an empty Project

What did i try?

- Scripting Define Symbols are set

Image 549

- the "game4automation -> apply standard settings" doesnt change anything

- deleting the current Version of NaughtyAttributes in the folder "Assets/game4automation/private/Tools" and importing the current release of NaughtyAttributes of github to the project

Everything is working as expected in old LTS Versions, like Unity 2020.3.19.

Answer
Support 2 years ago

Hi, thanks for the feedback. So it seems that it was indeed a Unity bug.