ProSoft Technology PS69-DPS User Manual

Page 50

Advertising
background image

RSLogix Example Program

PS69-DPS ♦ CompactLogix or MicroLogix Platform

User Manual

Profibus DP Slave Communication Module

Page 50 of 108

ProSoft Technology, Inc.

May 9, 2014

3.1

CompactLogix I/O Example

This ladder logic program is a basic example for the setup of the PROFIBUS-DP
Slave communications module "PS69-DPS" in RSLogix5000. This example can
be used to start a project when using a CPU 1769-L32E. Basic PROFIBUS I/O
data exchange is shown. Details on the Subroutines created and the User
Defined Data Types are as follows.
MainRoutine: The MainRoutine calls all of the following routines. This routine

also contains a simple I/O transfer function block.

DPS_Update_Ext_Data: The DPS_Update_Ext_Data routine serves as an

example of how the user can map each of the different extended status
information provided in the ExtStatusInfo array. This routine evaluates the
content of the ExtStaSelect value and copies the information into the
appropriate user defined data type.

SR_Copy_Input: The SR_Copy_Input routine on every scan updates the

DpsInputArray structure with the Input Data of the module.

SR_Copy_Output: The SR_Copy_Output routine on every scan updates the

DpsOutputArray structure with the Output Data of the module.

Numerous user defined data types have been created to make it easier to
address different elements of the Input and Output array of the module. The two
main structures are DpsInputArray and DpsOutputArray. Their definitions and the
structures included in each are shown in the following tables.

The I/O example program can also be used as an example for the two methods
of configuration "Configuration by Master" (ForceMasterConfig) and
"Configuration by Controller Application" (ForceUserConfig). The configuration
array of the sample project is pre-initialized with following values:

Configuration
word

Data
type

Low/High
Byte

Description

Configured
values

Explanation

0

INT

LOW Byte

Busaddress

2

This address will be active if the
rotary switches of the module are

adjusted to "00"

HIGH Byte

Force User
Configuration

0

0 = ForceMasterConfig
The module will take over the

configuration from the master.

1

INT

Reserved

2

INT

Watchdog Timeout

C8h (200dec) Watchdog 200 ms

3

INT

Number of valid config
bytes
(starting with

Local:1:C.Data[8])

8

8 Bytes of the module definition
array are valid

4

INT

Reserved

5

INT

Reserved

6

INT

Reserved

7

INT

Reserved

8

INT

LOW Byte

Module 1 Type

4

Module 1 Type:
Input Byte with consistency

HIGH Byte

Module 1 Length

3

Module 1 Length: 4 (byte)

Advertising