wiki:examples:plcopen_function_block
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
wiki:examples:plcopen_function_block [2012/10/20 18:56] – created pmueller | wiki:examples:plcopen_function_block [2012/10/20 19:08] – pmueller | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
+ | The [[http:// | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | According to the PLCopen specification this function block converts two equivalent SAFEBOOL inputs to one SAFEBOOL output with discrepancy time monitoring. If one channel signal changes from TRUE to FALSE the output immediately switches off (FALSE) for safety reasons. Discrepancy time monitoring: The discrepancy time is the maximum period during which both inputs may have different states without the function block detecting an error. Discrepancy time monitoring starts when the status of an input changes. The function block detects an error when both inputs do not have the same status once the discrepancy time has elapsed. | ||
+ | |||
+ | The machine presented below is a sample realization of the state diagram specified in the PLCopen document. In opposite to the original PLCopen specification all states - which set the READY output to TRUE - are sub-states of the superstate called ACTIVE. As soon as the ENABLE input becomes inactive the ACTIVE state is left and IDLE will be entered. Using sub-states reduces the number of required transitions in the diagram a lot. | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | The class diagram below shows how the sample implementation is designed. The class '' | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | The attached example implementation shows how the generated code can be used. The inputs come from a test vector. The code is built with cygwin and gcc but can be also compiled on Linux or Mac OS X for example. Main is the starting point of the code and initializes everything. A number of test cases are implemented wich can be commented in as needed. | ||
+ | |||
+ | Generated Files: | ||
+ | * {{: | ||
+ | * {{: | ||
+ | * {{: | ||
+ | * {{: |
wiki/examples/plcopen_function_block.txt · Last modified: 2022/09/25 10:58 by pmueller