Device Mapping in ABB
Hello,
I am working on connecting ABB robotstudio to game4automation, and I have a question about the device mapping. I have device mappings that go to +-120, How can I make this in robotstudio? I can only see it go up to 9 and then it becomes 1,1, 1,2 etc, does this count as 11,12 etc?
Another question, Do I have to create empties in robotstudio for every missing device map? I saw the page but didnt understand why you had to create that much empties.
Antwort
We are not deep experts in ABB robotsudio and did on our side only a small test project. On the G4A Side all I can say is that you need to enter empty signals so that the structure is without emtpy bits and bytes. Some information about the configuration (Simit is using the same interface) can be found in this video:
I have a new question. When creating the list as described, I have a group input which is the size of one byte. How can I get this in unity? I see that there is a signaltype.byte in the switch statement in ABBRobotStudioInterface.css but I cannot see where it writes the signaltype. I've tried filling "BYTE" in the "origin data type" field, but no luck so far.
Hm, thanks for the response but I cant find what to do with high device mapping numbers, I see ABB using 0-8 in their tutorial as well.
Can you provide us your ABB RobotStudio project or a simplified example and we will check?
I fixed the problems I had with the mapping, but I have one problem left. In Game4Automation you can set it on PLC output int,bool or float, but I need a Byte (so in ABB robotstudio one group input has 8 bits instead of the 32 of the INT). I've looked in the code and found some traces of the BYTE and WORD option, but I cannot find them in the scripts.
I Hope this table clarifies what i need.
Input | Mapping in robotstudio | Mapping in Game4automation |
A | 0 | M0.0 |
B | 1 | M0.1 |
C | 2 | M0.2 |
D | 3 | M0.3 |
E | 4 | M0.4 |
F | 5 | M0.5 |
G | 6 | M0.6 |
H | 7 | M0.7 |
J | 8-15 | M1.0 |
K | 16 | M2.0 |
In G4A bytes are also transferred to ints. So if you have on the ABB-Robotstudio SHM Side a Byte it should be on G4A-Side an PLCInputInt or PLCOutputInt.
IF i use PLCInputInt (or output int) K (on my table) will be on M5.0 because the int is specified as 32 bits, instead of the 8 bits that a byte is long. This results into a memory mismatch
I hope you have time to check this, i've been trying to fix it for a day and it doesnt work yet. It's all i need to test my system.
Please try do do this. I am not able to test because currently I have not an ABB Robotstudio with your configuration. Hope it works.
Add Byte to Origin Data Type
and replace Line 167 following in ABBRobotStudioInterface by this:
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 = $"MD{posmemory}";
accessor.Write(posheader, (byte) 10);
shm.type = SIGNALTYPE.INT;
posmemory = posmemory + 4;
}
}
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) 8);
shm.type = SIGNALTYPE.BYTE;
posmemory = posmemory + 1;
}
}
Perfect - and sorry for the missing Byte stuff - we will integrate it into next relase. If you have something to share in public of the things you are doing (a video, linkedin post or something like this) this would be very welcome.
No problem! I will ask the company to make a video/post once everything is finished. It's good promotion for us as well!
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;
}
}
Customer support service by UserEcho
Please try do do this. I am not able to test because currently I have not an ABB Robotstudio with your configuration. Hope it works.
Add Byte to Origin Data Type
and replace Line 167 following in ABBRobotStudioInterface by this: