# [[Programable Logic Controllers]]
## Source and Sink
[Sinking and Sourcing PLC Inputs with PNP NPN Sensors](https://www.youtube.com/watch?v=VFdtz3q4as8&list=PLUi5cdVq3wTBx55PZVMoFHeV5OkhATkLQ&index=6)
PLCs can get their inputs and set their outputs by either sourcing or syncing the electric circuit. How a PLC is setup to source or sync determines the types of sensors and how to wire them up to a PLC. ^[Think how common ground is can be different in LEDs]. For buttons and switches it doesn't make much of a difference but for sensors, they'll either be PNP or NPN so it matters if the PLC is sourcing or syncing. ^[mnemonic: PNP ==> power NPN ==> not power]
Note: different PLC manufacturers define sourcing and syncing differently.
```mermaid
```
## Questions
- How do inputs / outputs make it to OPC tags
- What's the scan time? how is it determined.
- Why is it called a coil?
- What's considered fieldbus? What protocols are used for a fieldbus?
## References
- Allen Bradley has a free RsLogix500 Micro Starter Lite
- [Understanding how a PLC program scans in Allen Bradley Micrologix](https://www.youtube.com/watch?v=_FSvOVCyk1s) is a good overview of the whole scan – getting from current at the input terminals through the ladder logic of the program, updating outputs, overhead and looping back around.
- [PLC programming playlist - Tim Wilborne](https://www.youtube.com/watch?v=DrGaOLGHE34&list=PLUi5cdVq3wTBx55PZVMoFHeV5OkhATkLQ)
---
- Links:
- Created at: [[2021-04-03]]