Вы находитесь на странице: 1из 6

High speed counter for an S7-1200 PLC STEP by STEP

1. Declare your HSC in hardware




2. What is the HSC used for?


3. Trigger a hardware interrupt block (OB40) if an event happens.
Event >> Count Value (CV) == Reference Value (RV)


4. Select a memory link also called an I/O address.
1000 >> ID1000 >> Input Double word 1000

ID1000 read as DINT is the Current Value (CV) of the high speed counter

5. Put down a LADDER block that administartes the functioning of the HSC.



6. Start writing code.

[A] The datablock that helps with admin for the HSC.

[B] The name of the HSC as it is known to the PLC
this is found under "show all tags" > "System
constants".

[1] The bit triggering DIR causes a direction change as
specified by NEW_DIR

[2] The bit triggering CV causes a NEW_CV to be
loaded changing the Current Value and thus ID1000.

[3] The bit triggering RV causes a NEW_RV to be
loaded changing the Reference Value or target. When
CV == RV the block OB40 will execute.

[4] The Current Value of the counter is loaded into a
buffer as example of code that can be designed.



Created by
WILLIAM B.
for
https://www.automation.siemens.com/forum

Вам также может понравиться