Configuration Example: Frequency Output

In the configuration example, channel 0 of the DC541-CM is configured for frequency output Usage for Frequency Output. The output signal is measured using the function “Time and frequency measurement” of the DC541-CM.

Hardware configuration:

The example control system shall have the following configuration:

  • Terminal base TB521 (two Communication Module slots)
  • DC541-CM in Communication Module slot 1 (first slot on the left of the CPU)
  • PM591-ETH CPU with internal ETHERNET Communication Module
  • I/O module DC532 on the I/O bus

Wiring:

The channels are connected as follows:

DC541 / C0   ————– DC541 / C1

PLC configuration:

DC541-CM in slot 1, operating mode “counter mode”
Configuration Channel C0 Frequency output
    C1 Frequency measurement
    C2…C7 Input
Specification of the ETHERNET Communication Module as internal Communication Module (if available)

Task configuration:

  • Task 1: Cyclic program / Prio = 10 / Interval = t#5ms / PLC_PRG

Purpose of the cyclic program PLC_PRG:

The cyclic program PLC_PRG contains the following functions:

  • Reading the cycle of PLC_PRG Calling of block TASK_INFO;
  • Reading the configuration of the DC541 Calling of block DC541_GET_CFG
  • Reading the status of the DC541 Calling of block DC541_STATE
  • Reading/writing the static channels of the DC541 Calling of block DC541_IO
  • Calling of the sequence control for frequency output and measurement Calling of program proFrequency

The blocks DC541_GET_CFG: DC541_GET_CFGDC541_STATE: DC541_STATEDC541_IO: DC541_IODC541 Library: DC541 Library

The block TASK_INFO: TASK_INFO Read Number of Completed Task CyclesSysInt Library: Internal System Library

The calling of the frequency output functionality as well as the measurement and acquisition of measured values are performed in the program proFrequency. The program proFrequency contains the calls for the function blocks DC541_FREQ_OUT: DC541_FREQ_OUTDC541_FREQ: DC541_FREQ

../_images/f524ee21e38b597b0a33139000eba54e1

The example program has a visualization implemented that displays all states:

Input EN_VISU of the function blocks DC541_FREQ_OUT and DC541_FREQ is TRUE. Therefore, the block inputs can be controlled using the buttons in the visualization.

../_images/1370b59be38b591d0a33139000eba54e1