3/28/2013 9:29 PM | |
Joined: 9/23/2005 Last visit: 8/13/2024 Posts: 4347 Rating:
|
Hi, It is difficult to build a HSC example, because, despite it is very simple (90% is just HW configuration), each one needs one specific solution that a general sample doesn't cover. Despite of it, I think that should be nice to give an initial step with a very simple example. TIPs: Device configuration The HSC configuration is defined on the Device Configuration, CPU properties, High seepd Counters In our example, HSC1 was enabled, for simple counting: High speed counter (HSC)1: 1- Checked: “Enable this high speed counter” 2- If you will work with A/B encoders, you need to change the property "Operating phase" from ‘single phase’ to ‘AB quadrature phase 1x’ (or 4x). 3 -The hardware inputs box will show where the field signals should be connected. TIP: With CPU FW4 and STEP 7 V13 it is necessary to adjust (minimise) the input filter of the digital inputs OB1: 1 - You can read the count value (as Dint) directly from the address showed HSC configuration (CPU properties) in the "IO address" / start address (e.g. starts with 1000). 2 – The call of the CTRL_HSC is not necessary to read the HSC value, however you could use it for change the HSC configuration in PLC RUN mode (by user program). Reset: You can define in HW enable an input for reset function. If you need to do a reset from a user program, you could call CTRL_HSC like showed in the network 2. CTRL_HSC: The main tip for CTRL_HSC block is to address the HSC by the symbolic name (not direct by a number): it is easier, clearer to understand, and avoid future problems (if you change for a new hardware and the number of HSC changes). Retentive: The HSC are not retentive (i.e. it looses your values after a power off/on). Despite of it, there is possible with help of the user program to reload the last read value to a HSC. The FAQ http://support.automation.siemens.com/BR/view/en/41995947shows how to do it. AttachmentHSC.zip (14096 Downloads) |
Last edited by: Pegaia at: 8/28/2014 8:02 PMTIP about DI filter Last edited by: Pegaia at: 5/6/2013 8:27 PMLast edited by: Pegaia at: 5/6/2013 8:27 PMLast edited by: O_Moderator at: 4/2/2013 12:21 PMLast edited by: Pegaia at: 3/29/2013 12:44 PMLast edited by: Pegaia at: 3/29/2013 12:43 PMLast edited by: Pegaia at: 3/29/2013 12:43 AMDenilson Pegaia |
|
This contribution was helpful to
27 thankful Users |
Follow us on