24.01.2015 Views

PLC Programming

  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Appendix D: CoDeSys Libraries<br />

If the upper limit HIGH is exceeded by IN, O becomes TRUE, and when IN is below LOW, U becomes<br />

TRUE. IL is TRUE if IN lies between LOW and HIGH.<br />

Example in FBD: Result:<br />

10.18 AnalyzationNew.lib library<br />

This library provides modules for the analysis of expressions. If a composed expression is FALSE,<br />

those of its components can be evaluated which are adding to this result.<br />

In the SFC-Editor the flag SFCErrorAnalyzationTable (see chapter 2.2.3) uses this function<br />

implicitely for the analysis of expressions in transitions.<br />

Example of an expression:<br />

b OR NOT(y < x) OR NOT (NOT d AND e)<br />

The functions:<br />

The following variables are used by all modules:<br />

InputExpr: BOOL, expression to be analysed<br />

DoAnalyze: BOOL, TRUE starts analysis<br />

ExpResult: BOOL, current value of the expression<br />

Different for the particular analyse modules is the output of the result of the analyzation:<br />

1. AnalyzeExpression returns in a string the components of the expression, which are adding to the<br />

total value FALSE. Function AppendErrorString is used for this purpose, separating the particular<br />

components in the output string by "|" characters.<br />

OutString: STRING, Result of the analysis, Sequence of the concerned components of the<br />

expression (e.g. y < x | d)<br />

2. AnalyseExpressionTable writes the components of the expression, which are adding to the total<br />

value FALSE, to an array. For each component the following information is provided by structure<br />

ExpressionResult: name, address, comment, (current)value.<br />

OutTable: ARRAY [0..15] OF ExpressionResult;<br />

e.g.<br />

3. AnalyseExpressionCombined combines the functionalities of AnalyzeExpression plus<br />

AnalyseExpressionTable.<br />

CoDeSys V2.3 10-59

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!