background image

5 MODBUS RTU Protocol communication 

 

 

CP340/CP341/CP440/CP441 Communication and Programming 
Entry-ID: 88867653,    V1.0,    02/2014 

 

 

54 

 

 S

ie

m

e

n

s

 A

G

 2014

 A

ll r

ig

h

ts

 r

e

s

e

rv

e

d

 

 

Fig. 96: Setting communication parameters 

4.  Then set the address 1 to 4 as 111 to 444 respectively, set M0.3 as TRUE in 
Step7 Variable table to enable receiving. Then set M0.0 as TRUE ( rising edge 
trigger. If it is necessary to re-send, set M0.0 from TRUE to FALSE, and then set it 
back to TRUE again). It may be monitored that the values from DB1.DBW0 to 
DB1.DBW4 are 111 to 444, as shown in the Fig. below.  

 

Fig. 97: Monitoring of receive data 

 

5.  If it is necessary to read the floating point number, it must be set in data format. 
Click the menu Display->Float Inverse.  

 

Fig. 98: Setting of floating point number data format 

 

6.  Set the values of address 1 and 3 as 1.234 and 5.678 respectively, and trigger 
M0.0 to send. You may see that the received data are 1.234 and 5.678, as shown 
in the Fig. below:  

Summary of Contents for SIMATIC S7 CP340

Page 1: ...http support automation siemens com WW view en ID 88867653 FAQ 02 2014 CP340 CP341 CP440 CP441 Communication and Programming SIMATIC S7 ...

Page 2: ...inuous development Siemens recommends strongly that you regularly check for product updates For the secure operation of Siemens products and solutions it is necessary to take suitable preventive action e g cell protection concept and integrate each component into a holistic state of the art industrial security concept Third party products that may be in use should also be considered For more infor...

Page 3: ...ication for the following devices 3rd party DCS and PLC systems etc 3rd party intelligent device and instrument etc Receiving data from scanner and bar code reader etc Sending data to serial printer and other receiving devices All other user defined protocol devices that support ASCII and MODBUS This document mainly introduces applications of CP340 CP341 CP440 CP441 1 and CP441 2 as well as ASCII ...

Page 4: ...w CP340 CP341 CP440 CP441 Communication and Programming Entry ID 88867653 V1 0 02 2014 4 Siemens AG 2014 All rights reserved should read the related module operation manuals carefully to use them in a better way ...

Page 5: ...led when CP341 or CP441 2 is used in MODBUS master but PtP Param V5 1 drive program software package shall be installed earlier This drive software package may be purchased when purchasing MODBUS Dongle or be downloaded through the following link MODBUS Master drive RTU software package http support automation siemens com WW view en 27774018 MODBUS Master drive ASCII software package http support ...

Page 6: ...erved 3 Manual and related application documents After all drive programs are installed user may search for all CP module manuals from the computer whose detailed position is Start SIMATIC Documentation English or they may be found directly from the folder of STEP7 installation path Program files Siemens Step7 S7MANUAL S7PtP_Cp Fig 1 Module manual path diagram ...

Page 7: ...etc that support serial communication The following examples are used to introduce the ASCII protocol communication of Siemens serial communication modules CP340 CP341 CP440 and CP441 4 1 ASCII protocol communication of CP340 4 1 1 Hardware catalog PS 307 6ES7 307 1EA00 0AA0 CPU 315 2DP 6ES7 315 2AG10 0AB0 MMC 6ES7 953 8LG11 0AA0 CP340 6ES7 340 1AH01 0AE0 4 1 2 Configuration 1 Open STEP 7 and clic...

Page 8: ...munication and Programming Entry ID 88867653 V1 0 02 2014 8 Siemens AG 2014 All rights reserved Fig 3 Insert S7 300 station 3 Double click Hardware to enter the hardware configuration interface and insert RACK CPU315 2DP and CP340 Fig 4 Configuration hardware ...

Page 9: ...ation and Programming Entry ID 88867653 V1 0 02 2014 9 Siemens AG 2014 All rights reserved 4 Double click CP340 module and click Parameter to configure CP340 parameters Fig 5 CP340 Properties dialog box 5 Select ASCII from Protocol options Fig 6 Protocol selection ...

Page 10: ... above if Activate BREAK monitoring is selected the SF red indicator of CP340 will be on when RS232C cable is not connected or the serial port of the communication partner is not activated 7 If CP340 in RS422 485 interface is selected the interface properties shall also be set as shown below Fig 8 Configuration interface parameters When the interface is in RS485 type half duplex mode the initial s...

Page 11: ...r exists download the hardware configurations to CPU to complete the whole hardware configuration process Fig 10 Compile and save hardware configuration 4 1 3 Write communication program 1 Double click OB1 to open OB1 programming screen Invoke Send Function Block FB3 P_SEND from Libraries CP PtP CP340 and distribute instance data block DB3 to it Set the block parameter LADDR as the start logic add...

Page 12: ...end Data which is 0 DB1 DBB0 in this example LEN Length of send data which is 10 in this example REQ trigger bit of Send Data rising edge trigger which is M0 0 in this example R Cancel communication which is not available in this example DONE send complete bit which is TRUE if Send completes and has no error ERROR error bit TRUE indicating that it has an error STATUS Status word ID error code See ...

Page 13: ...this example DBB_NO Start address of Send Data which is 0 DB10 DBB0 in this example LEN Length of receive data which is MW2 in this example This value is not 0 only in the current cycle when data are received The length of received data may be determined by checking the MW4 value EN_R Enable receive bit which is M0 1 in this example R Cancel communication which is not available in this example NDR...

Page 14: ...al Chapter B Connecting cables 4 2 ASCII protocol communication of CP341 4 2 1 Hardware catalog PS 307 6ES7 307 1EA00 0AA0 CPU 315 2DP 6ES7 315 2AG10 0AB0 MMC 6ES7 953 8LG11 0AA0 CP341 6ES7 341 1AH01 0AE0 4 2 2 Configuration 1 Open the project ptp created above and right click the project name select Insert New Object SIMATIC 300 Station to change the station name to CP341 ASCII Fig 19 Insert S7 3...

Page 15: ...d Programming Entry ID 88867653 V1 0 02 2014 15 Siemens AG 2014 All rights reserved Fig 20 Configuration hardware 3 Double click CP341 module and click Parameter to configure CP341 parameters Fig 21 CP341 Properties dialog box 4 Select ASCII protocol from Protocol options ...

Page 16: ...ameters The set communication parameters shall be the same as those of the communication partner Communication Baud rate 9600bps Data bit 8 bits Stop bit 1 bit Parity none Character delay time 4ms Other parameters shall be in default settings Fig 23 Distributing parameters for ASCII protocol 6 If CP341 in RS422 485 interface is selected the interface properties shall also be set as shown in the Fi...

Page 17: ...d it to CPU after confirming that no error exists The whole hardware configuration process is completed by now Fig 25 Compile and save hardware configuration 4 2 3 Write communication program 1 Double click OB1 to open OB1 programming screen Invoke Send Function Block FB8 P_SND_RK from Libraries CP PtP CP341 and distribute instance data block DB8 to it Set the parameter LADDR as the start logic ad...

Page 18: ...is 1 DB1 in this example DBB_NO Start address of Send Data which is 0 DB1 DBB0 in this example LEN Length of send data which is 10 in this example REQ trigger bit of Send Data rising edge trigger which is M0 0 in this example R Cancel communication DONE send complete bit which is TRUE if Send completes and has no error ERROR error bit TRUE indicating that it has an error STATUS status word ID erro...

Page 19: ...n this example DB_NO Send Data block number which is 10 DB10 in this example DBB_NO Start address of Send Data which is 0 DB10 DBB0 in this example LEN Length of receive data which is MW2 in this example This value is not 0 only in the current cycle when data are received The length of received data may be determined by checking the MW4 value EN_R Enable receive bit which is M0 1 in this example R...

Page 20: ...ts of CP341 and computer The detailed cable connecting method may be seen in CP341 Manual Chapter B Connecting cables 4 3 ASCII protocol communication of CP440 4 3 1 Hardware catalog RACK 400 6ES7 400 1JA01 0AA0 PS407 6ES7 407 0KA02 0AA0 CPU 6ES7 414 3XJ04 0AB0 CP440 6ES7 440 1CS00 0YE0 4 3 2 Configuration 1 Open the project ptp that has been created and right click the project name select Insert ...

Page 21: ...s AG 2014 All rights reserved Fig 34 Insert S7 400 station 2 Double click Hardware to enter the hardware configuration screen and insert RACK 400 PS407 CPU414 3DP and CP440 Fig 35 Configuration hardware 3 Double click CP440 module and click Parameter to configure CP440 parameters and select ASCII protocol in Protocol options ...

Page 22: ...communication parameters must match those of the communication partner Baud rate 9600bps Data bit 8 bits Stop bit 1 bit Parity none Character delay time 4ms other parameters may use default data Fig 37 Distributing parameters for ASCII protocol 5 As CP440 has only one type of RS422 485 interface conversion equipment shall be required if it has different interface from the communication partner and...

Page 23: ... correct 4 3 3 Write communication program 1 Double click OB1 to open programming screen Invoke Send Function Block FB10 SEND_400 from Libraries CP PtP CP440 and distribute instance data block DB10 to it Set the parameter LADDR as the start logic address 512 in hardware configuration Fig 39 Logic address of CP440 2 Create a Send Data block DB1 Fig 40 Send Data block DB1 3 Invoke Send Data block Th...

Page 24: ..._NO INT Send Data block number which is 1 DB1 in this example DBB_NO INT Start address of Send Data which is 0 DB1 DBB0 in this example LEN INT Length of send data which is 15 in this example DONE BOOL send complete bit which is TRUE if Send completes and has no error ERROR BOOL error bit which is TRUE if send has error STATUS WORD status word indicating error code If ERROR 1 this status word incl...

Page 25: ...ncel communication and give up receive LADDR Input INT Module start logic address in hardware configuration which is 512 in this example DB_NO Input INT Receive Data block number which is 2 DB2 in this example DBB_NO Input INT Start address of Receive Data which is 0 DB2 DBB0 in this example NDR Output BOOL Receive complete bit which is TRUE if Receive completes and has no error ERROR Output BOOL ...

Page 26: ...y select sub module in different interface type according to the actual application in order to realize communication with one or more communication partners CP441 1 1 selectable sub module interface CP441 2 2 selectable sub module interfaces The sub module interfaces are in 3 types Order number Interface type comments 6ES7963 1AA00 0AA0 RS232C 9 pin D type connection 6ES7963 2AA00 0AA0 20mA TTY 9...

Page 27: ... created and insert a new SIMATIC 400 Station to change the station name to CP441 ASCII Double click Hardware to enter the hardware configuration screen and insert the related module in steps stated above Fig 43 Configuration hardware 2 Double click CP441 2 module and click to enter Basic Parameters Select Interface address and designate interface type of the sub module RS232C interface is used in...

Page 28: ...e click the envelop icon under Protocol to configure ASCII communication parameters The set communication parameters shall be the same as those of the communication partner and the others shall be in default values The specific operations may be seen in the text above which are not repeated here 5 After completing configuration return to Sub module interface type selection interface and click Gene...

Page 29: ...nfiguration which is not introduced for it is not used in this example Fig 47 Interface status after PtP is connected 6 Then open the configure network icon in the hardware configuration screen to enter the network configuration interface Click to select the CPU in this station and user may see that communication connection table appears under the page Right click the first line to insert new conn...

Page 30: ...Select Unspecified as the connection object This option is used for connection with third party devices and the devices without communication bus including S7 CP PtP CP340 CP341 S5 CP PtP and Printer etc If the communication partner is CP441 it shall be confirmed that it has been connected to a same PtP subnet and selected directly as the connection object Fig 49 Insert a new connection ...

Page 31: ...ystem function block You may modify it in manual way to fit the parameters in the program SFB that have been configured but its range shall be noted W 16 1000 W 16 1400 The communication direction may be selected according to the actual demand In this example the third type is used Two way communication Click OK to confirm and compile the configuration and download it after it is confirmed correct...

Page 32: ...r which is obtained from the PtP connection properties and is hexadecimal R_ID DWORD Distinguish double word which may be any data However if the program uses multiple BSEND blocks different serial numbers shall be distributed to them SD_1 ANY Data send area DB area is used in this example and the send data are in 5 bytes Other addresses and data types may also be used for access and the detailed ...

Page 33: ...is used in this example ID WORD Local ID number which is obtained from the PtP connection properties and is hexadecimal R_ID DWORD W 16 0 must be used when in ASCII 3964 R communication RD_1 ANY Data receive area DB2 is used in this example to receive LEN WORD Receive data length memory area in bytes NDR BOOL Receive complete bit which is TRUE if Receive completes and has no error ERROR BOOL error...

Page 34: ...867653 V1 0 02 2014 34 Siemens AG 2014 All rights reserved Fig 55 Invoke SFB13 BRCV from OB1 4 4 4 Equipment connection Use standard RS232C cable to connect serial ports of CP441 2 interface1 and computer The detailed cable connecting method may be seen in CP441 Manual Appendix B Connecting cables ...

Page 35: ... For details of MODBUS RTU protocol please refer to related MODBUS RTU files or manuals 5 1 MODBUS Slave protocol communication of CP341 5 1 1 Hardware catalog PS 307 6ES7 307 1EA00 0AA0 CPU 315 2DP 6ES7 315 2AG10 0AB0 MMC 6ES7 953 8LG11 0AA0 CP341 6ES7 341 1AH01 0AE0 Dongle 6ES7 870 1AB01 0YA0 Dongle s support is necessary when using CP341 for MODBUS Protocol communication Before it is used insta...

Page 36: ...bove and right click the project name select Insert New Object SIMATIC 300 Station to change the station name to CP341 Modbus S Fig 58 Insert S7 300 station 2 Double click Hardware to enter the hardware configuration interface and insert RACK CPU315 2DP and CP341 Fig 59 Configuration hardware 3 Double click CP341 module and click Parameter to configure CP341 parameters Select MODBUS Slave from Pro...

Page 37: ... MODBUS Slave communication parameter Step 1 set MODBUS Slave address which is set as 2 in this example Step 2 set parameters of MODBUS Slave such as Baud rate stop bit and check bit etc Then configure the parameters represented by the function codes For details see the four figures below 5 FC01 05 15 status of read and forced output bit The left side is info transfer address and the right side is...

Page 38: ...to 300 and 301 to 400 match the Modbus address areas 00202 to 00301 and 00302 to 00401 and the corresponding Siemens data area is Timer Counter Fig 62 Distribution of MODBUS Slave addresses 6 FC02 reads input data status and the address matching is as stated above Fig 63 Distribution of MODBUS Slave addresses 7 FC03 06 16 configuration output register data area corresponds to Siemens data area DB ...

Page 39: ...etting limit values for writing parameters Fig 66 Write parameter limit values for MODBUS Slave 10 If CP341 in RS422 485 interface is selected the interface type shall also be set as shown in the Fig below and other parameters shall be in default settings Fig 67 Interface parameter assignment of MODBUS Slave 11 After configuration completes a prompt will ask you whether you load the driver before ...

Page 40: ...k button to save and compile the hardware configuration and confirm that it has no error Fig 69 Compile and save hardware configuration 5 1 3 Write communication program 1 Add FB7 and FB8 into the program Blocks in such method double click OB1 to open OB1 programming screen invoke send program block FB8 and receive program block FB7 from Libraries CP PtP CP341 and then delete them from OB1 because...

Page 41: ... this example OB_MASK I O access error mask bit which is M100 0 in this example CP_START FB initialization enable bit which is M100 1 in this example CP_START_FM CP_START initialization rising edge bit which is M100 2 in this example CP_START_NDR write from CP operation bit which is M100 3 in this example CP_START_OK initialization succeed flag which is M100 4 in this example CP_START_ERROR initia...

Page 42: ...ication data block DB1 5 Create FC04 function code communication data block DB2 Fig 73 Communication data block DB2 5 1 4 Equipment connection Use standard RS232C cable to connect serial ports of CP341 and computer The detailed cable connecting method may be seen in CP341 Manual Chapter B Connecting cables 5 1 5 Communication test 1 Download hardware configuration and program into CPU315 2DP first...

Page 43: ...Fig 74 Open Modscan32 software 2 Click Connection Connect in Modscan32 as shown in the screen below Select COM port COM1 connecting the computer with CP341 and set the Baud rate data bit stop bit and check mode as shown in the Fig below Fig 75 Setting of Modscan32 communication parameter 3 After setting completes click OK and the following screen will be shown ...

Page 44: ... is not introduced here 6 For display of floating point number it shall be explained that the high 16 bits and low 16 bits of the floating point number in PLC are opposite to those displayed in Modscan32 or in other words the high 16 bits of the floating point number in PLC correspond to the low 16 bits of the floating point number displayed in Modscan32 and the low 16 bits of the floating point n...

Page 45: ...ODBUS address corresponds to DB1 DBD0 Fig 79 Floating point number data exchange If CP341 module with RS422 RS485 interface is used RS422 485 converter shall be used when using computer serial port debugging program 5 2 MODBUS Master protocol communication of CP341 5 2 1 Hardware catalog PS 307 6ES7 307 1EA00 0AA0 CPU 315 2DP 6ES7 315 2AG10 0AB0 MMC 6ES7 953 8LG11 0AA0 CP341 6ES7 341 1AH01 0AE0 Do...

Page 46: ...ed Fig 80 Before and after inserting Dongle 5 2 2 Configuration 1 Open the project ptp created above and right click the project name select Insert New Object SIMATIC 300 Station to change the station name to CP341 Modbus M Fig 81 Insert S7 300 station 2 Double click Hardware to enter the hardware configuration interface and insert RACK CPU315 2DP and CP341 ...

Page 47: ...s reserved Fig 82 Configuration hardware 3 Double click CP341 module and click Parameter to configure CP341 parameters Select MODBUS Master from Protocol options Fig 83 Selecting communication protocol 4 Double click the envelop icon under Protocol to configure Modbus Master parameter and click Modbus Master button to set communication Baud rate etc ...

Page 48: ...her you load the driver before it is saved Fig 85 Dialog box prompting loading driver 6 At this moment it must be connected to the actual PLC Click Yes to load the driver or click Load Drivers The CPU must be in STOP mode when in loading Fig 86 Load drivers After the driver is loaded STEP7 will prompt Driver already exists if you load it another time After configuration completes click button to s...

Page 49: ...8 to it Set the parameter LADDR as the input start logic address 256 in hardware configuration Fig 88 Logic address of CP341 2 Create send data block DB1 in which the slave address is 2 the function code is 3 and start address is 0 Read 4 register data For use of the function code 3 see Modbus Master Manual 5 3 Function Code 03 Read Output Registers Fig 89 Send Data block DB1 3 Invoke Send Functio...

Page 50: ...ended data block which must be in capital form here R Cancel communication which is not available in this example DONE send complete bit which is TRUE if Send completes and has no error ERROR error bit TRUE indicating that it has an error STATUS Status word ID error code See Modbus Master Manual Chapter 7 for related description Other parameters Not applicable in this example Table 13 Parameter de...

Page 51: ..._NO Start address of Send Data which is 0 DB2 DBB0 in this example LEN Length of receive data which is MW4 in this example This value is not 0 only in the current cycle when data are received The length of received data may be determined by checking the MW8 value EN_R Enable receive bit which is M0 3 in this example R Cancel communication which is not applicable in this example NDR Receive complet...

Page 52: ... 5 2 4 Equipment connection Use standard RS232C cable to connect serial ports of CP341 and computer The detailed cable connecting method may be seen in CP341 Manual Chapter B Connecting cables 5 2 5 Communication test 1 Install Modbus Slave test software After installing an icon will be generated on the desktop Double click this icon to open Modbus Slave test software as shown in the Fig below ...

Page 53: ...used for 15min The software downloaded from the Internet has no registration code Then click the menu Connection connect to configure the serial parameters which shall be the same as the CP341 parameters Fig 95 Setting communication parameters 3 Click OK and then select the menu Setup Slave Definition to set the communication data As CP341 uses function code 3 03 Holding Register shall be used The...

Page 54: ... necessary to re send set M0 0 from TRUE to FALSE and then set it back to TRUE again It may be monitored that the values from DB1 DBW0 to DB1 DBW4 are 111 to 444 as shown in the Fig below Fig 97 Monitoring of receive data 5 If it is necessary to read the floating point number it must be set in data format Click the menu Display Float Inverse Fig 98 Setting of floating point number data format 6 Se...

Page 55: ...1 2AA03 0AE0 Dongle 6ES7870 1AA01 0YA0 Dongle is installed in the same positions as S7 300 and CP341 and both are behind the module Refer to the pictures above 5 3 2 Configuration 1 Open the created project ptp and insert a new SIMATIC 400 Station and change the station name to CP441 2 modbus Master Double click Hardware to enter the hardware configuration screen and insert RACK PS CPU and CP441 2...

Page 56: ...figure Modbus Master parameter and click Modbus master button to set the basic parameters such as communication rate and message details etc and other parameters may be in default settings Fig 101 Configure MODBUS Master communication parameter 4 After completing configuration click OK and save it and close the dialog box Just as ASCII communication with CP441 2 create PtP connection for the used ...

Page 57: ...ve and compile the configuration information If there is no error select CPU to download the configuration information as a whole and use to check the connection status online till the displayed icon of connection status is to indicate correct connection 6 When CP441 makes MODBUS communication the Startup parameter in CPU properties shall also be changed Fig 103 Change Startup parameter in CPU pro...

Page 58: ...2 Invoke Send Function block The used slave address is 5 the function code is FC01 the start address is 0 and the statuses of 16 output bits are read When using different function code for communication the definition of the request telegram may be seen in the related description in MODBUS MASTER Manual Chapter 5 Function code Fig 105 Invoke SFB12 in OB1 3 The supplementary instruction for SFB12 u...

Page 59: ...6 6 6 2 6 2 2 6 6 4 The instance data block of FB13 is DB13 and the receive data DB block DB2 is created Fig 106 Receive data block DB2 5 Invoke receive function block Fig 107 Invoke SFB13 in OB1 The R_ID in SFB13 must be set in consistence with the R_ID in SFB12 that is invoked in pair in order to activate the receive information program so it must be set as DW 16 1 here The information on Receiv...

Page 60: ...ppendix B Connecting cables 5 3 5 Communication test 1 Modbus slave test software is also used Please refer to the above stated operation steps for CP341 test The slave is set as shown in the Fig below Fig 108 Setting of Modbus Slave test software 2 Set M8 0 as TRUE in Step7 Variable table to enable receive and trigger M0 0 in manual way to produce rising edge to enable send The data communication...

Page 61: ... When testing different function codes just modify the data request telegram sent by the master Fig 110 Create send data frame Fig 111 Invoke SFB13 in OB1 5 4 MODBUS Slave protocol communication of CP441 2 5 4 1 Hardware catalog RACK 400 6ES7400 1JA01 0AA0 PS407 6ES7407 0KA02 0AA0 CPU414 3 6ES7414 3XJ04 0AB0 CP441 2 6ES7441 2AA03 0AE0 Dongle 6ES7870 1AB01 0YA0 ...

Page 62: ...efer to the forgoing chapters for specific steps 3 In the CP441 2 module click Parameter to configure CP441 2 parameters and select MODBUS Slave in Protocol options Fig 112 Selecting communication protocol 4 Double click the envelop icon under Protocol to configure MODBUS Slave parameter Fig 113 Configure MODBUS Slave communication parameter 5 Set the basic parameters such as communication rate an...

Page 63: ... 23 match MODBUS address area 00001 to 00024 and the corresponding Siemens data area is M0 0 M2 7 24 to 47 match the MODBUS Address area 00025 to 00048 and the corresponding Siemens data area is Q0 0 to Q2 7 Slave addresses 48 to 79 and 80 to 111 match the Modbus address areas 00049 to 00080 and 00081 to 00112 and the corresponding Siemens data area is Timer Counter FC02 reads input data status an...

Page 64: ...4 Siemens AG 2014 All rights reserved Fig 116 Distribution of MODBUS Slave addresses 8 FC04 configuration output register data area also corresponds to Siemens data area DB block Fig 117 Distribution of MODBUS Slave addresses 9 Set write parameter limit values of FC05 06 15 16 Fig 118 Distribution of MODBUS Slave addresses ...

Page 65: ...e used interface and record the Local ID Hex connection number Fig 119 Configuration connection 11 Click to compile the configuration information If no error exists select CPU to download the configuration information as a whole and use to check the connection status online till connection status icon is displayed as to indicate correct connection Just like MODBUS communication with CP441 the Star...

Page 66: ...uately long time may be guaranteed to download the used load protocol driver into the CP card during the parameter assignment process 5 4 3 Write communication program 1 Double click OB1 to open the programming screen Invoke FB180 in Libraries Modbus and distribute instance data block DB180 The function code communication data DB1 and DB2 for the newly created data block FC03 06 16 and FC04 are bo...

Page 67: ...tatus read time value which is 2S in this example OB_MASK INPUT BOOL IO access error mask bit which is M20 0 in this example 0 Non mask IO access error 1 Mask IO access error and delaying the alarm CP_START INPUT BOOL FB initialization enable bit which is M20 1 in this example CP_START_FM INPUT BOOL CP_START initialization rising edge bit which is M20 2 in this example CP_NDR OUTPUT BOOL CP write ...

Page 68: ...computer The detailed cable connecting method may be seen in CP341 Manual Chapter B Connecting cables 5 4 5 Communication test Download the hardware configuration and program into CPU Open the software Modscan32 in the computer and click Connection Connect in Modscan32 to display the following screen Select the used serial port and set Baud rate data bit stop bit and check mode and select a commun...

Page 69: ...8867653 V1 0 02 2014 69 Siemens AG 2014 All rights reserved Fig 123 Distribute communication parameters Fig 124 Communication monitor interface Modbus slave address Modbus initial address and length Type of data accessed by Modbus viz selecting function code to be used corresponds to Q0 0 Q2 7 in PLC ...

Page 70: ...ts reserved Shown in the Fig below is the corresponding communication monitor screen when the function code FC04 is used To read other data just change the related access data type For floating point number display refer to the read method for Modbus Slave communication of CP341 as stated above Fig 125 Communication monitor interface corresponds to ...

Reviews: