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

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.

0
Answered

Grip scripts teleports mu to a different location

Matteo 3 years ago in realvirtual.io Starter and Professional updated by Support 3 years ago 1

Hi I'm having an issue with the grip script which I placed on a rotary arm on the automatic machine I'm designing, when the PLCOutputBool I use to pick the designated mu goes to true the MU that should be picked up and placed immediately teleports to a different location. My grip works just fine, but the mu will be moved on the location where it was teleported instead of attached to the gripper. I will include some pictures to better explain the issue.
In the first picture the green arrow points to the gripper and the red one to the mu.
In the second one, you can see how the mu (red arrow) is teleported to a different location immediately just as the signal linked to "Signal Pick" is true.

The pivots of the sensor linked to "part to grip", of the gripper and the pivot of the rotary arm correctly set. The Pivot of the game object representing all the automatic machine (highest in the hierarchy) is located also on the red arrow in the secon picture.

How do I fix this issue?

Thanks

Image 266

Image 267




Answer
Support 3 years ago

Sorry for my late response.

Grip should work. Please check how we did it in our dem model.

You can upload  your model via https://game4automation.com/send and I will check what is missing in your project.

0
Answered

Why my g4a project everytime I enter play mode stops working?

Matteo 4 years ago in General Questions updated 4 years ago 6

H, I'm currently working on my first project. I have added some drive scripts and some Mu and source, it is small at the moment and without any physics, but every time I press the play button to see my scripts in action, unity stops working and it took approx 3 mins to start or close the play mode and all the changes I made will disappear even though I saved them, I am talking about the bottom entity inside the game4automation gameobject. I tried to uninstall unity a couple of times, and this issue is still here only for my projects with the g4a asset on it, all my other unity projects ( even bigger one) will run without any problem. I should also mention that my pc is new and powerful. How can I fix this? I need to work on my final dissertation and like this is impossible.
Thanks

Answer
Support 4 years ago

Based on your description it is hard to say where your problem is. Did you followed these steps?

https://forum.game4automation.com/knowledge-bases/2/articles/193-step-by-step-guide-if-you-have-problems

If these steps don't help please export us your project and we will look into it.