Hello everybody,
I write these lines to summarize what I have experienced recently.
For some time I wondered if it was possible to put Roboguide in communication with a PLC Simatic type
to exchange data from the PLC area to registers R [] and vice versa by mean of TCP open communication.
So I collected some information and advice over the internet and I must say that the biggest help was to know that
making this communication work is possible.
I can say that I had little knowledge of RG and Karel programming while instead I am familiar with Simatic PLC programming.
In a week of spare time I could make what I was looking for.
Get Roboguide, a Karel programming manual, a Simatic PLC. In my case I used a WinLC installed on Simatic Microbox IPC427C.
My initial intent was to use a single station with WinLC and RG communicating on localhost 127.0.0.1 but that didn't work.
So I set two stations:
Microbox IPC427C Laptop
WinLC RG
Blocks:
TCON, TDISC, TSEND, TRCV
Options:
R632 - KAREL, R648 - User Socket Messaging
IP 192.168.1.1 192.168.100.1
Mask 255.255.255.0 255.255.255.0
Client Server
Port 2000 2000
- At PLC side you need to create a program to manage communication as Client through TCON, TDISC, TSEND, TRCV blocks
It is important to enter the communication parameters correctly (ID, Connection type, Active / Passive, IPs, Mask, Ports)
I suggest to test TCP Open Open PLC side with the Hercules program at laptop side set program as a server.
This allows you to test the communication before you have prepared the Karel routine at RG side.
- Once the PLC side is tested, a workcell must be prepared on RG.
> Create a workcell with the necessary options (Karel, User Socket Messaging)
> Set Comm Host with IP address and Subnet Mask
> Create the Server Tag variable: Host Comm \ Servers S3
- Set the protocol to SM (Socket Messaging) and start the service. I recommend reading ROS.org tutorials that offer a good help in configuring Server or Client tags on RG
Now, it takes some patience and research to create the karel that uses RG tag server for communication.
To communicate I used SM_SERVR.kl found on this forum. I have modified it and adapted to my purpose by studying Karel's instructions reading and writing the values of the R [] registers.
It takes a bit of work but worth it.
I hope I could help with these few lines