CJ1W-PRM21 Operation Manual

Add to my manuals
304 Pages

advertisement

CJ1W-PRM21 Operation Manual | Manualzz

Message Communications

This section describes the message service communications commands concept sent from the user program in the CPU Unit.

6-1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2

6-2 Sending Acyclic Messages Using SendCmd Instructions . . . . . . . . . . . . . 6-3

6-3 Acyclic Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-7

6-3-1 EXPLICIT MESSAGE SEND (2801) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-7

6-3-2 PROFIBUS MESSAGE SEND (2809) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-9

6-3-3 MEMORY AREA READ (0101) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-20

6-3-4 ERROR LOG CLEAR (2103) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-21

6

CJ-series PROFIBUS Master Unit Operation Manual for NJ-series CPU Unit (W509) 6-1

6 Message Communications

6-1 Overview

Message communications enable messages to be sent between nodes on a PROFIBUS network when required by system conditions. It is possible for messages to be sent between a CPU and a PROFIBUS

Master or Slave Unit. You can use them to send/receive data; read time data, error logs, and other data; or control specific operation, e.g., clearing the error log.

There are three types of messages:

Explicit

PROFIBUS

Other

The figure below depicts the command structure for the CJ1W-PRM21 PROFIBUS Master units

CPU Unit

Other message

PROFIBUS Master Unit

Other message function

SendCMd

Instruction

(0101 Hex)

(2103 Hex)

SendCmd

Instruction

(2809 Hex)

2809 PROFIBUS message

PROFIBUS message function

SendCmd

Instruction

(2801 Hex)

2801 Explicit message

Explicit message function

PROFIBUS network

PROFIBUS message

DP-V1 Explicit message

6-2 CJ-series PROFIBUS Master Unit Operation Manual for NJ-series CPU Unit (W509)

6 Message Communications

6-2 Sending Acyclic Messages Using

SendCmd Instructions

The SendCmd (send command) instruction can be used in the CPU Unit user program of the CJ-series

PROFIBUS Unit to send acyclic messages.

In a program that issues acyclic messages, the following execution conditions are generally used based on the AND gate:

Network Enabled Flag on the CPU Unit side

*_MstrOperateSta; the PROFIBUS Master Unit is in Operate mode and commencing I/O data exchange.

Execution Condition _Port_isAvailable *_MstrOperateSta sample

SendCmd

Execute

DstNetAdr

CommPort

CmdDat

CmdSize

RespDat

Option

Done

Busy

Error

ErrorID

ErrorIDEx

RespDat

Example of Sending Acyclic Messages Using SendCmd Instruction

Below is an example of reading alarm information using the EXPLICIT MESSAGE SEND command

(2801) from the PROFIBUS Communication Unit with the following system configuration:

PROFIBUS Master Unit’s station address: 05

Unit number: 0

Unit address: 11 Hex

GRT1-PRT Communication Unit’s station address: 65

6

NJ series CPU Unit

PROFIBUS Master Unit No.: 0

SendCmd

Master Unit station address: 05

Unit address: 11 Hex

Explicit message

GRT1-PRT Communicatio

Unit station address: 65

CJ-series PROFIBUS Master Unit Operation Manual for NJ-series CPU Unit (W509) 6-3

6 Message Communications

6-4

SendCmd

Execute

Done

DstNetAdr Busy

CommPort

CmdDat

CmdSize

RespDat

Option

Error

ErrorID

ErrorIDEx

RespDat

Command source

Sdata[0]

Sdata[1]

Sdata[7]

Sdata[8]

SendCmd

Destination

Command code interpretation

Rdata[0]

Rdata[1]

Rdata[8]

Rdata[9]

Response

Execution

Input Variable

Execute

DstNetAdr

CommPort

CmdDat

CmdSize

RespDat

Option

Function

The operation SendCmd is executed when TRUE is set.

The destination network address is specified with the use of the network address/node address/unit address.

The destination port is specified.

Sdata[0] Command code

Sdata[1]

Sdata[2] Slave node address (65)

Sdata[3]

Sdata[4]

Sdata[5]

Sdata[6]

ServiceCode

ClassID

InstanceID

Example Details

---

Network address: 0

Node address: 0

Unit address: 16#11

NONE (Default)

16#28

16#01

16#41

16#0E

16#00

16#9C

16#00

Sdata[7]

Sdata[8] AttributeID

The number of bytes corresponding to the command data to be sent is specified.

Command code

16#01

16#73

9

Rdata[0]

Rdata[1]

Rdata[2]

Rdata[3]

End code

16#28

16#01

16#00

16#00

Rdata[4]

Rdata[5]

Rdata[6]

Rdata[7]

Rdata[8]

Rdata[9]

Rdata[10]

Rdata[11]

Number of bytes received

Slave node address (65)

ServiceCode (when completed normally)

Number of slave alarm data: 32 (20 Hex)

Status of slave #4, slave #3 (2 bits each)

Status of slave #8, slave #7 (2 bits each)

Status of slave #1, slave #2 (2 bits each)

16#00

16#2A

16#41

16#8E

16#20

16#00

16#00

16#00

Rdata[12 to 41] -(continue)

Response monitoring, and number of resends, are specified.

ResponseTime = 3C

Retry = 0

CJ-series PROFIBUS Master Unit Operation Manual for NJ-series CPU Unit (W509)

6 Message Communications

Additional Information

You can send acyclic messages to OMRON slaves by setting the command code to 28 01.

In this case, set the response monitoring time to at least the value set for the message monitoring timer (default: 2s). If it is set to less than the value, communications may be busy even if the next command is executed after the first one times out.

Unit Settings

Name

Unit Configuration

Device name of this unit

Unit number

Setting target

CPU/Expansion Racks under

Controller Configurations and

Setup of Sysmac Studio

Unit No. Switch and Unit Configuration and Setup

(CPU/Expansion Racks under

Controller Configurations and

Setup of Sysmac Studio)

Settings

Mount CJ1W-PRM21 in slot 0 of the

CPU Rack.

"PRM21"

Unit number 0

Program Example

System-defined variable

Name Data type

_Port_isAvailable BOOL ---

Default Comments

Communications Port

Enabled Flags

Details

TRUE when there are internal logical ports available, FALSE when there is no internal logical port available.

User-defined variables (Define before or when creating a program)

Name

Trigger

OperatingEnd

Operating

InDNetAdr

InOption

Sdata

Rdata

RS_instance

SendCmd_instance

Data type Default

BOOL

BOOL

False

False

BOOL

_sDNET_ADR

False

(NetNo := 0, NodeNo := 0,

UnitNo := 16#0)

_sRESPONSE (isNonResp := False, TimeOut :=

0, Retry := 0)

ARRAY[0..8] OF BYTE [9(16#0)]

ARRAY[0..9] OF BYTE [10(16#0)]

RS ---

SendCmd ---

Details

Execution conditions

Process completed

Processing

Destination network address

Response monitoring and retry setting

Send data

Receive data

---

---

Device variables for CJ-series Unit (Create on the I/O Map View window after the unit configuration is created)

Name

PRM21_MstrOper ateSta

Data type

BOOL ---

Default

Allocated address (AT)

IOBus://rack#0/slot

#0/MstrSta/MstrOp erateSta

Comments

Online Status

Details

TRUE when the

Unit is in Operate mode and commencing I/O Data-

Exchange.

6

CJ-series PROFIBUS Master Unit Operation Manual for NJ-series CPU Unit (W509) 6-5

6 Message Communications

Determining the SendCmd instruction execution completion

SendCmd_instance.Done

SendCmd_instance.Error

Trigger reception

Trigger

_Port_isAvailable

PRM21_MstrOperateSta

OperatingEnd

RS_instance

RS

Set Q1

Reset1

Communications parameters settings

Operating

1 InDNetAdr.NetNo:=0;

2 InDNetAdr.NodeNo:=0;

// Network address settings

//

3 InDNetAdr.UnitNo:=BYTE#16#11; //

4 InOption.isNonResp:=FALSE;

5 InOption.TimeOut:=60;

6 InOption.Retry:=0;

7 Sdata[0]:=BYTE#16#28;

8 Sdata[1]:=BYTE#16#01;

//

//

// Command data settings

//

9 Sdata[2]:=BYTE#16#41;

10 Sdata[3]:=BYTE#16#0E;

11 Sdata[4]:=BYTE#16#00;

12 Sdata[5]:=BYTE#16#9C;

//

//

//

//

13 Sdata[6]:=BYTE#16#00;

14 Sdata[7]:=BYTE#16#01;

15 Sdata[8]:=BYTE#16#73;

//

//

//

SendCmd instruction execution

Operating

InDNetAdr

_ePORT#_NONE

Sdata[0]

UINT#9

Rdata[0]

InOption

SendCmd_instance

SendCmd

Execute

DstNetAdr

CommPort

CmdDat

CmdSize

RespDat

Option

Done

Busty

Error

ErrorID

ErrorIDEx

RespDat

Processing at normal end

Operating SendCmd_instance.Done

1

2

;

// Processing after normal end

Processing at an error completion

Operating SendCmd_instance.Error

1

2

;

// Processing after an error completion

OperatingEnd

Operating

6-6 CJ-series PROFIBUS Master Unit Operation Manual for NJ-series CPU Unit (W509)

6 Message Communications

6-3 Acyclic Messages

Acyclic message services allow exchange of extended information between a PROFIBUS DP-V1 Master and a PROFIBUS DP-V1 slave device during regular I/O data exchange.

6-3-1 EXPLICIT MESSAGE SEND (2801)

Sends an explicit message over the PROFIBUS network to an OMRON slave device (GRT1 SmartSlice for example) and receives a response.

Explanation

The Explicit Message Send command sends a CIP-defined explicit message to an OMRON PROFI-

BUS Slave device supporting CIP messages.

Note 1 For information on explicit messages for OMRON slave, refer to SmartSlice GRT1-Series

GRT1-PRT PROFIBUS Communication Unit Operation Manual (Cat No. W04E-EN-

).

2 The Explicit Message Send command is wrapped in a PROFIBUS DP-V1 Class 2 message. The handling of this message, i.e. establishing a connection, transferring data and aborting a connection is done automatically by the PROFIBUS Master unit.

Command Format

28 01 996 bytes max.

Command code

Class ID Instance ID Service data

Service code

Destination station address

Response Format

If a normal response has been returned by the targeted device, the response format for the executed explicit message is as follows:

6

28 01 00 00 996 bytes max.

Command code

Response code

No. of bytes

received

Service data

Service code

Source station address (local node)

If transmission of the Explicit message was successful, but the execution was not, the response message will still contain response code 0000 as well as return data. However, an error code, indicating the failure will be part of the data block. The response format for this case is shown below.

CJ-series PROFIBUS Master Unit Operation Manual for NJ-series CPU Unit (W509) 6-7

6 Message Communications

6-8

28 01 00 00 94

Command code

Response code

No. of bytes received

Error code

Service code 94 (Hex)

Source station address (local node)

For the definition of the error codes for unsuccessful execution of CIP messages, refer to the Smart-

Slice GRT1-Series GRT1-PRT PROFIBUS Communication Unit Operation Manual (Cat. No. W04E-

EN-

).

If transmission of the message was unsuccessful, the response frame will only contain a response code and no data block.

Response Codes

The table below lists the response codes for the message transmission itself.

Response code

0000

1001

1002

110C

2208

220F

Description

Normal completion.

Command too large, i.e. > 1004 bytes.

Command too short, i.e. < 8 bytes.

Device Address Invalid, i.e. > 7E (Hex)

PROFIBUS Master unit not in correct mode, i.e. it is in OFFLINE mode.

The connection was rejected, i.e. the Master Unit could not establish connection to send the requested message.

A timeout has occurred, i.e. the Master Unit did not transmit the message in time, or the slave device did not respond in time. An open connection will be aborted.

The slave device does not support this message.

Parameters

Send Destination Station Address (Command)

Specifies the station address of device to send the explicit message to over the PROFIBUS network.

Service Code (Command, response)

The service code defines the action to be implemented with the data sent to the slave device, e.g.

Read, Write, Save. The service codes are listed in the Operation manual of the targeted slave device.

For normal responses, the service code is returned within the response data block, with bit 15 of the service code set to ON. For error responses, 94 hex, which indicates an error, is returned.

Class ID (Command)

Specifies the class ID for the explicit message destination. The supported Class ID values are specified in the Operation manual of the targeted slave device.

Instance ID (Command)

Specifies the instance ID for the explicit message destination. The supported Instance ID values are specified in the Operation manual of the targeted slave device.

Service Data (Command, response)

CJ-series PROFIBUS Master Unit Operation Manual for NJ-series CPU Unit (W509)

6 Message Communications

For commands, specifies the data defined by the service code.

For responses, returns the reception data defined by the service code.

No. of Bytes Received (Response)

Returns the number of data bytes received in the rest of the message.

Source Station Address (local node) (Response)

Returns the Station Address of the responder.

Error Code (Response)

Returns the error code defined by the slave device.

6-3-2 PROFIBUS MESSAGE SEND (2809)

The PROFIBUS MESSAGE SEND command provides a means to initiate transmission and reception of standard PROFIBUS DP and DP-V1 Class 1 services over the PROFIBUS network via the CJ1W-

PRM21 PROFIBUS Master Unit. The general command/response structures are shown below.

Command Format

PROFIBUS service data

28 09

Command code

Device address

PROFIBUS command specific data

Device Service

Access Point

Response Format

6

28 09

Command code

Response code

PROFIBUS service data

Parameters

The PROFIBUS service data part in both the command and response depends on the PROFIBUS service to be transmitted / received, and will therefore be different in length and contents for every service. Also, the response error codes will depend on the services requested. The common parameters are described below. Each supported service will be described separately after the common parameters.

Destination Address (Command)

The address of the device on the PROFIBUS network, to which the PROFIBUS message will be sent. The valid address range is 0 to 7E (Hex).

Device Service Access Point (Command)

The Device Service Access Point is a 1 byte number, identifying the PROFIBUS service to the slave device, as defined by the PROFIBUS standard.

CJ-series PROFIBUS Master Unit Operation Manual for NJ-series CPU Unit (W509) 6-9

6 Message Communications

.

The table below lists the PROFIBUS services supported using the PROFIBUS MESSAGE SEND command

PROFIBUS Service

Set_Slave_Add

Rd_Inp

Rd_Outp

Get_Cfg

37

38

D SAP

(Hex)

39

3B

MSAC1_Read

MSAC1_Write

33

33

Description

Change the address of a slave device.

Read the Input data of a slave device.

Read the Output data of a slave device.

Read the PROFIBUS DP I/O Configuration of a slave device.

PROFIBUS DP-V1 (Class 1) Acyclic Data Read from a slave device.

PROFIBUS DP-V1 (Class 1) Acyclic Data Write to a slave device.

10

11

12

13

14

18

Page

Set_Slave_Add Service

The PROFIBUS DP Set_Slave_Add service allows a PROFIBUS Master Unit to change the address of a remote slave device. It is defined for slave devices of which the PROFIBUS address cannot be set through switches. Slave devices which support this service also provide a means to store the address in internal non-volatile memory. In case this non-volatile memory does not contain an entry, the slave device will assume the default address 126.

The figures below show the command and response message formats.

Command Format

28 09

Command code

Device address

PROFIBUS

Ident Number

Device Service

Access Point

New device address

Additional slave data

Address change lock

Response Format

6-10

28 09

Command code

Response code

Parameters

Destination Address (Command)

The address of the device on the PROFIBUS network, to which the PROFIBUS message will be sent. The valid address range is 0 to 7E (Hex).

Device Service Access Point (Command)

The Device Service Access Point for the Set_Slave_Add PROFIBUS service must be set to 37

(Hex).

PROFIBUS Ident Number (Command)

CJ-series PROFIBUS Master Unit Operation Manual for NJ-series CPU Unit (W509)

6 Message Communications

The PROFIBUS Ident Number is a 1 word identifier, issued by PROFIBUS International, which identifies the slave device type and model. The number can be obtained form the slave device GSD file or from the slave documentation.

New Device Address (Command)

Contains the new address of the device. The valid address range is 0 to 7E (Hex).

Address Change Lock (Command)

Enables address lock, after changing it. Valid range:

00 Disable Address Lock

01: Enable Address Lock

Enabling Address Lock makes any future changes of the address impossible, even after powerdown/power-up of the slave device.

Response Codes

Response code

0000

1001

1002

110C

2208

0001

0402

Description

Normal completion

Command too large, i.e. > 124 words

Command too short, i.e. < 4 words.

Device Address Invalid, i.e. > 7E (Hex)

New Device Address Invalid, i.e. > 7E (Hex)

Address change lock invalid, i.e. not equal to 00 or 01.

Invalid target slave address (exceeds 125).

PROFIBUS Master unit not in correct mode, i.e. it is in OFFLINE mode.

The slave has deactivated this service.

The slave has not responded to the request.

The slave does not have sufficient memory space for the request data.

New Address is same as current master address.

Service is not supported: Device Service Access Point is invalid.

6

Rd_Inp Service

The PROFIBUS DP Rd_Inp service allows a PROFIBUS Master Unit to read the current input data of any slave device, even if it is not allocated to the Master Unit.

The figures below show the command and response message formats.

Command Format

28 09 38

Command code

Device address

Device Service

Access Point

CJ-series PROFIBUS Master Unit Operation Manual for NJ-series CPU Unit (W509) 6-11

6 Message Communications

Response Format

28 09

Command code

Response code

Device address

Data length

(Bytes)

Input data

Parameters

Destination Address (Command, Response)

The address of the device on the PROFIBUS network, to which the PROFIBUS message will be sent. The valid address range is 0 to 7E (Hex). The most significant byte in the Response Format is set to 00.

Device Service Access Point (Command)

The Device Service Access Point for the Rd_Inp PROFIBUS service must be set to 38 (Hex).

Data length (Bytes) (Response)

This parameter defines the number of Input data bytes returned by the slave device. The number ranges from 0 to 244 bytes. The most significant byte is set to 00.

Input data (Response)

Input data returned by the slave device.

Response Codes

Response code

0000

1001

1002

110C

2208

0001

0402

Description

Normal completion

Command too large, i.e. > 2 words

Command too short, i.e. < 2 words.

Device Address Invalid, i.e. > 7E (Hex)

PROFIBUS Master unit not in correct mode, i.e. it is in OFFLINE mode.

The slave has deactivated this service.

The slave has not responded to the request.

The slave does not have sufficient memory space for the request data.

Destination address is same as current master address.

Service is not supported: Device Service Access Point is invalid.

Rd_Outp Service

The PROFIBUS DP Rd_Outp service allows a PROFIBUS Master Unit to read the current output data of any slave device, even if it is not allocated to the Master Unit.

The figures below show the command and response message formats.

6-12 CJ-series PROFIBUS Master Unit Operation Manual for NJ-series CPU Unit (W509)

6 Message Communications

Command Format

28 09 39

Command code

Device address

Device Service

Access Point

Response Format

28 09

Command code

Response code

Device address

Data length

(bytes)

Output data

Parameters

Destination Address (Command, Response): The address of the device on the PROFIBUS network, to which the PROFIBUS message will be sent. The valid address range is 0 to 7E (Hex). The most significant byte in the Response Format is set to 00.

Device Service Access Point (Command): The Device Service Access Point for the Rd_Outp PRO-

FIBUS service must be set to 39 (Hex).

Data length (Bytes) (Response): This parameter defines the number of Output data bytes returned by the slave device. The number ranges from 0 to 244 bytes. The most significant byte is set to 00.

Output Data (Response): Output data returned by the slave device.

Response Codes

6

Response code

0000

1001

1002

110C

2208

0001

0402

Description

Normal completion

Command too large, i.e. > 2 words

Command too short, i.e. < 2 words.

Device Address Invalid, i.e. > 7E (Hex)

PROFIBUS Master unit not in correct mode, i.e. it is in OFFLINE mode.

The slave has deactivated this service.

The slave has not responded to the request.

The slave does not have sufficient memory space for the request data.

Destination address is same as current master address.

Service is not supported: Device Service Access Point is invalid.

Get_Cfg Service

The PROFIBUS DP Get_Cfg service allows a PROFIBUS Master Unit to read the I/O Configuration data of any slave device, even if it is not allocated to the Master Unit.

The figures below show the command and response message formats.

CJ-series PROFIBUS Master Unit Operation Manual for NJ-series CPU Unit (W509) 6-13

6 Message Communications

Command Format

28 09 3B

Command code

Device address

Device Service

Access Point

Response Format

28 09

Command code

Response code

Device address

Data length

(bytes)

I/O Configuration data

Parameters

Destination Address (Command, Response)

The address of the device on the PROFIBUS network, to which the PROFIBUS message will be sent.

The valid address range is 0 to 7E (Hex). The most significant byte in the Response Format is set to 00.

Device Service Access Point (Command)

The Device Service Access Point for the Get_Cfg PROFIBUS service must be set to 3B (Hex).

Data length (Bytes) (Response)

This parameter defines the number of I/O Configuration bytes returned by the slave device. The number ranges from 0 to 244 bytes. The most significant byte is set to 00.

I/O Configuration data (Response)

I/O Configuration data returned by the slave device. The I/O Configuration bytes are coded according to the PROFIBUS standard.

Response Codes

Response code

0000

1001

1002

110C

2208

0001

0402

Description

Normal completion

Command too large, i.e. > 2 words

Command too short, i.e. < 2 words.

Device Address Invalid, i.e. > 7E (Hex)

PROFIBUS Master unit not in correct mode, i.e. it is in OFFLINE mode.

The slave has deactivated this service.

The slave has not responded to the request.

The slave does not have sufficient memory space for the request data.

Destination address is same as current master address.

Service is not supported: Device Service Access Point is invalid.

6-14 CJ-series PROFIBUS Master Unit Operation Manual for NJ-series CPU Unit (W509)

6 Message Communications

MSAC1_Read Service

The PROFIBUS DP-V1 MSAC1_Read service allows a PROFIBUS DP-V1 Master Unit to read (parameter) data acyclically from a PROFIBUS DP-V1 slave device, which is allocated to that Master unit.

The figures below show the command and response message formats.

Command Format

28 09 33 00 5E

Command code

Device address

Device Service

Access Point

Function code

Slot number

Data length

(bytes)

Index number

Response Format

Upon normal completion of the MSAC1_Read command service two types of response frames can be returned:

A normal data response frame containing the requested data.

A normal response frame containing PROFIBUS error codes, indicating that the PROFIBUS service was not completed correctly, although the message was completed normally.

Both response frames are shown below.

6

28 09 00 5E

Command code

Response code

Function code

Actual data length read

(bytes)

Data

28 09 00 DE

Command code

Response code

Function code

Error decode

Error code 1

Error code 2

Parameters

Destination address (Command, Response)

The address of the device on the PROFIBUS network, to which the PROFIBUS message will be sent. The valid address range is 0 to 7E (Hex). The most significant byte in the Response Format is set to 00.

Device Service Access Point (Command)

The Device Service Access Point for the MSAC1_Read PROFIBUS service must be set to 33 (Hex).

CJ-series PROFIBUS Master Unit Operation Manual for NJ-series CPU Unit (W509) 6-15

6 Message Communications

Function code (Command, Response)

The function code is defined by the PROFIBUS standard and defines the type of MSAC1 message.

In the command it must be fixed to 005E (Hex). The response will contain either 005E (Hex) indicating a normal PROFIBUS completion, or 00DE (Hex), indicating PROFIBUS errors.

Slot number (Command)

The parameter Slot_Number is used in the destination device for addressing the desired data slot

(typically an I/O module). The number ranges from 0 to 254.

Index number (Command)

The parameter Index is used in the destination device for addressing the desired data block within a specified slot. The number ranges from 0 to 254.

Data length (Bytes) (Command)

The Data length indicates the number of bytes, which have to be read. If the actual data block length is less than requested, the length in the response will be the actual length of the data block. If the actual data block length is greater or equal than requested, the response will contain the requested length of data. The number ranges from 0 to 240.

Data (Response)

Requested data block as retrieved from the PROFIBUS DP-V1 slave device.

Error decode (Response)

The Error decode byte defines the type of errors reported in the Error code 1 and Error code 2, e.g.

a PROFIBUS DP-V1 error.This response will only be returned if the message was delivered suc-

cessfully, but the PROFIBUS service returned an error. Refer to A-7-4 PROFIBUS DP-V1 Error

Codes for more information.

Error code 1, Error code 2 (Response)

The contents of the Error code bytes depends on the contents of the Error decode byte and the slave device.

The Error codes returned by a PROFIBUS DP-V1 slave device are defined in the PROFIBUS DP-V1

Extension to the PROFIBUS standard. This section lists the Error codes, which can be returned as a result of a PROFIBUS DP-V1 MSAC1 services. From these codes, the user can determine the cause of the failure.

The figure below shows the two of the three Error code bytes, returned by a PROFIBUS DP-V1 slave device, in case an MSAC1 service resulted in an error. The third byte, Error code 2, which is not shown below will always contain user specific error codes.

6-16 CJ-series PROFIBUS Master Unit Operation Manual for NJ-series CPU Unit (W509)

6 Message Communications

Error Decode Byte

Bit

00 to 07 Error Decode

Description

The code determines the protocol type of the slave which returned the error code. Since this error scheme can also be used in network applications containing protocol converters (i.e. gateways), non-PROFIBUS protocols are also defined in this list.

0 to 127: Reserved

128: PROFIBUS DP-V1

129 to 253: Reserved

254: PROFIBUS FMS

255: HART

®

In case the Error decode byte is 128, i.e. PROFIBUS DP-V1, the Error code 1 byte can have the possible values defined in the table below.

Error Code 1 Byte

0 to 9

Error Class Code

Reserved

10 Application

11

12

13 to 15

Access

Resource

User Specific

Error Code

--

0: Read error

1: Write error

2: Module failure

3 to 7: Reserved

8: Version conflict

9: Feature not supported

10 to 15: User specific

0: Invalid index

1: Write length error

2: Invalid slot

3: Type conflict

4: Invalid area

5: State conflict

6: Access denied

7: Invalid range

8: Invalid parameter

9: Invalid type

10 to 15: User specific

0: Read constrain conflict

1: Write constrain conflict

2: Resource busy

3: Resource unavailable

4 to 7: Reserved

8 to 15: User specific

--

Description

Error codes related to the application, i.e. the slave device it self or I/O modules connected to this device.

Error codes related to accessing the requested data area in the slave device or I/O modules connected to the slave device.

Error codes related to resources inside the slave device which are required to process the requested data, e.g. functions required to implement a requested action.

Error Code 2 Byte

This error code will always contain user specific error codes. If necessary, refer to the slave device’s documentation for decoding the returned byte.

6

CJ-series PROFIBUS Master Unit Operation Manual for NJ-series CPU Unit (W509) 6-17

6 Message Communications

Response Codes

Response code

0000

1001

1002

110C

2208

0001

0402

Description

Normal completion

Command too large, i.e. > 5 words

Command too short, i.e. < 5 words.

Device Address Invalid, i.e. > 7E (Hex).

The slot number is invalid, i.e. > FE (Hex).

The Index number is invalid, i.e. > FE (Hex).

The Data Length is invalid, i.e. > F0 (Hex)

PROFIBUS Master unit not in correct mode, i.e. it is in OFFLINE mode.

The slave has deactivated this service.

The slave has not responded to the request.

The slave does not have sufficient memory space for the request data.

Destination address is same as current master address.

Service is not supported:

Device Service Access Point is invalid.

The Function code is invalid

MSAC1_Write Service

The PROFIBUS DP-V1 MSAC1_Write service allows a PROFIBUS DP-V1 Master Unit to write (parameter) data acyclically to a PROFIBUS DP-V1 slave device, which is allocated to that Master unit.

The figures below show the command and response message formats.

Command Format

28 09 33 00 5F

Command code

Device address

Device Service

Access Point

Function code

Slot number

Data length

(bytes)

Index number

Data

Response Format

Upon normal completion of the MSAC1_Write command service two types of response frames can be returned:

A normal data response frame, signalling successful completion of both the command and the PROFIBUS service.

A normal response frame containing PROFIBUS error codes, indicating that the PROFIBUS service was not completed correctly, although the message was completed normally.

Both response frames are shown below.

6-18 CJ-series PROFIBUS Master Unit Operation Manual for NJ-series CPU Unit (W509)

6 Message Communications

28 09 00 5F

Command code

Response code

Function code

Actual length of data written

(bytes)

28 09 00 DF

Command code

Response code

Function code

Error decode

Error code 1

Error code 2

Parameters

Destination address (Command, Response)

The address of the device on the PROFIBUS network, to which the PROFIBUS message will be sent. The valid address range is 0 to 7E (Hex). The most significant byte in the Response Format is set to 00.

Device Service Access Point (Command)

The Device Service Access Point for MSAC1 PROFIBUS services must be set to 33 (Hex).

Function code (Command, Response)

The Function code is defined by the PROFIBUS standard and specifies the type of MSAC1 message. For the MSAC1_Read service it must be fixed to 005F (Hex). The Response Format will contain either 005F (Hex) indicating a normal PROFIBUS completion, or 00DF (Hex), indicating

PROFIBUS errors.

Slot number (Command)

The parameter Slot number is used in the destination device for addressing the desired data slot

(typically an I/O module). The number ranges from 0 to 254.

Index number (Command)

The parameter Index is used in the destination device for addressing the data block within a specified slot to which the data must be written. The number ranges from 0 to 254.

Data length (Bytes) (Command, Response)

The Data length indicates the number of bytes, which must be written. If the actual data block length is less than the length of the data written, the response will contain an error code in the Error code 1 byte. If the actual data block length is greater or equal than the length of the data block written, the response will contain the actual number of bytes written. The data length number ranges from 0 to

240.

Data (Command)

Data to be written to the PROFIBUS DP-V1 slave device.

Error decode (Response)

The Error decode byte defines the type of errors reported in the Error code 1 and Error code 2, e.g.

PROFIBUS DP-V1 error. This response will only be returned if the message was delivered success-

fully, but the PROFIBUS service returned an error. Refer to A-7-4 PROFIBUS DP-V1 Error Codes

for more information.

6

CJ-series PROFIBUS Master Unit Operation Manual for NJ-series CPU Unit (W509) 6-19

6 Message Communications

Error code 1, Error code 2 (Response)

The contents of the Error code bytes depends on the contents of the Error decode byte and the

slave device. Refer to A-7-4 PROFIBUS DP-V1 Error Codes for more information.

Response Codes

Response code

0000

1001

1002

110C

2208

0001

0402

Description

Normal completion

Command too large, i.e. > 125 words

Command too short, i.e. < 5 words.

Device Address Invalid, i.e. > 7E (Hex).

The slot number is invalid, i.e. > FE (Hex).

The Index number is invalid, i.e. > FE (Hex).

The Data Length is invalid, i.e. > F0 (Hex)

PROFIBUS Master unit not in correct mode, i.e. it is in OFFLINE mode.

The slave has deactivated this service.

The slave has not responded to the request.

The slave does not have sufficient memory space for the request data.

Destination address is same as current master address.

Service is not supported:

Device Service Access Point is invalid.

The Function code is invalid

6-3-3 MEMORY AREA READ (0101)

The MEMORY AREA READ command is used to read the last diagnostics data message the PROFI-

BUS Master Unit received from the specified slave device. The command frame requires three byte data type specifier, specifying the information and one byte specifying the slave device address.

The number of items to read must be 244 - the maximum data size of the PROFIBUS DP diagnostics message - or less.

Command Format

Response Format

01 01 81 FF 00

Command code

Data specifier

No. of items

(binary)

Device address

6-20

01 01

Command code

Response code

Parameters

Data specifier code (command)

Diagnostics data

(for number of items)

CJ-series PROFIBUS Master Unit Operation Manual for NJ-series CPU Unit (W509)

6 Message Communications

Defines the data to be retrieved from the Unit. Always set to 81 FF 00 (Hex).

Slave device address (command)

Defines the slave device network address. Set to 00 to 7D (Hex).

Number of items to read (command)

Defines the number of bytes to read. Set to 1 to F4 (Hex).

Response Codes

The following end codes can be returned by the Unit in response to the MEMORY AREA READ command:

Response code

0000

0203

0402

1001

1002

110C

2208

Description

Normal completion.

Slave device not allocated to the PROFIBUS Master.

Service not supported by Unit model / version.

Command too large.

Command too short.

Invalid start address code word (non-specified code used).

Invalid target slave address (exceeds 125).

Unit is not in correct mode, e.g. it is in OFFLINE or STOP mode.

6-3-4 ERROR LOG CLEAR (2103)

The ERROR LOG CLEAR command clears the number of records stored in the PROFIBUS Master

Unit error log.

Command Format

6

21 03

Command code

Response Format

21 03

Command code

Response code

Response Codes

Response code

0000

250F

260B

Description

Normal completion.

Memory writing error. Error Log was not cleared normally.

Cannot Clear the Error Log. The error cause still exists.

CJ-series PROFIBUS Master Unit Operation Manual for NJ-series CPU Unit (W509) 6-21

6 Message Communications

6-22 CJ-series PROFIBUS Master Unit Operation Manual for NJ-series CPU Unit (W509)

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