Library manual XBTGC Expert I/O High speed counting | 3 MB
Library manual XBTGC Expert I/O High speed counting | 3 MB
Library manual XBTGC Expert I/O High speed counting | 3 MB
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
EIO0000000644.04<br />
Magelis XBT GC HMI Controller<br />
04/2012<br />
Magelis XBT GC HMI<br />
Controller<br />
<strong>High</strong> Speed Counting<br />
XBT GC HSC <strong>Library</strong> Guide<br />
04/2012<br />
www.schneider-electric.com
The information provided in this documentation contains general descriptions and/or<br />
technical characteristics of the performance of the products contained herein. This<br />
documentation is not intended as a substitute for and is not to be used for<br />
determining suitability or reliability of these products for specific user applications. It<br />
is the duty of any such user or integrator to perform the appropriate and complete<br />
risk analysis, evaluation and testing of the products with respect to the relevant<br />
specific application or use thereof. Neither Schneider Electric nor any of its affiliates<br />
or subsidiaries shall be responsible or liable for misuse of the information contained<br />
herein. If you have any suggestions for improvements or amendments or have found<br />
errors in this publication, please notify us.<br />
No part of this document may be reproduced in any form or by any means, electronic<br />
or mechanical, including photocopying, without express written permission of<br />
Schneider Electric.<br />
All pertinent state, regional, and local safety regulations must be observed when<br />
installing and using this product. For reasons of safety and to help ensure<br />
compliance with documented system data, only the manufacturer should perform<br />
repairs to components.<br />
When devices are used for applications with technical safety requirements, the<br />
relevant instructions must be followed.<br />
Failure to use Schneider Electric software or approved software with our hardware<br />
products may result in injury, harm, or improper operating results.<br />
Failure to observe this information can result in injury or equipment damage.<br />
© 2012 Schneider Electric. All rights reserved.<br />
2 04/2012
Table of Contents<br />
Safety Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5<br />
About the Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7<br />
Part I I/O Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11<br />
Chapter 1 Special I/O Configuration. . . . . . . . . . . . . . . . . . . . . . . . . 13<br />
Local and Special I/O Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14<br />
Special I/O Configuration Possibilities. . . . . . . . . . . . . . . . . . . . . . . . . . . . 16<br />
I/O Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19<br />
Part II HSC Principles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23<br />
Chapter 2 HSC General Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . 25<br />
HSC Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26<br />
HSC General Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28<br />
Chapter 3 1-Phase HSC Counter. . . . . . . . . . . . . . . . . . . . . . . . . . . . 29<br />
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30<br />
Up/Rising Edge Counter Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31<br />
Down/Rising Edge Counter Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32<br />
Up/Falling Edge Counter Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33<br />
Down/Falling Edge Counter Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34<br />
Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35<br />
Chapter 4 2-Phase HSC Counter. . . . . . . . . . . . . . . . . . . . . . . . . . . . 37<br />
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38<br />
Mode 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39<br />
Mode 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40<br />
Mode 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41<br />
Mode 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42<br />
Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43<br />
Chapter 5 HSC Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45<br />
HSC Configuration Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45<br />
Part III HSC <strong>Library</strong>. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49<br />
Chapter 6 General Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51<br />
Dedicated Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51<br />
04/2012 3
Chapter 7 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53<br />
HMI_HSCStart: Start the HSC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54<br />
HMI_HSCStop: Stop the HSC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55<br />
HMI_HSCGetCurrentValue: Get the HSC Current Value . . . . . . . . . . . . 56<br />
HMI_HSCGetCapturedValue: Get the HSC Value . . . . . . . . . . . . . . . . . 57<br />
HMI_GetSynchronizedOutput: Get Synchronized Output Status . . . . . . 58<br />
HMI_ClearSynchronizedOutput: Clear Synchronized Output Status. . . . 59<br />
HMI_SetCounterValue: Set the HSC Value. . . . . . . . . . . . . . . . . . . . . . . 60<br />
HMI_ClearCounterValue: Clear the HSC Value . . . . . . . . . . . . . . . . . . . 61<br />
HMI_GetPreLoadStatus: Detect Preload Input Signal. . . . . . . . . . . . . . . 62<br />
HMI_ClearPreLoadStatus: Clear PreLoad Status . . . . . . . . . . . . . . . . . . 63<br />
HMI_GetPreStrobeStatus: Get PreStrobe Status . . . . . . . . . . . . . . . . . . 64<br />
HMI_ClearPreStrobeStatus: Clear PreStrobe Status . . . . . . . . . . . . . . . 65<br />
HMI_GetMarkerStatus: Detect Hardware Marker Input Signal . . . . . . . . 66<br />
HMI_ClearMarkerStatus: Clear the Marker Status . . . . . . . . . . . . . . . . . 67<br />
Appendices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69<br />
Appendix A Function and Function Block Representation . . . . . . . . 71<br />
Differences Between a Function and a Function Block . . . . . . . . . . . . . . 72<br />
How to Use a Function or a Function Block in IL Language . . . . . . . . . . 73<br />
How to Use a Function or a Function Block in ST Language . . . . . . . . . 76<br />
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79<br />
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87<br />
4 04/2012
Important Information<br />
NOTICE<br />
Safety Information<br />
Read these instructions carefully, and look at the equipment to become familiar with<br />
the device before trying to install, operate, or maintain it. The following special<br />
messages may appear throughout this documentation or on the equipment to warn<br />
of potential hazards or to call attention to information that clarifies or simplifies a<br />
procedure.<br />
04/2012 5<br />
§
PLEASE NOTE<br />
Electrical equipment should be installed, operated, serviced, and maintained only by<br />
qualified personnel. No responsibility is assumed by Schneider Electric for any<br />
consequences arising out of the use of this material.<br />
A qualified person is one who has skills and knowledge related to the construction<br />
and operation of electrical equipment and its installation, and has received safety<br />
training to recognize and avoid the hazards involved.<br />
6 04/2012
At a Glance<br />
Document Scope<br />
Validity Note<br />
Related Documents<br />
About the Book<br />
This documentation provides information on the <strong>High</strong> Speed Counter (HSC);<br />
functions available with the XBT GC HMI Controller.<br />
This documentation describes the data types and functions of the XBT GC HMI<br />
Controller HSC library.<br />
The following basic knowledge is required:<br />
Basic information on functionality, structure and configuration of the XBT GC HMI<br />
Controller<br />
Programming knowledge of FBD, LD, ST, IL or CFC language<br />
This document has been updated with the release of SoMachine V3.1.<br />
Title of Documentation Reference Number<br />
Magelis XBT GC HMI Controller, Pulse Train Output, Pulse<br />
Width Modulation, XBT GC PTOPWM <strong>Library</strong>Guide<br />
EIO0000000650 (ENG);<br />
EIO0000000651 (FRE);<br />
EIO0000000652 (GER);<br />
EIO0000000653 (SPA);<br />
EIO0000000654 (ITA);<br />
EIO0000000655 (CHS);<br />
Magelis XBT GC HMI Controller Programming Guide EIO0000000632 (ENG);<br />
EIO0000000633 (FRE);<br />
EIO0000000634 (GER);<br />
EIO0000000635 (SPA);<br />
EIO0000000636 (ITA);<br />
EIO0000000637 (CHS);<br />
04/2012 7
Product Related Information<br />
SoMachine Programming Guide EIO0000000067 (ENG);<br />
EIO0000000069 (FRE);<br />
EIO0000000068 (GER);<br />
EIO0000000071 (SPA);<br />
EIO0000000070 (ITA);<br />
EIO0000000072 (CHS);<br />
You can download these technical publications and other technical information from<br />
our website at www.schneider-electric.com.<br />
LOSS OF CONTROL<br />
WARNING<br />
The designer of any control scheme must consider the potential failure modes<br />
of control paths and, for certain critical control functions, provide a means to<br />
achieve a safe state during and after a path failure. Examples of critical control<br />
functions are emergency stop and overtravel stop, power outage and restart.<br />
Separate or redundant control paths must be provided for critical control<br />
functions.<br />
System control paths may include communication links. Consideration must be<br />
given to the implications of unanticipated transmission delays or failures of the<br />
link.<br />
Observe all accident prevention regulations and local safety guidelines. 1<br />
Each implementation of this equipment must be individually and thoroughly<br />
tested for proper operation before being placed into service.<br />
Failure to follow these instructions can result in death, serious injury, or<br />
equipment damage.<br />
1 For additional information, refer to NEMA ICS 1.1 (latest edition), "Safety<br />
Guidelines for the Application, Installation, and Maintenance of Solid State Control"<br />
and to NEMA ICS 7.1 (latest edition), "Safety Standards for Construction and Guide<br />
for Selection, Installation and Operation of Adjustable-Speed Drive Systems" or their<br />
equivalent governing your particular location.<br />
8 04/2012
User Comments<br />
UNINTENDED EQUIPMENT OPERATION<br />
WARNING<br />
Only use software approved by Schneider Electric for use with this equipment.<br />
Update your application program every time you change the physical hardware<br />
configuration.<br />
Failure to follow these instructions can result in death, serious injury, or<br />
equipment damage.<br />
We welcome your comments about this document. You can reach us by e-mail at<br />
techcomm@schneider-electric.com.<br />
04/2012 9
10 04/2012
Magelis XBT GC HMI Controller<br />
I/O Configuration<br />
04/2012<br />
I/O Configuration<br />
04/2012 11<br />
I
I/O Configuration<br />
12 04/2012
Introduction<br />
Magelis XBT GC HMI Controller<br />
Special I/O<br />
04/2012<br />
Special I/O Configuration<br />
This chapter describes how local I/Os can be configured as special I/Os.<br />
What’s in this Chapter?<br />
This chapter contains the following topics:<br />
04/2012 13<br />
1<br />
Topic Page<br />
Local and Special I/O Overview 14<br />
Special I/O Configuration Possibilities 16<br />
I/O Summary 19
Special I/O<br />
Local and Special I/O Overview<br />
Introduction<br />
Special I/O Types<br />
The XBT GC HMI Controller supports Local I/Os (see Magelis <strong>XBTGC</strong> HMI<br />
Controller, Programming Guide). There are:<br />
12 hardware inputs and 6 hardware outputs for the local I/Os of the<br />
XBT GC 1100 HMI Controller<br />
16 hardware inputs and 16 hardware outputs for the local I/Os of the<br />
XBT GC 2120 HMI Controller and the XBT GC 2230 HMI Controller<br />
The local I/O can be configured as special I/O. Special I/Os include:<br />
<strong>High</strong> Speed Counter (HSC) (see page 26)<br />
Pulse Train Output (PTO) (see Magelis <strong>XBTGC</strong> HMI Controller , Pulse Train<br />
Output, Pulse Width Modulation, <strong>XBTGC</strong> <strong>Library</strong> Guide),<br />
Pulse Width Modulation (PWM) (see Magelis <strong>XBTGC</strong> HMI Controller , Pulse<br />
Train Output, Pulse Width Modulation, <strong>XBTGC</strong> <strong>Library</strong> Guide) output<br />
Pulse Latch Input (PLI) (see Magelis <strong>XBTGC</strong> HMI Controller , Pulse Train Output,<br />
Pulse Width Modulation, <strong>XBTGC</strong> <strong>Library</strong> Guide)<br />
Special I/O Configuration<br />
Special I/Os are configured in four Groups. Each Group has two inputs (In and In+1 of Group n) and one output (Qn of Group n), as shown in the diagram below:<br />
NOTE: Any remaining I/Os can be configured as normal I/O. (see page 15).<br />
14 04/2012
Local I/Os and Special I/Os Configuration<br />
The following diagram provides the local and special I/Os configuration:<br />
Special I/O<br />
Legend<br />
1 The local I/Os for the XBT GC 1100 HMI Controller are from I8 to I11 and from<br />
Q4 to Q5.<br />
2 The local I/O for the XBT GC 2120 HMI Controller and the<br />
XBT GC 2230 HMI Controller are from I8 to I15 and from Q4 to Q15.<br />
Special I/Os Configuration Order<br />
When configuring special I/Os, follow the order shown in the diagram below:<br />
The special I/Os configuration depends on the number and type of HSC required.<br />
There are 3 cases:<br />
Case 1: (see page 16) No HSC is required, or only 1-Phase HSC is required (also<br />
referred to No 2-Phase HSC)<br />
Case 2: (see page 17) One 2-Phase HSC is required<br />
Case 3: (see page 18) Two 2-Phase HSC are required<br />
See more specific information in the HSC Configuration chapter (see page 45).<br />
04/2012 15
Special I/O<br />
Special I/O Configuration Possibilities<br />
Case 1: No 2-Phase HSC Combination<br />
All Groups can be configured independently as HSC, PLI or PTO/PWM:<br />
These Groups can provide the combinations shown in the following table:<br />
Main Functions I (2n) I (2n+1) Q (n)<br />
1-Phase HSC Input 1-Phase HSC Input Normal Input or<br />
Preload or<br />
Prestrobe<br />
Normal I/O, PWM or<br />
PTO<br />
Normal Output or<br />
Synchronized Output<br />
Normal Input Normal Input Normal Output or<br />
PWM or<br />
PTO<br />
PLI Pulse Latch Input Normal Input Normal Output<br />
NOTE: n is the Group number starting from 0 to 3 (HSC0n/PTO0n/Latch0n) where<br />
I( 2n ), I( 2n+1 ) and Q( n ) are the inputs and ouput respectively of the Group n.<br />
16 04/2012
Special I/O<br />
Case 2: One 2-Phase HSC Combination<br />
Group 0 and Group 1 form a 2-Phase HSC, the others can be configured as HSC,<br />
PLI or PTO/PWM:<br />
For this combination, Group 0 (HSC00) and Group 1 (HSC01) are combined to form<br />
a 2-Phase HSC. The following tables show the combinations available:<br />
I0 I1 Q0<br />
Counter 1A Normal Input or<br />
Preload or<br />
Prestrobe<br />
I2 I3 Q1<br />
Counter 1B Marker Input or<br />
Normal Input<br />
Normal Output or<br />
Synchronized Output<br />
Normal Output or<br />
PWM or<br />
PTO<br />
NOTE: Group 2 and Group 3 (HSC0n/PTO0n/Latch0n) follow the rules of the No 2-<br />
Phase HSC.<br />
One 2-Phase HSC Combinations Summary:<br />
The PLI function is not available on any input of the Group<br />
The PWM and PTO functions are available on the second output of the second<br />
HSC in the Group<br />
The Synchronized Output is available on the output of the first HSC in the Group<br />
04/2012 17
Special I/O<br />
Case 3: Two 2-Phase HSC Combination<br />
The following diagram shows the Two 2-Phase HSC Combination:<br />
For this combination, Group 0 (HSC00) and Group 1 (HSC01) are combined to form<br />
a 2-Phase HSC. Group 2 (HSC02) and Group 3 (HSC03) form another 2-Phase<br />
HSC. The following tables show the functions available:<br />
I0 or I4 I1 or I5 Q0 or Q2<br />
Counter 1A Normal Input or<br />
Preload or<br />
Prestrobe<br />
I2 or I6 I3 or I7 Q1 or Q3<br />
Counter 1B Normal Input or<br />
Preload or<br />
Prestrobe<br />
Normal Output or<br />
Synchronized Output<br />
Normal Output or<br />
Synchronized Output<br />
18 04/2012
I/O Summary<br />
Overview<br />
Special I/O<br />
The I/O summary shows the current I/O pin configuration for I/O nodes as HSC,<br />
PTO/PWM and PLI.<br />
To access the I/O summary, click the IO Summarize... button available on the<br />
configuration screen of each function.<br />
The following picture shows, as an example, the HSC IO Summary:<br />
NOTE: The IO Summarize... button is common to all functions and can be<br />
accessed from the configuration screen of each function: HSC, PTO/PWM and PLI.<br />
04/2012 19
Special I/O<br />
I/O Summary Window<br />
Click the IO Summarize button to display the following window:<br />
I/O Summary Messages<br />
If an I/O setting inconsistency is detected, the Configuration column from the IO<br />
Summary provides two types of messages:<br />
Error: Conflict happened on HSC and IO settings<br />
Error: Conflict happened on HSC and PTO/PWM settings<br />
20 04/2012
Special I/O<br />
Example of I/O Summary<br />
The following example shows the IO Summary window when I/O is configured as a<br />
standard input, with a Prestrobe input including a detected error message:<br />
04/2012 21
Special I/O<br />
22 04/2012
Introduction<br />
Magelis XBT GC HMI Controller<br />
HSC Principles<br />
04/2012<br />
HSC Principles<br />
04/2012 23<br />
II<br />
This part describes the HSC principles used with the XBT GC HMI Controller.<br />
What’s in this Part?<br />
This part contains the following chapters:<br />
Chapter Chapter Name Page<br />
2 HSC General Overview 25<br />
3 1-Phase HSC Counter 29<br />
4 2-Phase HSC Counter 37<br />
5 HSC Configuration 45
HSC Principles<br />
24 04/2012
Magelis XBT GC HMI Controller<br />
HSC Overview<br />
04/2012<br />
HSC General Overview<br />
What’s in this Chapter?<br />
This chapter contains the following topics:<br />
04/2012 25<br />
2<br />
Topic Page<br />
HSC Overview 26<br />
HSC General Characteristics 28
HSC Overview<br />
HSC Overview<br />
Concept<br />
The HSC function executes the <strong>counting</strong> of fast pulses from electronic sensors,<br />
encoders, switches, etc. The HSC function is independent from the XBT GC HMI<br />
Controller scan time.<br />
Two HSC types are available:<br />
1-Phase HSC (see page 29)<br />
2-Phase HSC (see page 37)<br />
For information on the XBT GC HMI Controller general I/O configuration, refer to I/O<br />
Configuration (see page 11).<br />
Maximum Number of Channels and Operating Frequency<br />
For information on the maximum number of HSC channels and their operating<br />
frequency, refer to HSC General Characteristics (see page 28).<br />
Use Case<br />
The following graph shows a typical use case. The synchronized output changes<br />
only when the counter value crosses the ON or OFF preset threshold values:<br />
NOTE: The 1-Phase HSC up-<strong>counting</strong> or down-<strong>counting</strong> depends of the Mode<br />
(see page 30) set from the HSC I/O configuration (see page 45) screen. Up<strong>counting</strong>/Down-<strong>counting</strong><br />
is available with the 2-Phase HSC only. The 1-Phase HSC<br />
offers up-<strong>counting</strong> or down-<strong>counting</strong> depending upon your selected mode from the<br />
HSC configuration screen.<br />
26 04/2012
HSC Overview<br />
Once the HSC is configured, it works independently from the application. Each event<br />
that occurs in the graph above is described in the table below:<br />
Event Number Description<br />
1 The counter crosses the ON preset upward<br />
Result: The synchronized output is set to a high level<br />
2 The counter crosses the OFF preset upward<br />
Result: The synchronized output is set to a low level<br />
3 The counter crosses the maximum count and resets to 0<br />
4 The counter crosses the OFF preset downward<br />
Result: The synchronized output is set to a high level<br />
5 The counter crosses the ON preset downward<br />
Result: The synchronized output is set to a low level<br />
6 The counter decreases to 0 and wraps back to the maximum count<br />
7 The direction of <strong>counting</strong> changes from up to down<br />
04/2012 27
HSC Overview<br />
HSC General Characteristics<br />
HSC Characteristics<br />
The following table shows the maximum frequency per HSC:<br />
HSC type Number of HSC Max. frequency (kHz) per<br />
HSC<br />
1-Phase HSC 4 4*25 100<br />
3 2*25 + 1*50<br />
2 2*50<br />
1 1*100<br />
2-Phase HSC 2 2*25 50<br />
1 1*50<br />
Total Max.<br />
frequency (kHz)<br />
28 04/2012
General<br />
Magelis XBT GC HMI Controller<br />
1-Phase HSC Counter<br />
04/2012<br />
1-Phase HSC Counter<br />
04/2012 29<br />
3<br />
This chapter describes the 1-Phase HSC Counter for the XBT GC HMI Controller.<br />
What’s in this Chapter?<br />
This chapter contains the following topics:<br />
Topic Page<br />
Overview 30<br />
Up/Rising Edge Counter Mode 31<br />
Down/Rising Edge Counter Mode 32<br />
Up/Falling Edge Counter Mode 33<br />
Down/Falling Edge Counter Mode 34<br />
Specifications 35
1-Phase HSC Counter<br />
Overview<br />
Introduction<br />
The 1-Phase HSC uses one hardware input as a counter input. When there is a<br />
pulse signal on the input, it can be a:<br />
count-up counter, or,<br />
count-down counter<br />
Configure the 1-Phase HSC using the modes available via the HSC Configuration<br />
screen (see page 45).<br />
1-Phase HSC Modes Overview<br />
Up/Rising edge Counter (see page 31)Mode:<br />
The counter counts up at each rising edge of the input.<br />
Down/Rising edge Counter (see page 32) Mode:<br />
The counter counts down at each rising edge of the input.<br />
Up/Falling edge Counter (see page 33) Mode:<br />
The counter counts up at each falling edge of the input.<br />
Down/Falling edge Counter (see page 34) Mode:<br />
The counter counts down at each the falling edge of the input.<br />
1-Phase HSC Specification<br />
Specification of this counter is described in the 1-Phase HSC Specification<br />
(see page 35).<br />
30 04/2012
Up/Rising Edge Counter Mode<br />
1-Phase HSC Counter<br />
Up/Rising Edge Counter Mode Description<br />
The following diagram shows the behavior of the 1-Phase HSC using the Up/Rising<br />
mode:<br />
On each rising edge of input 1A, the counter counts up.<br />
04/2012 31
1-Phase HSC Counter<br />
Down/Rising Edge Counter Mode<br />
Down/Rising Counter Mode Description<br />
The following diagram shows the behavior of the 1-Phase HSC using the<br />
Down/Rising mode:<br />
On each rising edge of input 1A, the counter counts down.<br />
32 04/2012
Up/Falling Edge Counter Mode<br />
1-Phase HSC Counter<br />
Up/Falling Counter Mode Description<br />
The following diagram shows the behavior of the 1-Phase HSC using the Up/Falling<br />
mode:<br />
On each falling edge of input 1A, the counter counts up.<br />
04/2012 33
1-Phase HSC Counter<br />
Down/Falling Edge Counter Mode<br />
Down/Falling Counter Mode Description<br />
The following diagram shows the behavior of the 1-Phase HSC using the mode<br />
Down/Falling:<br />
On each falling edge of input 1A, the counter counts down.<br />
34 04/2012
Specifications<br />
1-Phase HSC Specification<br />
The following table describes the 1-Phase HSC Specification:<br />
1-Phase HSC Counter<br />
Synchronized Output Specification<br />
The following table describes the synchronized output specification with the 1-<br />
Phase HSC:<br />
Preload Input<br />
Items Specification<br />
Low limit 0, see 1 and 2 below<br />
<strong>High</strong> limit 4,294,967,295 dec (FFFFFFFF hex)<br />
Start Counter Counter starts from the IEC application via the counter library<br />
Stop Counter Counter stops from the IEC application via the counter library<br />
Counting Up/Rising edge<br />
Modes Down/Rising edge<br />
Up/Falling edge<br />
Down/Rising edge<br />
NOTE: Refer to 1-Phase HSC Modes Overview (see page 30) and 1-Phase<br />
HSC Configuration Screen (see page 45) for more information.<br />
Counter clear Clears the counter value to 0 from the IEC application via the counter library<br />
Legend<br />
1 After the counter value reaches the low limit of 0 hex, the counter value is<br />
FFFFFFFF hex for the next input.<br />
2 After the counter value reaches the high limit of FFFFFFFF hex, the counter<br />
value is 0 hex for the next input.<br />
Items Specification<br />
Counting up The synchronized output when <strong>counting</strong> up is set to:<br />
ON when the value of the ON preset +1 is detected<br />
OFF when the value of the OFF preset +1 is detected<br />
Counting down The synchronized output when <strong>counting</strong> down is set to:<br />
OFF when the value of the ON preset -1 is detected<br />
ON when the value of the OFF preset -1 is detected<br />
Clear Clears synchronized output from the IEC application via the counter library<br />
The counter value is set to a pre-configured value when the Preload input pulse is<br />
detected. The pre-configured value is set via the user interface of the HSC.<br />
04/2012 35
1-Phase HSC Counter<br />
Prestrobe Input<br />
HSC Value Settings<br />
The counter value is written into an internal memory area. The value is retrieved<br />
from the IEC application via the counter library, using the function<br />
HMI_HSCGetCapturedValue (see page 57).<br />
Value Setting Specification<br />
ON preset From 0 to 4,294,967,295 dec (FFFFFFFF hex)<br />
OFF preset From 0 to 4,294,967,295 dec (FFFFFFFF hex)<br />
36 04/2012
General<br />
Magelis XBT GC HMI Controller<br />
2-Phase HSC Counter<br />
04/2012<br />
2-Phase HSC Counter<br />
04/2012 37<br />
4<br />
This chapter describes the 2-Phase HSC Counter for the XBT GC HMI Controller.<br />
What’s in this Chapter?<br />
This chapter contains the following topics:<br />
Topic Page<br />
Overview 38<br />
Mode 0 39<br />
Mode 1 40<br />
Mode 2 41<br />
Mode 3 42<br />
Specifications 43
2-Phase HSC Counter<br />
Overview<br />
Introduction<br />
2-Phase HSC Modes Overview<br />
The 2-Phase HSC uses the phase difference between two counter signals to<br />
perform count-up or count-down. There are four modes of phase difference:<br />
Mode 0: 2-Phase*4 (see page 39)<br />
Mode 1: Count + Direction (see page 40)<br />
Mode 2: Up + Down (see page 41)<br />
Mode 3: Two Phases*2 (see page 42)<br />
Mode 0 (2-Phase*4):<br />
The counter counts up or down depending on the order of the inputs.<br />
Mode 1 (Count + Direction):<br />
The counter counts up or down depending on the rising edge of one input and the<br />
value of the other input.<br />
Mode 2 (Up + Down):<br />
The counter counts up or down depending on the rising edge of one input and the<br />
value of the other input.<br />
Mode 3 (2-Phase*2):<br />
The counter counts up or down depending on the rising/falling edge of one input<br />
and depending on the order of the inputs.<br />
2-Phase HSC Specification<br />
Specification of this counter is described in the 2-Phase HSC Specification<br />
(see page 43).<br />
38 04/2012
Mode 0<br />
2-Phase HSC Counter<br />
Mode 0 Description<br />
The following diagram shows the behavior of the 2-Phase HSC using mode 0 (2-<br />
Phase*4):<br />
Input 1A<br />
Input 1B<br />
Counter<br />
Value<br />
Off Preset<br />
ON Preset<br />
Synchronized<br />
ouput<br />
If the rising edge of input 1A is enabled before the rising edge of input 1B, then the<br />
counter counts up. If the falling edge of input 1A is enabled after the falling edge of<br />
Input 1B, then the counter counts down.<br />
The following table provides the 2-Phase HSC behavior for inputs 1A and 1B:<br />
Input 1A Input 1B Counter Behavior<br />
1 (<strong>High</strong>) Rising edge Counts up<br />
0 (Low) Falling edge<br />
Falling edge 1 (<strong>High</strong>)<br />
Rising edge 0 (Low)<br />
1 (<strong>High</strong>) Falling edge Counts down<br />
0 (Low) Rising edge<br />
Rising edge 1 (<strong>High</strong>)<br />
Falling edge 0 (Low)<br />
04/2012 39
2-Phase HSC Counter<br />
Mode 1<br />
Mode 1 Description<br />
The following diagram shows the behavior of the 2-Phase HSC using mode 1 (Count<br />
+ Direction):<br />
The HSC counts up on the rising edge of input 1A when 1B is 0 (low). The HSC<br />
counts down in the rising edge of input 1A when 1B is 1 (high).<br />
The following table provides the 2-Phase HSC behavior for inputs 1A and 1B:<br />
Input 1A Input 1B Counter Behavior<br />
Rising edge 0 (Low) Counts up<br />
1 (<strong>High</strong>) Counts-down<br />
All other combinations All other combinations Does not count<br />
40 04/2012
Mode 2<br />
2-Phase HSC Counter<br />
Mode 2 Description<br />
The following diagram shows the behavior of the 2-Phase HSC using mode 2 (Up +<br />
Down):<br />
Input 1A<br />
Input<br />
Counter<br />
Value<br />
1B<br />
On Preset<br />
Synchronized<br />
Output<br />
The HSC counts up in the rising edge of input 1A when 1B is 0 (low). The HSC<br />
counts down in the rising edge of 1B when 1A is 0 (low).<br />
The following table provides the 2-Phase HSC behavior for inputs 1A and 1B:<br />
Input 1A Input 1B Counter Behavior<br />
Rising edge 0 (Low) Counts up<br />
0 (Low) Rising edge Counts down<br />
All other combinations All other combinations Does not count<br />
04/2012 41
2-Phase HSC Counter<br />
Mode 3<br />
Mode 3 Description<br />
The following diagram shows the behavior of the 2-Phase HSC using mode 3 (2-<br />
Phase*2):<br />
Input 1A<br />
Input 1B<br />
Counter<br />
Value<br />
Off Preset<br />
ON Preset<br />
Synchronized<br />
ouput<br />
The HSC counts up in the rising and falling edge when input 1A comes before input<br />
1B. The HSC counts down in the rising and falling edge when input 1A comes after<br />
input 1B.<br />
The following table provides the 2-Phase HSC behavior for inputs 1A and 1B:<br />
Input 1A Input 1B Counter Behavior<br />
1 (<strong>High</strong>) Rising edge Counts up<br />
0 (Low) Falling edge<br />
0 (Low) Rising edge Counts down<br />
1 (<strong>High</strong>) Falling edge<br />
All other combinations All other combinations Does not count<br />
42 04/2012
Specifications<br />
2-Phase HSC Specification<br />
The following table describes the 2-Phase HSC Specification:<br />
2-Phase HSC Counter<br />
Synchronized Output Specifications<br />
The following table describes the synchronized output specification with the 2-<br />
Phase HSC:<br />
Marker Input<br />
Preload Input<br />
Prestrobe Input<br />
Item Specification<br />
Low limit 0<br />
<strong>High</strong> limit 4,294,967,295 dec (FFFFFFFF hex)<br />
Start Counter Counter starts from the IEC application via the counter library<br />
Stop Counter Counter stops from the IEC application via the counter library<br />
Counting<br />
edge<br />
Rising edge or falling edge<br />
Counter clear Clears the counter value to 0 from the IEC application via the counter library<br />
Item Specification<br />
Counting up The synchronized output when <strong>counting</strong> up is set to:<br />
ON when the value of the ON preset +1 is detected<br />
OFF when the value of the OFF preset +1 is detected<br />
Counting down The synchronized output when <strong>counting</strong> down is set to:<br />
OFF when the value of the ON preset -1 is detected<br />
ON when the value of the OFF preset -1 is detected<br />
Clear Clear synchronized output from the IEC application via the counter library<br />
A hardware input sets the HSC value to 0. This is only available on the 2-Phase<br />
counters.<br />
The counter value is set to a pre-configured value when the Preload input pulse is<br />
detected. The pre-configured value is set via the user interface of the HSC.<br />
The counter value is written into an internal memory area. The value is retrieved<br />
from the IEC application via the counter library, using the function<br />
HMI_HSCGetCapturedValue (see page 57).<br />
04/2012 43
2-Phase HSC Counter<br />
HSC Value Settings<br />
The following table shows the value settings of the HSC:<br />
Value Setting Specification<br />
ON preset From 0 to 4,294,967,295 dec (FFFFFFFF hex)<br />
OFF preset From 0 to 4,294,967,295 dec (FFFFFFFF hex)<br />
44 04/2012
Magelis XBT GC HMI Controller<br />
HSC Configuration<br />
04/2012<br />
HSC Configuration Screen<br />
HSC Configuration<br />
04/2012 45<br />
5<br />
Accessing the HSC Configuration Screen<br />
You can access the HSC configuration screen from the Devices window, as<br />
explained in the procedure below:<br />
Step Action<br />
1 Access the Devices window<br />
2 Click Embedded Functions → HSC (HSC)<br />
Result: The HSC I/O Configuration window appears
HSC Configuration<br />
HSC Configuration Screen<br />
The following screenshot shows the entire HSC configuration screen:<br />
Properties of the HSC Configuration Screen<br />
The following table describes the properties of the HSC Configuration screen:<br />
Parameters Initial Value Range Description<br />
Phase Type Not used Not Used Select the HSC counter<br />
1-Phase<br />
2-Phase 1 HSC<br />
2-Phase 2 HSC<br />
type<br />
46 04/2012
I/O Summary<br />
HSC Configuration<br />
Parameters Initial Value Range Description<br />
IN (2n+1) Not used Not Used<br />
Normal Input<br />
Preload<br />
Prestrobe<br />
Select the input pin type<br />
Out(n) Not used Normal Ouput<br />
Synchronized Output<br />
Select the ouput pin type<br />
Mode (1-Phase) Up/Rising Up/Rising edge Counter Select the 1-Phase HSC<br />
Edge<br />
Down/Rising edge Counter<br />
Up/Falling edge Counter<br />
Down/Falling edge Counter<br />
counter mode<br />
Mode (2-Phase) Mode 0 Mode 0 Select the 2-Phase HSC<br />
Mode 1<br />
Mode 2<br />
Mode 3<br />
counter mode<br />
On Preload 1000 0 - 4,294,967,295 Set the On Preload<br />
value<br />
On Preset 2000 0 - 4,294,967,295 Set the On Preset value<br />
Off Preset 2000 0 - 4,294,967,295 Set the Off Preset value<br />
When selecting HSC → Counter Type → Phase Type as 1-Phase HSC counter<br />
from the I/O Configuration window, you can configure:<br />
Each of the four HSC groups as 1-Phase HSC counter<br />
When selecting HSC → Counter Type → Phase Type as a 2-Phase 1 HSC from<br />
the I/O Configuration window:<br />
Group 0 (HSC00) and 1 (HSC01) form a 2-Phase HSC counter<br />
Group 2 (HSC02) and 3 (HSC03) can be configured as 1-Phase HSC counter<br />
When selecting HSC → Counter Type → Phase Type as a 2-Phase 2 HSC from<br />
the I/O Configuration window:<br />
Group 0 (HSC00) and 1 (HSC01) form a 2-Phase HSC counter<br />
Group 2 (HSC02) and 3 (HSC03) form another 2-Phase HSC counter<br />
The I/O Summarize... button is described in the I/O Summary (see page 19)<br />
section.<br />
04/2012 47
HSC Configuration<br />
48 04/2012
Introduction<br />
Magelis XBT GC HMI Controller<br />
HSC <strong>Library</strong><br />
04/2012<br />
HSC <strong>Library</strong><br />
III<br />
This part describes the data types and functions of the XBT GC HMI Controller.<br />
What’s in this Part?<br />
This part contains the following chapters:<br />
Chapter Chapter Name Page<br />
6 General Information 51<br />
7 Functions 53<br />
04/2012 49
HSC <strong>Library</strong><br />
50 04/2012
Magelis XBT GC HMI Controller<br />
General Information<br />
04/2012<br />
Dedicated Functions<br />
General Information<br />
Using Dedicated Functions<br />
Once dedicated functions such as HSC, PLI and PTO/PWM outputs are configured,<br />
certain inputs and outputs are dedicated to the function or function blocks that<br />
control them.<br />
WARNING<br />
04/2012 51<br />
6<br />
UNINTENDED EQUIPMENT OPERATION<br />
Do not modify a function, function block references or parameter values while the<br />
function or the function block is active (executing).<br />
Failure to follow these instructions can result in death, serious injury, or<br />
equipment damage.<br />
The function block instance name must match the name defined by configuration.<br />
Hardware related information managed by this function block is synchronized with<br />
the MAST task cycle.<br />
UNINTENDED OUTPUT VALUES<br />
WARNING<br />
Only use the Function Block instance in the MAST task.<br />
Do not use the same Function Block instance in a different task.<br />
Failure to follow these instructions can result in death, serious injury, or<br />
equipment damage.<br />
NOTE: Forcing the logical output values of the FB is allowed by SoMachine but it<br />
will have no impact on hardware related outputs if the function is active (executing).
General Information<br />
52 04/2012
Overview<br />
Magelis XBT GC HMI Controller<br />
Functions<br />
04/2012<br />
Functions<br />
This chapter describes the functions of the HSC <strong>Library</strong>.<br />
What’s in this Chapter?<br />
This chapter contains the following topics:<br />
04/2012 53<br />
7<br />
Topic Page<br />
HMI_HSCStart: Start the HSC 54<br />
HMI_HSCStop: Stop the HSC 55<br />
HMI_HSCGetCurrentValue: Get the HSC Current Value 56<br />
HMI_HSCGetCapturedValue: Get the HSC Value 57<br />
HMI_GetSynchronizedOutput: Get Synchronized Output Status 58<br />
HMI_ClearSynchronizedOutput: Clear Synchronized Output Status 59<br />
HMI_SetCounterValue: Set the HSC Value 60<br />
HMI_ClearCounterValue: Clear the HSC Value 61<br />
HMI_GetPreLoadStatus: Detect Preload Input Signal 62<br />
HMI_ClearPreLoadStatus: Clear PreLoad Status 63<br />
HMI_GetPreStrobeStatus: Get PreStrobe Status 64<br />
HMI_ClearPreStrobeStatus: Clear PreStrobe Status 65<br />
HMI_GetMarkerStatus: Detect Hardware Marker Input Signal 66<br />
HMI_ClearMarkerStatus: Clear the Marker Status 67
Functions<br />
HMI_HSCStart: Start the HSC<br />
Function Description<br />
This function is used to start the HSC function. The couting is enabled and any<br />
pulses present before the start of the HSC counter are ignored.<br />
Graphical Representation (LD/FBD)<br />
IL and ST Representation<br />
To see the general representation in IL or ST language, please refer to the chapter<br />
How to Use IL and ST Representation (see page 71).<br />
Parameter Description<br />
The following table describes the input parameters:<br />
Parameter Type Comment<br />
Enable VAR_INPUT Enable if true<br />
CH VAR_INPUT Channel number of the HSC 1<br />
Legend<br />
1 An out of range CH value sets the FB output to a false state. The CH values<br />
can be:<br />
For a 1-Phase HSC: from 0 to 3<br />
For a one 2-Phase HSC: 0<br />
For a two 2-Phase HSC: 0 or 2<br />
The following table describes the output parameter:<br />
Parameter Type Comment<br />
HMI_HSCStart VAR_OUTPUT HSC started successfully<br />
54 04/2012
HMI_HSCStop: Stop the HSC<br />
Function Description<br />
This function is used to stop the HSC function.<br />
Graphical Representation (LD/FBD)<br />
Functions<br />
IL and ST Representation<br />
To see the general representation in IL or ST language, please refer to the chapter<br />
How to Use IL and ST Representation (see page 71).<br />
Parameter Description<br />
The following table describes the input parameters:<br />
Parameter Type Comment<br />
Enable VAR_INPUT Enable if true<br />
CH VAR_INPUT Channel number of the HSC1 Legend<br />
1 An out of range CH value sets the FB output to a false state.<br />
The CH values can be:<br />
For a 1-Phase HSC: from 0 to 3<br />
For a one 2-Phase HSC: 0<br />
For a two 2-Phase HSC: 0 or 2<br />
The following table describes the output parameter:<br />
Parameter Type Comment<br />
HMI_HSCStop VAR_OUTPUT HSC stopped successfully<br />
04/2012 55
Functions<br />
HMI_HSCGetCurrentValue: Get the HSC Current Value<br />
Function Description<br />
This function is used to get the current value of the HSC.<br />
Graphical Representation (LD/FBD)<br />
IL and ST Representation<br />
To see the general representation in IL or ST language, please refer to the chapter<br />
How to Use IL and ST Representation (see page 71).<br />
Parameter Description<br />
The following table describes the input parameters:<br />
Parameter Type Comment<br />
Enable VAR_INPUT Enable if true<br />
CH VAR_INPUT Channel number of the HSC1 Legend<br />
1 An out of range CH value sets the FB output to a false state.<br />
The CH values can be:<br />
For a 1-Phase HSC: from 0 to 3<br />
For a one 2-Phase HSC: 0<br />
For a two 2-Phase HSC: 0 or 2<br />
The following table describes the output parameter:<br />
Parameter Type Comment<br />
HMI_HSCGetCurrentValue VAR_OUTPUT HSC current value<br />
56 04/2012
HMI_HSCGetCapturedValue: Get the HSC Value<br />
Functions<br />
Function Description<br />
This function is used to get the HSC value when the PreStrobe input is triggered.<br />
Graphical Representation (LD/FBD)<br />
IL and ST Representation<br />
To see the general representation in IL or ST language, please refer to the chapter<br />
How to Use IL and ST Representation (see page 71).<br />
Parameter Description<br />
The following table describes the input parameters:<br />
Parameter Type Comment<br />
Enable VAR_INPUT Enable if true<br />
CH VAR_INPUT Channel number of the HSC1 Legend<br />
1 An out of range CH value sets the FB output to a false state.<br />
The CH values can be:<br />
For a 1-Phase HSC: from 0 to 3<br />
For a one 2-Phase HSC: 0<br />
For a two 2-Phase HSC: 0 or 2<br />
The following table describes the output parameter:<br />
Parameter Type Comment<br />
HMI_HSCGetCapturedValue VAR_OUTPUT HSC value on PreStrobe input<br />
trigger<br />
04/2012 57
Functions<br />
HMI_GetSynchronizedOutput: Get Synchronized Output Status<br />
Function Description<br />
This function is used to get the status of the synchronized output.<br />
Graphical Representation (LD/FBD)<br />
IL and ST Representation<br />
To see the general representation in IL or ST language, please refer to the chapter<br />
How to Use IL and ST Representation (see page 71).<br />
Parameter Description<br />
The following table describes the input parameters:<br />
Parameter Type Comment<br />
Enable VAR_INPUT Enable if true<br />
CH VAR_INPUT Channel number of the HSC1 Legend<br />
1 An out of range CH value sets the FB output to a false state.<br />
The CH values can be:<br />
For a 1-Phase HSC: from 0 to 3<br />
For a one 2-Phase HSC: 0<br />
For a two 2-Phase HSC: 0 or 2<br />
The following table describes the output parameter:<br />
Parameter Type Comment<br />
HMI_GetSynchronizedOutput VAR_OUTPUT The function returns a true<br />
state on a synchronized output<br />
detection, and a false state<br />
otherwise.<br />
58 04/2012
HMI_ClearSynchronizedOutput: Clear Synchronized Output Status<br />
Function Description<br />
This function is used to clear the status of synchronized ouput.<br />
Graphical Representation (LD/FBD)<br />
Functions<br />
After the operation is completed, synchronized outputs are managed according to:<br />
the counter evolution<br />
the ON and OFF preset values<br />
IL and ST Representation<br />
To see the general representation in IL or ST language, please refer to the chapter<br />
How to Use IL and ST Representation (see page 71).<br />
Parameter Description<br />
The following table describes the input parameters:<br />
Parameter Type Comment<br />
Enable VAR_INPUT Clear Status if true<br />
CH VAR_INPUT Channel number of the HSC1 Legend<br />
1 An out of range CH value sets the FB output to a false state.<br />
The CH values can be:<br />
For a 1-Phase HSC: from 0 to 3<br />
For a one 2-Phase HSC: 0<br />
For a two 2-Phase HSC: 0 or 2<br />
The following table describes the output parameter:<br />
Parameter Type Comment<br />
HMI_ClearSynchronizedOutput VAR_OUTPUT The function returns a<br />
true state if successful<br />
and a false state<br />
otherwise.<br />
04/2012 59
Functions<br />
HMI_SetCounterValue: Set the HSC Value<br />
Function Description<br />
This function is used to set the HSC value.<br />
Graphical Representation (LD/FBD)<br />
IL and ST Representation<br />
To see the general representation in IL or ST language, please refer to the chapter<br />
How to Use IL and ST Representation (see page 71).<br />
Parameter Description<br />
The following table describes the input parameters:<br />
Parameter Type Comment<br />
Enable VAR_INPUT Set if true<br />
CH VAR_INPUT Channel number of the HSC1 NewValue<br />
Legend<br />
VAR_INPUT Value to set<br />
1 An out of range CH value sets the FB output to a false state.<br />
The CH values can be:<br />
For a 1-Phase HSC: from 0 to 3<br />
For a one 2-Phase HSC: 0<br />
For a two 2-Phase HSC: 0 or 2<br />
The following table describes the output parameter:<br />
Parameter Type Comment<br />
HMI_SetCounterValue VAR_OUTPUT The function returns a true state if<br />
successful and a false state<br />
otherwise.<br />
60 04/2012
HMI_ClearCounterValue: Clear the HSC Value<br />
Function Description<br />
This function is used to clear the HSC value (set to 0).<br />
Graphical Representation (LD/FBD)<br />
Functions<br />
IL and ST Representation<br />
To see the general representation in IL or ST language, please refer to the chapter<br />
How to Use IL and ST Representation (see page 71).<br />
Parameter Description<br />
The following table describes the input parameters:<br />
Parameter Type Comment<br />
Enable VAR_INPUT Clear if true<br />
CH VAR_INPUT Channel number of the HSC 1<br />
Legend<br />
1 An out of range CH value sets the FB output to a false state.<br />
The CH values can be:<br />
For a 1-Phase HSC: from 0 to 3<br />
For a one 2-Phase HSC: 0<br />
For a two 2-Phase HSC: 0 or 2<br />
The following table describes the output parameter:<br />
Parameter Type Comment<br />
HMI_ClearCounterValue VAR_OUTPUT The function returns a true state if<br />
successful and a false state<br />
otherwise.<br />
04/2012 61
Functions<br />
HMI_GetPreLoadStatus: Detect Preload Input Signal<br />
Function Description<br />
This function is used to detect a hardware Preload input signal. The Preload status<br />
must be cleared prior the next Preload status detection.<br />
Graphical Representation (LD/FBD)<br />
IL and ST Representation<br />
To see the general representation in IL or ST language, please refer to the chapter<br />
How to Use IL and ST Representation (see page 71).<br />
Parameter Description<br />
The following table describes the input parameters:<br />
Parameter Type Comment<br />
Enable VAR_INPUT Get Status if true<br />
CH VAR_INPUT Channel number of the HSC1 Legend<br />
1 An out of range CH value sets the FB output to a false state.<br />
The CH values can be:<br />
For a 1-Phase HSC: from 0 to 3<br />
For a one 2-Phase HSC: 0<br />
For a two 2-Phase HSC: 0 or 2<br />
The following table describes the output parameter:<br />
Parameter Type Comment<br />
HMI_GetPreLoadStatus VAR_OUTPUT The function returns a true state if<br />
successful and a false state<br />
otherwise.<br />
62 04/2012
HMI_ClearPreLoadStatus: Clear PreLoad Status<br />
Functions<br />
Function Description<br />
This function is used to clear the PreLoad status in order to detect the next PreLoad<br />
hardware input trigger.<br />
Graphical Representation (LD/FBD)<br />
IL and ST Representation<br />
To see the general representation in IL or ST language, please refer to the chapter<br />
How to Use IL and ST Representation (see page 71).<br />
Parameter Description<br />
The following table describes the input parameters:<br />
Parameter Type Comment<br />
Enable VAR_INPUT Clear PreLoad status if true<br />
CH VAR_INPUT Channel number of the HSC1 Legend<br />
1 An out of range CH value sets the FB output to a false state.<br />
The CH values can be:<br />
For a 1-Phase HSC: from 0 to 3<br />
For a one 2-Phase HSC: 0<br />
For a two 2-Phase HSC: 0 or 2<br />
The following table describes the output parameter:<br />
Parameter Type Comment<br />
HMI_ClearPreLoadStatus VAR_OUTPUT The function returns a true state if<br />
successful and a false state<br />
otherwise.<br />
04/2012 63
Functions<br />
HMI_GetPreStrobeStatus: Get PreStrobe Status<br />
Function Description<br />
This function is used to detect a hardware PreStrobe input signal. The PreStrobe<br />
status must be cleared prior the next PreStrobe status detection.<br />
Graphical Representation (LD/FBD)<br />
IL and ST Representation<br />
To see the general representation in IL or ST language, please refer to the chapter<br />
How to Use IL and ST Representation (see page 71).<br />
Parameter Description<br />
The following table describes the input parameters:<br />
Parameter Type Comment<br />
Enable VAR_INPUT Get PreLoad Status if true<br />
CH VAR_INPUT Channel number of the HSC1 Legend<br />
1 An out of range CH value sets the FB output to a false state.<br />
The CH values can be:<br />
For a 1-Phase HSC: from 0 to 3<br />
For a one 2-Phase HSC: 0<br />
For a two 2-Phase HSC: 0 or 2<br />
The following table describes the output parameter:<br />
Parameter Type Comment<br />
HMI_GetPreStrobeStatus VAR_OUTPUT The function returns a true state if<br />
the PreStrobe input signal is<br />
detected and a false state<br />
otherwise.<br />
64 04/2012
HMI_ClearPreStrobeStatus: Clear PreStrobe Status<br />
Function Description<br />
This function is used to clear the PreStrobe status in order to detect the next<br />
PreStrobe hardware input trigger.<br />
Graphical Representation (LD/FBD)<br />
Functions<br />
IL and ST Representation<br />
To see the general representation in IL or ST language, please refer to the chapter<br />
How to Use IL and ST Representation (see page 71).<br />
Parameter Description<br />
The following table describes the input parameters:<br />
Parameter Type Comment<br />
Enable VAR_INPUT Enable if true<br />
CH VAR_INPUT Channel number of the HSC1 Legend<br />
1 An out of range CH value sets the FB output to a false state.<br />
The CH values can be:<br />
For a 1-Phase HSC: from 0 to 3<br />
For a one 2-Phase HSC: 0<br />
For a two 2-Phase HSC: 0 or 2<br />
The following table describes the output parameter:<br />
Parameter Type Comment<br />
HMI_ClearPreStrobeStatus VAR_OUTPUT The function returns a true<br />
state if successful and a false<br />
state otherwise.<br />
04/2012 65
Functions<br />
HMI_GetMarkerStatus: Detect Hardware Marker Input Signal<br />
Function Description<br />
This function is used to detect a hardware marker input signal. The marker status<br />
must be cleared before the next marker status detection.<br />
Graphical Representation (LD/FBD)<br />
IL and ST Representation<br />
To see the general representation in IL or ST language, please refer to the chapter<br />
How to Use IL and ST Representation (see page 71).<br />
Parameter Description<br />
The following table describes the input parameters:<br />
Parameter Type Comment<br />
Enable VAR_INPUT Enable if true<br />
CH VAR_INPUT Channel number of the HSC 1<br />
Legend<br />
1 An out of range CH value sets the FB output to a false state.<br />
The CH values can be:<br />
For a 1-Phase HSC: from 0 to 3<br />
For a one 2-Phase HSC: 0<br />
For a two 2-Phase HSC: 0 or 2<br />
The following table describes the output parameter:<br />
Parameter Type Comment<br />
HMI_GetMarkerStatus VAR_OUTPUT The function returns a true state if<br />
there is a marker signal and a false<br />
state otherwise.<br />
66 04/2012
HMI_ClearMarkerStatus: Clear the Marker Status<br />
Functions<br />
Function Description<br />
This function is used to clear the marker status in order to detect the next marker<br />
input trigger (rising edge).<br />
Graphical Representation (LD/FBD)<br />
IL and ST Representation<br />
To see the general representation in IL or ST language, please refer to the How to<br />
Use IL and ST Representation (see page 71) chapter.<br />
Parameter Description<br />
The following table describes the input parameters:<br />
Parameter Type Comment<br />
Enable VAR_INPUT Enable if true<br />
CH VAR_INPUT Channel number of the HSC1 Legend<br />
1 An out of range CH value sets the FB output to a false state.<br />
The CH values can be:<br />
For a 1-Phase HSC: from 0 to 3<br />
For a one 2-Phase HSC: 0<br />
For a two 2-Phase HSC: 0 or 2<br />
The following table describes the output parameter:<br />
Parameter Type Comment<br />
HMI_ClearMarkerStatus VAR_OUTPUT The function returns a true state if<br />
successful and a false state<br />
otherwise.<br />
04/2012 67
Functions<br />
68 04/2012
Magelis XBT GC HMI Controller<br />
04/2012<br />
Appendices<br />
04/2012 69
70 04/2012
Overview<br />
Magelis XBT GC HMI Controller<br />
Function and Function Block Representation<br />
04/2012<br />
Function and Function Block<br />
Representation<br />
Each function can be represented in the following languages:<br />
IL: Instruction List<br />
ST: Structured Text<br />
LD: Ladder Diagram<br />
FBD: Function Block Diagram<br />
CFC: Continuous Function Chart<br />
A<br />
This chapter provides functions and function blocks representation examples and<br />
explains how to use them for IL and ST languages.<br />
What’s in this Chapter?<br />
This chapter contains the following topics:<br />
Topic Page<br />
Differences Between a Function and a Function Block 72<br />
How to Use a Function or a Function Block in IL Language 73<br />
How to Use a Function or a Function Block in ST Language 76<br />
04/2012 71
Function and Function Block Representation<br />
Differences Between a Function and a Function Block<br />
Function<br />
Function Block<br />
A function:<br />
is a POU (Program Organization Unit) that returns one immediate result<br />
is directly called with its name (not through an Instance)<br />
has no persistent state from one call to the other<br />
can be used as an operand in other expressions<br />
Examples: boolean operators (AND), calculations, conversion (BYTE_TO_INT)<br />
A function block:<br />
is a POU (Program Organization Unit) that returns one or more outputs<br />
is always called through an Instance (function block copy with dedicated name<br />
and variables)<br />
each Instance has a persistent state (outputs and internal variables) from one<br />
call to the other<br />
Examples: timers, counters<br />
In the example below, Timer_ON is an instance of the Function Block TON:<br />
72 04/2012
How to Use a Function or a Function Block in IL Language<br />
Function and Function Block Representation<br />
General Information<br />
This part explains how to implement a Function and a Function Block in IL language.<br />
Functions IsFirstMastCycle and SetRTCDrift and Function Block TON are<br />
used as examples to show implementations.<br />
Using a Function in IL Language<br />
The following procedure describes how to insert a function in IL language:<br />
Step Action<br />
1 Open or create a new POU in Instruction List language.<br />
NOTE: The procedure to create a POU is not detailed here. For more information, refer to the SoMachine<br />
global help.<br />
2 Create the variables that the function requires.<br />
3 If the function has 1 or more inputs, start loading the first input using LD instruction.<br />
4 Insert a new line below and:<br />
type the name of the function in the operator column (left field), or<br />
use the Input Assistant to select the function (select Insert Box in context menu).<br />
5 If the function has more than 1 input and when Input Assistant is used, the necessary number of lines is<br />
automatically created with ??? in the fields on the right. Replace the ??? with the appropriate value or<br />
variable that corresponds to the order of inputs.<br />
6 Insert a new line to store the result of the function into the appropriate variable: type ST instruction in the<br />
operator column (left field) and the variable name in the field on the right.<br />
To illustrate the procedure, consider the Functions IsFirstMastCycle (without<br />
input parameter) and SetRTCDrift (with input parameters) graphically presented<br />
below:<br />
Function Graphical Representation<br />
without input parameter:<br />
IsFirstMastCycle<br />
with input parameters:<br />
SetRTCDrift<br />
04/2012 73
Function and Function Block Representation<br />
In IL language, the function name is used directly in the Operator Column:<br />
Function Representation in SoMachine POU IL Editor<br />
IL example of a function<br />
without input parameter:<br />
IsFirstMastCycle<br />
IL example of a function<br />
with input parameters:<br />
SetRTCDrift<br />
Using a Function Block in IL language<br />
The following procedure describes how to insert a function block in IL language:<br />
Step Action<br />
1 Open or create a new POU in Instruction List language.<br />
NOTE: The procedure to create a POU is not detailed here. For more information, refer to the SoMachine<br />
global help.<br />
2 Create the variables that the function block requires, including the instance name.<br />
74 04/2012
Step Action<br />
Function and Function Block Representation<br />
3 Function Blocks are called using a CAL instruction:<br />
Use the Input Assistant to select the FB (right-click and select Insert Box in context menu).<br />
Automatically, the CAL instruction and the necessary I/O are created.<br />
Each parameter (I/O) is an instruction:<br />
Value to inputs are set by ":=".<br />
Values to outputs are set by "=>".<br />
4 In the CAL right-side field, replace ??? with the instance name.<br />
5 Replace other ??? with an appropriate variable or immediate value.<br />
To illustrate the procedure, consider this example with the TON Function Block<br />
graphically presented below:<br />
Function Block Graphical Representation<br />
TON<br />
In IL language, the function block name is used directly in the Operator Column:<br />
Function Block Representation in SoMachine POU IL Editor<br />
TON<br />
04/2012 75
Function and Function Block Representation<br />
How to Use a Function or a Function Block in ST Language<br />
General Information<br />
This part explains how to implement a Function and a Function Block in ST<br />
language.<br />
Function SetRTCDrift and Function Block TON are used as examples to show<br />
implementations.<br />
Using a Function in ST Language<br />
The following procedure describes how to insert a function in ST language:<br />
Step Action<br />
1 Open or create a new POU in Structured Text language.<br />
NOTE: The procedure to create a POU is not detailed here. For more information, refer to the SoMachine<br />
global help.<br />
2 Create the variables that the function requires.<br />
3 Use the general syntax in the POU ST Editor for the ST language of a function. The general syntax is:<br />
FunctionResult:= FunctionName(VarInput1, VarInput2,.. VarInputx);<br />
To illustrate the procedure, consider the function SetRTCDrift graphically<br />
presented below:<br />
Function Graphical Representation<br />
SetRTCDrift<br />
The ST language of this function is the following:<br />
Function Representation in SoMachine POU ST Editor<br />
SetRTCDrift PROGRAM MyProgram_ST<br />
VAR myDrift: SINT(-29..29) := 5;<br />
myDay: DAY_OF_WEEK := SUNDAY;<br />
myHour: HOUR := 12;<br />
myMinute: MINUTE;<br />
myRTCAdjust: RTCDRIFT_ERROR;<br />
END_VAR<br />
myRTCAdjust:= SetRTCDrift(myDrift, myDay, myHour, myMinute);<br />
76 04/2012
Function and Function Block Representation<br />
Using a Function Block in ST Language<br />
The following procedure describes how to insert a function block in ST language:<br />
Step Action<br />
1 Open or create a new POU in Structured Text language.<br />
NOTE: The procedure to create a POU is not detailed here. For more information, refer to the SoMachine<br />
global help.<br />
2 Create the input and output variables and the instance required for the function block:<br />
Input variables are the input parameters required by the function block<br />
Output variables receive the value returned by the function block<br />
3 Use the general syntax in the POU ST Editor for the ST language of a Function Block. The general syntax<br />
is:<br />
FunctionBlock_InstanceName(Input1:=VarInput1, Input2:=VarInput2,...<br />
Ouput1=>VarOutput1, Ouput2=>VarOutput2,...);<br />
To illustrate the procedure, consider this example with the TON function block<br />
graphically presented below:<br />
Function Block Graphical Representation<br />
TON<br />
The following table shows examples of a function block call in ST language:<br />
Function Block Representation in SoMachine POU ST Editor<br />
TON<br />
04/2012 77
Function and Function Block Representation<br />
78 04/2012
1-phase counter<br />
2-phase counter<br />
BOOL<br />
Boot application<br />
Magelis XBT GC HMI Controller<br />
Glossary<br />
04/2012<br />
Glossary<br />
0-9<br />
A 1-phase counter uses 1 hardware input as counter input. It usually counts up or<br />
counts down when there is pulse signal in the input.<br />
A 2-phase counter uses the phase difference between 2 input counter signals to<br />
count up or count down.<br />
B<br />
A Boolean type is the basic data type in computing. A BOOL variable can have one<br />
of these values: 0 (FALSE), 1 (TRUE). A bit that is extracted from a word is of type<br />
BOOL, for example: %MW10.4 is a fifth bit a memory word number 10.<br />
Files that contain machine dependent parameters:<br />
machine name<br />
device name or IP address<br />
Modbus Serial Line address<br />
Routing table<br />
04/2012 79
Glossary<br />
BOOTP<br />
BYTE<br />
CAN<br />
CANopen<br />
CFC<br />
controller<br />
The Bootstrap Protocol is a UDP network protocol that can be used by a network<br />
client to automatically obtain an IP address (and possibly other data) from a server.<br />
The client identifies itself to the server using the client’s MAC address. The server—<br />
which maintains a pre-configured table of client device MAC addresses and<br />
associated IP addresses—sends the client its pre-configured IP address. BOOTP<br />
was originally used as a method that enabled diskless hosts to be remotely booted<br />
over a network. The BOOTP process assigns an infinite lease of an IP address. The<br />
BOOTP service utilizes UDP ports 67 and 68.<br />
When 8 bits are grouped together, they are called a BYTE. You can enter a BYTE<br />
either in binary mode or in base 8. The BYTE type is encoded in an 8-bit format that<br />
ranges from 16#00 to 16#FF (in hexadecimal format).<br />
C<br />
The Controller Area Network protocol (ISO 11898) for serial bus networks is<br />
designed for the interconnection of smart devices (from multiple manufacturers) in<br />
smart systems for real-time industrial applications. CAN multi-master systems<br />
ensure high data integrity through the implementation of broadcast messaging and<br />
advanced diagnostic mechanisms. Originally developed for use in automobiles,<br />
CAN is now used in a variety of industrial automation control environments.<br />
CANopen is an open industry-standard communication protocol and device profile<br />
specification.<br />
The Continuous Function Chart (an extension of the IEC61131-3 standard) is a<br />
graphical programming language that works like a flowchart. By adding simple<br />
logicals blocks (AND, OR, etc.), each function or function block in the program is<br />
represented in this graphical format. For each block, the inputs are on the left and<br />
the outputs on the right. Block outputs can be linked to inputs of other blocks in order<br />
to create complex expressions.<br />
A controller (or “programmable logic controller,” or “programmable controller”) is<br />
used to automate industrial processes.<br />
80 04/2012
expansion bus<br />
E<br />
Glossary<br />
The expansion bus is an electronic communication bus between expansion modules<br />
and a CPU.<br />
expansion I/O module<br />
An expansion input or output module is either a digital or analog module that adds<br />
additional I/O to the base controller.<br />
FBD<br />
firmware<br />
Function Block<br />
F<br />
A Function Block Diagram is a graphically oriented programming language,<br />
compliant with IEC 61131-3. It works with a list of networks whereby each network<br />
contains a graphical structure of boxes and connection lines which represents either<br />
a logical or arithmetic expression, the call of a function block, a jump, or a return<br />
instruction.<br />
The firmware represents the operating system on a controller.<br />
(FB) A Program unit of inputs and variables organized to calculate values for outputs<br />
based on a defined function such as a timer or a counter.<br />
Function Block Diagram language<br />
(FBD) A function block diagram describes a function between input variables and<br />
output variables. A function is described as a set of elementary blocks. Input and<br />
output variables are connected to blocks by connection lines. An output of a block<br />
may also be connected to an input of another block.<br />
GVL<br />
G<br />
The Global Variable List manages global variables that are available in every<br />
application POU.<br />
04/2012 81
Glossary<br />
HMI<br />
HSC<br />
IEC 61131-3<br />
IL<br />
LD<br />
located variable<br />
H<br />
A human-machine interface is an operator interface (usually graphical) for industrial<br />
equipment.<br />
high-<strong>speed</strong> counter<br />
I<br />
The IEC 61131-3 is an international electrotechnical commission standard for<br />
industrial automation equipment (like controllers). IEC 61131-3 deals with controller<br />
programming languages and defines 2 graphical and 2 textual programming<br />
language standards:<br />
graphical: ladder diagram, function block diagram<br />
textual: structured text, instruction list<br />
A program written in the Instruction List language is composed of a series of<br />
instructions executed sequentially by the controller. Each instruction includes a line<br />
number, an instruction code, and an operand. (IL is IEC 61131-3 compliant.)<br />
L<br />
A program in the Ladder Diagram language includes a graphical representation of<br />
instructions of a controller program with symbols for contacts, coils, and blocks in a<br />
series of rungs executed sequentially by a controller. IEC 61131-3 compliant.<br />
A located variable has an address. (See unlocated variable.)<br />
82 04/2012
Modbus<br />
NEMA<br />
PLC<br />
PLI<br />
POU<br />
PTO<br />
M<br />
The Modbus communication protocol allows communications between many<br />
devices connected to the same network.<br />
N<br />
Glossary<br />
The National Electrical Manufacturers Association publishes standards for the<br />
performance of various classes of electrical enclosures. The NEMA standards cover<br />
corrosion resistance, ability to protect from rain and submersion, etc. For IEC<br />
member countries, the IEC 60529 standard classifies the ingress protection rating<br />
for enclosures.<br />
P<br />
The Programmable Logic Controller is the “brain” of an industrial manufacturing<br />
process. It automates a process, used instead of relay control systems. PLCs are<br />
computers suited to survive the harsh conditions of the industrial environment.<br />
Pulse Latch Input<br />
A Program Organization Unit includes a variable declaration in source code and the<br />
corresponding instruction set. POUs facilitate the modular reuse of software<br />
programs, functions, and function blocks. Once declared, POUs are available to one<br />
another. SoMachine programming requires the utilization of POUs.<br />
Pulse Train Outputs are used to control for instance stepper motors in open loop.<br />
04/2012 83
Glossary<br />
PWM<br />
reflex output<br />
retained data<br />
RTC<br />
SFC<br />
Structured Text<br />
system variable<br />
Pulse Width Modulation is used for regulation processes (e.g. actuators for<br />
temperature control) where a pulse signal is modulated in its length. For these kind<br />
of signals, transistor outputs are used.<br />
R<br />
In a <strong>counting</strong> mode, the high <strong>speed</strong> counter’s current value is measured against its<br />
configured thresholds to determine the state of these dedicated outputs.<br />
A retained data value is used in the next power-on or warm start. The value is<br />
retained even after an uncontrolled shutdown of the controller or a normal switch-off<br />
of the controller.<br />
The real-time clock option keeps the time for a limited amount of time even when the<br />
controller is not powered.<br />
S<br />
A program written in the Sequential Function Chart language can be used for<br />
processes that can be split into steps. SFC is composed of steps with associated<br />
actions, transitions with associated logic condition, and directed links between steps<br />
and transitions. (The SFC standard is defined in IEC 848. It is IEC 61131-3<br />
compliant.)<br />
A program written in the structured text (ST) language includes complex statements<br />
and nested instructions (such as iteration loops, conditional executions, or<br />
functions). ST is compliant with IEC 61131-3.<br />
A system variable structure provides controller data and diagnostic information and<br />
allows sending commands to the controller.<br />
84 04/2012
U<br />
unlocated variable<br />
An unlocated variable does not have an address. (See located variable.)<br />
Glossary<br />
04/2012 85
Glossary<br />
86 04/2012
Magelis XBT GC HMI Controller<br />
Index<br />
04/2012<br />
Index<br />
0-9<br />
1-Phase Counter<br />
Down/Falling Mode, 34<br />
Down/Rising Mode, 32<br />
Overview, 30<br />
Up/Falling Edge Mode, 33<br />
Up/Rising Mode, 31<br />
2-Phase Counter<br />
Mode 0, 39<br />
Mode 1, 40<br />
Mode 2, 41<br />
Mode 3, 42<br />
Overview, 38<br />
Specifications, 43<br />
C<br />
ClearCounterValue, 61<br />
ClearMarkerStatus, 67<br />
ClearPreLoadStatus, 63<br />
ClearPreStrobeStatus, 65<br />
ClearSynchronizedOutput, 59<br />
Combination<br />
Special I/O, 16<br />
Configuration<br />
HSC, 45<br />
Special I/O, 13<br />
04/2012 87<br />
CBA<br />
F<br />
Functions<br />
Dedicated, 51<br />
Differences Between a Function and a<br />
Function Block, 72<br />
How to Use a Function or a Function<br />
Block in IL Language, 73<br />
How to Use a Function or a Function<br />
Block in ST Language, 76<br />
G<br />
GetMarkerStatus, 66<br />
GetPreLoadStatus, 62<br />
GetSynchronizedOutput, 58<br />
H<br />
HSC, 26<br />
1-Phase Counter, 30, 35<br />
2-Phase Counter, 38<br />
Characteristics, 28<br />
Configuration, 45<br />
<strong>Library</strong>, 49<br />
Number of channels, 26<br />
Operating Frequency, 26<br />
Overview, 25<br />
Use Case, 26
Index<br />
HSC <strong>Library</strong><br />
ClearCounterValue, 61<br />
ClearMarkerStatus, 67<br />
ClearPreStrobeStatus, 65<br />
ClearSynchronized, 59<br />
GetMarkerStatus, 66<br />
GetPreLoadStatus, 62<br />
GetSynchronizedOutput, 58<br />
HGetPreLoadStatus, 63<br />
HSCGetCapturedValue, 57<br />
HSCGetCurrentValue, 56<br />
HSCStart, 54, 64<br />
HSCStop, 55<br />
SetCounterValue, 60<br />
HSCGetCapturedValue, 57<br />
HSCGetCurrentValue, 56<br />
HSCStart, 54, 64<br />
HSCStop, 55<br />
I<br />
I/Os<br />
Summary, 19<br />
L<br />
Local and Special I/O<br />
Overview, 14<br />
O<br />
Overview<br />
Local and Special I/O, 14<br />
S<br />
SetCounterValue, 60<br />
Special I/O<br />
Combination, 16<br />
Special I/O Configuration<br />
Configuration, 13<br />
Summary<br />
I/Os, 19<br />
88 04/2012