Teilen Sie Ihre Erfahrunge und Wünsche mit uns und anderen Usern!
Hi,
nice work. How did you connected to KUKA.
There seems to be still a cycle time problem. If you would like I could support you, if you support me for getting it into the Professional version ;-)
Best regards
Thomas
RobotDK jitter
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();
}*/
}
}
}
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.
S7PLC to PLCSIM Compact
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)
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
Why my g4a project everytime I enter play mode stops working?
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
Based on your description it is hard to say where your problem is. Did you followed these steps?
If these steps don't help please export us your project and we will look into it.
Colider Box , vertical movment on chan element
I add chain with chain element, and make chain element as transfer surface. But when cans comes to chain element it is holding only in vertical moving , but not for horizontal, there is video, what i miss?
OK we found a solution. Thanks for sharing your information.
Here is a video about it, will be in the release next week. If you need the changed scripts earlier please send me a message.
Changing local zero point for mesh
How can i change local zero point of mesh from parts4cad? i want add drive (rotation), but zero point of rotation is wrong.
For changing the local 0 point you could embed it into an empty game object manually or use the Kinematic script for doing that on startup or you can change the zero point on the CAD side.
AR template
Hi Thomas,
In one post, you have an AR example with some industrial tanks and the values collected from PLC.
Do you have a template (or some instructions) for this type of application and willing to share?
Thanks
Hi, no I am sorry we can't provide this. It was a prototype and we used in the Unity Project some basic Unity UI-Stuff, the game4automation OPCUA interface and Vuforia for marker tracking.
VFX Graph error after importing Game4Automation in 2020.1 project
H. I have recently imported Game4Automation into my project, but has since not been able to compile.
The console throws me a
InvalidEnumArgumentException in visualeffectgraph's Orient.cs
Has anyone run into this?
State: Robot Integration
Hi,
I want to ask about the state of the Robot-Integration into Game4Automation. I did not find anything in the Release Notes.
What is about Fanuc, ABB, Kuka , (and Universal Robots). Or do we need RoboDK for this?
Best Regards,
Mike
We are currently checking that. There is a discussion if we integrate Fanuc, KUKA, Stäubli and ABB Interface into a Game4Automation Ultimate Version. This will be about 300€ above the price of Game4Automation Professional. If we decide to go for it ETA will be around end of this year.
Modbus TCP/IP support
I. was wondering if Modbus TCP / IP support was planned in the near future.
Modbus is very well supported in the open source world and would enable they use of a large selection of pre-existing software, hardware and PLCs, in North American particularly.
How to use Modbus on G4A side is described here:
https://game4automation.com/documentation/current/modbus.html
G4A works as a Modbus server so your PLC needs to write and read from the modbus registers by some small PLC code. We don't have any knowledge about fx3u so you would need to take care about the fx3u side by yourself.
Best regards
Customer support service by UserEcho