Can anyone explain the syntax used to send over values and messages to higher level controller via AB PLC?
KRC4 to higher level controller sending values/messages
-
TickTack -
November 20, 2015 at 7:49 PM -
Thread is marked as Resolved.
-
-
Any number of options. Depends entirely on what kind of connection you have between your KRC and PLC, and how much data of what kind you want to send.
-
Of course, communication is with Ethernet IP using CIP, would only be transfer integer values and characters 25 max.
-
just map block of I/O for cyclical update... all info is in the WoV manual and help. important thing to know is that you must use virtual5 as EIP interface. if you wish to split windows and EIP traffic, then create new adapter (virtual6) and make it windows interface (EIP must stay on virtual5).
-
I don't think thats what I need. Thanks for the response though. ... All i need to do is make the syntax to say set instance 1-11 to some integer and another to set to some string. then i would pull them out through the plc. I know in Motoman you simply say SET I001 somevalue. I have the ethernetIP manual but could not make sense of the messaging sytax. I already have the Class, and instances set up in the KRC4 enabled.
-
when you have EIP driver installed on the robot controller and configured and IO mapped, (and done the same on PLC end), you should be able to exchange data.
basically turning on bit on PLC will set bit among robot inputs and the other way around. This is needed BEFORE doing anything else (such as things mentioned in rest of this message).To exchange blocks of data larger than bit, you can create series of signals for variables that are more than one bit.
one signal can be up to 32-bit.
in AB PLC variables of DINT type are 32bit as well.
to map single character you need just 8bit.if you want to map string, then simplest solution is to create structure on robot side that matches PLC string type (DINT as length, then 8bit per character)
possible syntax:
SIGNAL MyStrLen $IN[1] to $IN[32]
SIGNAL Ch1 $IN[33] to $IN[40]
SIGNAL Ch2 $IN[41] tp $IN[48]
... -
Is that acyclic communication? I see the manual has example ...
// write cmd 2, cmd len 8, Data = 0x1 0x2 0x3 0x4 0x1 0x2 0x3 0x4
IF KUKA:I.Data[0].1 THEN
ReqDataBufWrite[0] := 2;
ReqDataBufWrite[1] := 8;
ReqDataBufWrite[2] := 16909060;
ReqDataBufWrite[3] := 16909060;
MSG( MsgCtrlWrite);Where and what do you declare and how is it mapped?
-
Mapping has to be done in WorkVisual.
Basically, the KRC has very large numbers of I/O available, as an array of boolean values: $IN[number] for inputs, and $OUT[number] for outputs. The system variables exist, and can be used, all the time, regardless of mapping (although obviously they won't go anywhere if they're not mapped).
In the I/O config in Workvisual, you can connect the KRC to a wide variety of I/O devices, masters, slaves, etc, and even use multiple different networks at the same time. Some people make some VERY baroque I/O arrangements this way... But since you're using EIP and a PLC, we'll stick to that. Most likely the PLC is the EIP master, and the robot is the EIP slave. You can configure the EIP adapter in the robot to a particular number of I/O bytes, and the config on the PLC side will need to match. Let's assume you set the robot to 64 bytes (512 bits). So, it WorkVisual, you need to select which bytes in the $IN/$OUT arrays are connected to which input/output bytes on the EIP channel. Usually it's simplest to do this in one large block.
If you just start with the first $IN/$OUT bytes, and map the first 64 bytes to the EIP channel, that will mean that $IN[1] through $IN[512] are mapped to the PLC's outputs, and vice versa for the $OUTs.
Then, inside your program, you can create "integer" signals by grouping $INs and $OUTs together, and give names to these new user-created signals, using the SIGNAL declaration, as Panic showed.
-
Thanks SkyeFire, that clears somethings up for me. However I don't think that is what Im after. I think i need to use the CWrite function and unsure how to use it.
DECL INT nHandle, tmpInt, retVal
DECL STATE_T Stat
DECL MODUS_T WMode
DECL INT Offset
DECL INT UserData
UserData = 255;
Offset=0
CAST_TO(Buffer[],Offset,UserData)
CWrite ($CMDΙ$FCT_CALL,CMD_SYN, WMode,"%1d",Buffer[])attached is a photo of what Im trying to do in AB plc, i just don't know how kuka gathers and sends the info.
-
why do you want explicit message? this is what you use to communicate between two plcs etc.
for data exchange with robot controller you need to setup cyclical I/O. acyclical is possible but you are on you own, i don't recall anyone actually playing with it (though it is in EIP manual). -
I was trying to do that because code is already written to receive information using Motoman, I was trying to keep everything similar, but if its too difficult to try I can rethink the subject. so.. if i go a different route... i just need to send over INT values and then strings of characters.
-
as i look at things, you just need data from device A to somehow appear at device B (and the other way around). exact method of transfer or mode of operation (master/slave etc) is irrelevant.
once you have data transferred, you can pick it apart and massage it to pieces any way you like. so far everywhere i looked data is exchanged cyclically. acyclic comms are used only when transmitting large block of data to better utilize resources or when issuing odd-ball commands (parameter setup of some device).
on KRC4 you may use EIP to exchange over 500 bytes of data each way cyclically (that is over 4000 bits!!!). seem to be plenty of data to me.... do you really need more than that?
to setup cyclic data transfer is a 5-min job. what more can one ask...
-
Thank you for your input and information, Ill look into sending data cyclically.Not having the manual on hand, is setup a process ? Or simply in the program using the Signal command?
-
it is a series of steps on robot end (and on PLC end...):
1. make sure that EthernetIP driver is installed on the robot (cold start)
2. not robot network settings and connect your laptop to it (must have WoV installed)
3. get current working project from robot
4. save it, also save it as a new file version (so it will not overwrite current project later on when we deploy it)
5. double click on controller in Hardware tab in WoV to activate it (this associates all tools and editors in WoV with current controller and allows expansion of Bus Options)
6. Right click on Bus and add EthernetIP
7. Doubleclick on Ethernet IP bus and configure it. For example you need to select which network card you are using on your laptop to do configuration, what the address range for EIP is and of course IP address of robot (same one you used to connect to to get WoV project)
8. set network parameters depending on chosen architecture. normally PLC would be "master" or "scanner" and robot is "slave" or "device" but this does not have to be the case. robot can be slave to up to 5 masters, normally under Slave1 you would activate connection, enter description for connection (this would be name appearing in messgaes when connection is broken for some reason).
9 set desired block of I/O bytes and map them to robot I/O.
10 deploy and activate project on robot controlleron the PLC side you need to create new network adapter (generic network adapter), and use same instance numbers and I/O size like on robot...
-
All of that has already been done, Im already able to send bits and words back to my PLC. Right now I'm trying to send an explict message again.... I have my class set to 64, instance set to 1 , service code at 32 and attribute set to 1.
I have no errors on PLC side for communication but when I run the program I have made for a test, I don't get a MSG Done. I can't tell if the krl program I have is sending the information or not. -
code you entered is in wrong sections, things in SRC (everything you added) should be after INI fold.
your command length is 16 while example in manual is using 8. did you read manual? did you adapt XML file? -
Hi guys, this is a old topic but a new ploblem to me. Please Help-me.
panic mode, I really need work with a assyclic message.There no other way. I have a KRC4 and a AB Micro850 (this s**** is able to send explicit message over EIP but can't map a I/O in module like a AB Compactlogix - "There is no a Modular ESD" saids WoV...)
I have read the KR C4 EtherNet/IP 2.0 Manual but could not understand very well...
...
61 CRead (nHandle, Stat, RMode, TimeOut, Offset, "%r",Buffer[]);
62 If ( Stat.Ret1==#DATA_END ) then
63
64 Offset=0
65 CAST_FROM(Buffer[],Offset, CmdID)
66 CAST_FROM(Buffer[],Offset, CmdLen)
67
68 if (CmdID == 1) then....
CmdID is cast from Buffer? On PLC side this is a String Buffer?
TickTack did your code worked?
-
all that is documented in CREAD/CWRITE manual.
rest is in EIP manual... -
Ok. I did could understand the code... I think...
But I lost my self with the IP adressing at WoV.
I need to put insert a Generic Explicity Massage EDS? When I try "Connect" its return a error: Diferent Vendor Number.
I did not see cleary were I will define the target of my comunication. Shoud I put a IP address in some place or the KRC4 will be a slave? a server? This will bethe scanner?still locking for Help.
Thanks
-
just map block of I/O for cyclical update... all info is in the WoV manual and help. important thing to know is that you must use virtual5 as EIP interface. if you wish to split windows and EIP traffic, then create new adapter (virtual6) and make it windows interface (EIP must stay on virtual5).Could you tell me more about this Virtual6? I did not find reference in any manual.
After make the adaptatons in drivers files I got the Error :"Can´t read/write EIP-SCANNER" after to try create a virtual6 some errors apears. (don´t know how) but other eipDEVICES worked well in virtual5 together windows conection. Only explicit message don't.
-