This functionality is only available for certain module packages. Info / Copyright

Macros for PLC Schematic Generation

The assignment of macros to the PLC devices is done in the Generate PLC schematic dialog. The Macro file column is used for this.

With PLC boxes the macro file is automatically entered from the main part (the first part that is not an accessory). The macro file can also be manually selected or swapped. It must contain all required representations for generating multi-line pages, single-line pages, I/O overview pages and rack overview pages.

With PLC connection points you can specify wiring macros. The wiring macros can contain single-line and multi-line representations.

All macro variants are shown in the general graphical preview. If page cells are selected, then only the used macro variants are displayed.

Macros for multi-line / single-line representation

Single-line macros are assigned and placed according to the same principle as multi-line macros. The macro variant for the multi-line representation of a PLC box must contain the PLC box functions and also all PLC connection points belonging to the respective channels, but not the wiring of the PLC inputs and outputs. The macro variant for the single-line representation must contain only the PLC box and the signal connection points.

The first macro variants in the macro file with single-line / multi-line representations must be window macros representing the single-line / multi-line card connection points. (The macro file can contain further variants with single-line / multi-line representations that are not used for schematic generation but rather for (e.g.) single-bit representations.)

When generating single-line / multi-line pages, for each device EPLAN inserts one macro variant after another as page macros until no more unplaced macro variants containing connection points are available. The unused PLC connection points that are additionally contained in the macro receive the DT of the current PLC card.

The macros should therefore be so constructed that each of them fills an entire page before the next macro variant is placed. You can define how many channels are to be displayed on a page when creating the macro (a typical value is 8 channels).

Transition from one PLC device to the next

Multiple macros for one device are placed on their own respective pages. Multiple macros for different devices can be placed on the same page when enough space is available. For example, if a PLC card is distributed over two macros then each macro is placed on a new page. Two small PLC cards are placed on the same page.

If the last placed device fits onto a single page and the next device fits onto the same page, then as many PLC devices as possible are placed on the page until the next device no longer fits on the page. This is automatically accounted for in the page calculations.

The macros are then placed one after another in sequence (macro box to macro box). The direction depends on the Reporting direction plot frame property (for "Vertical" from left to right and for "Horizontal" from top to bottom).

Note:

The page data, including the Page type, is adopted from each of the first window macros.

Wiring macros for multi-line / single-line representation

The wiring of the PLC inputs and outputs is specified in separate macro files and these are entered into the PLC connection point rows. The macro files must contain the multi-line and single-line wiring, each of which in the variant A.

A macro can contain multiple connection points but only the connection point where it is to be placed should be assigned. (If it is assigned further connection points, then it is multiply placed.)

The handle of the macro is inserted at the next grid point in the connection point direction at the PLC connection point to which it is assigned in theGenerate PLC schematic dialog. The plot frame logic has no effect here. When creating the macro, you must ensure that the macro for the PLC card and the wiring macro match (i.e., the connection point direction and the handle position must match, e.g., the handle must be above when the associated connection point points downwards).

The assignment between the PLC card macro and the PLC connection point wiring is carried out via the connection point designation and the plug designation of the PLC connection point.

If a macro cannot be assigned, then an appropriate system message is generated and the macro is not inserted.

Macros for I/O overviews

The overview macro for inputs and outputs is read from variant A of the macro file. An overview macro therefore always exists for every PLC card.

Macros for rack overviews

The overview macro for rack layout is read from variant E of the macro file. This type of macro represents either the rack or a PLC card of a rack module. The macros are output in the same sequence that they occur in the PLC navigator (in the rack-oriented view).

For a rack overview, the rack macro is placed on the first page at its original position, then the associated PLC cards. These are always arranged from left to right. Therefore, you must ensure that these match when creating rack overview macros.

For each rack, the macros are sequentially placed on a page until it is full. The process then automatically starts again on a new page. Macros for different PLC cards are combined onto a single page when they belong to the same rack. A new page is used for every rack.

Racks are either output completely (meaning with all the associated PLC cards) or not output at all. If a PLC card of the rack exists in the project that is not listed in the Generate PLC schematic dialog, a message is displayed and the rack is not output. The PLC schematic is generated anyway, without the pages for the incomplete rack.

Note:

If you are notified of incomplete racks, it makes no sense to just add the missing PLC cards in the Generate PLC schematic dialog because this also affects the other representations. You must then regenerate the entire PLC schematic. If new PLC cards are to be subsequently added, you can first generate the multi-line and single-line as well as I/O overview representations on new pages and then (with changed settings) regenerate the rack overview as an entire block.

Identification of interruptions in rack overviews

To graphically represent an interruption on a rack overview, you can specify an additional macro file in the settings (Options > Settings > Projects > "Project name" > Devices > PLC). The variant E in this macro file must contain the graphic for the interruption and the variant F must contain the graphic for the continuation. If the page is full when the rack overview macro is placed and a new page must be started, then the interruption graphic is placed at the end of the page and the continuation graphic is displayed at the start of the next page.

The page data of the subsequent pages is adopted by the first page of the rack.

At the start of the subsequent page, the continuation macro (variant F) is placed at its original position. If macro variant F is empty, the next PLC card is placed at its original position on the subsequent page.

Macro variables

Macros can contain placeholder objects with variables. In this case, a column is displayed for every variable name in the Generate PLC schematic dialog. The variable name is displayed in the header of each column. If multiple macros have variables with the same name, then only one column for this name is displayed.

You can use the popup menu to sort the variable columns alphanumerically, which also removes unused variable columns.

In a table cell of the variable columns you can use the popup menu to call up the value set selection, with which you can then fill all macro variables with values in a single step. You can also manually enter values.

See also