Signal Generator Using PLC
Signal Generator Using PLC
Using PLC
Application Sheet
Simple designs of binary signal generators (on their outputs logical 0 and logical 1 are generated) are also
presented. One design utilizes two Delay blocks and one design uses one Timer block and one Delay
block.
These signals may be used in many ways in the controller logic or for control of external devices. Their
properties may be changed easily to alter their function and this makes them suitable for universal usage.
2. List of controllers
NT NT NTC NT NT NTC
InteliGen , InteliGen BaseBox, InteliGen BaseBox, InteliSys , InteliSys BaseBox, InteliSys
NT NT NTC
BaseBox, InteliMains , InteliMains BaseBox, InteliMains BaseBox
3. List of tools
GenConfig, WinScope
-2-
VYDT
5. Detailed description of solution
The first sheet shows generator of logical rectangular output with variable duty. It uses one Timer block and
one Delay block. These two block form the core of the logical generator function. Timer block itself
generates output with duty 50%. Half-period can be adjusted by Reload Value input in this example
connected to the setpoint PLC:HalfPeriod. Since the period of the Timer is adjusted in PLC cycles instead
of seconds, one Convert block can be used to make the function more clear and user-friendly. Convert
block converts the input value which is adjusted in 0.1 s to output value which has dimension PLC cycles [-]
and has no decimals (this causes the block Convert to effectively multiply the incoming value ten times).
Therefore user can adjust all the input setpoints of this function in seconds.
-3-
VYDT
Half period adjusts the duration of up and down period of the Timer block output and setpoints
PLC:SignalDutyDown and PLC:SignalDutyUp allows user to change the duty of the final output of the
function. If the function is required to produce e.g. signal with period of 12s, PLC:HalfPeriod should be
adjusted to 6s. Then the duty should be e.g. 75%. In this case we need to adjust PLC:SignalDutyUp to 3s
(6 + 3 = 9 which is 75% of 12). Observe several examples in the next chapter.
The difference between this function using Timer block and the next design using one Delay and one AND
block is quite small, but in longer run the function with Timer block produces more accurate results. If the
precision of the output signal can be lower, next design can be used and Timer block may be saved for
another use.
The second design uses only two blocks and is very simple. AND block in this example is used to combine
activation signal and the reset signal which is looped back from the output of this logical output generator.
Two setpoints PLC:SignalDutyUp and PLC:SignalDutyDown are used to change the reaction time of the
Delay block to rising or falling edge. In this case, the period of the signal is given by the sum of those two
setpoints and signal duty is given straight by the ratio of PLC:SignalDutyUp to PLC:SignalDutyDown.
The third sheet contains a multipurpose signal generator. It is possible to generate rectangular, triangle and
saw signal with variable high and low amplitude and duty. When PLC:SlopeRateUp and
PLC:SlopeRateDown are adjusted to 32767, the output of the signal generator is rectangular.
PLC:SignalDutyUp and PLC:SignalDutyDown then adjust the time that the output signal has the value of
high amplitude and low amplitude. The amplitudes are adjusted by PLC:AmplitudeHigh and
PLC:AmplitudeLow.
When PLC:SignalDutyUp and PLC:SignalDutyDown are adjusted to 0.0s, the signal generator generates
triangle or saw signal depending on the settings of PLC:SlopeRateUp and PLC:SlopeRateDown. More
examples are shown in the next chapter.
The core of this function is formed by the Up/Down block which is connected to the Comparator with
hysteresis and Delay. Comparator inverts the function of Up/Down block when the limit values are reached.
To make the function more user-friendly, two additional blocks are used. 1 is subtracted from the high
amplitude and 1 is added to the low amplitude. This causes the function of Up/Down block to be inverted
once the limit value is reached and not before. The AND block in this PLC function serves as Negation.
6. Example
The first two logical signal generators allow user to generate logical signals with various duty. This can be
especially useful in functions that require a periodic run of some equipment for defined time. For example
the oil pump may be required to run once in 30 minutes for 30 seconds to prelubricate the machine and
keep it ready for immediate start. Then the PLC:HalfPeriod should be adjusted to 900s and
PLC:SignalDutyDown to 870s.
In the case of the second generator, the PLC:SignalDutyDown should be adjusted to 1770s and
PLC:SignalDutyUp to 30s. In both cases this function can be triggered based on some condition given by a
binary state. This is different from the Timers that are available in the controller. Those Timers run
regardless on any condition and when their output is used as a input for AND block with the binary input for
the condition, the cycle starts in random position when the condition is activated. Built-in Timers also allow
longer times but the minimum time on the other hand is 1 minute.
-4-
VYDT
The multipurpose signal generator can generate various signals. Several examples with the corresponding
settings are presented in the scheme below.
Asymmetrical saw output
Symmetrical triangle output AmplHigh = 140
AmplHigh = 70 Asymmetrical triangle output AmplLow = 0
AmplLow = -70 AmplHigh = 140 SlopeRateUp = 20
SlopeRateUp and Down = 20 AmplLow = 0 SlopeRateDown = 32767
SlopeRateUp and Down = 280
-5-
VYDT
7. Other comments
Use WinScope to properly test designed function. Test the function in the prepared archive using supplied
WinScope file. All the interesting values for scoping are prepared in this file.
For your convenience use the ComAp’s Starterkit to test the basic principle of this function: InteliGen NT
Colour StarterKit, InteliSys NT StarterKit.
Test this function also on one of the ComAp’s MultiKits: InteliGen NT Colour Multikit, InteliSys NT
MultiKit or H-System Multikit.
-6-
VYDT