Description
You're looking for an SCL function block (FB_Tuerzugang_RFID) that transforms your PLC into a flexible access control system. It supports RFID cards, a manual door opening button, emergency stop release, failed attempt counter, and locking logic after three invalid attempts. It's directly executable in the Siemens TIA Portal.
Note: All modules are designed exclusively as a learning and optimization basis and are not approved for live operation. System modules, in particular, must be finally tested and commissioned by qualified personnel before productive use.
How it works
- Reset button → reset all failed attempts, locks and alarm states
- Emergency stop active or failed attempt limit reached → Lock door release, alarm on
- Manual opening button → immediate release at any time
- New RFID UID detected → comparison with stored list
- UID valid → release door, OK LED on
- UID invalid → increase failed attempt counter; lock active after 3 attempts
- Door contact closes → release and OK LED automatically reset
Technical details
• Inputs: Reset button, emergency stop, manual button, RFID reader, door contact
• Outputs: Door release, OK LED, Error LED, Alarm
• Internal counter for invalid attempts; lock after 3 failed attempts
• Edge detection of new UIDs; list comparison via FOR loop (up to 10 entries)
• RETURN in safety-critical conditions aborts logic immediately
Possible applications
• Access control for industrial and office buildings
• Retrofitting existing locking systems with RFID
• PLC training on access concepts
• Live demos at trade fairs or in training labs
compatibility
• Siemens S7-1200 & S7-1500
• TIA Portal V13 and higher; recommended V16+ for HMI integration and PLCSIM
Scope of delivery
• .scl file with input/output declarations, internal variables (UID list, counter, lock flag), manual opening and reset function
• Download link directly after purchase
Support
I'm happy to adapt the module to other RFID formats, protocols, or HMI interfaces, and integrate logging and remote monitoring functions. Feel free to contact me anytime via shop message or email.