PLC 5 and Control Logix Subroutine Parameters Input

PLC 5 and Control. Logix Subroutine Parameters

Input Parameters Simple Example • Three variable frequency drives heat sink temperatures input to PLC • Temperatures input in degrees Celsius • Convert to degrees Fahrenheit and display on operator interface

Option #1 Ladder Conversion • Each time temperature input could add a rung to do calculations. • This would make ladder file longer. – More rungs – Slower scan

Option #2 Subroutine Conversion • Put conversion instructions in a subroutine • Access subroutine each time conversion necessary • Less rungs in ladder • JSR input parameters used to move temperature data to subroutine

JSR Instructions with Parameters

Heat Sink Temperature from Three Different Sources • Drive node 21 temperature to F 8: 0 • Drive node 22 temperature to F 8: 1 • Drive node 23 temperature to F 8: 2

JSR Sends Information to SBR JSR sends temperature information to SBR instruction input parameter address F 8: 10. Node 21, F 8: 0 temperature Node 22, F 8: 1 temperature Node 23, F 8: 2 temperature

Subroutine Shares Data - F 8: 10 is where temperature is stored. - F 8: 10 data used in calculation

CPT Destination Stores Result

Result, F 8: 11 to RET Output Parameter

Data Returned to JSR Data from RET instruction return parameter to JSR return parameter F 8: 12

Data Flow Ladder 2 A Ladder 3 B D E C

No Return Parameter Faults Processor
- Slides: 13