Schneider Electric LUFP9 user manual Appendix C Practical Example RSLogix

Page 91

9. Appendix C: Practical Example (RSLogix 500)

9.4.Sub-Program for Writing a Parameter on a Single TeSys U Motor Starter: “LAD 5 - WR_PAR”

The role of this sub-program consists of writing the value of a parameter on a single TeSys U motor starter. The user should enter the address of the TeSys U motor starter (N7:12), the address of the parameter (N7:13) and the value to be assigned to the parameter (N7:14). Finally, he should activate bit B3:0/2 to activate the writing process. This bit is automatically reset by the LAD 5 sub-program. When the writing process is finished, the result of the writing (address of the parameter and value of the parameter) is copied in an array starting at N7:16 (for motor starter no. 1) and ending at N7:31 (for motor starter no. 8), using variable N7:15 as an index. Two successive cells of this array are used for each motor starter: The first receives the parameter’s address and the second its value. The processes carried out by this sub-program are described below, in the order in which they are run:

The sub-program goes into standby mode. The rest of the sub-program is not run until the user has activated bit B3:0/2. This allows the user to enter the values of data N7:12, 13 and 14 one after another beforehand.

The data the sub-program uses subsequently is initialized, but only if the writing process is finished (B3:0/3 = 0). These initializations are summarised below:

ƒB3:0/2 = 0.............................User command: The command for writing a parameter on a TeSys U motor starter is reset.

ƒB3:0/3 = 1.............................A parameter is written on a TeSys U motor starter: In progress.

ƒReset (T4:1) .........................The timer related to the timeout of the parameter write response is reset.

ƒN7:15 = (N7:12 × 2) + 14 .....Index in the array of results.

ƒN7:[N7:15] = { 0 ; 0 } ............The content of the array of results is reset, but only for the motor starter affected by the write query (two successive bytes).

ƒB3:0/6 = 0.............................Enables the update of the “trigger byte” that will trigger the emission of the query.

The output data corresponding to the write query is updated (O:1.13 to O:1.15) and the N7:37 counter (“trigger byte”) is increased by one. This update is only done once (bit B3:0/6 used for this pupose).. Reminder: In the LUFP9 gateway’s default configuration, this output data corresponds to the personalized Modbus command “Transactions 2” of the “TeSys U n°1” node. The query frame for this personalized command is sent when the “trigger byte” located in bits 8-15 of O:1.16 is changed (“Update mode” = “Change of state on trigger”). As a result, increasing the N7:37 counter, then updating O:1.16 using N7:37 (in “LAD 2 – MAIN_LUFP9”), causes this query to be sent. On the other hand, the output data O:1.13 to O:1.15 must be valid so that the content of the Modbus query remains coherent! The LSB and the MSB of outputs O:1.14 and O:1.15 must be swapped. The scratch variable N9:0 is used to carry out this swap between variables N7:13 and N7:14 and outputs O:1.14 and O:1.15.

The data from the Modbus response which corresponds to this write command is checked. The values of inputs I:1.13 to I:1.15 are compared to those of outputs O:1.13 to O:1.15 to determine whether the response to the command has arrived or not. If the slave number, the function number, the address of the parameter and its value correspond to those of the query (see above) and the number of bytes of data received is correct, bit B3:0/4 is activated in order to tell the rest of the sub-program that the response has arrived and that it is correct.

The address and the value of the parameter are copied into two successive locations in the array of results (indexing carried out using N7:15), reserved for the motor starter currently being polled and only takes place if the response has arrived and its content is correct (bit B3:0/4 active). The LSB and the MSB for each of these two items of data are then swapped to restore its correct value. The timer for the response timeout (T4:1) is reinitialized to ready the program for a future write command. Bit B3:0/3 is reset to show that the command is finished, thus avoiding having to run the rest of the sub-program.

91

Image 91
Contents LUFP9 Page LUFP9 Page Table of contents Introduction to the user guide IntroductionTerminology Introduction to the LUFP9 GatewayAltistart Additional Documentation Notational ConventionsDownstream network no.1 ModbusModbus VW33-A48 Downstream network no.3 ModbusPrinciple Used to Configure and Operate the LUFP9 Gateway Modbus network ABC ConfiguratorDeviceNet Network LUFP9 gatewayRSNetWorx RSLogixHardware Implementation of the LUFP9 Gateway Configuration Modbus RTUOn Receipt Mounting the Gateway on a DIN Rail Powering the gatewayMounting the gateway Dismounting the gateway Examples of Modbus connection topologies Connecting the Gateway to the Modbus NetworkLUFP9 gateway Pin outs TSXCSA00120 Ω Wiring recommendations for the Modbus networkHubs, drops, taps, and line terminations Pin Connecting the LUFP9 gateway to the DeviceNet networkWire colour CablesSelector Switches DeviceNet speed 3 4 5 6 7 Configuring DeviceNet Communication FeaturesSpeed Address Mac ID Selector DeviceNet Switches Address 3 4 5 6 7Encoding the Gateway Address Signalling DeviceNet Master PLC SLC500 DeviceNet upstream network Software Implementation of the GatewayIntroduction System ArchitectureModbus cycle time Configuring the Motor StartersManaging degraded modes Installing the Gateway Description File Configuring the Gateway in RsNetWorxSelecting and adding the master PLC’s DeviceNet scanner Editing gateway parameters Selecting and Adding the Gateway to the DeviceNet NetworkSoftware Implementation of the Gateway Configuring the DeviceNet Scanner I1.2 Configuring Inputs from the GatewayService PLC input Description I1.1O1.2 Configuring Outputs Intended for the GatewayService PLC output Description O1.1Output Value Meaning MSB + LSB Description of Services Assigned to Gateway Inputs/OutputsInput Value Meaning MSB + LSB Developing a DeviceNet Application Transferring the DeviceNet Scanner ConfigurationControl/Status Byte field Sub-chapter Gateway Initialization and DiagnosticsFull Management SummaryFbdu Modbus exchange startup Fbhssend New DeviceNet master command wordBits Description Gateway Status Word Bits Description Abchssend New gateway diagnostic11EC Error code associated with the Modbus network ED Error data item associated with the Modbus networkDescription of the error Diagnostic only DeviceNet Master Command Word Simplified Operation Connecting the Gateway to the Configuration PC Configuring the GatewayPC COM Male 9 point SUB-D LUFP9 Configuration Female RJ45RS-232 link protocol Male RJ45Importing the Gateway Configuration Installing AbcConfMonitoring the Content of the Gateway’s Memory Transferring a Configuration to the GatewayConfiguring the Gateway Deleting a Modbus Slave Procedure for deleting a Modbus slaveKeyboard shortcut Ctrl Copying a previously configured Modbus slaveAdding a Modbus Slave Adding a new type of Modbus slaveImporting/exporting a Modbus slave configuration Replacing a Periodic Input Data Element Changing the Periodic Data Exchanged With a Modbus SlaveReplacing an Output Periodic Data Element Increasing the Amount of Periodic Input Data Configuring the Gateway Configuring the Gateway I1.20 I1.17I1.18 I1.19Configuring the Gateway Configuring the Gateway Configuring the Gateway O1.18 O1.17Deleting Aperiodic Parameter Data Configuring the Gateway Changing the Name of a Modbus Slave Changing a Modbus slave ConfigurationChanging the Address of a Modbus Slave Modbus response Adding and Setting Up a Modbus CommandName of the Modbus command Modbus query With TeSys U Motor StartersWith a Generic Modbus Slave Configuring the Gateway DeviceNet Configuration Description Element Configuring the QueryConfiguring the Gateway Default communication mode. The query is transmitted Configuring the Response Field Size Description Frame Configuring the Content of the Query FrameSize FieldFrame Configuring the Content of the Response Frame Mode. The default value, CRC, should not be changedModbus Commands Based on Standard Commands Adding a Special Modbus CommandModbus Commands which Can Be Completely Changed by the User Fieldbus element Configuring the General Characteristics of the GatewayABC Element Sub-Network Element Configuring the Gateway Adding a Broadcaster Node Communication Characteristics Appendix a Technical CharacteristicsEnvironment Input data area InputsGeneral data area OutputsGeneral data Output data area16#06 Appendix B Default ConfigurationConfiguring Modbus exchanges 16#10Input Data Memory Area Content of the Gateway’s Dpram Memory16#0200 Main Program LAD 2 MAINLUFP9 Appendix C Practical Example RSLogixScanvalidation Address Symbol DescriptionAddress Symbol Display Cmdreset ModuleAppendix C Practical Example RSLogix Numparam Appendix C Practical Example RSLogix Wrrunning Reserves relating to the RSLogix 500 example Address Symbol DisplayClass Required Instances Interfaces Appendix D DeviceNet ObjectsIntroduction to the Gateway’s DeviceNet Objects List of the Gateway’s DeviceNet ObjectsIdentity Object class 16#01 Graphical Representation of the Gateway’s DeviceNet ObjectsAttributes of instance 16#01 of class 16#01 Services of instance 16#01 of class 16#01DeviceNet Object class 16#03 Message Router Object class 16#02Revision index of the Assembly Object class Assembly Objects Class 16#04Services of instance 16#01 of class 16#03 Services in class 16#04Attributes of instance 16#96 of class 16#04 Modbus Outputs Services of instances 16#64 and 16#96 of class 16#04Connection Object Class 16#05 Attributes of instance 16#64 of class 16#04 Modbus InputsAttributes of class 16#05 Services in class 16#05Produced connection ID Initial comm. characteristicsWatchdog timeout action 16#83Type Value 16#01 Get State Access NameGet / Set Produced connection path Type Value16# 20 04 24 64 30 Type Value 16#07 Get / Set Produced connection size #0 xx Type Value 16#04 Get / Set Produced connection IDAttributes of class 16#2B Services in class 16#2BAcknowledge Handler Object class 16#2B Attributes of instances 16#01 to 16#04 of class 16#05Type Value 16#06 Get Data with ack path list size Services of instance 16#01 of class 16#2BData with ack path list Attributes of class 16#A0 Services in class 16#A0Services of instance 16#01 of class 16#A0 10.10. I/O Data Input Mapping Object Class 16#A0Attributes of class 16#A1 Services in class 16#A1Services of instance 16#01 of class 16#A1 10.11. I/O Data Output Mapping Object Class 16#A1Attributes of instance 16#01 of class 16#AA Diagnostic Object Class 16#AAServices in class 16#AA Attributes of class 16#AAChanged data field Access Name Need Type Value 16#09 Get LED statusModule type DeviceNet module statusServices of instance 16#01 of class 16#AA Appendix E Modbus Commands Preset Single Register command 16#06 Read Holding Registers Command 16#03Frame Field Value or properties Modbus Protocol Exception Responses Preset Multiple Registers Command 16#10Code Name Description of the exception Exception Page User’s manual V1.0 2003-03