The text of a manual · part 6 of 18
Simatic S5 to RSLogix 5000 Application Conversion Guide: Chapter 2: Software Conversions - Program Structure, pages 39 to 46
Pages 39 to 46 of 140, from Simatic S5 to RSLogix 5000 Application Conversion Guide
The original document is the PDF (3.5 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Siemens 6ES5-431-8MA11, Siemens 6ES5-451-8MA11 and Siemens 6ES5-452-8MR11
Page 39
Software Conversions - Program Structure
Chapter 2
With the Add-On Instruction a pre-scan routine can be configured to run when the controller goes from Program mode to Run mode, or powers up in Run mode. Under these conditions, the pre-scan routine will run once, and can typically be used to initialize data. This is not available with Step 5 Function Blocks. An Add-On Instruction can have an EnableInFalse routine, which will be called (if present) when the rung condition at the Add-On Instruction call is false. In this case, the input and output parameters will pass values.
Watchdog Timer
A watchdog timer can be configured for each RSLogix 5000 task. This timer specifies the maximum time a task can run before triggering a fault. In S5 the user configures the cycle time in 54 DX0 or OB26. An error is triggered if a scan of the program is not executed within this time. There is no facility to set watchdog timers for individual blocks in S5. The S5 watchdog timer can be retriggered by calling OB 222.
I/O Addressing
In Step 5 and RSLogix 5000 software, the software address of a physical input from the plant is determined by the position of the input card and the channel to which the input is connected. Similarly, the software address of a physical output to the plant is determined by the position of the output card and the channel to which the output is connected.
Example In Step 5, if an input is connected into the 3rd channel on the first input card, it is assigned the address I0.2. (The first channel on this card is assigned address I0.0). Using the Step 5 symbols table, the programmer can assign a name to each input/output as shown below.
Publication LOGIX-AP010B-EN-P - May 2010
39
Page 40
Chapter 2
Software Conversions - Program Structure
In the ladder code these symbols can be displayed instead of the assigned addresses as shown below.
A limitation of Step 5 is that the length of a symbol name is by default restricted to 8 characters, extendable to maximum 20 characters. The comment is limited to 20 characters and is extendable to 48 characters. In RSLogix 5000 software, a feature called ‘built-in device profiles’ means that when a digital input/output card is configured, the individual channels are automatically assigned addresses based on the digital module slot number and type of card. This address can be seen from the Controller Tag screen that is accessed by clicking the Controller Tag icon on the project tree as shown below. In the window below, a 16-channel digital input module is configured in slot 1. The channels are assigned addresses Local:1:I.Data.0 to Local:1:I.Data.15
40
Publication LOGIX-AP010B-EN-P - May 2010
Page 41
Software Conversions - Program Structure
Logix Aliasing
Chapter 2
The difference between Step 5 and RSLogix 5000 software is the RSLogix 5000 software uses a feature called aliasing to assign more intuitive names to I/O, which makes for more user-friendly programming. An alias can be created for each I/O point and this alias will contain the same value as the associated I/O point. When writing code, the programmer can use the alias name instead of the address location. The alias name can be up to 40 characters in length. Use aliases in the following situations: • Program logic in advance of wiring diagrams. • Assign a descriptive name to an I/O device. • Provide a simpler name for a complex tag. • Use a descriptive name for an element of an array.
Example If the 1st input channel is connected to the feedback signal from Pump1 then the following alias can be created by right-clicking on the tag assigned to this address and choosing New tag which aliases “Local:1:I.Data.0” from the pull-down menu as shown in the window below.
Publication LOGIX-AP010B-EN-P - May 2010
41
Page 42
Chapter 2
Software Conversions - Program Structure
When the alias tag is created, it will appear in the tag list as follows.
When the code references the feedback from the pump it can use the address Pump1_Running rather than Local:1:I.Data.0 as shown below.
It is possible also to display the aliased input reference as shown below.
42
Publication LOGIX-AP010B-EN-P - May 2010
Page 43
Software Conversions - Program Structure
Internal Memory Addressing
Chapter 2
Internal controller memory locations are available as flag words/bits or DataBlock (DB) words/bits.
Flag Words/Bits Step 5 internal controller flag address locations have these formats: • F3.5 for a bit • FB7 for a byte • FW10 for a word • FD for a double word • S for an extended memory location These addresses can then be assigned symbolic names via the symbols table. RSLogix 5000 software does not use this type of address format. Instead, memory locations are defined and referenced solely by the name assigned to them in the tag database.
Example In Step 5, an internal PLC location for storing tank weight could be defined as follows.
This can be used in the PLC logic to perform a comparison as shown below.
Publication LOGIX-AP010B-EN-P - May 2010
43
Page 44
Chapter 2
Software Conversions - Program Structure
There is no address field in RSLogix 5000 software so the internal registers can be given any name as defined by the user. An example is shown below.
This can be used in the controller logic to perform a comparison as shown below.
Data Blocks In S5, controller data blocks are often used to store the various data elements relating to a device type such as a pump, motor or valve. Some S5 controllers also have extended data blocks (DX) that store data in a similar manner to ordinary data blocks. The members of the data blocks can be of various data types:
44
Data Type
Description
KM for a binary pattern (16 bits)
KY for two absolute numbers, one byte each, each in the 0 to 255 range
KH for a hexadecimal pattern with a maximum of four digits
KS for two alphanumeric characters
KT for timer value (BCD coded) units .0 to .3 and values 0 to 999
KC for a counter value 0 to 999
Publication LOGIX-AP010B-EN-P - May 2010
Page 45
Software Conversions - Program Structure
Chapter 2
Example Data Block DB1 could be assigned to store data relating to valves. The data block would store information such as the open/closed feedback status of the valves, the error status of the valves, or the auto/manual status of the valve. RSLogix 5000 software allows the creation of User Defined Data Types that will often be useful in replacing Step 5 data blocks. An RSLogix 5000 User Defined Data Type is a custom data structure made up of individual standard data type elements.
Example To create an RSLogix 5000 data structure to replace a Step 5 data block containing valve information, the following User Data Structure could be generated.
Publication LOGIX-AP010B-EN-P - May 2010
45
Page 46
Chapter 2
Software Conversions - Program Structure
From the tag database, a tag with this User Data Type can then be created. Multiple instances are automatically generated by selecting the dimension of the array as shown below.
46
Publication LOGIX-AP010B-EN-P - May 2010