Материал: m083700e

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам

86• Fieldbus Controller 750-837, /02x-000, 750-838, /02x-000 Data Exchange

Examples of how to define PFC fieldbus variables

The following examples show some definitions for PFC variables with different data types, compared to the specific object directory entries.

Data type

PFC input variables

 

PFC output variables

 

 

Index

 

Index

 

 

of PFC

Definition according to IEC

 

variables

/Sub-

Definition according to IEC 61131-3

/Sub-

61131-3

 

Index

 

Index

 

 

 

 

 

 

 

 

Unsigned8

InByte0 AT%IB512 : BYTE;

0xA4C0/1

OutByte0 AT%QB512 : BYTE;

0xA040/1

 

InByte0 AT%IB513 : BYTE;

0xA4C0/2

OutByte0 AT%QB513 : BYTE;

0xA040/2

Integer16

InInt0 AT %IW256 : INT;

0xA540/1

InInt0 AT %QW256 : INT;

0xA0C0/1

 

InInt1 AT %IW257 : INT;

0xA540/2

InInt1 AT %QW257 : INT;

0xA0C0/2

Unsigned16

InWord0 AT %IW256 : WORD;

0xA580/1

OutWord0 AT %QW256 : WORD;

0xA100/1

 

InWord0 AT %IW257 : WORD;

0xA580/2

OutWord0 AT %QW257 : WORD;

0xA100/2

Unsigned32

InDWord0 AT %ID128 : DWORD;

0xA680/1

OutDWord0 AT %QD128 : DWORD;

0xA200/1

 

InDWord0 AT %ID129 : DWORD;

0xA680/2

OutDWord0 AT %QD129 : DWORD;

0xA200/2

Table 3-5: Examples for variable definitions with the specific object directory entries

3.1.5.4.1.4Maximum indexes

The maximum indexes and sub-indexes result from the memory size of the fieldbus controller of 512 bytes and the individual data width of the data types.

The table shows a review of the maximum indexes and sub-indexes of the IEC 61131-3 variable.

Data type

IEC 61131-3 input variables

IEC 61131-3 output variables

 

 

 

 

max. Index

max. Sub-Index

Max. Index

max. Sub-Index

 

 

 

 

 

 

Integer8

0xA002

2

0xA482

2

 

 

 

 

 

Unsigned8

0xA042

2

0xA4C2

2

 

 

 

 

 

Boolean

0xA082

2

0xA502

2

 

 

 

 

 

Integer16

0xA0C1

1

0xA541

1

 

 

 

 

 

Unsigned16

0xA101

1

0xA581

1

 

 

 

 

 

Integer24

0xA140

AA

0xA5C0

AA

 

 

 

 

 

Unsigned24

0xA180

AA

0xA600

AA

 

 

 

 

 

Integer32

0xA1C0

80

0xA640

80

 

 

 

 

 

Unsigned32

0xA200

80

0xA680

80

 

 

 

 

 

Float32

0xA240

80

0xA6C0

80

 

 

 

 

 

Unsigned40

0xA280

66

0xA700

66

 

 

 

 

 

Integer40

0xA2C0

66

0xA740

66

 

 

 

 

 

Unsigned48

0xA300

55

0xA780

55

 

 

 

 

 

Integer48

0xA340

55

0xA7C0

55

 

 

 

 

 

Unsigned56

0xA380

49

0xA800

49

 

 

 

 

 

Integer56

0xA3C0

49

0xA840

49

 

 

 

 

 

Integer64

0xA400

40

0xA880

40

 

 

 

 

 

Unsigned64

0xA440

40

0xA8C0

40

 

 

 

 

 

Table 3-6: Maximum indexes and sub-indexes for the definition of IEC 61131-3 variables

WAGO-I/O-SYSTEM 750

CANopen

Fieldbus Controller 750-837, /02x-000, 750-838, /02x-000

• 87

Data Exchange

 

 

 

Example:

512 byte output variables are addressed word-wise with the Unsigned16 data type.

Addressing the 256 data words is in this case done with:

-index 0xA580, sub-index 1 to 255 and

-index 0xA581, sub-index 1.

Index:

 

Sub-

Contents:

 

Description:

 

 

Index:

 

 

 

 

 

 

 

 

 

 

 

0

255

 

number of output variable blocks

0xA580

 

1

D1 *)

 

1. output variable block

 

...

...

 

...

 

 

 

 

 

255

D255 *)

 

255. output variable block

0xA581

 

0

1

 

number of output variable blocks

 

1

D256 *)

 

256. output variable block

*) D1 =

Data

word output variable 1, D255 =

Data word output variable 255, etc.

3.1.5.4.2 Absolute Addresses

The CPU has direct access to the bus terminal data through absolute addresses. Addressing begins with the address 0 both with inputs and outputs. The corresponding addresses for bits, bytes and double words (DWord) are derived from the word addresses.

The structure of the process image is described in chapter 3.1.4 "Process Image". Addressing is done in this structure.

Input data

%IW0

word-orientated data

 

|

 

 

%IWn

 

 

%In+1

bit-orientated data

 

|

 

 

%In+m

 

Output data

%QW0

word-orientated data

 

|

 

 

%QWn

 

 

%Qn+1

bit-orientated data

 

|

 

 

%Qn+m

 

3.1.5.4.3 Calculate Addresses

The word address is the basis for calculation (word).

Bit Address

Word address .0 to .15

Byte Address

1st byte:

2 x Word address

 

2nd byte:

2 x Word address + 1

DWord Address

lower section: Word address (even numbers) / 2

 

upper section: Word address (odd numbers) / 2, rounded off

WAGO-I/O-SYSTEM 750

CANopen

88• Fieldbus Controller 750-837, /02x-000, 750-838, /02x-000 Data Exchange

3.1.5.4.3.1Address Range for I/O Module Data

Data width

 

 

 

 

Address range I/O module data

 

 

 

 

Bit

0.0

 

0.8

 

1.0

 

1.8

...

254.0

 

254.8

 

255.0

 

255.8

 

...

 

...

 

...

 

...

 

...

 

...

 

...

 

...

 

0.7

 

0.15

 

1.7

 

1.15

 

254.7

 

254.15

 

255.7

 

255.15

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Byte

0

 

1

 

2

 

3

...

508

 

509

 

510

 

511

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Word

0

 

 

 

1

...

 

254

 

 

255

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DWord

 

 

 

0

 

 

 

...

 

 

 

127

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3.1.5.4.3.2Address Range for Fieldbus Variables

Data width

 

 

 

 

Address range fieldbus variables

 

 

 

 

Bit

256.0

 

256.8

 

257.0

 

257.8

...

510.0

 

510.8

 

511.0

 

511.8

 

...

 

...

 

...

 

...

 

...

 

...

 

...

 

...

 

256.7

 

256.15

 

257.7

 

257.15

 

510.7

 

510.15

 

511.7

 

511.15

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Byte

512

 

513

 

514

 

515

...

1020

 

1021

 

1022

 

1023

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Word

256

 

 

 

257

...

 

510

 

 

511

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DWord

 

 

128

 

 

 

...

 

 

 

255

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3.1.5.4.3.2.1Address Range for Flags

Data width

 

 

 

 

 

 

Address range flags

 

 

 

Bit

0.0

 

0.8

 

1.0

 

1.8

...

4094.0

4094.8

4095.0

4095.8

 

...

 

...

 

...

 

...

 

...

...

...

...

 

0.7

 

0.15

 

1.7

 

1.15

 

4094.7

4094.15

4095.7

4095.15

 

 

 

 

 

 

 

 

 

 

 

 

 

Byte

0

 

1

 

2

 

3

...

8188

8189

8190

8191

 

 

 

 

 

 

 

 

 

 

 

 

 

Word

0

 

 

1

 

...

4094

4095

 

 

 

 

 

 

 

 

 

 

 

 

 

DWord

 

 

 

0

 

 

 

...

 

2047

 

 

 

 

 

 

 

 

 

 

 

 

 

 

All flags are non volatile (retain).

3.1.5.4.4 Example for Absolute Addresses

Data size

Inputs:

 

 

 

 

 

Bit

%IX14.0 ... 15

%IX15.0 ... 15

 

 

 

 

 

 

 

 

Byte

%IB28

 

%IB29

%IB30

 

%IB31

 

 

 

 

 

 

 

 

Word

 

%IW14

 

%IW15

 

 

 

 

 

 

 

 

DWord

 

 

 

%ID7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Data size

Outputs:

 

 

 

 

 

Bit

%QX5.0 ... 15

%QX6.0 ... 15

 

 

 

 

 

 

 

 

Byte

%QB10

 

%QB11

%QB12

 

%QB13

 

 

 

 

 

 

 

 

Word

 

%QW5

 

%QW6

 

 

 

 

DWord

%QD2 (upper part)

%QD3 (lower part)

 

 

 

 

 

 

 

 

WAGO-I/O-SYSTEM 750

CANopen

Fieldbus Controller 750-837, /02x-000, 750-838, /02x-000

• 89

Data Exchange

 

 

 

Data size

Flags:

 

 

 

 

 

Bit

%MX11.0 ... 15

%MX12.0 ... 15

 

 

 

 

 

 

 

 

Byte

%MB22

 

%MB23

%MB24

 

%MB25

 

 

 

 

 

 

 

 

Word

 

%MW11

 

%MW12

 

 

 

 

 

 

DWord

%MD5 (upper part)

%MD6 (lower part)

 

 

 

 

 

 

 

 

The character 'X' for single bits can be deleted, e.g.%I14.0, %Q6.10, %M11.7

WAGO-I/O-SYSTEM 750

CANopen

90• Fieldbus Controller 750-837, /02x-000, 750-838, /02x-000 Programming the PFC with WAGO-I/O-PRO CAA

3.1.6 Programming the PFC with WAGO-I/O-PRO CAA

Due to the IEC 61131 programming of the CANopen fieldbus controller you have the option to use the functionality of a PLC beyond the functions of fieldbus coupler.

An application program according to IEC 61131-3 is created using the programming tool WAGO-I/O-PRO CAA.

This manual, however, does not include a description of how to program with WAGO-I/O-PRO CAA. In contrast, the following chapters are to describe the special modules for WAGO-I/O-PRO CAA for you to utilize explicitly for programming the CANopen fieldbus controller.

The description also explains transmitting the IEC 61131-3 program into the controller and loading a suitable communication driver.

More Information

For a detailed description of how to use the software, please refer to the

WAGO-I/O-PRO CAA manual (download: www.wago.com).

3.1.6.1 WAGO-I/O-PRO CAA Library Elements for CANopen

You are offered various libraries for different IEC 61131-3 programming applications in WAGO-I/O-PRO CAA. They contain modules for universal use and can, thereby, facilitate and speed up the creation of your program. As standard, the library 'standard.lib' is available to you.

The library described in the following is specifically intended for CANopen projects with WAGO-I/O-PRO CAA:

"CIA405. LIB"

(contains function blocks for CANopen and CANopen acc. to CiA 405),

This library is loaded on the WAGO-I/O-PRO CD.

Having integrated this library, you have access to its POUs, data types and global variables which can be used in the same manner as those defined by yourself.

More Information

For a detailed description of the POUs and the software operation, please refer to the WAGO-I/O-PRO CAA manual (download: www.wago.com).

WAGO-I/O-SYSTEM 750

CANopen

Источник: https://studfile.net/preview/16369781/