ProSoft Technology PS69-DPM User Manual

Page 92

Advertising
background image

Contents

PS69-DPM ♦ CompactLogix or MicroLogix Platform

User Manual

PROFIBUS DPV1 Master

Page 92 of 130

ProSoft Technology, Inc.

October 1, 2014

4.1

CompactLogix I/O Example

This ladder logic program is a basic example for the setup of the PROFIBUS-DP Master
communications module "PS69-DPM" in RSLogix 5000. This example can be used to start a
project when using a CPU 1769-L32E. Basic PROFIBUS I/O data exchange, Diagnostic
requests, and Global Control are shown. Details on the Subroutines created and the User
Defined Data Types are as follows.
MainRoutine: The MainRoutine calls all of the following routines based on conditions

like doing a diagnostic request or a Global Control command. This routine also contains
a simple I/O transfer function block.

IO_Global_Control: The IO_Global_Control routine serves as an example of how the

user can execute a Global Control to issue a Sync or Freeze to a slave module group.
This routine is executed based on the state of the DoIOGlobCtrl tag. The command,
Group, and Slave address data must be filled in before using the command.

IO_Slave_Diag: The IO_Slave_Diag routine shows an example of send a Slave

diagnostics request. The routine is called automatically by the logic found in the
MainRoutine or can be executed manually by toggling the DoIOSlaveDiag bit.

SR_Copy_Input: The SR_Copy_Input routine on every scan updates the

DpmInputArray structure with the Input Data of the module.

SR_Copy_Output: The SR_Copy_Output routine on every scan updates the

DpmOutputArray 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
DpmInputArray and DpmOutputArray. Their definitions and the structures included in each
are shown in RSLogix 5000 User Defined Data Types (page 110).

4.2

CompactLogix Messaging Example

This ladder logic program is a CIP messaging example for the setup of the PROFIBUS-DP
master communications module "PS69-DPM" in RSLogix 5000. This example can be used
to start a project when using a CPU 1769-L32, which supports CIP messaging. Basic
PROFIBUS I/O data exchange and all messaging function examples are shown. Details on
the subroutines created and the User Defined Data Types are as follows.
MainRoutine: The MainRoutine calls all of the following routines based on conditions

like doing a diagnostic request or a Global Control command. This routine also contains
a simple I/O transfer function block.

AlarmHandler: This routine shows an example on how to handle unsolicited DPV1

alarms from a Slave. The user must modify this routine to the DPV1 slave or slaves used
in the application.

Init_AlarmResMsg: The AlarmHandler routine is used to trigger this routine. When the

alarm event has occurred, this routine will format and send the response to a DPV1
Alarm from a Slave.

Init_GlobalControlMsg: This routine serves as an example of how the user can

execute a Global Control command used to issue a Sync or Freeze to a slave module
group. This routine will execute based on the state of the DoDDLMGlbCtrl tag. The
command, Group, and Slave address data must be filled in before using the command.

Init_GlobalVariables: Initializes the Slave address used by several other routines.

Make changes as needed to support the Slave address for your application.

Advertising