How-to
How to read an SLC 500 integer into ABB robot RAPID
Short answer
Configure the robot's DeviceNet unit and a 16-bit group input in EIO.CFG, add the robot to the scanner's scan list at 2 bytes, and read the word in RAPID with GInput, converting the two's-complement value when the SLC integer is negative. Socket messaging is a separate RobotWare option for custom TCP framing, not the path for one integer from a DeviceNet SLC 500.
On this page
Yes, and the direct path is DeviceNet group I/O, not sockets. An SLC 500 wired to DeviceNet reaches the network through a scanner module such as the 1747-SDN, and the robot joins that same network as a slave: define the DeviceNet unit and a 16-bit group input in EIO.CFG, add the robot node to the scanner's scan list at 2 bytes, and read the value in RAPID with GInput. Socket messaging is a separate RobotWare option for custom TCP framing between a robot and a computer; it carries no PLC data model, and a DeviceNet SLC 500 has no Ethernet socket to bind to in the first place.
Let the wiring pick the route #
The ports decide, not the word Ethernet in the requirement. DeviceNet is a CAN-based bus with its own 24 V DC network power and its own trunk cable; it is not Ethernet. With a scanner module in the SLC rack and a DeviceNet board in the robot controller, group I/O is the answer: do not build a TCP protocol to avoid one scan-list entry. If the robot controller has no DeviceNet board, the honest choices are adding the board or placing an Ethernet gateway in front of the PLC to do the protocol conversion. Socket messaging earns its keep only when the far end is a computer or device already running a TCP protocol you control; ABB documents it in the application manual for the option, and it leaves every protocol decision to you.
The four settings that must match #
A 16-bit SLC integer crosses as two bytes. Four quantities must agree at both ends or the word arrives shifted, truncated, or not at all:
| Setting | Value for one 16-bit integer | Where it lives |
|---|---|---|
| Node address (MAC ID) | One unused value from 0 to 63 | Robot unit definition and scanner scan list |
| Bit rate | 125, 250 or 500 kbit/s, identical on every node | Robot network parameters and scanner configuration |
| Slave I/O size | 2 bytes in the direction the PLC writes | Robot unit definition and scan-list entry |
| Group signal width | 16 bits, beginning at bit 0 | EIO.CFG signal definition |
DeviceNet moves the low byte first, so a group input spanning bits 0 through 15 of the unit's input image returns the SLC word without shifting. SLC integers are stored in two's complement, so a negative word reads in RAPID as 32768 or more until you subtract 65536. The trunk's maximum length falls as the bit rate rises; on a running network you inherit the rate, and one added node does not change it. One safety limit: this word is control data with no safety rating, so stop and protective functions stay on the robot controller's safety circuit, never on a value read this way.
Step by step: SLC word to RAPID variable #
-
Get online with the scanner's configuration software, where choosing the DeviceNet configuration connection path matters, and record the running bit rate and the MAC IDs already in use. Pick one free address for the robot.
-
In the robot's system parameters (EIO.CFG, edited from RobotStudio or the FlexPendant), define the DeviceNet slave unit on the robot's board with the generic unit type DN-Generic: the chosen MAC ID, the network's bit rate, and an input size of 2 bytes.
-
Define a group input signal on that unit, 16 bits wide, beginning at bit 0.
-
Add the robot to the scanner's scan list with 2 bytes in and 2 bytes out, then download the scan list. The software can automap devices into the scan list; verify the byte counts and addresses it chose instead of trusting them. The full SLC-side procedure is in how to map a 1747-SDN scanner for DeviceNet drive control.
-
In the SLC program, MOV the integer (an example address is N7:10) into the scanner output-image word the scan list assigned to the robot node. Take that address from the scan-list mapping, not from assumption.
-
Read and sign-correct the value in RAPID:
! giSlcWord is an example 16-bit group input signal name VAR num nValue := 0; nValue := GInput(giSlcWord); IF nValue > 32767 THEN nValue := nValue - 65536; ENDIF TPWrite "SLC word = " \Num:=nValue; -
Test it from the PLC before trusting it: force the word to 0, 255, 65280 and one negative value, and check the FlexPendant line each time.
Worked example: proving a signed value #
Force N7:10 to -1234. The two's-complement 16-bit pattern is 65536 - 1234 = 64302. On the wire, low byte first: 64302 = 251 x 256 + 46, so byte 0 carries 46 and byte 1 carries 251. The group input recomposes 251 x 256 + 46 = 64302, GInput returns 64302, the test 64302 > 32767 is true, and RAPID computes 64302 - 65536 = -1234. The FlexPendant line reads 'SLC word = -1234', matching the forced value. Repeat with an unsigned value, 4660: it breaks into 18 x 256 + 52, so the bytes are 52 then 18, and the signal returns 4660 unchanged. Two prints matching two forced values proves byte order, group width and sign handling in one pass.
Prove the mapping on the wire #
- The three-value test: 0 reads 0, 255 exercises byte 0 alone, and 65280 (255 x 256) exercises byte 1 alone. If 255 and 65280 trade places, the mapping is reversed or offset by a byte. If only the low byte ever moves, the connection carries 1 byte: fix the size in the scan-list entry and the unit definition.
- Watch the node status in the scanner software. A steady running state on the robot's MAC ID means address, bit rate and byte counts all match; an error or flashing state on that one node points to a duplicate MAC ID, a size mismatch or a bit-rate mismatch. Confirm the trunk terminators are fitted at both ends before changing settings.
- Staleness is real: the robot sees a new word after the node's poll interval plus the time to the next RAPID read. Read in a loop or wait on the signal; a single read at routine start freezes one snapshot.
- Words that arrive swapped on a different network get the same class of fix; fix ABB IRC5 PROFINET word values with a byte swap walks the PROFINET version of the symptom.
When socket messaging is the right answer #
Check the installed RobotWare options first: RAPID socket calls fail on a controller without the option. What the option gives you is a TCP or UDP transport and nothing else, because you design the message format, the byte order, the boundaries (TCP is a stream, so one send can arrive as two reads) and the retries, on both ends. A DeviceNet SLC 500 offers no port to serve any of that. The decisions by case: one integer from a DeviceNet SLC 500, group I/O every time. Robot to a computer or vision system you program on both ends, socket messaging, with the protocol in your hands. Robot to an Ethernet PLC you cannot reprogram, a gateway that converts, not a socket protocol you have to invent. The application manual for the option carries working examples; search it for the word Socket.
Questions asked
Can the robot write an integer back to the SLC 500 on the same link?
Yes. Mirror the setup in the other direction: give the scan-list entry its 2 output bytes, define a 16-bit group output signal on the same unit in EIO.CFG, and set it from RAPID. The scanner places the robot's output bytes in the input image the SLC program reads, so a MOV from that location picks the value up.
The robot controller has no DeviceNet board. What are my options?
Two real ones: add the DeviceNet board to the controller, or put an Ethernet gateway in front of the PLC and let it do the protocol conversion. Socket messaging is not a third option here, because it is an empty transport that leaves the PLC protocol to you, and a DeviceNet SLC 500 has no Ethernet side to serve it. Check the controller's installed board and options list before you plan the cell.
How do I read a second integer from the same SLC 500?
Widen the unit's input size by 2 bytes in both the EIO.CFG definition and the scan-list entry, then define a second 16-bit group input beginning at bit 16. Each group signal maps its own contiguous bit range, so the two words arrive as two separate values in RAPID.
Does GInput update continuously, or only when RAPID executes?
The fieldbus keeps the signal's image current on the node's poll interval; GInput only samples when it executes. A loop or a wait instruction sees changes as they happen, while a single read at program start freezes one snapshot for the rest of the routine.