Native Modbus TCP on Logix Platform

Typically, a Logix platform with Modbus TCP support means adding a 3rd party card to your rack and configuring it as a master or slave. Then the PLC program parses out the assembly data into user structures to be utilized throughout the rest of the program. As of firmware version 20, Rockwell has enabled user defined protocols on most of its ethernet cards and ethernet enabled processors. This allows all sorts of nice features to be incorporated into your PLC program. Things like a PLC telnet client and FTP of log files are now possible. Modbus TCP is another possible protocol that now can be coded into your PLC program. This isn’t exactly a trivial task and it certainly isn’t going to replace the 3rd party card in all cases but it can a valid alternative solution. Maybe there is a very small amount of data you need to pull, or there isn’t room in the existing chassis for a dedicated Modbus card. Maybe there are several dozen PLC’s in the system and saving a Modbus card for each chassis would be considerable cost savings. In any case it is nice knowing the option is there. As a Modbus master, the program must open a remote connection on TCP port 502 , parse together a valid Modbus request , send the request and track the transmission id. On receiving a return data packet the program must match up transaction IDs , decode the Modbus reply , handle any errors, and then parse the received data into local arrays. I recently wrote a Modbus TCP master task and developed HMI graphics to configure the polling commands. Now I can simply import the new task, point the HMI global object to the task and have a new Modbus node online and polling in a fraction of the time it takes to configure the 3rd party card.