Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
158
Добавлен:
11.10.2020
Размер:
2.81 Mб
Скачать

PLC Configuration...

Converting of old PLC configurations, 'Extras' 'Convert'

This command is available in the menu 'Extras' if you open a project containing a PLC configuration, which was created with an older CoDeSys version than V2.2. If all needed configuration files are available, the command 'Convert' will transfer the existing configuration into the format of the actual PLC configuration. A dialog will open which asks "Convert the configuration to the new format ? Attention: Undo is not possible !" You can select Yes or No. If you close the dialog with Yes, the configuration editor will be closed also. Reopen it and you will see the configuration in the new format. Be aware that after having converted the old format cannot get restored anymore !

6.6.4Custom specific parameter dialog

The parametrizing possibilities of the configurator can be expanded by the use of an applicationspecific DLL which is an individual dialog. This 'Hook'-DLL must be in that directory which contains the configuration file and then can be linked by an entry in the configuration file.to a module or channel. If done so, for the concerned modules the standard dialog 'Module parameters' will be replaced by a dialog defined in the DLL.

Example of an application-specific parameter dialog (Custom Parameters)

6-24

CoDeSys V2.3

6 - The Resources

6.6.5Configuration of an I/O Module...

Base parameters of an I/O Module

Base parameters Dialog for an I/O Module

If an I/O module is selected in the configuration tree, the dialog 'Base parameters' is displayed with the following entries:

Module id: The Module id is a unique identifier of the module within the entire configuration. It is defined by the configuration file and it is not editable in the configuration editor.

Node number: The Node number is defined by an entry in the configuration file or – if there is no entry – by the position of the module in the configuration structure.

Input address, Output address, Diagnostic address: Addresses for Inputand Output respectively for the storage of diagnosis data.

These addresses refer to the module. It depends on the general settings, which addresses are already predefined, which address mode is valid and whether the addresses can be still edited here.

Load module description: If this option is deactivated, the module will not be regarded at a download of the project. Per default the option is activated and it is defined in the configuration file *.cfg whether it is visible and editable in the configuration dialog.

Do not adapt address automatically: This option is only available if defined by the configuration file. If it is activated, the module will not be regarded in case of a recalculation of the addresses. (Default: Option is deactivated.)

The diagnosis in the PLC configuration:

A marker address must be given at the diagnostic address of the module. For normal I/O modules it depends on the special hardware configuration how the diagnosis will be handled. For bus systems like CAN or Profibus DP the diagnosis works like described in the following: From the given diagnosis address onwards there will be stored various information concerning the structure GetBusState which is part of a corresponding library delivered by the manufacturer (e.g. BusDiag.lib by 3S - Smart Software Solutions). All bus modules get a request to fill the diagnosis structure in a cyclic sequence each time when an IEC task has written or read process data to/from the modules. As soon as at least one module in the bus system produces an error, the specific diagnosis information can be read using the function block DiagGetState which is also part of the above mentioned library. This function is only available for bus masters, which have been configured within the CoDeSys PLC configuration!

See in the following the input and output parameters of the function block DiagGetState. Define an instance of this function block in your CoDeSys project to read the diagnosis information for a specific bus module:

CoDeSys V2.3

6-25

PLC Configuration...

Input variables of DiagGetState:

ENABLE: BOOL;

At a rising edge of ENABLE the function block starts working

 

 

DRIVERNAME:POINTER TO

Name of the driver (address of the name) to which the diagnosis

STRING;

request should be sent. If here is entered a 0, the diagnosis request

 

will be forwarded to all present drivers.

 

 

DEVICENUMBER:INT;

Identification of the bus which is managed by the driver. E.g.: the

 

Hilscher driver can handle up to 5 cards (busses). The index is 0-

 

based.

 

 

BUSMEMBERID:DWORD ;

Unique bus-/driver specific identification of the busmodule (E.g.: for a

 

CANopen-card this is the NodeID, for a PB-DP card this is the

 

station address of the participant etc. )

 

 

Output variables of DiagGetState

 

 

READY:BOOL ;

TRUE: the work on the diagnosis request has been terminated

 

 

STATE:INT;

If READY = TRUE then STATE gets one of the following values

 

which define the actual state of the function block:

 

-1: invalid input parameter

 

(NDSTATE_INVALID_INPUTPARAM:INT;)

 

0: function block does not work (NDSTATE_NOTENABLED:INT;)

 

1: function block is just reading the diagnosis info

 

(NDSTATE_GETDIAG_INFO:INT;)

 

2: diagnosis info is now available

 

(NDSTATE_DIAGINFO_AVAILABLE:INT;)

 

3: no diagnosis info is available

 

(NDSTATE_DIAGINFO_NOTAVAILABLE:INT;)

 

 

EXTENDEDINFO:

Up to 100 Bytes manufacturer specific diagnosis data of the bus. For

ARRAY[0..129] OF BYTE;

each bus participant 1 byte is reserved in which the 0 – 2 are used

 

as described in the following:

 

Bit 0: Bus module exists in PLC configuration.

 

Bit 1: Bus module is available in bus system.

 

Bit 2: Bus module reports error.

 

 

6-26

CoDeSys V2.3

6 - The Resources

Module parameters / Custom parameters of an I/O Module

Module parameters Dialog

In this dialog the parameters which are given by the device file are shown. Only the column 'value' is editable.

Index: The Index is a consecutive digit (i), which numbers through all the way the parameters of the module.

Name: Name of the parameter

Value : Value of the parameter, editable

Initially the default is displayed. Values can be set directly or by means of symbolic names. If the entries in the configuration file are not set to 'Read Only', they can be edited. To do that click on the edit field respectively select on of the entries in a scroll list. If the value is a file name, you can open the dialog 'Open file' by a double-click and browse for another file there.

Default: Default value of the parameters

Min.: minimum value of the parameter (only if no symbolic names are used) Max.: maximum value of the parameter (only if no symbolic names are used) A tooltip may give additional information on the currently marked parameter.

Instead of the Module parameters dialog there might be a customer specific dialog. This is due to the fact, that such a dialog is linked by an entry (Hook-DLL) at the module definition in the configuration file.

6.6.6Configuration of a Channel

Base parameters of a channel

Channel-Id: Globally unique identifier of the channel

Class: Defines whether the channel is used as input (I), output (Q), or as input and output (I&Q), or whether it is switchable (I|Q). If the channel is switchable, this can be done by the command 'Extras' 'Replace element'.

Size: Size of the channel [Byte]

Default identifier: Symbolic name of the channel

The name of the channel is defined in the configuration file. Only if it is allowed by the definition of the father module, the name of the channel can be edited in the configuration tree.

Comment: Additional information on the channel

In the edit field a comment can be inserted or modified.

CoDeSys V2.3

6-27

Соседние файлы в папке 759-333