CJ1W-PRT21 Profibus Slave Unit Operation - Products

Add to my manuals
125 Pages

advertisement

CJ1W-PRT21 Profibus Slave Unit Operation - Products | Manualzz

Data Exchange with the CPU Unit

This section describes the interface and data exchange between the NJ-series CPU and the PROFIBUS-DP CJ1W-PRT21 Slave Unit.

3

3-1 Input and Output Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2

3-2 I/O Data Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3

3-3 I/O Data Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5

3-4 PROFIBUS Startup Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6

3-5 Data Exchange with the CPU Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8

3-5-1 Data Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8

3-5-2 Accessing From the User Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-11

3-6 Device Variables for CJ-series Unit (Software Switches, Statuses) . . . . 3-15

3-6-1

3-6-2

Software Switches (*_SwCmd) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15

Status Flags (*_SlvSta) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16

3-7 Device Variables for CJ-series Unit (Configuration) . . . . . . . . . . . . . . . . . 3-20

3-7-1 Slave Parameter Data (*_SlvParamSta) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-21

3-7-2 Slave Output Data (*_SlvOutSta) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-22

3-7-3 Slave Input Settings (*_SlvInSta) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-24

3-8 CPU Status Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-28

CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510) 3-1

3 Data Exchange with the CPU Unit

3-1 Input and Output Data

The CJ1W-PRT21 forms a link between two bus systems: the host CPU’s I/O bus and the PROFIBUS-

DP Master. The Unit can be considered as a slave to both systems: the I/O bus communication is controlled by the host CPU Unit and the PROFIBUS-DP communication is controlled by a PROFIBUS-DP

Master.

Definitions

Being a slave of two systems may cause confusion as to which data should be considered ’input data’ and which is ’output data’. In this manual all I/O data communication is defined from the point of view of the PROFIBUS-DP system.

Slave Input Data

Slave INPUT Data is process data which the CJ1W-PRT21 reads from the assigned areas of the host CPU. The CJ1W-PRT21 sends this data to the PROFIBUS-DP master unit.

Host CPU

I/O Bus

CJ1W-PRT21

PROFIBUS

PROFIBUS

Master

Slave Output Data

Slave OUTPUT Data is process data which the CJ1W-PRT21 receives from the PROFIBUS-DP master unit. The CJ1W-PRT21 writes this data to the assigned areas of the host CPU.

Host CPU

I/O Bus

CJ1W-PRT21

PROFIBUS

PROFIBUS

Master

3-2 CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510)

3 Data Exchange with the CPU Unit

3-2 I/O Data Mapping

Data flow

The figure below shows the flow of remote I/O data in the CPU system. It is necessary to map the

PROFIBUS-DP I/O data to the areas of the CPU memory. The input and output areas can be assigned independently. User-defined variables can be created and implemented in the User pro-

gram to access this data (see section 3-5 Data Exchange with the CPU Unit).

Host CPU

I/O Area

(Not allocated words

1

)

I/O Area

(Not used

2

)

Data Link Area

(Not allocated words

1

)

Internal I/O Areas

CPU Bus unit area

(Not allocated words

1

)

Special I/O Unit Area

(Not allocated words

1

)

DeviceNet Area

(Not allocated words

1

)

Work Area

Holding Area

Data Memory Area

CJ1W-PRT21

Input buffer

Max. 100 words

(200 bytes)

Output buffer

Max. 100 words

(200 bytes)

Purposed for Special I/O units (not allocated words

1

)

Purposed for CPU BUS units (not allocated words

1

)

Extended Data Memory Area

3

Note 1 Words that are not allocated can be used

2 Unused words can be used, but those areas may be used in future for expanding functions.

Slave input data is transferred via the I/O bus to the input buffer of the Unit. During each PROFIBUS-

DP cycle this data is transmitted to the master over PROFIBUS. Slave output data received from PRO-

FIBUS is first stored in the output buffer of the Unit. During an I/O refresh, this data is transferred to the memory of the host CPU via the I/O Bus.

CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510) 3-3

3 Data Exchange with the CPU Unit

Additional Information

For details on CJ Unit memory, variable allocation and user-defined variable registration, refer to section How to Create Device Variables for CJ-series Unit and Sysmac Studio (Ver. 1.0)

Operation Manual (Cat. No. W504).

For CJ1W-PRT21, the maximum amount of mapped I/O data is 100 words input + 100 words output with the following restrictions that inputs + outputs must be 180 words or less.

3-4 CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510)

3 Data Exchange with the CPU Unit

3-3 I/O Data Format

The CJ1W-PRT21 allows the user to select between two methods to map the word-oriented CPU data to the essentially byte-oriented PROFIBUS-DP messages. The default method is Motorola format (Big-

Endian), which allows easy data exchange with other OMRON PROFIBUS-DP devices. For communication with other manufacturers’ devices, in some cases it may be more convenient to select Intel format (Little-Endian).

Motorola (Big-Endian)

By default, the most significant byte of a CPU data word will be mapped to an even byte in the PRO-

FIBUS-DP message, the least significant byte is mapped to an odd byte, e.g.

CPU Data Area

Word 15 to 8

Bit #

7 to 0

0

1

8 9

C D

A B

E F

PROFIBUS-DP Message

Bit #

7 to 0

8 9

A B

C D

E F

Byte

0

1

2

3

Intel (Little-Endian)

Alternatively, selecting Intel format will result in:

CPU Data Area

Word

0

15 to 8

Bit #

7 to 0

8 9 A B

1 C D E F

PROFIBUS-DP Message

Bit #

7 to 0

A B

8 9

E F

C D

Byte

0

1

2

3

3

Additional Information

Variable *_SlavOutEndianMdSta

indicates how the data bytes of a PROFIBUS data telegram are

mapped to Host CPU data words (see section 3-7-2 Slave Output Data (*_SlvOutSta))

0: Motorola (high byte first),

1: Intel (low byte first).

CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510) 3-5

3 Data Exchange with the CPU Unit

3-4 PROFIBUS Startup Data

The mapping of PROFIBUS I/O data to the host CPU is controlled by the Set_Prm (set parameter) and

Chk_Cfg (check configuration) telegrams sent by the PROFIBUS Master. At startup of the PROFIBUS communication the following commands are sent

Slave Master

Slave diagn ostic

Not OK

Set_Prm

Chk_Cfg

Slave diagn ostic

OK

Data

Data

Data

Data

Set_Prm

At system startup, after a restart and in data exchange mode the Set_Prm telegram will provide the following information:

Start address of the area in the host CPU where to read and to send to the master.

Format (Motorola/Intel) of the data to be sent to the master.

Actions to be taken in case of CPU status change or fatal errors.

Inclusion of 2 words CPU status information or not.

Chk_Cfg

The Chk_Cfg telegram will provide the number of words to be read from the host CPU and to be sent to the Master plus the number of words to be received from the Master and to be written to the host CPU.

3-6 CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510)

3 Data Exchange with the CPU Unit

Additional Information

Until the Set_Prm and Chk_Cfg have been accepted by the Unit, only the control and status words are exchanged with the host CPU. The status information will indicate that no I/O data is exchanged.

After the Set_Prm telegram is received by the Unit, it will check if the specified data areas in the host CPU exist. If not, this will be indicated as a Parameter Fault to the PROFIBUS master, and in variable *_SlvSta.

In case the parameters specify to include CPU status information in the input data, the amount of input data read from the CPU will be 2 words less than the PROFIBUS input data length. If the input data length is less than 2 words, this is also indicated as a Configuration Fault.

3

CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510) 3-7

3 Data Exchange with the CPU Unit

3-5 Data Exchange with the CPU Unit

Data exchange between this Unit and the CPU Units uses the I/O port and memory for CJ-series Unit allocated to the PROFIBUS Slave Unit.

3-5-1 Data Flow

The CPU Unit and CJ-series PROFIBUS Slave Unit exchange various types of information at each I/O refresh via the memory for CJ-series Units within the CPU Unit.

From the user program, various types of information are exchanged using device variables and userdefined variables. Device Variables are positioned internally in the CPU Bus Unit words allocated in

CIO and DM areas. User-defined variables are created by the user and can be allocated to specific memory areas used for CJ-series Units allocated to slaves.

Control and Status

Area, Configuration

Information Area

Data type

Software Switches,

Status flags

Configuration Information Area

Data Mapping User-set allocation controller by PROFI-

BUS Master Unit

CJ Unit memory

Allocated CIO Area

Allocated DM Area

Any area of CIO, DM, WR, HR and EM

Access method

Device Variable for CJseries Unit

User-defined Variables

Additional Information

By using these variables, the user can program without the need to be aware of the configuration of the memory used for CJ-series Units.

3-8 CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510)

3 Data Exchange with the CPU Unit

User program

Corresponding device variable for CJ-series Unit

CPU Unit

I/O Port

CPU Special Unit Words

Allocated in CIO Area

Mach No #0

(10 wds)

Software Switches (I/O refresh)

(I/O refresh) Status

PROFIBUS Slave Unit

3

Corresponding device variable for CJ-series Unit

Mach No #15

(10 wds)

Allocated DM Area

Words for Special I/O Units

Mach No #0

(8 wds)

Configuration Information

(When Data Changes)

User-defined variable

Mach No #15

(8 wds)

CJ Unit Memory

Memory areas such as

CIO, DM, WR, HR and EM

User Specified Variables

(I/O refresh)

CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510) 3-9

3 Data Exchange with the CPU Unit

Device Variables for CJ-series Unit

Device variables for CJ-series Units are variables for which AT is specified for the I/O port explained below. The user program uses device variables for CJ-series Units to access the Configuration for a unit such as the CJ1W-PRT21.

For allocation of the device variables for CJ-series Unit to the I/O port, refer to How to Create Device

Variables for CJ-series Unit on page 11.

These variables are used to set this Unit and reference statuses from a user program.

Device Variables for CJ-series Unit are positioned internally in the CPU Bus Unit words allocated in

CIO/DM areas shown below.

CPU Bus Unit words allocated in CIO area (software switches, statuses)

CPU Bus Unit words allocated in DM area (configuration information)

I/O Port

An "I/O port" is a logical interface for data exchange by a CPU Unit with a PROFIBUS Slave Unit or other Configuration Unit.

An I/O port has a unique pre-defined name for each unit model and function.

An I/O port is automatically created by preparing the Unit Configuration with Sysmac Studio.

For details on the I/O ports defined for PROFIBUS Slave Unit, refer to 3-6 Device Variables for CJ-

series Unit (Software Switches, Statuses) and 3-7 Device Variables for CJ-series Unit (Configura-

tion).

Software Switches, Status Area

Software switches (execution instructions of each function from the CPU Unit to the PROFIBUS

Slave Unit) and statuses are allocated.

They are allocated in the memory used for CJ-series Unit according to the machine number as shown below.

Allocated CIO words (Start address CIO Area = 2000 + MACH No. x 10)

03

04

05

MACH No.

00

01

02

CIO Area

CIO 2000 to CIO 2009

CIO 2010 to CIO 2019

CIO 2020 to CIO 2029

CIO 2030 to CIO 2039

CIO 2040 to CIO 2049

CIO 2050 to CIO 2059

MACH No.

06

07

08

09

10..

..95

CIO Area

CIO 2060 to CIO 2069

CIO 2070 to CIO 2079

CIO 2080 to CIO 2089

CIO 2090 to CIO 2099

CIO 2100 to CIO 2109

CIO 2940 to CIO 2949

Allocated DM words (Start address DM Area = 20000 + MACH No. x 100):

03

04

05

MACH No.

00

01

02

CIO Area

DM 20000 to DM 20007

DM 20100 to DM 20107

DM 20200 to DM 20207

DM 20300 to DM 20307

DM 20400 to DM 20407

DM 20500 to DM 20507

MACH No.

06

07

08

09

10..

..95

CIO Area

DM 20600 to DM 20607

DM 20700 to DM 20707

DM 20800 to DM 20807

DM 20900 to DM 20907

DM 21000 to DM 21007

DM 29500 to DM 29507

3-10 CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510)

3 Data Exchange with the CPU Unit

User-defined Variable

These variables are defined by the user and can be used to exchange data with PROFIBUS slave devices from a user program. User-defined Variables are specified to access user-allocated areas designated with CX-ConfiguratorFDT for slave devices.

To use this area from the user program, you need to create user-defined variables of AT specification.

3-5-2 Accessing From the User Program

From the user program, various types of information are exchanged using AT specified device variables for CJ-series Unit that are allocated to the I/O ports, and AT specified user-defined variables that are allocated to slave allocation areas.

3

How to Create Device Variables for CJ-series Unit

Use I/O Map in Sysmac Studio to allocate device variables for CJ-series Unit to the I/O port. Specify variable names using one of the methods shown below.

1. Select and allocate existing variables.

2. Input a new variable name.

3. Automatically create with "Device variable creation".

The following shows the structure of a variable name created automatically with method 3.

Name of Device Variable for CJ-series Unit Type

*_StartCommCmd BOOL

Part that identifies the individual Unit.

Part that the user can change and identifies unit functions, statuses and parameters.

For details on Device Variables for CJ-series Unit, refer to the following:

3-6 Device Variables for CJ-series Unit (Software Switches, Statuses)

3-7 Device Variables for CJ-series Unit (Configuration)

In the explanations throughout this manual, the default device name automatically created is used as the device variable name for CJ-series Unit, for example *_StartCommCmd.

For details on the CJ Unit memory, refer to NJ-series CPU Unit Software User’s Manual (Cat. No.

W501)

How to Create User-defined Variables

Sysmac Studio is used to register user-defined variables to the variable table. Specify the user-defined variables in memory used for CJ-series Unit to which slaves can be allocated.

Below is an example of allocation to user-defined variables.

CJ1W-PRT21 Slave Unit Configuration

Machine Number 1

Station Address 2

1 Word In (to master) from host CPU memory area CIO 150

CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510) 3-11

3 Data Exchange with the CPU Unit

1 Word Out (from master) to host CPU memory area CIO 350

CX-ConfiguratorFDT configuration (downloaded to Master Unit):

3-12

CJ1W-PRM21 Master Unit Configuration

Unit Number 1

Station Address 1

1 Word Input Allocation (from slave) to CPU area CIO 3300

1 Word Output Allocation (to slave) from CPU area CIO 3200

CX-ConfiguratorFDT configuration (downloaded to Master Unit):

CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510)

3 Data Exchange with the CPU Unit

3

Allocate the I/O data to the user-defined variables as shown in the example below.

CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510) 3-13

3 Data Exchange with the CPU Unit

Additional Information

For details on CJ Unit memory, variable allocation and user-defined variable registration, refer to

Sysmac Studio (Ver. 1.0) Operation Manual (Cat. No. W504).

3-14 CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510)

3 Data Exchange with the CPU Unit

3-6 Device Variables for CJ-series Unit

(Software Switches, Statuses)

When you operate and reference the control and status area, use the following Device Variables allocated to the I/O port of this Unit.

Name of Device Variable for CJseries Unit

*_SwCmd

*_StartCommCmd

*_StopCommCmd

*_SlvSta

*_DatXchgActSta

*_ClearSta

*_FreezeSta

*_SyncSta

*_WdtDsblSta

*_WdtTmBaseSta

*_FailSafeEnblSta

*_ParamErr

*_StartAdrInErr

*_EndAdrInErr

*_StartAdrOutErr

*_EndAdrOutErr

Type

BOOL

BOOL

BOOL

BOOL

BOOL

BOOL

WORD

BOOL

BOOL

WORD

BOOL

BOOL

BOOL

BOOL

BOOL

BOOL

R/W

R

R

R

R

R

R

R

R

R

RW

RW

RW

R

R

R

R

Description

Software Switches (see section 3-6-1)

Bit 00: Start communication

Bit 01: Stop communication

Status flags (see section 3-6-2)

Bit 00: Data exchange active

Bit 01: CLEAR

Bit 02: FREEZE

Bit 03: SYNC

Bit 04: Watchdog disabled

Bit 05: Watchdog timebase 1 ms

Bit 06: Fail-safe enabled

Bit 08: Parameter/configuration error

Bit 12: Incorrect start address for slave input area

Bit 13: Incorrect end address for slave input area

Bit 14: Incorrect start address for slave output area

Bit 15: Incorrect end address for slave output area

3

3-6-1 Software Switches (*_SwCmd)

The PROFIBUS-DP communication status of CJ1W-PRT21 can be controlled through the first CIO word (device variable *_SwCmd) allocated via the Machine No. setting. The communication status set by these bits is retained until the Unit is restarted (Power-on or reset). After a restart, PROFIBUS-DP communication is enabled by default.

*_SwCmd

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

*_StartCommCmd

*_StopCommCmd

CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510) 3-15

3 Data Exchange with the CPU Unit

Name of Device Variable for CJseries Unit

*_StartCommCmd

*_StopCommCmd

Type R/W Description

BOOL RW Start Communication

BOOL RW Stop Communication

Function

FALSE

TRUE:

PROFIBUS-DP communication will be enabled.

If the communication is already enabled, no specific action is taken.

TRUE

FALSE:

No action.

FALSE

TRUE:

PROFIBUS-DP communication will be disabled

(Slave Offline). If the communication is already disabled, no specific action is taken.

TRUE

FALSE:

No action.

Additional Information

In the event start communication and stop communication are both set from 0 to 1 at the same moment, communication will be enabled (default value).

3-6-2 Status Flags (*_SlvSta)

The CJ1W-PRT21 indicates its status in the second CIO word (device variable *_Sta) allocated via the

Machine No. setting. The lower byte shows the PROFIBUS-DP related status information and the higher byte indicates configuration errors. At power-on, or after a reset of the unit, the initial value shall be 0000. During normal operation only the data exchange active flag (*_DatXchgActSta) will be TRUE.

*_SlvSta

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

*_DatXchgActSta

*_ClearSta

*_FreezeSta

*_SyncSta

*_WdtDsblSta

*_WdtTmBaseSta

*_FailSafeEnblSta

*_ParamErr

*_StartAdrInErr

*_EndAdrInErr

*_StartAdrOutErr

*_EndAdrOutErr

3-16 CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510)

3 Data Exchange with the CPU Unit

Name of Device Variable for CJseries Unit

*_DatXchgActSta

*_ClearSta

*_FreezeSta

*_SyncSta

*_WdtDsblSta

*_WdtTmBaseSta

Type R/W

BOOL R

BOOL

BOOL

BOOL

BOOL

BOOL

R

R

R

R

R

Description Function

Data exchange active

CLEAR

FREEZE

SYNC

Watchdog disabled

Watchdog timebase 1 ms

FALSE:

The slave unit is not in data exchange mode.

TRUE:

The slave unit is exchanging I/O data with the master. When this flag is TRUE, the assigned slave output area of the Host CPU contains data sent by the PROFIBUS master. When the flag is FALSE, the user should not process the data from this area since its validity cannot be guaranteed.

This does not necessarily mean that slave outputs are updated cyclically:

If the communication watchdog timer is disabled by the master (*_WdtDsblSta), the I/O data refresh interval may be of indefinite length.

In 'Clear' mode (*_WdtDsblSta), only the slave inputs are read, while all slave outputs are forced to FALSE.

FALSE: Not in CLEAR mode.

TRUE: The master has sent a global control command CLEAR, which resets all outputs of all the addressed slaves on the network.

FALSE: Not in FREEZE mode.

TRUE: The slave has accepted a global control command FREEZE from its master. The slave input data from the CPU is not updated at the

PROFIBUS-DP interface until the next FREEZE command to this slave, or until the slave receives an UNFREEZE command.

FALSE: Not in SYNC mode.

TRUE: The slave has accepted a global control command SYNC from its master. The slave output data to the CPU is not updated at the CPU

I/O bus interface until the next SYNC command to this slave, or until the slave receives an

UNSYNC command

FALSE: The slave's watchdog is enabled by the

PROFIBUS-DP master, and the actual watchdog time is indicated in Watchdog Factors (see

section 3-7-1 Slave Parameter Data

(*_SlvParamSta)).

TRUE: The master has disabled the slave's watchdog. If the Master-Slave communication fails, the slave will not exit data exchange mode, and its outputs will keep their state as received in the last data exchange telegram.

FALSE: The slave's watchdog uses the default timebase of 10 ms. The product of the two

Watchdog Factors is multiplied by 10 ms to give

the actual watchdog time (see section 3-7-1

Slave Parameter Data (*_SlvParamSta)).

TRUE: The slave's watchdog uses the optional timebase of 1 ms. The product of the two

Watchdog Factors is multiplied by 1 ms to give

the actual watchdog time (see section 3-7-1

Slave Parameter Data (*_SlvParamSta)).

3

CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510) 3-17

3 Data Exchange with the CPU Unit

Name of Device Variable for CJseries Unit

*_FailSafeEnblSta

*_ParamErr

*_StartAdrInErr

Type R/W

BOOL R

BOOL

BOOL

R

R

Description Function

Fail-safe enabled

Parameter/configuration error

Incorrect start address for slave input area

FALSE: After the master sends a global control command CLEAR, the slave requires data telegrams containing 0000 as data, in order to remain in data exchange mode.

TRUE: After the master sends a global control command CLEAR, the slave can accept data telegrams containing no data, while still remaining in data exchange mode

FALSE: The slave unit has received and accepted Set_Prm and Chk_Cfg telegrams from its master.

TRUE: The slave has not received, or received incorrect parameter and/or configuration telegrams from a master unit. I/O data exchange over PROFIBUS-DP will not take place.

Parameter Error can be caused by:

Invalid standard parameter settings (valid settings are described in the PROFIBUS standard).

Invalid user parameter settings (allowed settings are described in the GSD file of the

Unit).

Incorrect start addresses for I/O data in the host CPU system. If one of them is invalid, parameter error is indicated, plus

*_StartAdrInErr and/or *_StartAdrOutErr will be set.

Configuration Error can be caused by:

Input - or output length > 100 words

Input + output length > 180 words

Input length < 2 words while CPU status should be included.

Input - or output length causing errors indicated by *_EndAdrInErr, *_EndAdrOutErr

*See Note

FALSE: No error

TRUE: There is an error in the slave input area mapping. The start address of the area as specified in the Set_Prm telegram is invalid for this CPU type.

The BF indicator is BLINKING to indicate a configuration- or parameterisation error; no I/O data is transferred between master and slave units.

3-18 CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510)

3 Data Exchange with the CPU Unit

Name of Device Variable for CJseries Unit

*_EndAdrInErr

Type R/W Description Function

*_StartAdrOutErr

*_EndAdrOutErr

BOOL R

BOOL R

BOOL R

Incorrect end address for slave input area

Incorrect start address for slave output area

Incorrect end address for slave output area

FALSE: No error

TRUE: There is an error in the slave input area mapping. The end address of the area as specified by the start address in the Set_Prm telegram, plus the data length in the Chk_Cfg telegram, is invalid for this CPU.

The BF indicator is BLINKING to indicate a configuration or parameterisation error; no I/O data is transferred between master and slave units.

FALSE: No error

TRUE: There is an error in the slave output area mapping. The start address of the area as specified in the Set_Prm telegram is invalid for this CPU.

The BF indicator is BLINKING to indicate a configuration or parameterisation error; no I/O data is transferred between master and slave units.

FALSE: No error

TRUE: There is an error in the slave output area mapping. The end address of the area as specified by the start address in the Set_Prm telegram, plus the data length in the Chk_Cfg telegram, is invalid for this CPU.

The BF indicator is BLINKING to indicate a configuration or parameterisation error; no I/O data is transferred between master and slave units.

Note When the Parameter/Configuration flag is TRUE, the status of *_FreezeSta, *_FailSafeEnblSta and *_ParamErr are not updated.

3

CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510) 3-19

3 Data Exchange with the CPU Unit

3-7 Device Variables for CJ-series Unit

(Configuration)

The CJ1W-PRT21 provides 8 consecutive DM words to indicate configuration and parameterisation data received from the PROFIBUS-DP master unit. These words are not part of the cyclic refresh, but the unit writes this information to the Host CPU when the data in the unit changes. At power-on, or at a reset of the unit, all data will be set to 0. The DM words are in the area assigned to the Special I/O unit,

depending on the Machine No (see section 3-5-1 Data Flow).

Name of Device Variable for CJseries Unit

*_SlvParamSta

*_SlvMstrAdr

*_SlvGrp1

*_SlvGrp2

*_SlvGrp3

*_SlvGrp4

*_SlvGrp5

*_SlvGrp6

*_SlvGrp7

*_SlvGrp8

*_SlvWdtFact1

*_SlvWdtFact2

*_SlvOutSta

*_SlvOutAreaCode

*_SlvOutHoldBusErr

*_SlvOutIntelMd

*_SlvOutStartAdr

*_SlvOutDatLen

*_SlvInSta

*_SlvInAreaCode

*_SlvInProgCont

*_SlvInProgExit

*_SlvInFatlCont

*_SlvInFatlExit

*_SlvInIntelMd

*_SlvInclPLCSta

*_SlvInStartAdr

*_SlvInDatLen

Type

UINT

UINT

LWORD

USINT

BOOL

BOOL

BOOL

BOOL

BOOL

BOOL

UINT

UINT

BOOL

BOOL

USINT

USINT

LWORD

USINT

BOOL

BOOL

DWORD

USINT

BOOL

BOOL

BOOL

BOOL

BOOL

BOOL

R

R

R

R

R

R

R

R

R

R

R

R

R

R

R

R

R

R

R

R

R

R

R

R

R

R

R

R

R/W Description

Slave parameter data (see section 3-7-1)

Bits 00-07: Master address

Bit 08: Slave assigned to Group 1

Bit 09: Slave assigned to Group 2

Bit 10: Slave assigned to Group 3

Bit 11: Slave assigned to Group 4

Bit 12: Slave assigned to Group 5

Bit 13: Slave assigned to Group 6

Bit 14: Slave assigned to Group 7

Bit 15: Slave assigned to Group 8

Bits 00 to 07: Watchdog factor 1

Bits 08 to 15: Watchdog factor 2

Slave Output Data (see section 3-7-2)

Bits 00 to 07: Output area code

Bit 08: Data hold on PROFIBUS fail

Bit 12: Outputs Intel mode

Output start address

Output data length

Slave Input Settings (see section 3-7-3)

Bits 00 to 07: Input area code

Bit 08: Continue in PROGRAM mode

Bit 09: Exit in PROGRAM mode

Bit 10: Continue on fatal error

Bit 11: Exit on fatal error

Bit 12: Inputs Intel mode

Bit 15: Include PLC status in input data

Input start address

Input data length

3-20 CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510)

3 Data Exchange with the CPU Unit

The contents will only change

When the unit has accepted a Set_Prm and a Chk_Cfg telegram from a master.

When the slave exits 'data_exchange' state (resets all data to FALSE, except Master address

= 255).

The user should make sure not to overwrite this information by the CPU program.

DM indication is not synchronised with the CPU refresh cycle, this information is intended for debugging purposes.

3-7-1 Slave Parameter Data (*_SlvParamSta)

The CJ1W-PRT21 unit indicates slave parameter data information in the first two words of the allocated

Dm and Dm+1 area (*_SlvParamSta) allocated via the Machine No. setting.

3

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

*_SlvParamSta

*_SlvMstrAdr

*(Group assignment)

*_SlvGrp1

*_SlvGrp2

*_SlvGrp3

*_SlvGrp4

*_SlvGrp5

*_SlvGrp6

*_SlvGrp7

*_SlvGrp8

*_SlvGrp1

*_SlvGrp2

*_SlvGrp3

*_SlvGrp4

*_SlvGrp5

*_SlvGrp6

*_SlvGrp7

*_SlvGrp8

Name of Device Variable for CJseries Unit

*_SlvMstrAdr

Type R/W

USINT R

BOOL

BOOL

BOOL

BOOL

BOOL

BOOL

BOOL

BOOL

R

R

R

R

R

R

R

R

Description Function

Master

Address

Slave assigned to Group 1

Slave assigned to Group 2

Slave assigned to Group 3

Slave assigned to Group 4

Slave assigned to Group 5

Slave assigned to Group 6

Slave assigned to Group 7

Slave assigned to Group 8

Low byte: Integer value (00 to 125) indicating the node address of the PROFIBUS-DP Master from which the Unit has received and accepted the Chk_Cfg and Set_Prm telegrams. 255 indicates that the slave has not been configured by a master.

Indicates to which groups (numbered 1-8) the slave has been assigned by the PROFIBUS-DP master / configurator. When receiving a global control command, the slave will decide if the command is intended for a group of slaves to which it has been assigned.

The value is provided by the PROFIBUS master's Set_Prm telegram, and indicated in D m after both the Set_Prm and Chk_Cfg telegrams have been accepted.

CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510) 3-21

3 Data Exchange with the CPU Unit

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

*_SlvParamSta

*_SlvWdtFact1

*_SlvWdtFact2

Name of Device Variable for CJseries Unit

*_SlvWdtFact1

*_SlvWdtFact2

Type R/W

USINT R

USINT R

Description Function

Watchdog Factor 1

Watchdog Factor 2

The master's parameterisation telegram contains the value to which the slave's communication watchdog timer will be set. The actual watchdog control time is set with *_WDfact1,

*_WDfact2, *_WD timebase.

The WD timebase can be either 10 ms (default) or 1 ms (optional). This selection is made by the

PROFIBUS master and indicated in

*_WdtTmBaseSta

The actual watchdog control time can have any value from 2 ms (2*1*1) to 650250 ms

(255*255*10).

A value of 00 means that the slave has not been parameterized.

The values are provided by the PROFIBUS master's Set_Prm telegram, and indicated in

*_SlavOutStartAdrSta after both the Set_Prm and Chk_Cfg telegrams have been accepted.

The Slave will exit data exchange mode if the communication watchdog is enabled, and the time between two PROFIBUS-DP messages received from the master exceeds Twd

+

0

- WDtimebase

ms.

For example, if the Watchdog timeout (T

WD

) has been set to 100 ms and the Watchdog timebase has been set to 10 ms, two PROFIBUS-DP messages received from the master should not be more than 90 ms apart.

In this state, the Data exchange active flag (

*_DatXchgActSta

) will be off, and all slave output data to the host CPU will be 0000. The slave needs to receive the correct Set_Prm and Chk_Cfg messages from the master to re-enter data exchange mode.

3-7-2 Slave Output Data (*_SlvOutSta)

The CJ1W-PRT21 unit indicates configuration information and operational behavior settings for slave output data from the master to the slave (Dm+2, Dm+3 and Dm+4).

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

*_SlvOutSta

*_SlvOutAreaCode

*_SlvOutHoldBusErr

*_SlvOutIntelMd

3-22 CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510)

3 Data Exchange with the CPU Unit

*_SlvOutSta

Name of Device Variable for CJseries Unit

*_SlvOutAreaCode

*_SlvOutHoldBusErr

*_SlvOutIntelMd

Type R/W

USINT R

BOOL

BOOL

R

R

Description Function

Output area code

Data hold on

PROFIBUS fail

Outputs Intel mode

Output area code (data from Master to Slave

CPU). Indicates the area to which the unit will write PROFIBUS output data received from its master.

00: No assignment made

01: CIO area (CIOxxxx)

03: DM area (Dxxxxx)

04: Work area (Wxxx)

05: Holding area (Hxxx)

08: EM bank 0 (E0-xxxxx)

09: EM bank 1 (E1-xxxxx)

10: EM bank 2 (E2-xxxxx)

11: EM bank 3 (E3-xxxxx)

12: EM bank 4 (E4-xxxxx)

13: EM bank 5 (E5-xxxxx)

14: EM bank 6 (E6-xxxxx)

15: EM bank 7 (E7-xxxxx)

16: EM bank 8 (E8-xxxxx)

17: EM bank 9 (E9-xxxxx)

18: EM bank A (EA-xxxxx)

19: EM bank B (EB-xxxxx)

20: EM bank C (EC-xxxxx)

FALSE: Clear data to Host CPU

TRUE: Hold data to Host CPU

Indicates how the slave will behave on the Host

CPU I/O bus in the event the PROFIBUS data exchange communication fails (e.g. comm. watchdog timeout).

FALSE: Motorola (high byte first)

TRUE: Intel (low byte first)

Outputs Motorola/Intel mode

Indicates how the data bytes of a PROFIBUS data exchange telegram are mapped to Host

CPU data words.

The values in *_SlvOutSta are provided by the

PROFIBUS master's Set_Prm telegram, and indicated in *_SlvOutSta after both the Set_Prm and Chk_Cfg telegrams have been accepted.

3

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

*_SlvOutStartAdr

CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510) 3-23

3 Data Exchange with the CPU Unit

*_SlvOutSta

Name of Device Variable for CJseries Unit

Type

*_SlvOutStartAdr UINT

R/W

R

Description

address

Function

CPU)

Indicates the start address in the area indicated in *_SlavOutSta, to which the PROFIBUS output data, received from the master, will be written. The value is provided by the PROFIBUS master's Set_Prm telegram, and indicated in

*_SlvOutStartAdr after both the Set_Prm and

Chk_Cfg telegrams have been accepted.

The indication is only valid in case the output area code is unequal to 00.

The start address is indicated as a value in the range 0-32767.

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

*_SlvOutDatLen

Name of Device Variable for CJseries Unit

Type

*_SlvOutDatLen UINT

R/W

R

Description

length

Function

CPU).

The value indicates the size of the area to which the PROFIBUS output data, received from the master, will be written. The value is provided by the PROFIBUS master's Chk_Cfg telegram, and indicated in *_SlvOutSta after both the Set_Prm and Chk_Cfg telegrams have been accepted.

The indication is only valid in case the output area code is unequal to 00.

The length (in words) is indicated as a value in the range 0 to 100.

Before using the Slave output data in the CPU program, the user is to make sure the Unit Status

Flags in Variable *_SlvSta indicate that:

PROFIBUS data exchange is active,

there are no configuration errors,

and that the correct data format is selected. Otherwise the Slave Output words may contain invalid data.

3-7-3 Slave Input Settings (*_SlvInSta)

The CJ1W-PRT21 unit indicates configuration information and operational behavior settings for slave input data from the Slave CPU to the master (Dm+5, Dm+6 and Dm+7).

3-24 CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510)

3 Data Exchange with the CPU Unit

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

*_SlvInSta

*_SlvInAreaCode

*_SlvInProgCont/*_SlvInProgExit

*_SlvInFatlCont/*_SlvInFatlExit

*_SlvInIntelMd

*_SlvInclPLCSta

Name of Device Variable for CJseries Unit

Type R/W

*_SlvInAreaCode USINT R

Description

code

*_SlvInProgCont

*_SlvInProgExit

BOOL

BOOL

R

R

Continue in

PROGRAM mode

Exit in PRO-

GRAM mode

Function

ter). Indicates the area to which the unit will write PROFIBUS input data to be sent to its master.

00: No assignment made

01: CIO area (CIOxxxx)

03: DM area (Dxxxxx)

04: Work area (Wxxx)

05: Holding area (Hxxx)

08: EM bank 0 (E0-xxxxx)

09: EM bank 1 (E1-xxxxx)

10: EM bank 2 (E2-xxxxx)

11: EM bank 3 (E3-xxxxx)

12: EM bank 4 (E4-xxxxx)

13: EM bank 5 (E5-xxxxx)

14: EM bank 6 (E6-xxxxx)

15: EM bank 7 (E7-xxxxx)

16: EM bank 8 (E8-xxxxx)

17: EM bank 9 (E9-xxxxx)

18: EM bank A (EA-xxxxx)

19: EM bank B (EB-xxxxx)

20: EM bank C (EC-xxxxx)

Indicates how the slave will behave on PROFI-

BUS in case the host CPU is in PROGRAM mode (as opposed to RUN mode).

*Examine condition of both *_SlvInProgCont and *_SlvInProgExit for slave behavior shown below.

*_SlvInProgCont: FALSE

*_SlvInProgExit: FALSE

Slave has not been configured by a master

(n.a.).

*_SlvInProgCont: TRUE

*_SlvInProgExit: FALSE

Continue data exchange, and provide diagnostics to the master.

*_SlvInProgCont: FALSE

*_SlvInProgExit: TRUE

Exit data exchange, and provide diagnostics to the master. In this case the Slave will send static diagnostics messages to the master.

CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510) 3-25

3

3 Data Exchange with the CPU Unit

Name of Device Variable for CJseries Unit

*_SlvInFatlCont

*_SlvInFatlExit

Type R/W

BOOL R

BOOL R

Description

Continue on

Fatal error

Exit on fatal error

Function

Indicates how the slave will behave on PROFI-

BUS in case (the communication with) the host

CPU has a fatal error (CPU ERH indicator ON) e.g. I/O refresh timeout).

*Examine condition of both *_SlvInFatlCont and

*_SlvInFatlExit for slave behavior as shown below.

*_SlvInFatlCont: FALSE

*_SlvInFatlExit: FALSE

Slave has not been configured by a master

(n.a.).

*_SlvInFatlCont: TRUE

*_SlvInFatlExit: FALSE

Continue data exchange, and provide diagnostics to the master.

*_SlvInIntelMd

*_SlvInclPLCSta

BOOL

BOOL

R

R

Inputs Intel mode

Include CPU status in input data

*_SlvInFatlCont: FALSE

*_SlvInFatlExit: TRUE

Exit data exchange, and provide diagnostics to the master. In this case the Slave will send static diagnostics messages to the master.

Indicates how the host CPU data words are mapped to a PROFIBUS data exchange telegram.

FALSE: Motorola (high byte first)

TRUE: Intel (low byte first)

The values in *_SlavInSta are provided by the

PROFIBUS master's Set_Prm telegram, and indicated in *_SlavOutSta after both the

Set_Prm and Chk_Cfg telegrams have been accepted.

Include CPU status in input data

Indicates if the CPU status information should occupy the first two words of input data to the

PROFIBUS master.

FALSE: Do not include CPU status words

TRUE: Include CPU status words. See section

3-8 CPU Status Information.

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

*_SlvInStartAdr

*_SlvInStartAdr

3-26 CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510)

3 Data Exchange with the CPU Unit

Name of Device Variable for CJseries Unit

Type

*_SlvInStartAdr UINT

R/W

R

Description

address

Function

in *_SlvInSta, from which the PROFIBUS input data will be read (data from Slave CPU to Master).

The value is provided by the PROFIBUS master's Set_Prm telegram, and indicated in *_SlvInStartAdr after both the Set_Prm and Chk_Cfg telegrams have been accepted.

The indication is only valid in case the input area code is unequal to 00.

The start address is indicated as a value in the range 0 to 32767.

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

*_SlvInDatLen

*_SlvInDatLen

3

Name of Device Variable for CJseries Unit

*_SlvInDatLen

Type R/W

UINT R

Description

Input data length

Function

The value indicates the size of the area from which the PROFIBUS input data will be read

(data from Slave CPU to Master).

The value is provided by the PROFIBUS master's Chk_Cfg telegram, and indicated in

*_SlvInDatLen after both the Set_Prm and

Chk_Cfg telegrams have been accepted.

The indication is only valid in case the input area code is unequal to 00.

The length (in words) is indicated as a value in the range 0 to 100.

CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510) 3-27

3 Data Exchange with the CPU Unit

3-8 CPU Status Information

The user may specify that the first two input words to be sent over PROFIBUS that will contain status information about the slave CPU. This information is also contained in the PROFIBUS-DP diagnostics, but access to cyclic I/O data may be easier than access to diagnostics. In case the status of the slave

CPU is unknown (at startup, or at fatal I/O bus error), both Words 0 is set to "0000" (status unknown).

Word 0

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

PROGRAM Mode

RUN Mode

CPU Executing (RUN/MONITOR Mode

CPU Initialization (RUN/MONITOR Mode)

Word 1

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

Error code in CPU

(Reserved)

Additional Information

Shown format for both words is in Motorola mode. If Intel mode is specified for the PROFIBUS inputs, the high and low bytes will change places.

Specific NJ-series CPU status is not mapped in the second word (Word 1 above). Use generic

PROFIBUS Input to map detailed NJ-series status.

Refer to the NJ-series GetAlarm and GetPLCError functions to access detailed CPU status data.

3-28 CJ-series PROFIBUS Slave Unit Operation Manual for NJ-series CPU Unit (W510)

advertisement

Was this manual useful for you? Yes No
Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Related manuals

Download PDF

advertisement

Table of contents