background image

18 - 

DeviceMaster UP PROFINET CbA User Guide

: 2000409 Rev. D

Chapter 2. Programming Interface

Handshaking (Optional)

2.7. Handshaking 

(Optional)

Handshaking between the DeviceMaster UP and the PLC assures the producer (for example, the PLC 
component) that the consumer (for example, DeviceMaster UP) received the serial packet. The producer must 
know this before it sends another packet. This avoids possible data loss that might occur due to dissimilar 
polling periods or system busy conditions.

Handshaking is optional. When you disable handshaking, serial data transfer is simplified. You must ensure 
that the duty cycle of the serial packets is low enough to prevent data loss.

2.7.1. General 

Serial 

Transfer 

Procedure: Handshaking Enabled

When you enable handshaking, the handshake variables 

HSK_ID

 and 

HSK_ACK

 act as flags to the serial 

data producer and consumer. In the initial state, producer and consumer set the handshake variables 

HSK_ID

 and 

HSK_ACK

 to zero and behave according to the following state machine:

Consumer

Producer

1.

Consumer loops reading 

HSK_ID

2.

Producer writes packet of 
serial data to 

DATA

 variable.

3.

Producer increments 

HSK_ID

.

4.

Producer loops reading 

HSK_ACK

.

5.

Consumer observes incremented 

HSK_ID

, consumes 

DATA

.

6.

Consumer writes 

HSK_ACK

 to 

equal 

HSK_ID

.

7.

Producer observes 

HSK_ACK

 

equals 

HSK_ID

. Serial packet 

has been consumed.

Repeat

Содержание DeviceMaster Up

Страница 1: ...PROFINET CbA User Guide ...

Страница 2: ...trademark of Microsoft Corporation in the United States and or other countries Other product names mentioned herein may be trademarks and or registered trademarks of their respective owners Fourth Edition September 6 2008 Copyright 2005 2008 Comtrol Corporation All Rights Reserved Comtrol Corporation makes no representations or warranties with regard to the contents of this document or to the suit...

Страница 3: ...rt 13 2 5 4 3 Input Variables 14 2 5 4 4 Output Variables 14 2 5 5 Programming Suggestions 14 2 5 6 Maximum Length for a Serial Packet 15 2 5 6 1 DeviceMaster UP 1 Port 15 2 5 6 2 DeviceMaster UP 4 Port 15 2 6 How the DeviceMaster UP Transmits Data 16 2 6 1 Receive Serial Packet Example 16 2 6 2 Send Serial Packet Example 17 2 6 3 Send Receive Serial Packet Example 17 2 7 Handshaking Optional 18 2...

Страница 4: ...ection 36 4 5 3 Requirements 36 4 5 4 Procedure 36 4 6 Setting a Project s Transfer Properties 37 4 6 1 Defining Transfer Properties for the Interconnections of an Entire Project 37 4 6 2 Changing the Transfer Properties of an Interconnection 38 4 7 Assigning Addresses 39 4 7 1 Procedure 39 4 8 Using PortVision Plus to Change the PROFINET CbA Number 40 4 8 1 Procedure 40 4 9 Downloading Interconne...

Страница 5: ...s you are familiar with the following topics Windows operating system PROFINET CbA Siemens S7 PLC optional SIMATIC iMap configuration program 1 2 Product Overview The DeviceMaster UP is a PROFINET CbA Component Based Automation device server after you upload the firmware over the default application After uploading the firmware the DeviceMaster UP provides an PROFINET CbA interface to serial devic...

Страница 6: ...T CbA loaded on the DeviceMaster UP are identified in PortVision Plus and the DeviceMaster UP is labeled accordingly Configure the DeviceMaster UP IP address using PortVision Plus Note If necessary refer to the DeviceMaster UP Hardware Installation and Configuration Guide for the above procedures DeviceMaster UP Hardware Installation and Configuration Guide contains hardware installation PortVisio...

Страница 7: ...ceMaster UP serial port settings using Chapter 3 Embedded Configuration Pages on Page 25 2 Commission the device For more information see the instructions in Chapter 4 Commissioning the DeviceMaster UP on Page 31 3 Connect your serial device or devices and make sure all Ethernet devices are attached to the same Ethernet subnet If necessary refer to the DeviceMaster UP Hardware Installation and Con...

Страница 8: ...8 DeviceMaster UP PROFINET CbA User Guide 2000409 Rev D Chapter 1 Introduction PROFINET CbA Application Setup ...

Страница 9: ... CbA properties You can set these communication property values through SIMATIC iMap The following subsections describe 2 2 1 What is PROFINET CbA 2 2 2 Transfer Modes 2 2 3 Quality of Service QOS For additional information see 4 6 Setting a Project s Transfer Properties on Page 37 2 2 1 What is PROFINET CbA PROFINET CbA is the Ethernet based automation standard issued by the PROFIBUS Nutzerorgani...

Страница 10: ...in cyclical transfer mode for example every 10 ms Use this transfer mode for Soft Real Time SRT Scanning frequency acyclical Determines how frequently the data is polled for example every 100 ms in acyclical transfer mode The scanning frequency is the maximum time that elapses before a change in value is transferred You can set a transfer or scanning frequency to fast medium or low frequency You c...

Страница 11: ...ly When you enable ETX the DeviceMaster UP scans the serial data for the ETX When the DeviceMaster UP finds an ETX it stores the data as a packet When you enable Timeout and the time between characters exceeds the Timeout value the DeviceMaster UP stores the data as a packet Note You can enable ETX and Timeout together The DeviceMaster UP polls the serial port for serial data The collection of a p...

Страница 12: ...s on Page 6 for information on locating these files 2 5 1 What is SIMATIC iMap SIMATIC iMap is a device independent engineering tool designed by Siemens for Component based Automation CBA Use it to configure commission and monitor modular distributed automation systems based on the PROFINET CbA standard For more information see Chapter 4 Commissioning the DeviceMaster UP on Page 31 2 5 2 Component...

Страница 13: ... The input and output variables in this table are described in 2 5 4 3 Input Variables on Page 14 and 2 5 4 4 Output Variables on Page 14 Input Data Type Output Data Type P1_SEND_DATA BSTR 128 P1_RECV_DATA BSTR 128 P1_SEND_HSK_ID unsigned short P1_RECV_HSK_ID unsigned short P1_RECV_HSK_ACK unsigned short P1_SEND_HSK_ACK unsigned short P1_ENABLE bool P1_ENABLED bool P1_RESET bool P1_STATUS unsigned...

Страница 14: ...contains a new packet of serial data Px_RECV_HSK_ACK This variable sends the receive handshake acknowledgement When you enable handshaking DeviceMaster UP acknowledges that the packet in Px_RECV_DATA has been consumed When you disable handshaking this value is zero Px_ENABLE This variable opens the serial port and allows serial data to flow When you enable the port it also performs a port reset fl...

Страница 15: ...o PROFINET CbA restrictions the packet lengths are fixed as shown in the following table 2 5 6 2 DeviceMaster UP 4 Port If you have a DeviceMaster UP 4 port you can configure the connections for two ports to use one QOS setting for example cyclical fast The connections to the other two ports must be configured to another QOS setting for example cyclical medium Note You cannot configure the connect...

Страница 16: ...1 Receive Serial Packet Example The following diagram shows how data flows when using DeviceMaster UP to receive serial data The following example shows a SIMATIC iMap connection Serial Device DeviceMaster PLC Serial Packet Receive Serial Packet Px_RECV_DATA Px_RECV_HSK_ID PX_RECV_HSK_ACK Receive Serial Packet iMap Connections RECV_SERIAL_DATA RECV_HSK_ID RECV_HSK_ACK Px_RECV_DATA Px_RECV_HSK_ID P...

Страница 17: ...ections The following example shows a SIMATIC iMap connection Serial Device DeviceMaster PLC Serial Packet Send Serial Packet Px_SEND_DATA Px_SEND_HSK_ID PX_SEND_HSK_ACK Send Serial Packet SIMATIC iMap Connections SEND_SERIAL_DATA SEND_HSK_ID SEND_HSK_ACK Px_SEND_DATA Px_SEND_HSK_ID Px_ENABLE Px_SEND_HSK_ACK HIGH True PLC Component DeviceMaster UP Send Receive Serial Packet SIMATIC iMap Connection...

Страница 18: ...u must ensure that the duty cycle of the serial packets is low enough to prevent data loss 2 7 1 General Serial Transfer Procedure Handshaking Enabled When you enable handshaking the handshake variables HSK_ID and HSK_ACK act as flags to the serial data producer and consumer In the initial state producer and consumer set the handshake variables HSK_ID and HSK_ACK to zero and behave according to th...

Страница 19: ...andshaking Disabled When you disable handshaking only HSK_ID is used as a transfer flag between producer and consumer and producer and consumer behave according to the following state machine Consumer Producer 1 Consumer loops reading HSK_ID 2 Producer writes packet of serial data to DATA variable 3 Producer increments HSK_ID 4 Consumer observes incremented HSK_ID consumes DATA Repeat ...

Страница 20: ...20 DeviceMaster UP PROFINET CbA User Guide 2000409 Rev D Chapter 2 Programming Interface General Serial Transfer Procedure Handshaking Disabled ...

Страница 21: ...e device in the Address box of your web browser and press Enter to access the Server Configuration page 1 From PortVision Plus select the DeviceMaster UP that you want to configure and select Web Manager in the Device menu The DeviceMaster UP Server Configuration page appears 2 Select a port for example Port 1 to access the Edit Port Configuration page 3 Change the port configuration properties as...

Страница 22: ... setup you must use PortVision Plus to initially configure the network information into the DeviceMaster UP before configuring serial port characteristics Note See the instructions in the DeviceMaster UP Hardware Installation Guide or the PortVision Plus on line help system if you need help configuring the network settings Port configuration settings must be configured through the web page see 3 4...

Страница 23: ...ion about using this page Port Select the appropriate port to access the Edit Port Configuration page for that port See 3 4 Edit Port Configuration on Page 27 for information Serial Port Settings area You can change the serial port settings if you select the link to the appropriate port See 3 4 1 Edit Serial Configuration on Page 28 for information about serial port settings Serial Counters area S...

Страница 24: ... out of the serial port TX Pkt Count Displays the number of serial packets sent out of the serial port RX Byte Count Displays the number of bytes received over the serial port RX Pkt Count Displays the number of packets received over the serial port Parity Errors Displays the number of received serial packets dropped due to parity errors Framing Errors Displays the number of received serial packet...

Страница 25: ...a framing error and the packet was dropped Check the serial word length 7 bit 8 bit etc Parity error The UART detected a parity error and the packet was dropped Check the UART parity setting Overrun error The UART detected an overrun condition and data was lost Use flow control if necessary No STX STX was enabled in the Packet ID configuration but serial bytes were received that did not match that...

Страница 26: ...The network information is programmed into the DeviceMaster after applying the changes and rebooting the device If necessary see your network administrator for a valid IP address Note The DeviceMaster family default IP address is 192 168 250 250 default subnet mask is 255 255 0 0 and the default IP gateway is 192 168 250 1 3 Enter the PROFINET CbA number for the device in the provided box For more...

Страница 27: ... CbA User Guide 2000409 Rev D 27 Edit Port Configuration 3 4 Edit Port Configuration Use the Edit Port Configuration page to change a serial port parameters for example baud parity etc and serial port protocol settings See the following subsections for screen details ...

Страница 28: ...must be odd When the total is odd the parity bit is set to zero when it is even the parity bit is set to one Even When the sum of all the 1 bits is even the parity bit must be set to zero when it is odd the parity bit must be set to one Data Bits Select the number of bits that make up the data Choose from 5 6 7 or 8 bits Stop Bits Select the number of bits to mark the end of data transmission Flow...

Страница 29: ...abled When enabled the DeviceMaster UP scans the serial data for ETX If ETX is found the data is stored as a packet none When disabled the serial data is not scanned for ETX CR LF When CR LF Control line feed is enabled the DeviceMaster UP scans for CR LF Packet Timeout Detect When enabled it specifies the interpacket timeout in microseconds ms The default is disabled enabled When enabled and the ...

Страница 30: ...ation page to save the configuration 3 5 Configuration Updated This page appears when there are changes to the IP address or PROFINET CbA and indicates a reboot is required for changes to take affect Continue Returns to the Server Configuration page without rebooting the DeviceMaster UP Reboot Restarts the DeviceMaster UP with the latest changes Option Description Undo Changes Restores modified po...

Страница 31: ... Address on Page 42 You may want to read Chapter 2 Programming Interface on Page 11 before performing any of the procedures in this section You must meet the following requirements SIMATIC iMap must be installed on your computer Note If your computer is running Windows 2000 Professional or Windows XP Professional go to the Siemens web site and review the notes on the operation of SIMATIC iMap unde...

Страница 32: ...ady exists select Project Open and click the library in which you want to import the PROFINET CbA component The filename must have a cpb extension When the library name appears in the File name box click Open Note The file name drop down list contains the most recently opened SIMATIC iMap projects 3 Select the Project Library window and select Library Import components from the menu and browse to ...

Страница 33: ... for communication with other PROFINET CbA components SIMATIC iMap displays the technological function as a block with inputs and outputs in the SIMATIC iMap plant view The following example shows the technological function for a DeviceMaster UP 1 port 4 3 2 What is a PROFINET CbA Number SIMATIC iMap assigns a PROFINET CbA number PROFINET No technological function when you insert a PROFINET CbA co...

Страница 34: ...op the PROFINET CbA component into a project SIMATIC iMap creates an instance of the PROFINET CbA component in the project iMAP assigns additional properties to each instance for example a name and address The association between all the instances and the original PROFINET CbA component is indicated by their identical identification ID and version number 2 Record the PROFINET CbA number for each P...

Страница 35: ...ppears by an enabled serial port 4 5 Interconnecting Technological Functions The following subsections describe 4 5 1 What are Interconnections 4 5 2 Rules for Interconnection on Page 36 4 5 3 Requirements on Page 36 4 5 4 Procedure on Page 36 Make sure that you have read 2 6 How the DeviceMaster UP Transmits Data on Page 16 before reading the following subsections 4 5 1 What are Interconnections ...

Страница 36: ...e If you change the settings of objects for example interconnections in SIMATIC iMap they do not take immediate effect on the plant These changes will not become active until you download the interconnections to the DeviceMaster UP For more information see 4 9 Downloading Interconnections from SIMATIC iMap on Page 41 The following task describes how to create an interconnections between technologi...

Страница 37: ...fault setting for the new interconnections box Note These settings will apply to all subsequently created interconnections 4 Select the appropriate settings in the Transfer frequencies cyclical box 5 Select the appropriate settings in the Scanning frequencies acyclical box Note You must set the fast value for Scanning frequencies acyclical to 100 ms 6 Click OK or Accept to confirm and save your ch...

Страница 38: ...dividual interconnection You may want to review 2 5 6 Maximum Length for a Serial Packet on Page 15 before selecting the transfer mode QOS for an interconnection 1 Select the interconnection in the Plant View and select Edit Properties 2 In the Properties of Interconnection dialog box select the appropriate values for Transfer mode 3 Repeat Steps 1 through 2 for each additional interconnection tha...

Страница 39: ...nent into a SIMATIC iMap Project The IP address and subnet mask for the devices are known and assigned See the DeviceMaster UP Hardware Installation Guide for procedures 4 7 1 Procedure 1 If necessary select the device in the Net View screen 2 Select Edit Properties 3 Click the Addresses tab and enter the IP address and subnet mask for the device Note This IP address must match the IP address and ...

Страница 40: ...Plus 2 Select the DeviceMaster UP for which you want to program network information and click Web Manager The Server Configuration page for the selected device appears Alternatively you can enter the IP address for the device in the Address box of your web browser and press ENTER to access the web page for the device 3 Click Configure Network The Edit Network Configuration page appears 4 Enter the...

Страница 41: ... 4 10 1 Contents of Project Documentation You can create documentation containing the following information for a SIMATIC iMap project General project data such as name path and creation date All the technological functions and subordinate charts of the plant chart and their interconnections All the PROFINET CbA devices of the network chart The PROFINET CbA components used as library elements and ...

Страница 42: ...r the selected device appears Alternatively you can enter the IP address for the device in the Address box of your web browser and press ENTER to access the web page for the device 2 Scroll down to the bottom of the page and click Reboot The Reboot DeviceMaster page appears 3 Select Erase persistent connections Note Only select Reset port s to factory settings if you also intend to restore the ori...

Страница 43: ...r completes the cycle the LED has a solid steady light When lit the red Link Act LED indicates a working Ethernet connection When lit the red Duplex LED indicates full duplex activity When lit the red 100 LED indicates a working 100 MB Ethernet connection 100 MB network only 6 Verify that the change is successful by one of the following methods Type the new IP address for the device in your browse...

Страница 44: ...IP Address on Page 43 6 Click OK to save your changes 4 11 4 Downloading Interconnections This procedure describes how do download interconnections to DeviceMaster UP devices in your project Note If you created an interconnection to a device that represents a PLC program you may need to generate the PLC component and that requires Step 7 installed on your computer See the SIMATIC iMap documentatio...

Страница 45: ... Transfer mode 10 D Data Bits 28 Defining transfer properties 37 Device Status 25 DHCP IP configuration 26 Documenting a SIMATIC iMap project 41 Downloading Interconnections 41 44 Dropped Packets Count 24 DTR 28 E Edit Network Configuration web page 26 Edit Port Configuration page 28 Enabling Serial port in SIMATIC iMap 35 End of Text ETX described 11 Erase persistent connections 23 ETX 23 ETX Det...

Страница 46: ...l port Px_Enable 35 Port Changing Parameters 28 Erasing persistent connections 42 Resetting Erasing persistent connections 42 Serial port Enabling in iMap 35 Settings Serial port 28 port changing settings 21 configuration properties 21 Reset Counters button 24 Printing an SIMATIC iMap project 41 product overview 5 PROFINET Number Requirements 40 PROFINET CbA Application setup 6 Communication prope...

Страница 47: ...cket Handshaking 18 Maximum length 15 QOS 15 Receive example 16 Send example 17 Send Receive example 17 Serial port Enabling in SIMATIC iMap 35 Settings web page 28 Serial Port Settings area 23 Setting Baud rate 12 Serial parameters 12 Transfer properties 37 SIMATIC iMap Described 12 Documenting 41 Printing 41 Programming interface 9 Variables 13 Soft Real Time SRT 5 software version 23 Software f...

Страница 48: ... PROFINET CbA User Guide 2000409 Rev D Index Index W web page changing port settings 21 Changing PROFINET number 40 Edit Network Configuration 26 Edit Port Configuration 28 Serial port settings 28 Server Configuration 22 ...

Отзывы: