PROFINET Device4.2.0
 
Loading...
Searching...
No Matches
PROFINET-IO Device (PND) Application

Sample Application

This chapter describes the functionality of the implemented application as an example demonstrating how the Data-Exchange between PLC and EVM board works. For this purpose an I/O-Submodule / Telegram with I/O 4-Byte input and output data is used. It is pllugged in Slot-1, Subslot-2. The application on EVM board just copies the Output-Data into the Input-Data and transfer it to the PLC. On PLC side a counter value should be transfered cyclically by Output-Data.

PLC Programming

PLC tag table

Following figure shows the tag table of PLC in TIA portal:

  • Sitara1_In: 4 byre Input-Data from IO-Device to PLC,
  • Sitara1_Out: 4 byte Output-Data from PLC to IO-Device,
  • IOM_LED_Set: 1 byte Setpoint (Output-Data) from PLC to IO-Device, used to control LED. Bit-0: LED-1, Bit-1: LED-2...
  • IOM_LED_Act: 1 byte Actual-Value (Input-Data) from IO-Device, indicates the actual status of LED on IO-Device.

PLC-Data-tag

PLC Data-Block (DB1)

Following figure shows the additional Data-Block of PLC in TIA portal, this is inteded to synchronize/manage updating cyclically counter value according to PLC-Send-Clock and IO-Device cycle time:

  • RedRatio: controls the ratio between PLC and IO-Device cycle time,
  • CycleCnt: Cycle counter of IO-Device,
  • IO_diff: contains the calculated counter difference between Setpoint (output data) and Actual-Value (input data) from the IO-Device.

PLC-DB1

I/O Cycle Time Setting

PLC Send-Clock Cycle time

Following figure shows the configuration of PLC Send-Clock (in this example 1 millisecond):

PLC-Send-Clock

IO-Device Cycle time

Following figure shows the configuration of IO-Device Cycle time (in this example 2 millisecond):

IO-Device Cycle-time

Cyclically Interrupt Setting (OB30)

OB30 Cyclically Interrupt block used to control the counter value.

PLC-OB30 PLC-OB30-Cyle

Cyclically Interrupt Program (OB30)

PLC-Program

Cyclically Interrupt Program Network1

PLC-NW1

Cyclically Interrupt Program Network2

PLC-NW2

IO-Data Trace

Trace Signal definitions

Follwoing figure shows the signal definitions in TIA portal Trace:

PLC-Trace-Signals

Trace Time diagram

Follwoing figure shows the Trace Time diagram with captured curve of Input and Output Data:

PLC-Trace-Diag

IO-Device LED Control

Follwoing figure shows the LED-Control in watch_table:

IO-Device-LED