Home
FC5A Modbus Communication Training
Contents
1. 4 Use Mozo0 Unuse Use f Unuse Slave Mo Request Functon Code Allocation No Data Size Word Bit 0 ta 247 Slave Address Execution IR Error Status i neimane mo Wed fs eem Em wom ve pe oss oem a ier oo j1 me s wem 13 2 4 2 Programming WindLDR Setting up Modbus Slave 15 The setup for the Modbus Slave is the same as 3 3 2 in the example 3 2 4 3 Programming WindLDR Setting up the Modbus Master 1 Create a new file and open the Modbus RTU Master Request Table 2 Input the two communication requests according to the specification And then click on Use and input M0200 in the Request Execution Internal Relay setting After inputting all the parameters Modbus RTU Master Request Table will look like the image below Modbus RTU Master Request Table Port2 1 5 xj Request Execution Intemal Relay H Error Status j i Use M0200 C Unuse C Use Unuse Master Allocation Ma Data Size word Bit DO0S0 Word MOOS0 Slave No x to 24v Request Erde In Error Status MO200 Moz0i Function Code Slave Address 400021 3 Preset Multiple Registers 15 Force Multiple Coils l a l Es Communication Settings OF Cancel Help 5 Close the Request Table and Function A
2. Cancel Advanced 2 Help Preview 17 4 Create a Bit Button and input Q 2 as the Destination Device and select Toggle as the Action Mode Properties of Bit Button ui x General view Registration Text Comment Part Mame Bite uttanz OFF Test Action Mode Toggle Destination Device a A a Counce Device Device om x Transter f H Test Cancel Advanced Help Preview 5 Download the project to the touchscreen connected to Port 1 of Modbus Slave 15 2 4 5 Check the system 1 Connect the PC to the Modbus Master and select Online Monitor from the main menu to start the Monitor mode 2 Select Online Point Write to open a Point Write dialog box and then input D50 to monitor Change the D50 value to 5000 and confirm that QO of the slave does not turn on and the D20 value of the slave shown on the touchscreen remains O Point Write X a ocn s e fpem si 2 7 5 3 Turn on M100 of the master and then QO of the Slave turns on and the D20 value shown on the touchscreen becomes 5000 18 4 Change the D20 value to a value other than 5000 using the Numerical Input on the screen and the QO of the slave turns off Change the D20 value back to 5000 and then QO turns on again 5 Select Online Direct Set Reset to open a Direct Set Reset dialog box and then input M50 to monitor Set reset M50 and confirm that Q2 of
3. 1 Connect the PC to the Modbus Master and select Online gt Monitor from the main menu to start the Monitor mode 2 Select Online gt Point Write to open a Point Write dialog box and then input D100 as the monitor On the Modbus Slave change D8057 with the Analog Potentiometer 1 and see D100 of the Modbus Master change between 0 through 255 x Paint Write x Foint Write 10 pew s P ecw sj 0200 z DEC w zi 0200 x DEC Ew I e zi 2 0200 x DEC Ew Close Help Close Help 3 Select Online Direct Set Reset to open a Direct Set Reset dialog box and then input M100 to monitor M100 turns on and off every second 10 pm 1 TE CPI J i n pen mU m T n E 2 2 Example 2 Reading 2 words and 3 bits data from a slave In this example a FC5A Modbus Master will communicate with a FC5A Modbus Slave whose slave number is 15 The master reads D8057 and D8058 of the slave and stores it in D0100 and D0101 and reads M8121 through M8123 and stores them in M0100 through M0102 2 2 1 System Setup Two FC5A All in one CPUs are connected with a RS232C RS485 cable using Port 2 The master communicates with the slave using two communication requests Modbus Master Modbus Slave 15 Request 1 Request 2 2 2 2 Programming WindLDR Setting up the Modbus Slave 15 Nothing has to be c
4. Input Register 300001 300256 OOOO GOFF TO TABS timer current value 300000 and above 300501 300756 O1F4 23 CO C255 counter current value 400001 405000 OOOO 1F3F DO D7999 a B 16 408001 408500 1F40 2133 D8000 08499 409001 409256 2328 2427 TO 7255 timer preset value 405501 400756 251C 261B OO C255 counter preset value 410001 150000 2110 IAF D10000 D45999 a B 16 In order to obtain the Modbus address of MicroSmart operands the formula shown in the images below can be used For example the Modbus address of D8057 can be calculated as follows D8057 MicroSmart Operand 8057 8000 408001 408058 Modbus Address MicroSmart Operand Calculating Modbus Address 7e Decimal Minimum Offset address Modbus Device Name Offset b 086 97 Coi 80 8258 10 701 1255 0 3001 019 1827 o oo 1285 timer current value o S0000i Input Register D8000 D8493 1 8000 408001 Holding Register 10 1255 timer preserva 0 409901 Notes For your reference the Modbus Address table FC5A ModbusSlave AddressMap xls showing all the operands available on FC5A and corresponding Modbus address is available on the IDEC MicroSmart Pentra web page under Documents and Downloads EJ Microsoft Excel FECSA ModbusSslave AddressMap xls 0 x
5. gt Monitor from the main menu to start the Monitor mode 2 Select Online gt Point Write to open a Point Write dialog box and then input D50 to monitor Change the D50 value and see if QO of the Modbus Slave turns on when D50 of the Modbus Master is equal to 5000 13 Paint Write X Paint Write po Sf Moo Aw DEW DEC Iw zl DEC Iw DEC tw DEC fw DEC Iw pectw 1 DEC tw re DEC tw 3 Select Online Direct Set Reset to open a Direct Set Reset dialog box and then input M50 to monitor Set reset M50 and see if Q2 of the Modbus Slave turns on off accordingly Direct Set Reset Direct Set Reset 14 2 4 Example 4 Using Request Execution Relay In this example a FC5A Modbus Master will communicate with a FC5A Modbus Slave whose slave number is 15 The master will write D50 to D20 and M50 to Q2 when 1 0100 turns on The slave outputs QO when D20 is equal to 5000 A touchscreen also monitors the Modbus Slave through Port 1 of the slave and changes the value of D20 and Q2 2 4 1 System Setup HG touchscreen Modbus Master Modbus Slave 15 RS2323C RS485 Write p Read Write Numerical D50 p Input Pilot Lamp Request 2 M50 LS mm mm Bit Button Uwe Toggle Note Modbus Master Request Table and Request Execution Relay When the Request Execution Relay is disabled all the
6. and then turn on of the slave QO should turn on about 3 sec after lO turns on Point Write x fat e foc si 1 eS F few si few si 22 Close Help 21
7. the slave does not turn on and the Pilot Lamp on the touchscreen also does not turn on Direct Set Reset 6 Turn on M101 of the master Then Q2 of the slave will turn on and the Pilot Lamp on the touchscreen also turns on 7 Toggle Q2 using the Bit Button on the screen and see Q2 of the slave and the Pilot Lamp on the screen turn off Toggle Q2 again then Q2 and the Pilot Lamp turn on Note If you want to execute communication requests repeatedly when the Request Execution Relay is enabled you have to program SET instructions following M8125 In operation Output to set the relays For example if you program as below the communication Request 1 is executed only when M100 turns on but the communication Request 2 is executed repeatedly as long as the PLC is running 19 2 5 Example 5 Changing the preset values of Timers or Counters In example 5 a FC5A Modbus Master will communicate with a FC5A Modbus Slave whose slave number is 15 The master will write D50 to D20 QO of the slave turns off D20 ms later after IO turns on 2 5 1 System Setup Modbus Master Modbus Slave 15 RS2323C RS485 Note As shown below FC5A Modbus Slave Address Map in 30 5 of FC5A User s Manual only the Function Code 3 can be used to access the preset values of timers and counters As the Function Code 3 is 03 Read Holding Registers you can read these values but cannot write values to them puncilo Codo and above 00000
8. 0 vocc and above O1F4 O2F3 CO C255 counter current value 300000 reum ml eo C255 counter preset 00 2510 2618 408756 408501 D10000 D45999 EG 2 5 2 Programming WindLDR Setting up the Modbus Slave 15 o 1 Create a new file and configure the function area settings as shown 1 through 4 in 3 1 2 2 Create a ladder program as shown below When I0 turns on TIM TO instruction starts and D20 ms later QO is turned on 3 Download the program to the Modbus Slave 20 2 5 3 Programming WindLDR Setting up the Modbus Master 1 Create a new file and open the Modbus RTU Master Request Table and configure the Request 1 as follows EE une s e No Function Code Allocation Ma Data Size Word Bit B to 247 Slave Address Execution IR Error Status pn ___ Lowe 5 em ES 4 WENNS d 2 Close the dialog box and download the program to the master 2 5 4 Check the system 1 Connect the PC to the Modbus Master and select Online gt Monitor from the main menu to start the Monitor mode 2 Select Online gt Point Write to open a Point Write dialog box and then input D50 to the monitor Write 0 to D50 and then turn on of the slave QO should turn on right after lO turns on Paint Write a fem si foem sl 4 T fem si ecm z Close Help 3 Write 30 to D50
9. 086 o iE 2364 009099 78122 100 k M 7 InternalRelay Special Internal Relay Internal Rela Data Re s Ready NUM A 9 Click on the Function Code cell for Request 2 in the dialog box and select the 01 Read Coil Status from the dropdown list Then Input M100 in the Master Allocation No 1 as the Data Size 15 as the Slave No and 009098 as the Slave Address Modbus RTU Master Request Table Port 2 Error Status C Use Unuse Request Execution Internal Relay C Use Unuse Req Master Slave No Request No Function Code Allocation No Data Size Word Bit 0 to 247 Slave Address Execution IR Error Status 03 Read Holding Registers D0100 408058 0 EE NEN Communication Settings DK Cancel Help 10 Setup for communication request 2 has been completed The one bit data at the address 009098 of Modbus Slave 15 is read and stored in M0100 of the Modbus Master 11 Click OK to close the Modbus RTU Request Table dialog box Click OK again to close the Function Area Settings dialog box 12 Connect the FC5A as the Modbus Master to the PC and select Online gt Download Program from the main menu to open the Download Program dialog box Click the Download button to start downloading the program 13 The Program Download confirmation dialog box will appear and the Modbus Master setup has been completed 2 1 4 Check the system
10. BS File Edit view Insert Format Tools Data Window Help Type a question For help x 0 FR EET 9 0 EAS om e D8057 FLSA Microsmart Modbus Address Communication pansa 408059 1F7 D8059 408060 B 6 Enter D100 in the Master Allocation No 1 in the Data Size 15 in the Slave No and 408058 in the Slave Address The setup for communication Request 1 has been completed The one word data at the address 408058 of Modbus Slave 15 will read out and be stored in D0100 of the Modbus Master Modbus RTU Master Request Table Port 2 x Error Status Use Unuse C Use Unuse Request Execution Internal Relay No Function Code ic No Size W ord Bilt m to 7 Slave Address mn _ IR Status EN 03 Read Holding Registers 00100 00 wad 15 X 408058 O a SS SSS Communication Settings OK Cancel Help 7 Define the second communication request Modbus Master Modbus Slave Request 2 M0100 Head M8121 21 8 To obtain the Modbus Address of M8121 select the Special Internal Relay sheet in the Modbus Address table and look up M8121 EJ Microsoft Excel FC54_ModbusSlave_AddressMap xls BI xl EE File Edit wiew Insert Format Tools Data Window Help Type a question For help A X ki mu A C h18121 Address MicroSmart CON Poss p Address NB8117 O O009
11. Define the first communication request Modbus Master Modbus Slave Request 1 D0100 Head D8057 5 Click on the Function Code cell for Request 1 in the dialog box and the Lu list will appear From the dropdown list select the 03 Read Holding Register Modbus RTU Master Request Table X Request Execution Internal Relay Error Status Use Unuse Use Unuse Communication Settings OK Cancel Help Note Modbus Device Modbus Address and Function Code When using FC5A as a Modbus Slave device Modbus Addresses are assigned to all the operands available on FC5A In the page 30 9 of the FC5A User s Manual the Address Map of the FC5A Modbus Slave is shown as below For example special data registers D8000 thru D8499 are considered the Holding Registers The Modbus Addresses 408001 thru 408500 are assigned to these operands and the Function Codes 3 6 or 16 can be used to manipulate these operands Modbus Device Modbus Address Communication Applicable Name Map Decimal Frame Address Microsmart peran Function Code OOQQ01 OOO 504 0000 O1F7 QD 0627 Cail OOOFOL 0009565 Q2BC O3BB RO R255 1 5 15 QOOOOD and above 001001 003048 OSES OTFT MO M2557 OO09001 009256 2328 2427 M amp oo0 M8317 100001 100504 ODO O1F7 lO 1627 npe Roby 101001 101256 OSES 7 TO 7255 timer contact 100000 and above 101501 101756 O5DC QGDB GO C255 counter contact
12. Multiple Coils 1 to 128 bits OOQ001 065535 put R shift register or M internal relay 16 Preset Multiple Registers 1 to 64 words 400001 465535 REA REM celia lama a A iu 12 2 3 2 Programming WindLDR Setting up Modbus Slave 5 1 Create a new file and configure the function area settings as shown 1 through 4 in Example 2 2 Create a ladder program as shown in the image below When D20 is equal to 5000 QO turns on on on on n n 8 5 e t cd m 3 Download the program to the Modbus Slave 2 3 3 Programming WindLDR Setting up the Modbus Master 1 Create a new file and open the Modbus RTU Master Request Table 2 Enter the two communication requests according to the specification After inputting all parameters the Modbus RTU Master Request Table will look like the image below Modbus RTU Master Request Table Port 2 x C Use Unuse C Use Unuse Request Execution Internal Relay Error Status Reg Master Slave No Request No Function Code Allocation No Data Size Word Bit O to 247 Slave Address Execution IR 1 wmesmameneses omm fv owe s oa RE wooo o 9 fs ems 1 1 Communication Settings DK Cancel Help 4 Close the Request Table and Function Area Settings dialog boxes and then download the program to the Modbus Master 2 3 4 Check the system 1 Connect the PC to the Modbus Master and select Online
13. WindLDR Setting up the Modbus Slave 15 1 Start WindLDR and create a new program 2 Select the appropriate PLC type In this example FC5A C24R2 is used Select Configure gt PLC Selection from the main menu to open the PLC Selection dialog box Select FC5A C24R2 in the PLC list and click OK to close the dialog box Cancel FA 35 CP13 Micro Help anfigure Use as Default Default FL5A L 24H 3 Select Configure Function Area Settings from the main menu to open the Function Area Settings dialog box and then select the Communication tab 4 Select Modbus RTU Slave from the dropdown list for Port 2 and then the Communication Parameters dialog box will appear Input 15 as the Slave Number click OK to close the dialog box and then click OK to close the Function Area Settings dialog box FOBA C24R2 Function Area Settings x Run Stop Keep Special Input Communication Others Modbus ATU Master Configure SBUL 8 E ven 1 not necessary ERE Maintenance Protocal User Protocol Modem Protocol Data Link Master Data Link Slave Bici ATU Slave Qo odU 4 aster Modbus ATU Master xi Baud Fate bps 9600 Data Bits 8 7 Parity Even Stop Bits fi Slave Number 15 OF Cancel Default List Help b Connect the FC5A as the Modbus Slave to the PC and select Online Download Program from the main menu to open the Download Pr
14. ZIDEC FC5A Modbus Communication Training Table of Contents EE uii 3 1 1 IS 11 a sss deen De 3 1 2 LCN R 3 2 8100005 011313313165013 Examples A SRS OARS SRS 4 2 Example 1 Reading word and 1 bit data from a slave ssssse 4 2 2 Example 2 Reading 2 words and 3 bits data from a slave 11 2 3 Example 3 Writing 1 word and 1 bit to a slave sss 12 2 4 Example 4 Using Request Execution Relay essere 15 2 5 Example 5 Changing the preset values of Timers or Counters 20 1 System Setup 1 1 1 1 Network Modbus Master Modbus Slave RS2323C RS485 1 2 1 N Network Up to 31 Slaves Modbus Master Modbus Slave Port 2 Port 2 Port 2 Pbrt 2 2 Modbus Communication Examples 2 1 Example 1 Reading 1 word and 1 bit data from a slave In this example a FC5A Modbus Master will communicate with a FC5A Modbus Slave whose slave number is 15 The master reads D8057 of the slave stores it in D0100 reads M8121 and stores it in M0100 2 1 1 System Setup Port 2 of two FC5A All in one CPUs is connected with a RS232C RS485 cable The master communicates with the slave using two communication requests Modbus Master Modbus Slave 15 RS2323C RS485 Request 1 Head Request 42 Head 2 1 2 Programming
15. e devices you need to make sure which function codes the Modbus Slave devices support In fact some Modbus devices do not support Function Code 15 and 16 For example FC5A Modbus Slave supports all the 8 function codes and you need to select the function code according to the operand type you want to access If you want to read the status of l0 you need to use 02 Read Input Status and if you want to write values to D1 you need to use either 06 Preset Single Register or 16 Preset Multiple Registers Function Code Data Size Slave Address MicroSmart as Modbus Slave 01 Read Coil Status 00001 gissa PESOS St operand statuses ot Q tuu H shift register or M internal relay 02 Read Input Status 1t0128bits 100001 165555 2305 bit operand statuses of input JT timer contact or Counter contact Heads word operand data of D data register T una 1 d p go Res HONE PERRIS See Moe AUDOJE eons timer preset value or C counter preset value 04 Read input Registers 1to 64 words 300001 365535 Reads word operand data of T timer current value or C counter current value EUR ee Changes a bit operand status of Q output R E i E 05 Force Single Coil 1 bit 000001 065535 shift register or M internal relay 06 Preset Single Register 1 word 400001 1565535 Changes word operand data of D data register 0 l Changes multiple bit operand statuses of Q out 1 H EE 15 Force
16. hanged from Example 1 2 2 3 Programming WindLDR Setting up the Modbus Master 1 Open the Modbus Master program of example 1 and open the Modbus Master Request Table dialog box 2 Change the Data Size of Request 1 from 1 to 2 and of the Request 2 from 1 to 3 Modbus RTU Master Request Table x Request Execution Internal Relay C Use Unuse Error Status C Use f Unuse Req Master Slave No No Function Code Allocation No Data Size Word Bit 0 to 247 Slave Address Execution IR Error Status mmesmakenese omm 7 qs oe 2 bJ s om IHE OEE SS SSS p 11 2 3 Example 3 Writing 1 word and 1 bit to a slave In this example a FC5A Modbus Master will communicate with a FC5A Modbus Slave whose slave number is 15 The master writes D50 to the D20 of the slave and writes M50 to Q2 of the slave The slave outputs QO when D20 is equal to 5000 2 39 1 System Setup Port 2 of two FC5A All in one CPUs is connected with a RS232C RS485 cable The master communicates with the slave using two communication requests Modbus Master Modbus Slave 15 RS2323C RS485 Request 1 D50 Wite D20 Request 2 M50 Note Function Code FC5A Modbus Master supports 8 Function Codes as shown below 30 5 in the FC5A User s Manual Though the Function Codes 05 06 15 or 16 can be used to write values to Modbus Slav
17. ogram dialog box Click the Download button to start downloading the program Cancel Default FOBA C 4R2 Download Program Dialog x Download To ie PLC Loader Transfer Mode f Binary ASCII PLC Start Program Size OO002 PLE Stop Comm Settings v Automatic stop before dawnload Help v Automatic shart after download Keep output during download Download with comment data 6 The Program Download confirmation dialog box will appear letting you know the setup for the Modbus Slave has finished Program Download Succeeded E ce Program successtully downloaded 2 1 3 Programming WindLDR Setting up the Modbus Master 1 Create a new program and select the appropriate PLC type In this example select FC5A C10R2 2 Select Configure Function Area Settings from the main menu to open the Function Area Settings dialog box and then select the Communication tab 3 Select Modbus RTU Master from the dropdown list for Port 2 the Modbus Master Request Table dialog box will appear Keep Special Input TIT Others Port 1 Maintenance Protocol Configure Communication Parameters 9600 7 Even 1 Mode Selection Input Device Number 0 Port 2 Maintenance Protocol Y Maintenance Protocol Configure 9600 Even 1 Data Link Slave Modbus ASCII Slave Modbus ATU Slave Cancel Default List Help 4
18. rea Settings dialog boxes 6 Create a ladder program as shown in the image below When M100 turns on M200 and M201 are set Ls n Lx meme e lm Note When a Request Execution Relay turns on the corresponding communication request is executed and the Request Execution Relay is automatically turned off Therefore when a Request Execution Relay is turned on with a SET instruction following a SOTU D instruction as shown above the communication request is executed just one time 7 Download the program to the Modbus Master 16 2 4 4 Programming WindO I NV2 Setting up the Screen 1 Create a new project and select an appropriate screen type 2 Create a Numerical Input and input D 20 as the Destination Device Properties of Numerical Input X General View Format Comment Fart Mame Numinguti r Keypad Type Standard Screen MHo vw Adjust location automatically Coordinates X 3 Y o r Display Type Decimal C Hexadecimal r Data Farmat Aa aA Data Type Bint B Digits E Display Floating Point Floating Digits E v Suppress Zeros Nat display sign L r Input Method Destination Device D 2g m 3 Create a Pilot Lamp and input Q 2 as the Device Properties of Pilot Lamp P X General View Registration Test Trigger Condition Comment TrigaerT ype Device Comment
19. registered requests in the Request Table are executed repeatedly For example if 4 communication requests are registered as follows Request 1 through 4 are executed in order and when Request 4 is completed FC5A starts over with Request 1 As a result even if the value in D20 of the Modbus Slave 15 is changed with a touchscreen the value will be over written by the Modbus Master E me 858 or te a Man Function Cade Allocation Ma Data Size word Bit ta 247 Slave Address Execution Error Status 1 3ReadHoMingRegstes Jomo Wed fis 408088 E 3 ps Joa a emme xm fy 1 1 E SS EUREN Ss E When the Request Execution Relay is enabled internal relays are assigned to all the communication requests registered in the Request Table The communication requests are executed only when corresponding internal relays are ON For example when M200 is assigned as the Request Execution Relay 4 internal relays starting from M200 are assigned to the communication requests as follows And only when M202 is ON the Modbus Master executes the communication request 3 Therefore when M202 is OFF the value in D20 of the Modbus Slave 15 can be changed with a touch screen without over written by the Modbus Master V BLA deus m td ESL ui ES 3 Request Execution Internal Relay M Error Status
Download Pdf Manuals
Related Search
Related Contents
取扱説明書 User Manual Rexel 10560BU folder 小型 中継・伝送車 オートキャリー 逆タップセッ ト取扱説明書 POWERSHRED® D 2127S/2127C/2127M 127C/2127M Kensington SecureBack HD3000 Manual 詳細取扱説明書 refacciones originales italika Copyright © All rights reserved.
Failed to retrieve file