Logical typical

 

Import a logical typical

Delete a logical typical

Update a logical typical

Example logical typical (basic principle)

Example logical typical (XML)

 

With the logical add-on you can generate PLC code, which automatically is filled with project specific information. This window is used to import logical typicals. Logical typicals are small pieces of PLC code (*.txt or *.awl files for an example) which can contain variables. Variables are placed between a begin- and end tag. You can set the begin- and end tag in System -> Options -> System -> Plug-in logical to your needs. This is important before importing your typicals. A file viewer is available which will show you the selected typical.

 

 

See also:

Logical module

Logical template type

Default value typical variable

Import a logical typical


 

Notes:

1. You can define which file extensions you want to import in System - Options.

Delete a logical typical


 

Notes:

1. A typical in use can not be deleted.

Update a logical typical


In case a typical should be updated or overwritten:

 

The typical is updated now. It is also possible to update more typicals at once with the Import button.

Example logical typical (basic principle)


Download the typicals used in this example here.

 

Basic principle

Templates and typicals are placed using insert points and sections.

A section on a typical is marked by a with specific tags and a name, (e.g. <!CM_VARIABLE!>) this section will start with this mark and the section will end when the next section starts or till the end of the file.

The sections are placed on an insert point of the template with corresponding name (e.g. <$CM_VARIABLE$>)

 

Template typical

If you want to use a typical as a template, you have to check the ‘Is Template’ check box. A template is used to collect typicals. In a template, you can collect typicals on several places. In the template below we collect typicals at two places:

1. <$CM_VARIABLE$>

2. <$CM_MODULE$>

 

These two places were the template can collect typicals are called 'Insert points'.

 

 

You can change the template settings in System -> Options -> System -> Plug-in logical. Here you can change the begin- and end tag for variables, insert point and sections starts.

 

Typicals

The typicals below are used to 'fill' the template:

 

 

As you can see, the above typical begins with ‘<!CM_MODULE!>‘. So this typical is placed at the template at insert point ‘<$CM_MODULE$>‘.

 

Second typical:

 

 

The above typical is placed at the template at insert point ‘<$CM_VARIABLE$>’.

 

Example insert typicals

In the picture below you can see how the typicals are inserted on the template:

 

 

 

 

Example logical typical (XML)


Download the typicals used in this example here

 

Principle

Using logical typicals it is possible to create XML (like) structures. Link explained in the 'basic' example above, a typicals with a section mark will be placed on the corresponding insert point on the template.

The same is for templates with sections, these sections will be placed on templates with corresponding insert points.

 

If a template has a section mark, that section will be placed on the first template it can find with the correct insert point. The section will always be places in a 'higher' level template.

At first the section is tried to be inserted in a template of the top location of the template.

 

Example pictured below:

If template 'breakfast food template' in location '[1] Belian Waffels' has an section to be placed in an other template. the fist template to look are templates 'Breakfast Food Template' and 'Breakfast Template' in location 'Breakfast master.

If no valid insert point on any template is found, the next top location is used to find insert points, and so on.

 

 

 

This Example will demonstrate how Logical typicals/template are used to generate the flowing XML file, used to store a breakfast menu.

 

 

 

Templates and typical:

To generate this xml file 2 templates where created, 'BreakfastTemplate' and 'BreakfastFoodTemplate' and a typical 'BreakfastFoodTypical'

 

BreakfastTemplate

 

 

 

BreakfastFoodTemplate:

 

 

 

BreakfastFoodTypical

 

 

Example insert typicals

In the picture below you can see how the typicals are inserted on the template when generating.

 

 

Assuming the flowing Logical Location structure is created:

 

when generating. the example XML file is generated as output.

The food template with a typical can/will be place multiple times on the breakfast template to create the different 'foods' in the XML file

 

NOTE:

This technique, inserting template sections in to insert points on other template is not limited to XML only, this can also be used to control the location of templates/typicals to create a single file. or to create multiple files that have a nested structure, but is no XML file.