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

0
Answered

Chain rotation is bugged

SMF - 3PTechnology 3 years ago updated 3 years ago 8

I implemented your chain script as descript in https://game4automation.com/documentation/current/chain.html and as you have done in the scene DemoChain. The rotation of my chain elements are not correct and jumps at some points along the chain. All my anchers and all their tangent have rotation (0,0,0). I don't understand what I have done wrong. 

Image 316

Answer
Support 3 years ago

I don't know exactly how you would like to align the objects. But playing around with the Align Object and the rotation of the geometry in your Chain Element should do the job. Please check the video:

QbVAbcVI4D.mp4

0
Answered

Change the model from CADLink to a prefab (MU)

zhou zhou 3 years ago in CADLink updated 3 years ago 2

Hi,


 I use CADLink importing a model into scene and want to make a MU.  How to change it to a prefab quickly ? Thanks so much.

Image 300



0
Answered

RobotDK jitter

Дмитрий Мурашов 3 years ago in General Questions updated by Support 3 years ago 2
Hello, i add RobotDK API to game4automation
Youtube video
if check on video Comm cycle in very long, without moving in RobotDK it's 3-5ms, during movment is is 1500ms, is any possibility to make it smaller and more stable? or it is problem of RobotDK ?


Here is code od RobotDK script.

using System;
using UnityEngine;
using Sharp7;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;

namespace game4automation
{
public class RoboInterfaceDK : InterfaceThreadedBaseClass
{

[ReadOnly] public string notifybar;
[ReadOnly] public string txtJoints;

public string Adress = "localhost"; //!< The ip adress of the PLC

public Drive Axis1;
public Drive Axis2;
public Drive Axis3;
public Drive Axis4;
public Drive Axis5;
public Drive Axis6;



private RoboDK RDK = null;
private bool starting = true;

// Keep the ROBOT item as a global variable
private RoboDK.Item ROBOT = null;


public bool Check_RDK()
{
// check if the RDK object has been initialised:
if (RDK == null)
{
notifybar = "RoboDK has not been started";
return false;
}

// Check if the RDK API is connected
if (!RDK.Connected())
{
notifybar = "Connecting to RoboDK OK!";
// Attempt to connect to the RDK API

if (!RDK.Connect())
{

notifybar = "Problems using the RoboDK API. The RoboDK API is not available...";
return false;
}


}
return true;
}

public string Values_2_String(double[] dvalues)
{
if (dvalues == null || dvalues.Length < 1)
{
return "Invalid values";
}
// Not supported on .NET Framework 2.0:
//string strvalues = String.Join(" , ", dvalues.Select(p => p.ToString("0.0")).ToArray());
string strvalues = dvalues[0].ToString();
for (int i = 1; i < dvalues.Length; i++)
{
strvalues += " , " + dvalues[i].ToString();
}

return strvalues;
//return "";
}
public void SelectRobot()
{
notifybar = "Selecting robot...";
if (!Check_RDK())
{
ROBOT = null;
return;
}
ROBOT = RDK.ItemUserPick("Select a robot", RoboDK.ITEM_TYPE_ROBOT); // select robot among available robots
//ROBOT = RL.getItem("ABB IRB120", ITEM_TYPE_ROBOT); // select by name
//ITEM = RL.ItemUserPick("Select an item"); // Select any item in the station
if (ROBOT.Valid())
{
ROBOT.NewLink(); // This will create a new communication link (another instance of the RoboDK API), this is useful if we are moving 2 robots at the same time.
notifybar = "Using robot: " + ROBOT.Name();
}
else
{
notifybar = "Robot not available. Load a file first";
}
}

public bool Check_ROBOT(bool ignore_busy_status = false)
{
if (!Check_RDK())
{
return false;
}
if (ROBOT == null || !ROBOT.Valid())
{
notifybar = "A robot has not been selected. Load a station or a robot file first.";
SelectRobot();
return false;
}
try
{
notifybar = "Using robot: " + ROBOT.Name();
}
catch (RoboDK.RDKException rdkex)
{
notifybar = "The robot has been deleted: " + rdkex.Message;
return false;
}

// Safe check: If we are doing non blocking movements, we can check if the robot is doing other movements with the Busy command
/*if (!MOVE_BLOCKING && (!ignore_busy_status && ROBOT.Busy()))
{
notifybar = "The robot is busy!! Try later...";
return false;
}*/
return true;
}

//! Updates all signals in the parallel communication thread
protected override void CommunicationThreadUpdate()
{
if (!Check_ROBOT(true)) { return; }

double[] joints = ROBOT.Joints();
//Mat pose = ROBOT.Pose();

// update the joints
Axis1.TargetStartMove = !Axis1.TargetStartMove;
Axis1.TargetPosition = (float)joints[0];

Axis2.TargetStartMove = !Axis2.TargetStartMove;
Axis2.TargetPosition = (float)joints[1] + 90;

Axis3.TargetStartMove = !Axis3.TargetStartMove;
Axis3.TargetPosition = (float)joints[2] - 90;

Axis4.TargetStartMove = !Axis4.TargetStartMove;
Axis4.TargetPosition = (float)joints[3];

Axis5.TargetStartMove = !Axis5.TargetStartMove;
Axis5.TargetPosition = (float)joints[4];

Axis6.TargetStartMove = !Axis6.TargetStartMove;
Axis6.TargetPosition = (float)joints[5];

string strjoints = Values_2_String(joints);
txtJoints = strjoints;

}


public override void OpenInterface()
{

if (RDK == null) { RDK = new RoboDK(); }
base.OpenInterface();
}


public override void CloseInterface()
{
//if (!Check_RDK()) { ;}
// Force to stop and close RoboDK (optional)
// RDK.CloseAllStations(); // close all stations
// RDK.Save("path_to_save.rdk"); // save the project if desired
//RDK.CloseRoboDK();
RDK = null;

base.CloseInterface();
}

private void Update()
{
//Check_RDK();
/*if (Check_RDK()) { starting = false; }

if (!Check_RDK() && !starting)
{
RDK = new RoboDK();

}*/


}
}
}

Answer
Support 3 years ago

Hi, I checked your example on my computer. It moves smoothly on my side´(RoboDK and G4A),

I think your started to implement your own RoboDK Interface because you did not purchased professional version - right?

It could save you some time to use G4A Professional. Please get in contact with me if you need an offer.

0
Completed

S7PLC to PLCSIM Compact

Дмитрий Мурашов 3 years ago in General Questions updated by Stupiddog 2 years ago 3

Here is solution for S7PLC connect to PLCSIM Compact, comment in S7Interface disconection timeout.

SetPDU to 10 (working not stable and max 5 byte in, 5 byte out)

Image 292

Image 294

And using Nettoplcsim-S7o-v-1-2-4-0 program

Some features in configs NetToPlcsim

start.cmd

//

sc stop "S7DOS Help Service"
START /B NetToPLCSim.exe -f=S7Test.ini -s=NO -autostart

TIMEOUT /T 4
sc start "S7DOS Help Service"
TIMEOUT /T 4
"D:\Program Files\Siemens\Automation\S7-PLCSIM V15_1\Bin\Siemens.Simatic.PlcSim.Compact.exe"

S7Test.ini

//

[Station_1]
Name=PLC#001
NetworkIpAddress=192.168.88.50 //External IP of PLCSIM , adress of Ethernet board
PlcsimIpAddress=192.168.0.1   //internal IP of PLCSIM , not change this one
PlcsimRackNumber=0
PlcsimSlotNumber=0
TsapCheckEnabled=False

And now can connect to PLCSIM

Image 295

0
Answered

Automatic aggregation of objects and relations

Christiane 3 years ago updated by Support 3 years ago 2

Hi,

I am wondering whether G4A includes some way to automatically derive a meaningful object hierarchy and derive relations (e.g. spatial relations such as RCC8 relations). When you import models from CAD, there is often quite a "flat" hierarchy, i.e. most objects will be on the same level (e.g. a screw is on the same level as a motor). But this is usually not what you want, it would be better to have a "higher-level" hierarchy computed based on the positions of objects relative to each other. Similar with the relations like adjacent etc. Is there a way to derive this automatically in G4A? In the documentation I could not find anything.

Best regards,

Christiane

0
Answered

data not automatically updated on demo tempate

lcl88 3 years ago in OPCUA4Unity updated by Support 3 years ago 1

Hi I am using DEMOOPCUA on unity 2020.1.13f1. I am working directly on the demo templates. After switching to a different opc ua server, information are not automatically updated, this is unlike in the original demo template where data are automatically updated. Is it something that i am missing?   

0
Under review

S7 interface plc input write error CPU : Function not available

JO SG 3 years ago in realvirtual.io Starter and Professional updated by Support 3 years ago 6

Helo. Im trying to connect s7-1200 with game4automation. I saw the tutorial video and the https://game4automation.com/documentation/current/s7tcpip.html.

I followed all the process but still not working with this signs keep cycling.

Image 278

Image 277

I successfully checked the connection and added sdf file as well.

S7 interface plc input write error CPU : Function not available

I don't know how to solve this problem. Thank you.

Answer
Support 3 years ago

Hi, sorry for my late response. We needed first to support the open issues of our professional customers.

I checked your project but it seems that I don't have all data to be able to reproduce your problem. I would need your full S7 project. And you need to tell me which scene to open and what else to do to get the same problems as you do. Thanks.

0
Answered

OPCUA Data cannot be updated

liubaoyue 3 years ago updated by Support 3 years ago 5

Image 275

Answer
Support 3 years ago

Sorry we can't tell you what is wrong based on this rough information. It could be your Unity Configuration or the OPC Server configuration .....

To be able to check it we would need an example based on an OPCServer we can test with.

Please try to rebuild your problem based on UaCPP C++ Demo server (will send you a download link for this test server in a private message later).

Please upload your project where you can reproduce your problem based on UaCPP Demo server here:  https://game4automation.com/send 

0
Under review

Error opening game4automation project in a different PC

looi 3 years ago in realvirtual.io Starter and Professional updated by Support 3 years ago 5

I've started a project with the game4automation asset. I have a robot connected with the roboDK interface. When I try to open the project with another PC, It appears this error:

ArgumentNullException: Value cannot be null.
Parameter name: String
System.Number.StringToNumber (System.String str, System.Globalization.NumberStyles options, System.Number+NumberBuffer& number, System.Globalization.NumberFormatInfo info, System.Boolean parseDecimal) (at <9577ac7a62ef43179789031239ba8798>:0)
System.Number.ParseInt32 (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) (at <9577ac7a62ef43179789031239ba8798>:0)
System.Int32.Parse (System.String s) (at <9577ac7a62ef43179789031239ba8798>:0)
game4automation.PLCOutputInt.SetValue (System.String value) (at [old PC Path]/PLCOutputInt.cs:58)
game4automation.RoboDKInterface.UpdateSignals () (at [old PC Path]/RoboDK/RoboDKInterface.cs:320)
game4automation.RoboDKInterface.CommunicationThreadUpdate () (at [old PC Path]/RoboDK/RoboDKInterface.cs:537)
game4automation.InterfaceThreadedBaseClass.CommunicationThread () (at [old PC Path]/InterfaceThreadedBaseClass.cs:50)
System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) (at <9577ac7a62ef43179789031239ba8798>:0)
System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <9577ac7a62ef43179789031239ba8798>:0)
System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <9577ac7a62ef43179789031239ba8798>:0)
System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) (at <9577ac7a62ef43179789031239ba8798>:0)
System.Threading.ThreadHelper.ThreadStart () (at <9577ac7a62ef43179789031239ba8798>:0)
UnityEngine.<>c:b__0_0(Object, UnhandledExceptionEventArgs)

It seems like some paths from the old PC are still remembered by the asset. I have changed the RoboDK Application path and the RoboDK file path, but the error stays. Reinstalling the asset just works, but it is uncomfortable to do it every time I switch to another PC.

Answer
Support 3 years ago

If you changed the RoboDK pathes I don't know why it not opens. The code is always just using this path. Is your path somehow uncommon with special characters or empty spaces?

You might need to set some breakpoints in RoboDKInterface.cs and check what is going wrong. If you don't find the issue we should do a Zoom Session and I will check on your computer.

0
Not a bug

Cadlink building problem

zhou zhou 3 years ago in CADLink updated by Support 3 years ago 1

Hi,

 Game4automation  2019.08,Unity 2019.4.12f1  . Some cadlink errors when building .

Image 271


Image 273

 

Answer
Support 3 years ago

First picture shows that your project was still importing something and not ready to build. 

I am able to build this scene based on the current release.

You need to make sure that cadimport is not part of your build because it is an editor only function and uses editor classes.

Usually it is done by excluding cadimport in the dll settings. This should be the case in your project. Maybe you referenced cadimport.dll somewhere in your scripts and this is why the build is not running. Please check what you added or changed in difference to the current release.