Home
FREE Smart Modbus Master
Contents
1. Type VARIABLE Attribute Normal Val type BOOL Address MB23 0 Long press of Key functions when a key is released the related flag is not automatically reset 0 F1 1 F2 2 F3 3 F4 PS 0 UP 1 Esc 2 Down 3 Set invenss s Controls Eliwell Controls s r l Via dell Industria 15 Zona Industriale Paludi e 32010 Pieve d Alpago BL ITALY Telephone 39 0437 986 111 e Fax 39 0437 989 066 Technical helpline 39 0437 986 250 e E mail eliwell freeway invensys com page 1 5 www eliwell com lt lill FREE Application Notes code 91S24300 1 rel 13 03 13 Example 4 Disable slave node 4 a p The user wishes to verify whether or not a slave node is responding or no longer responding and if not to stop further messages being sent to the node In effect the time that elapses typically a few seconds when waiting for a response from an unresponsive slave until the end of the timeout period influences the overall performance of the Master The following code checks the number of errors that have occurred and disables the slave node if the number exceeds a given threshold Test if the user issued a command to enable Slave 2 again slaveEnableRisingEdge Slave2 enabled N GI IF slaveEnableRisingEdge q THI Reset the counters so that if the slave is enabled again with an explicit command available as a menu item the test below works agai
2. Parameters MY Modbus Fc 03 B Satun variables E tum Settings Modus C ot Modbus FC 05 E BIOS Parameters Fen EE E envn Modbus FC 06 E Menu vet Modus address T W 247 O broadeast Modbus FCS Bi VO Mapping mo Manero Gre i treodcint Ei Loca Modbus FC 16 Bi Ertended eee Master Modbus RTU re Sled 99 Yavetxenple Q Help 5 in the example the default instance is Generic Modbus_1 Generic Modbus_2 etc 6 described in Appendix invenss s Controls Eliwell Controls s r l Via dell Industria 15 Zona Industriale Paludi e 32010 Pieve d Alpago BL ITALY Telephone 39 0437 986 111 e Fax 39 0437 989 066 Technical helpline 39 0437 986 250 e E mail eliwell freeway invensys com page 6 www eliwell com IIL free lt lill FREE Application Notes code 91S24300 1 rel 13 03 13 Ap Double clicking the node the Settings pane will appear to allow selection of the node settings The pane has 2 tabs General and Object in the example illustrated Object Holding Reg 5 File Edit View Project Debug Communication Window Tools Developer Help aame teels ASORAR n E TE h So l A d ject x Resources Project Definitions Resources Configuration Modbus FC 03 0x03 Read Holding Register S FreeSmart_542p0 General Holding Reg S E Modbus objects 3 EEPROM Parameters amp Status variables r A Enums Settings 2 BIOS Para
3. Technical helpline 39 0437 986 250 e E mail eliwell freeway invensys com page 20 www eliwell com IIL free lt lill FREE Application Notes code 91S24300 1 rel 13 03 13 sySMbMRTU_FC16 LW Write Multiple Registers Function 16 0x10 AP Type FUNCTION BLOCK Code type EMBEDDED Input vars num 13 node MbMRTUNode Slave node base UINT Address of the first Holding Register to write no UINT Number of contiguous Holding Registers to write object INT 1st Holding Register value object8 INT 8th Holding Register value pollingTime UINT Polling time ms O write on variation timeout UINT Timeout ms Inout vars num 0 Output vars num 2 error BOOL TRUE error occurred FALSE no error diagnostics MoMRTUDiagnostics Message diagnostics Extern vars num 0 Broadcast Read write sysMbMRTU_BroadcastFC05 Broadcast Write Single Coil Function 05 0x05 Type FUNCTION BLOCK Code type EMBEDDED Input vars num 4 address UINT Address of the Coil to write object BOOL Coil value turnaroundTime UINT Turnaround time ms pollingTime UINT Polling time ms O write on variation Inout vars num 0 Output vars num 2 error BOOL TRUE error occurred FALSE no error diagnostics MobMRTUDiagnostics Message diagnostics Extern vars num 0 invenss s Controls Eliwell Controls s r l Via dell Industria 15
4. com IIL free lt lill FREE Application Notes code 91S24300 1 rel 13 03 13 MODBUS CUSTOM EDITOR With the Editor custom Modbus devices can be created directly by the user When these devices are used in the project and added to the catalogue they can then be reused conveniently in third party Modbus slave devices Implementation of the Modbus map is carried out once only thereby simplifying future utilizations as there is no need to create new Modbus messages and functions To create a custom Modbus device select Developer gt Run ModbusCustomEditor from the drop down menu Build Configuration Export application to catalog Open with Free Studio Device iv View Catalog The external ModbusCustomEditor work environment will launch with the creation of a blank document empty 9 details on creating a custom Modbus device can be found in the document entitled FREE Studio Connection User Manual available on the Help pages of the FREE Studio Connection work environment key F1 e invensys Controls Eliwell Controls s r l Via dell Industria 15 Zona Industriale Paludi e 32010 Pieve d Alpago BL ITALY Telephone 39 0437 986 111 e Fax 39 0437 989 066 Technical helpline 39 0437 986 250 E mail eliwell freeway invensys com page 8 www eliwell com IIL free lt lill FREE Application Notes code 91S24300 1 rel 13 03 13 Building Configuration The Modbus Master configuration is built autom
5. ic Modbus RTU node Denice name Configuration Modbus FC 01 FreSa 5420 Genaral 2 fas ay __ Modbus FC 02 3 EEPROM Parameters NY Modbus Fc 03 B Saatus variables Setti Motus Fc 08 A tum e 9 BIOS Paramete pons Ee Modbus Fo 05 IR Menu Prg E Menu set Maddous edsress fi 0 247 O broadcast Fi VO Mapping Mres poling boe T mo heneround bre if breodcast B ines Modbus fC 16 Bi tended Modbus Fc 06 WY Modbus FC45 Master Modbus RTU M Savetsemple Q Help Besides the name the settings available are Modbus Address Modbus slave address If address 0 the node is virtual no device connected and is utilized for broadcast messages Minimum polling time minimum polling time for sending messages addressed to the single node If the address is 0 this is the broadcast messages turnaround time the interval between one broadcast message and the next Note With assisted configuration it is not sufficient simply to add a node one or more Modbus messages must be added Select and drag the desired message from the Catalog pane as illustrated a ree erm ge some cee tr apc ct pin ene G De ida Vew Project Debug Semmunication Window Tools Developer Help Ip laala ASON S Eog eG b os Ae Pepa x P esoras Eeen PITA 3 Renourcet G ic Modbus RTU node Dence name C Configuration Modbus FC 01 E FeeSmat 420 General Me P E Modus abjects E A EEPROM
6. FC15 f syswritePaBOOL m 4 f _ Operator and standard blocks Target variables Target blocks basic Enable SySMbMRTU_Enable Enable Disable Modbus master that allows to dynamically switch to programming debug mode Type FUNCTION Code type EMBEDDED Input vars num 1 enable BOOL If TRUE enables Modbus master otherwise disables it Result type BOOL Read write sysMbMRTU FC01 Read Coils Function 01 0x01 Type FUNCTION BLOCK Code type EMBEDDED Input vars num 5 node MbMRTUNode Slave node base UINT Address of the first Coil to be read no UINT Number of contiguous Coils to be read pollingTime UINT Polling time ms timeout UINT Timeout ms Inout vars num 0 Output vars num 18 error BOOL TRUE error occurred FALSE no error diagnostics MoMRTUDiagnostics Message diagnostics object1 BOOL 1st Coil object16 BOOL 16th Coil Extern vars num 0 e invensys s Controls Eliwell Controls s r l Via dell Industria 15 Zona Industriale Paludi e 32010 Pieve d Alpago BL ITALY Telephone 39 0437 986 111 e Fax 39 0437 989 066 Technical helpline 39 0437 986 250 e E mail eliwell freeway invensys com page 17 www eliwell com IIL free lt lill FREE Application Notes code 91S24300 1 rel 13 03 13 sySMbMRTU_FCO2 lin Read Discrete Inputs Function 02 0x02 Ap Type FUNCTION BLOCK Code type E
7. IIL free lt lill FREE Application Notes code 91S24300 1 rel 13 03 13 FREE Smart Modbus Master Contents DEFINITIONS cccccssscosscccoscccsseccssccceseecsees 1 MODBUS MASTER ASSISTED Por ER MEG ESC HIPTION occ ects o CONFIGURATION esssssssssssssssessssseenssen 4 REQUIREMENTS cs csseccsescoseccesccsscccseeress g MODBUS CUSTOM EDITOR rsscossssossseonsee 6 BeBe A ODEVE MASTER MANUAL PROGRAMMING e 00 11 MODELS ccuscccuccccsseccsseccuseecuseccsscecesccesees 2 APPENDIX EXAMPLES OF MANUAL RS485 SERIAL c scccscssecoseecoseccscccseccnseesess g PROGRAMMING sorscconssconseronessnnssoense 13 FIRST START UP ccescseccseccseccsecssecssecsecuee g APPENDIX LIBRARIES svssessssosseenseense Ae ENABLE MODBUS MASTER seccoeeeeoeee 4 DEFINITIONS e BIOS is synonymous with Firmware in FREE Studio e FREE Smart Modbus in this document understood to mean FREE Smart Modbus Master e Modbus understood to mean the Modbus RTU version e Target is synonymous with Smart in FREE Studio e Target blocks the default functions library includes functions specific to the target device FREE Smart Modbus Important note for developers using UATT FREE Studio the Library includes a target blocks chart containing the functions to be used for managing Modbus functionalities See Appendix Libraries and FREE Studio manual for details aa For further in
8. MBEDDED Input vars num 5 node MbMRTUNode Slave node base UINT Address of the first Discrete Input to be read no UINT Number of contiguous Discrete Inputs to be read pollingTime UINT Polling time ms timeout UINT Timeout ms Inout vars num 0 Output vars num 18 error BOOL TRUE error occurred FALSE no error diagnostics MbMRTUDiagnostics Message diagnostics object1 BOOL 1st Discrete Input object16 BOOL 16th Discrete Input Extern vars num 0 sysMbMRTU_FC03 Read Holding Registers Function 03 0x03 Type FUNCTION BLOCK Code type EMBEDDED Input vars num 5 node MbMRTUNode Slave node base UINT Address of the first Holding Register to be read no UINT Number of contiguous Holding Registers to be read pollingTime UINT Polling time ms timeout UINT Timeout ms Inout vars num 0 Output vars num 10 error BOOL TRUE error occurred FALSE no error diagnostics MoMRTUDiagnostics Message diagnostics object1 INT 1st Holding Register object8 INT 8th Holding Register Extern vars num 0 e invensys s Controls Eliwell Controls s r l Via dell Industria 15 Zona Industriale Paludi e 32010 Pieve d Alpago BL ITALY Telephone 39 0437 986 111 e Fax 39 0437 989 066 Technical helpline 39 0437 986 250 e E mail eliwell freeway invensys com page 1 8 www eliwell com IIL free lt li
9. Zona Industriale Paludi e 32010 Pieve d Alpago BL ITALY Telephone 39 0437 986 111 e Fax 39 0437 989 066 Technical helpline 39 0437 986 250 e E mail eliwell freeway invensys com page 21 www eliwell com IIL free lt lill FREE Application Notes code 91S24300 1 rel 13 03 13 sysMbMRTU_BroadcastFC06 Broadcast Write Single Register Function 06 0x06 Type FUNCTION BLOCK Code type EMBEDDED Input vars num 4 address UINT Address of the Holding Register to write object INT Holding Register value turnaroundTime UINT Turnaround time ms pollingTime UINT Polling time ms O write on variation Inout vars num 0 Output vars num 2 error BOOL TRUE error occurred FALSE no error diagnostics MoMRTUDiagnostics Message diagnostics Extern vars num 0 SySMbMRTU_BroadcastFC15 Broadcast Write Multiple Coils Function 15 0x0F Type FUNCTION BLOCK Code type EMBEDDED Input vars num 20 base UINT Address of the first Coil to write no UINT Number of contiguous Coils to write object BOOL 1st Coil value object16 BOOL 16th Coil value turnaroundTime UINT Turnaround time ms pollingTime UINT Polling time ms O write on variation Inout vars num 0 Output vars num 2 error BOOL TRUE error occurred FALSE no error diagnostics MoMRTUDiagnostics Message diagnostics Extern vars num 0 invensyss C
10. aster project Directory p Fs Target selection FreeEvolution EVD 423 FreeEvolution EVC FreeEvolution EVP FreeSmart EreeSmart Modbus I Case sensitive The following options will now be available e Create anew project New Project e the program will prompt selection of the FreeSmart or the FreeSmart Modbus target e inthis case select FreeSmart Modbus e the numbers at the side indicate the firmware version mask e Open an existing project Open project e Open recent projects Open an existing project by selecting from a list Existing projects have the extension ppjs e invenss s Controls Eliwell Controls s r l Via dell Industria 15 Zona Industriale Paludi e 32010 Pieve d Alpago BL ITALY Telephone 39 0437 986 111 e Fax 39 0437 989 066 Technical helpline 39 0437 986 250 E mail eliwell freeway invensys com page 3 www eliwell com lt lill FREE Application Notes code 91S24300 1 rel 13 03 13 ENABLE MODBUS MASTER FREE Studio offers two ways of enabling Modbus Master 1 using assisted configuration 2 using the library function sysMbMRTU_Enable MODBUS MASTER ASSISTED CONFIGURATION Click the Resources tab and select Modbus Master Smart Modbus Master project Eliwell Free Studio Application D FS Smart Modbus Master project Smart Modbus Master project ppjs Resources 5 File Edit View Project Debug Communication Windo
11. atically on saving the project It will be possible to force the FREE Studio Application to create the configuration by selecting Developer gt Build configuration from the drop down menu Corian 9 Export application to cata Open with Free Studio Device View Catalog Run ModbusCustomEditor Configuration errors In the event that configuration errors are detected an error message appears in Output gt Resources Start compilation luned 18 febbraio 2013 11 08 28 Created L Eliwell1 TEMP FREESmart 001 Global shared ple 4 vars Created L Eliwel1 TEMP FREESmart 001 Menu plc ERROR BuildCfg ModbusRTUMaster Invalid Modbus message no variables configured Build Findin project Debug Resources an SE a Double clicking on the error message FREE Studio Application re addresses to the relative page of the configuration wizard which will resolve the issue without delay e invenss s Controls Eliwell Controls s r l Via dell Industria 15 Zona Industriale Paludi e 32010 Pieve d Alpago BL ITALY Telephone 39 0437 986 111 e Fax 39 0437 989 066 Technical helpline 39 0437 986 250 e E mail eliwell freeway invensys com page 9 www eliwell com IIL free lt lill FREE Application Notes code 91S24300 1 rel 13 03 13 Modbus CFG Once the configuration has been concluded without error the Project pane will display a folder named Modbus_cfg containing the eleme
12. escribed in Appendix Libraries MODBUS RTU MASTER 1 in FREE Studio the target is indicated as FreeSmart Modbus invenss s Controls Eliwell Controls s r l Via dell Industria 15 Zona Industriale Paludi e 32010 Pieve d Alpago BL ITALY Telephone 39 0437 986 111 e Fax 39 0437 989 066 Technical helpline 39 0437 986 250 E mail eliwell freeway invensys com page 2 www eliwell com IIL free lt lill FREE Application Notes code 91S24300 1 rel 13 03 13 RS485 SERIAL FA p There is only one RS485 serial communication interface connection to the target is not possible with Modbus RTU active If the target is empty the serial connection will be set to Slave mode If there is a PLC application running there will be a pause of 5 seconds before execution occurs during which a connection can be made through FREE Studio by forcing Slave mode Once the 5 seconds have elapsed without any connection to the target the serial connection defaults to Modbus Master mode In any event Modbus Master mode can always be enabled disabled by means of the IEC code using the relative function sysMbMRTU_Enable described in Appendix Libraries FIRST START UP 1 Click the Launch FREE Studio icon located on the Desktop 2 Click the FREE Studio Application icon The program appears as illustrated below Welcome to Eliwell Free Studio Application New project Name Smbrt Modbus M
13. formation on FREE Studio functionalities not expressly tied to the Modbus Master configuration consult Help On Line press key F1 from the FREE Studio work environment or the FREE Studio Quick Start aid which is downloadable from the Eliwell site registration required e invensys Controls Eliwell Controls s r l Via dell Industria 15 Zona Industriale Paludi e 32010 Pieve d Alpago BL ITALY Telephone 39 0437 986 111 e Fax 39 0437 989 066 Technical helpline 39 0437 986 250 e E mail eliwell freeway invensys com www eliwell com IIL free lt lill FREE Application Notes code 91S24300 1 rel 13 03 13 GENERAL DESCRIPTION REQUIREMENTS The FREE Smart Modbus Master target is available in the FREE Studio development environment from version 3 1 0 onwards The firmware mask is number 542 The programming development environment is FREE Studio Application FREE SMART MODBUS MASTER MODELS The FREE Smart Modbus Master target is available in 4Din versions with display Po Mode pte Other p ns available on request Contact Eliwell Sales Office Modbus Master models are identified by the suffix M_and are provided with on board RS485 serial interface suffix S Modbus Master models can be connected to the slave nodes of Eliwell tools or those of third parties Modbus messages are identified by the relative functions target blocks implementing the Modbus commands that will be sent over the bus as d
14. free lt lill FREE Application Notes code 91S24300 1 rel 13 03 13 APPENDIX EXAMPLES OF MANUAL PROGRAMMING Example 1 Send single message just once Sending a message to a slave node just once immediately after power up The message is a Modbus 05 function the target is already managed by the guided configuration procedure wizard this implies that there is already an existing STRUCT instance available in the project for the slave node A program can be added to the PLC Modbus task with the following instructions If Modbus master is not enable skip custom messages IF NOT sysMbMRTUStatus enabled THEN When Modbus master is enabled again send the message again sent FALSE RETURN END _ F Una tantum message to Slave 2 IF NOT sent THEN Send the message Slave2 WriteCoill2 node ADR Slave2 Slave2 WriteCoill2 address 12 Slave2 WriteCoill2 timeout 1000 Slave2 WriteCoill2 object TRUE Check if correctly received by the slave in this case never send it again sent NOT Slave2 WriteCoill2 error END _ F Note The boolean type Sent variable is defined as a local variable The Slave2_WriteCoil12 variable is created as an instance of the target block sysMbMRTU_FCO5 e invensys s Controls Eliwell Controls s r l Via dell Industria 15 Zona Industria
15. l Industria 15 Zona Industriale Paludi e 32010 Pieve d Alpago BL ITALY Telephone 39 0437 986 111 e Fax 39 0437 989 066 Technical helpline 39 0437 986 250 E mail eliwell freeway invensys com page 14 www eliwell com lt lill FREE Application Notes code 91S24300 1 rel 13 03 13 Example 3 Disable Modbus Master by keystroke Ar The user may wish to disable the Modbus RTU Master by pressing and holding the Ap ESC key of the target local display to allow the debug of FREE Studio applications for collection to the target device even if the PLC application has already been launched In symmetrical manner the Modbus Master is reactivated by pressing and holding the SET key On ESC key long press disable Modbus RTU master IF sysKeyFunctions 1 THEN Reset long press event sysKeyFunctions 1 FALSE Ne Disable Modbus RTU master boolWarningsKiller sysMbMRTU_Enable FALSI GI END IF On SET key long press enable Modbus RTU master IF sysKeyFunctions 3 THEN Reset long press event sysKeyFunctions 3 FALSE Ne Enable Modbus RTU master boolWarningsKiller sysMbMRTU_Enable TRUE E w END IF Note sysKeyFunctions isa function available in the Library gt Target variable section of FREE Studio Application as described in FREE Studio Target Variables sysKeyFunctions
16. le Paludi e 32010 Pieve d Alpago BL ITALY Telephone 39 0437 986 111 e Fax 39 0437 989 066 Technical helpline 39 0437 986 250 e E mail eliwell freeway invensys com page 1 3 www eliwell com IIL free lt lill FREE Application Notes code 91S24300 1 rel 13 03 13 Example 2 Creation of diagnostics menu The code can also be used for the publication of diagnostics information relating to the Modbus Master in a FREE Smart menu The intention is to publish the diagnostics counters for a specific slave node these must appear in a submenu that the user can access via a local display from the Set menu The first step is to set all of the status variables required and assemble them in a menu X E customcomma E Resources ga Project O Definitions Resources FreeSmart Slave2 Configuration FreeSmart Modbus F emov Displa Nod d Add R e 1 4 Modbus objects m j j e EEPROM Parameters i B Status variables Name 1 Slave2_MessageCount 2 Slave2_ErrorCount 3 4 k BIOS Parameters Menu Prg A Menu set LE Slave Slave2_LastError Publish Slave 2 diagnostics counters Slave2 MessageCount Slave2 diagnostics messageCount Slave2 ErrorCount Slave2 diagnostics errorCount Slave2 LastError Slave2 diagnostics lastError Slave2 LastException Slave2 diagnostics lastException e invenss s Controls Eliwell Controls s r l Via del
17. ll FREE Application Notes code 91S24300 1 rel 13 03 13 sysMbMRTU FC04 LW Read Input Registers Function 04 0x04 E p Type FUNCTION BLOCK Code type EMBEDDED Input vars num io node MbMRTUNode Slave node base UINT Address of the first Input Register to be read no UINT Number of contiguous Input Registers to be read pollingTime UINT Polling time ms timeout UINT Timeout ms Inout vars num 0 Output vars num 10 error BOOL TRUE error occurred FALSE no error diagnostics MoMRTUDiagnostics Message diagnostics object1 INT 1st Input Register object8 INT 8th Input Register Extern vars num 0 sysMbMRTU_FCO05 Write Single Coil Function 05 0x05 Type FUNCTION BLOCK Code type EMBEDDED Input vars num eS node MbMRTUNode Slave node address UINT Address of the Coil to write object BOOL Coil value pollingTime UINT Polling time ms O write on variation timeout UINT Timeout ms Inout vars num 0 Output vars num 2 error BOOL TRUE error occurred FALSE no error diagnostics MoMRTUDiagnostics Message diagnostics Extern vars num 0 invensys s Controls Eliwell Controls s r l Via dell Industria 15 Zona Industriale Paludi e 32010 Pieve d Alpago BL ITALY Telephone 39 0437 986 111 e Fax 39 0437 989 066 Technical helpline 39 0437 986 250 e E mail eliwell freeway in
18. meters Start address booo 1 65536 E Menu Prg Menu set Poling time 0 ms 0 Continuous Read 3 85 VO Mapping Timeout o0 m BE Local BE Extended BE Remote A Alarms Master Modbus RTU 2 49 SlaveExample General Pane Settings Besides the name the settings available are Start Address address of the first Modbus slave object The range is 1 65536 Bear in mind that some manufacturers use 0 65535 In this case 1 must be added to the Start Address Polling time the time within which the message will be processed expressed in ms If time 0 write only if the value is changed read indicates the maximum speed Object Pane Settings This second tab varies according to the message note 6 and defines the list of readable or writeable objects Similarly in the case of Modbus objects EEPROM parameters BIOS Status Variables etc there is the option of adding or removing up to Modbus objects 8 registers 16 bit 16 Coil Discrete Inputs 1 bit 7 depending on the Modbus message the Object tab Holding Reg Inputs Coil Single Reg etc 8 see Help On Line key F1 or FREE Studio Quick Start invenss s Controls Eliwell Controls s r l Via dell Industria 15 Zona Industriale Paludi e 32010 Pieve d Alpago BL ITALY Telephone 39 0437 986 111 e Fax 39 0437 989 066 Technical helpline 39 0437 986 250 E mail eliwell freeway invensys com page 7 www eliwell
19. n Slave2 messageCount 0 Slave2 errorCount 0 Slave2 lastError ErrNone Slave2 lastException ExcNone END IF Is the error count above the configured threshold IF Slave2 diagnostics errorCount gt MAX ERRS THEN Disable Slave 2 Slave2 enabled FALSI GI END IF e invenss s Controls Eliwell Controls s r l Via dell Industria 15 Zona Industriale Paludi e 32010 Pieve d Alpago BL ITALY Telephone 39 0437 986 111 e Fax 39 0437 989 066 Technical helpline 39 0437 986 250 e E mail eliwell freeway invensys com page 1 6 www eliwell com IIL free lt lill FREE Application Notes code 91S24300 1 rel 13 03 13 APPENDIX LIBRARIES Indicated below are the Modbus Master functions available in the Library gt Target blocks section of FREE Studio Application as described in FREE Studio Library F DINT_TO_Registers GF OvermiteLocalDisplay GF Reaisters_TO_REAL sysMbMRTU_BroadcastFC05 iif sysMbMRTU_Enable sysMbMRTU_FCO4 sysMbMRTU_FC16 TF KeyLogDutDisplays GF PWM_Frequency GF Registers_TO_UDINT sysMbMRTU_BroadcastFCO6 sysMbMRTU_FCO1 sysMbMRTU_FCO5S F syswD_Background TF LocalAnalogHystFilter 5 REAL_TO_Registers TT sysClockwrite sysMbMRTU_BroadcastFC15 sysMbMRTU_FCO2 sysMbMRTU_FCO6 GF syswD_Timed TF LocalDigitalDebounce GF Registers_TO_DINT GF sysExecutionPassword sysMbMRTU_BroadcastFC16 sysMbMRTU_FCO3 sysMbMRTU_
20. ne 39 0437 986 111 e Fax 39 0437 989 066 Technical helpline 39 0437 986 250 e E mail eliwell freeway invensys com page 11 www eliwell com IIL free lt lill FREE Application Notes code 91S24300 1 rel 13 03 13 To activate a task point the mouse over the name right click and select Add program Project Project o Definitions Resources S E MbMATU Project H Programs H 0 Function blocks Functions H E Global variables H Global shared H Modbus_cfg Al Tasks c Timed conf Background a 3 Modbus devel fi CustomCommands The PLC Modbus task is an invaluable resource for the developer it encodes part of the Modbus RTU master configuration manually this is a dedicated entry point needed for every operation that produces a message to be sent over the bus Using this rule Modbus messages will not influence the timed PLC task and will have only a limited impact on low priority tasks asynchronous mode Note The dedicated code combines with the code generated by the configuration wizard to determine an increment of the code and the time values of the Modbus Master interrogation on bus etc e invenss s Controls Eliwell Controls s r l Via dell Industria 15 Zona Industriale Paludi e 32010 Pieve d Alpago BL ITALY Telephone 39 0437 986 111 e Fax 39 0437 989 066 Technical helpline 39 0437 986 250 e E mail eliwell freeway invensys com page 12 www eliwell com IIL
21. nts generated by the Modbus Master configuration wizard Project Definitions Resources S E FREESmart_001 Project J Programs i Function blocks DINT_TO_RegistersConverter Ss MySlaveNode_1 FE MySlaveNode_1__0 MySlaveNode_1__1 Pa Onceln4LifeSlave Bi Onceln4LifeSlave_ModbusFCO3_1 REAL_TO_RegistersConverter FF UDINT_TO_ReaistersConverter ees Tasks Also there is always an IEC 61131 3 STRUCT instance for each single node configured as a slave and a function block instance for each single Modbus message These elements are exploited by the PLC application and by debug operations which access the resources as illustrated in the next chapter on manual programming e invensyss Controls Eliwell Controls s r l Via dell Industria 15 Zona Industriale Paludi e 32010 Pieve d Alpago BL ITALY Telephone 39 0437 986 111 e Fax 39 0437 989 066 Technical helpline 39 0437 986 250 E mail eliwell freeway invensys com page 1 0 www eliwell com IIL free lt lill FREE Application Notes code 91S24300 1 rel 13 03 13 MANUAL PROGRAMMING As an alternative to assisted configuration the developer can create the IEC 61131 3 code using Modbus Master functions Assisted configuration allows the creation of nodes and messages e g readable and or writeable Expansions and I O values polling of these slaves takes place cyclically as a background task Should the intention be
22. ontrols Eliwell Controls s r l Via dell Industria 15 Zona Industriale Paludi e 32010 Pieve d Alpago BL ITALY Telephone 39 0437 986 111 e Fax 39 0437 989 066 Technical helpline 39 0437 986 250 e E mail eliwell freeway invensys com page 22 www eliwell com IIL free lt lill FREE Application Notes code 91S24300 1 rel 13 03 13 sysMbMRTU_BroadcastFC16 Broadcast Write Multiple Registers Function 16 0x10 Type FUNCTION BLOCK Code type EMBEDDED Input vars num 12 base UINT Address of the first Holding Register to write no UINT Number of contiguous Holding Registers to write object INT 1st Holding Register value object8 INT 8th Holding Register value turnaroundTime UINT Turnaround time ms pollingTime UINT Polling time ms O write on variation Inout vars num 0 Output vars num 2 error BOOL TRUE error occurred FALSE no error diagnostics MobMRTUDiagnostics Message diagnostics Extern vars num 0 invensss Controls Eliwell Controls s r l Via dell Industria 15 Zona Industriale Paludi e 32010 Pieve d Alpago BL ITALY Telephone 39 0437 986 111 e Fax 39 0437 989 066 Technical helpline 39 0437 986 250 E mail eliwell freeway invensys com page 23 www eliwell com
23. riale Paludi e 32010 Pieve d Alpago BL ITALY Telephone 39 0437 986 111 e Fax 39 0437 989 066 Technical helpline 39 0437 986 250 E mail eliwell freeway invensys com page 4 www eliwell com free lt lill FREE Application Notes code 91S24300 1 rel 13 03 13 BIOS CF31 and CF32 parameters Note the modified default CF31 3 9600 5 38400 Deu HOCH EET E E eum num num num num num mum eum ma num eum num Right clicking on Resources gt Modbus Master RTU and selecting Add from the pop up menu a generic slave node Generic Modbus can be added 3p kaala a SAMENES ETB Shashi Gagi eee ma o EE Prope o Dotrina J Rexaeces S W Freesat s42p0 i E Modbus objects 29 EEPROM Parameters G Regte TO_AEAL S Registon 10_UDNT P r dwe gt as Double clicking the node the Settings pane will appear to allow selection of the node settings e invenss s Controls Eliwell Controls s r l Via dell Industria 15 Zona Industriale Paludi e 32010 Pieve d Alpago BL ITALY Telephone 39 0437 986 111 e Fax 39 0437 989 066 Technical helpline 39 0437 986 250 E mail eliwell freeway invensys com page 5 www eliwell com IIL free lt lill FREE Application Notes code 91S24300 1 rel 13 03 13 a ae a G De fda View Project Debug Communication Window Tools Developer Help CEECEE ETE a eae TEE SAS S eS Prsa x Beres Rew y E Pop 0 Oetrtione BF Resource G
24. to interrogate a resource just once or on the basis of a specific event determined by way of a PLC code it will be preferable to write dedicated code to meet the explicit requirements of the developer Association of the Modbus program with a Task For the Modbus program to run it must be associated with a task There are various types of task e Boot Task executed once only on starting up the system e Init Task executed at each download of the application and on starting up the system after Boot Note The associated program initializes slaves and messages according to the configuration with fixed values that are independent of the run time e Timed Task executed at regular intervals which can be set by the developer Default setting every 100ms Note Modbus messages do not interfere with this task e Background Task executed as low priority once or repeatedly between the end of one Timed task and the start of the next Also available in addition to these is the task e Modbus Task executed to implement Modbus Master calling relative function blocks and to send messages Note Each new project has the main program associated with the background task the main program can still be eliminated and or associated with other tasks 10 firmware mask 542 only e invenss s Controls Eliwell Controls s r l Via dell Industria 15 Zona Industriale Paludi e 32010 Pieve d Alpago BL ITALY Telepho
25. vensys com page 19 www eliwell com IIL free lt lill FREE Application Notes code 91S24300 1 rel 13 03 13 sysMbMRTU_FC06 Write Single Register Function 06 0x06 Ap Type FUNCTION BLOCK Code type EMBEDDED Input vars num 5 node MbMRTUNode Slave node address UINT Address of the Holding Register to write object INT Holding Register value pollingTime UINT Polling time ms O write on variation timeout UINT Timeout ms Inout vars num 0 Output vars num 2 error BOOL TRUE error occurred FALSE no error diagnostics MobMRTUDiagnostics Message diagnostics Extern vars num 0 SySMbMRTU_FC15 Write Multiple Coils Function 15 0x0F Type FUNCTION BLOCK Code type EMBEDDED Input vars num p21 node MbMRTUNode Slave node base UINT Address of the first Coil to write no UINT Number of contiguous Coils to write object1 BOOL 1st Coil value object16 BOOL 16th Coil value pollingTime UINT Polling time ms 0 write on variation timeout UINT Timeout ms Inout vars num 0 Output vars num 2 error BOOL TRUE error occurred FALSE no error diagnostics MoMRTUDiagnostics Message diagnostics Extern vars num 0 e invenss s Controls Eliwell Controls s r l Via dell Industria 15 Zona Industriale Paludi e 32010 Pieve d Alpago BL ITALY Telephone 39 0437 986 111 e Fax 39 0437 989 066
26. w Tools Developer Help aame 328 46 WSR OAA S E TE oath So G0 AS S el oject x E Resources EA Project o Definitions E Resources RS485 Configuration T Configuration E FreeSmart_542p0 D Modbus objects a 3 EEPROM Parameters amp Status variables C Notused A Enums Modbus Master BIOS Parameters E Menu Prg m Baud rate Menu set ens BE 1 0 Mapping E BE Local 2400 b s BE Extended C 4800 b s BE Remote 9600 b s amp Alarms 19200 b s Master Modbus RTU 38400 b s Help C 57600 b s 115200 b s r Serial Mode E 8 1 Even parity 8 data bits 1 stop bit _ When Modbus Master is selected it will be possible to set Baud Rate and parity Serial Mode Bear in mind that the configuration procedure impacts on the configuration of BIOS parameters CF31 e CF32 CF31 and CF32 are visible e from the menu Resources gt Modbus Objects gt BIOS Parameters if they are added to the list with Add or e from FREE Studio Device from the drop down menu select Developer gt Open with FREE Studio Device and access the Configuration folder e from the BIOS menu of the target press esc set Prg and access the folder PAr gt CF 2 defined by Help On Line as CONFIGURATION WIZARD 3 see Appendix Libraries 4 operation is not guaranteed at rates above 19200 b s invenss s Controls Eliwell Controls s r l Via dell Industria 15 Zona Indust
Download Pdf Manuals
Related Search
Related Contents
Manual del Producto el AC-C32 - Más información manuale citofono senzafili 1029 Lidco Rapid user manual e+p MW 1250 Hampton Bay HDP11235 Installation Guide Avaya 4600 Series IP Telephones Application Note Benutzer- handbuch 0312-901 SRB_EC145_JPN_Instruction Manual Copyright © All rights reserved.
Failed to retrieve file