The function sets the state of the device's output line.
To use this function, the device configuration must include the following settings:
Configuration
➜Outputs
➜Use as
➜ (General Purpose
orBuzzer
)
Function Menu | Block Diagram |
---|---|
![]() |
![]() |
Name | Type | Description |
---|---|---|
value |
bool int32 |
Input value to change the line state. The interpretation of the input value depends on the line configuration in the device settings: General Purpose - The state of the output line.True - Turn on the output line False - Turn off the output line Buzzer - The frequency (Hz) to generate on the outputThis function works only for output line OUT1 |
WARNING!
The function triggers with every call. Detailed explanation of this feature is provided in the "Examples" section below.
Not available
Name | Description |
---|---|
Output Number | The number of the device's output |
An important feature of this function is its triggering logic. The function triggers on every call, not on the front or value True, like some other functions.
When working with outputs, it's often important to consider the degree of control over the particular output line by Complex Events.
The following are two examples showing two approaches:
The block with the output control function should be at the "root" of the main program cycle. This ensures the function is called promptly.
Inside the block, provide the variable containing the desired output state as input to the function.
Thus, the function constantly controls the output and maintains it in the required state.
If the main firmware issues a command to change the output state, the Complex Events function will override it.
Output control is split into two functions: one for turning on and one for turning off the output.
In this case, the block with each of these functions doesn't run all the time as in Example 1 but only when the out ON condition
or out OFF condition
is met.
One of the key conditions for limiting the "rights" of Complex Events is the proper configuration of conditions. It's important that the trigger conditions for turning on and off are limited to a single signal (front or back edge).
![]() |
out ON condition |
:---: |
![]() |
out OFF condition |
When the condition is met, the output will be activeted or deactivated once, until the next state transition. Inside the control blocks, the constant containing the desired output state should be provided as input to the function.
![]() |
out ON |
:---: |
![]() |
out OFF |
Thus, Complex Events only toggles the output state. After this toggle, it doesn't control the output until the next triggering condition is met.
Therefore, if the main firmware issues a command to change the output state, Complex Events will override it only when the out ON condition
or out OFF condition
is triggered.