Blog post written by Louis Servant, Support Specialist at SCADAware
Introduction
For simple, small PLC projects, the Micro800 series is a force to be reckoned with at an affordable price. Similarly, RFIDeas has a rather handy RFID reader compatible with many different RFID card types that communicates over EtherNet/IP, the PCProx Plus EIP RFID Reader. Unfortunately, it seemed that no one has ever tried to integrate the two before, as I could not find a single piece of documentation about it. As my first PLC program, I thought I’d jumped in over my head, purchasing incompatible parts. However, with the guidance of my fellow engineers at SCADAware, and some support from the folks at Rockwell and RFIDeas, I was finally able to get it working using explicit CIP Messaging in Connected Components Workshop.
Method
RFIDeas has nailed it when it comes to setting up their reader to run. You can simply download a configuration program, connect the reader, and quickly configure to suit your needs. It’s a good idea to know what card type you’re dealing with, because if you’re left with guessing, there are far too many options to go through for my patience. Follow RFIDeas instructions (https://www.rfideas.com/support/pcprox-plus-eip-poe, bottom of the page) up to Step 4. Take note of your reader’s IP address, as that will be how we talk to it.
Previously, all that page had for reference was for RSLogix 5000 controllers. Connected Components Workbench uses a more basic interface than RSLogix, and is pretty much a different beast entirely. Converting instructions from RSLogix to CCW is not a very straightforward task as each program makes different assumptions.
This guide will assume that we’re starting a completely new project from scratch. In Connected Components Workbench, create a new program with a MSG-CIPGENERIC instruction block. Create variables for each of the inputs and outputs of this block.
The CtrlCfg, AppCfg, TargetCfg, and Status each have unique data types associated with them. Each of the inputs should be configured as follows.
Note: if a subitem is omitted, then it is assumed to be left at its default value.
CtrlCfg
TriggerType – Trigger every n cycles. Should match the setting in RFID Reader (1000).
AppCfg
- Service – 14. Stands for 0x0e in decimal notation.
- Class – 4
- Instance – The one place where existing documentation crosses over. We want the card number, 100.
- Attribute – 3
TrgtCfg
Path – CIP Destination Path, a string of comma-separated values. The first value is the physical port number of the controller to which the reader is connected. The second value is the IP address of the reader.
The rest of the inputs are standard data types. ReqLength needs to be 0. ReqData should be an empty array of USINTs. ResData needs to be an array of 0-37 USINTs. Your card read count will be at 0, and the card number will be at 37.
Note: The number may not match the readout of the reader config program, likely due to the expectation of the SINT data type. However, the code should still be usable in an isolated environment where the numbers generated by the reader in the PLC don’t need to match numbers generated by the reader itself. In my application, my cards were distributed from 200-300. This leads me to believe they may wrap around after 999. I haven’t done sufficient testing to determine.
Download the program to your controller, and if everything is configured correctly, you should see a number appear in row 37 of ResData while a card is scanned. The number at row 0 will increment every time a card is scanned. You may then proceed with the rest of your program as you see fit. Easy!
What can go wrong?
I ran into all of these things while debugging this process for the first time. Hopefully you don’t have to deal with these issues if you follow the guide correctly, but I’ll include them for posterity.
Status Codes, What They Mean, How to Fix them
More than likely, the Status variable will contain information on the error. You’ll know because the .Error subitem is marked TRUE. Here are the status codes I ran into, and how they were fixed. Any errors not listed here can be found in the help viewer of CCW under ‘CIPSTATUS error codes’
Error 33 – Configuration Errors
Errors in here likely point to a typo in one of your Cfg variables. Double check that they match what is shown here.
Error 55 – Timeouts
These errors point to networking issues. Check your cables, ping the reader and the controller to make sure they talk. I ran into this a few times early on when I was repeatedly failing and retrying every cycle, which eventually locked up the reader, which required a power cycle to fix.
Error 224 – CIP Errors
These are errors reported in the CIP Specification. A complete list is found in the Spec under Appendix B. The CIP Error I ran into was Error 21 (0x15 in the spec), which said too much information was sent to service. If the Request Length is greater than 0, this error will be thrown because the reader doesn’t handle requests. It only responds. Setting your request length to 0 and shrinking request data to an array of 0 should alleviate that issue.
Error 255 – Startup Error
I find this error occurs early in the reader’s power cycle. It should clear itself out within a few seconds.
Conclusion
All in all, jumping between this manual and that manual and talking to various support people, I spent far too much time debugging this issue simply because the reference wasn’t easily accessible in one place. With this model as a reference, starting up a new CCW Project with the PCProx Plus EIP RFID Reader should take a matter of minutes. This may not be the 100% correct way to handle the reader on a Micro800 Series controller, but it got results good enough to distinguish between one RFID card and another, which is all I needed.