...
The following figure shows how the output is set to true. Note that a "WRITE OUTPUT ITEM" block also forwards the value to the bus if a physical data point is behind the server item.
\nxagraphic
{examples/fig/delayed_off_write_true_to_output.png}
{examples/fig/delayed_off_write_true_to_output.png}
{"Write true to output" block}
{"Write true to output" Block}
{delayed_off_write_true_to_output}
{150pt}
{0.5pt}
...
"Process output"
After having finished the "Process input" block, the "Process output" block has to be implemented. By doing a double click on the corresponding block, the work sheet of the "CMD BLOCK" opens. Within this work sheet, define the command flow that is shown in the following figure.
\nxagraphic
{examples/fig/delayed_off_process_output.png}
{examples/fig/delayed_off_process_output.png}
{Process output}
{Verarbeiten des Outputs}
{delayed_off_process_output}
{350pt}
{0.5pt}
The command flow of the "Process output" block consists of the following blocks:
- "Is counter 0?": this condition verifies whether the current counter value is zero.
- "Is output true?": if the counter is zero, the output shall be reset to false again. However, this shall only be done if the output is currently set to true. The required test is done within this block.
- "Write false to output": Within this "CMD" block, the output is set to false.
- "Decrement counter": if the counter is not yet zero, it is decremented by one within this block.
In the following, the above mentioned blocks are explained in more detail.\subsubsection{
"Is counter 0?'
...
\nxatext
...
Using a "LESS OR EQUAL" block, the current counter value which is stored within the variable "counter" is compared with zero. To get the value of the variable, a "VARIABLE VALUE" block is used. Since the variable may be uninitialized after server startup, zero is specified as default value. The implementation of this condition is shown in figure \ref{fig:delayed_off_is_counter_zero}.
}
{
Mithilfe eines "LESS OR EQUAL" Blocks wird der momentane Zählerwert, der in der Variable "counter" gespeichert ist, mit 0 verglichen. Um den Wert der Variable zu erhalten wird ein "VARIABLE VALUE" Block verwendet. Da die Variable nach Serverstart uninitialisiert sein kann, wird 0 als Standardwert spezifiziert. Die Implementierung dieser Bedingung ist in Abbildung \ref{fig:delayed_off_is_counter_zero} zu sehen.
}
\nxagraphic
{examples/fig/delayed_off_is_counter_zero.png}
{examples/fig/delayed_off_is_counter_zero.png}
{"Is counter 0?"}
{"Is counter 0?"}
{delayed_off_is_counter_zero}
{250pt}
{0.5pt}
\subsubsection{the following figure.
"Is output true?'
...
\nxatext
...
If the current counter value is zero, the delay interval is elapsed and the output shall be reset to false again. However, to avoid that multiple "false" telegrams are sent to the bus, the output shall only be set to false if the output is currently true. The implementation of the required test is shown in figure \ref{fig:delayed_off_is_output_true}.
}
{
Wenn der momentane Zählerwert 0 ist, ist die Verzögerungszeit abgelaufen und der Output soll auf "False" rückgesetzt werden. Um allerdings zu verhindern, dass mehrfache "False" Telegramme auf den Bus gesendet werden, soll der Output nur dann auf "False" gesetzt werden, wenn er im Moment "True" ist. Die Implementierung des notwendigen Tests ist in Abbildung \ref{fig:delayed_off_is_output_true} zu sehen.
}
\nxagraphic
{examples/fig/delayed_off_is_output_true.png}
{examples/fig/delayed_off_is_output_true.png}
{"Is output true?"}
{"Is output true?"}
{delayed_off_is_output_true}
{250pt}
{0.5pt}
\subsubsection{the following figure.
"Write false to output'
...
\nxatext
{
...
The following figure shows how the output is set to false. To forward the value also to the bus if the output is a physical data point, a "WRITE OUTPUT ITEM" is used\footnote{. If the value shall only be set internally and not forwarded to the bus, a "SET OUTPUT VALUE" block has to be used instead.}.
}
{
Abbildung \ref{fig:delayed_off_write_false_to_output} zeigt, wie der Output auf "False" gesetzt wird. Um den Wert auch auf den Bus weiterleiten wenn der Output ein physikalischer Datenpunkt ist, wird ein "WRITE OUTPUT ITEM" Block verwendet\footnote{Wenn der Wert nur intern gesetzt und nicht auf den Bus weitergeleitet werden soll, muss ein "SET OUTPUT VALUE" Block verwendet werden.}.
}
\nxagraphic
{examples/fig/delayed_off_write_false_to_output.png}
{examples/fig/delayed_off_write_false_to_output.png}
{"Write false to output"}
{"Write false to output"}
{delayed_off_write_false_to_output}
{200pt}
{0.5pt}
\subsubsection{"Decrement counter'}
...