Often, simple commands for full control of blinds will not be enough for us. In this section, we will show more complex control of blinds using universal adjustable blocks that execute sequences of commands. Let's take a simple example: we need the blinds to lower to the desired position and perform a certain number of tilts for the required shading, either in the TPG time program or when the comparator is flipped at a certain facade exposure value. In the next chapter we will get acquainted with all the blocks of this sequence.
Note: First, please get acquainted with the project in the first part.
When using a time program, the output signal must be adjusted by the Sched2_MW240 block before using it. It contains two monostable flip-flop cicruits that generate a 0.5 s long pulse at the output. The PulseON_OUT output generates a pulse at the rising edge of the TPG, while the PulseOFF_OUT output generates a pulse at the falling edge of the TPG. So, the action is performed only when the TPG state changes. If the command is interrupted by another command, either from the PLC or locally, the last one "wins". The program will not try to execute the requested command from the TPG again. Another chance will occur the next time the TPG status changes.
Attention! When designing a program, it is necessary to exclude situations where multiple requests access one blind at the same time. Hazardous conditions can occur.
We will use a logical OR block to easily merge Boolean requests. We will use the created block int_OR_mw240 to merge requests for crossing to the setpoint (usint). It copies the value of the input where the value differs than in the last PLC cycle and displays it on the output. An exception applies to the In1_noCalibr input: if the value changes to 0, it is not copied to the output. Use this input only to connect the output of the Seq_move_and_tilt_MW240 block. Hide unused inputs in the block properties.
Finally, we will introduce the block Seq_move_and_tilt_MW240. It contains a sequence of commands for moving to the desired position and then the number of tilting blinds, ie the level of shading. We start the sequence with the leading edge of the StartSeq_IN input. We bring a variable from the data point to the actual_position input, which is linked to reg. 16 of the LSB module MW240-B. We will use it to find out if we are already in the right position and so we can start tilting. We set the constants of the number of tilts and the required position on the inputs ReqNumberOfTilts and RequiredPosition_IN. Subsequently, we hide them in the properties of the block.
If it is interrupted during the sequence, either manually by buttons or by another command, and the blinds do not reach the desired position within 120 s, it will not tilt and the unfinished sequence will end.