background image

97BPLC concepts 

 

4.5 Using a memory card 

 

S7-1200 Programmable controller 

100

 

System Manual, 11/2011, A5E02486680-05 

 

Use a transfer card to copy a program to the internal load memory of the CPU without 

using STEP 7. After you insert the transfer card, the CPU first erases the user program 

and any force values from the internal load memory, and then copies the program from 

the transfer card to the internal load memory. When the transfer process is complete, you 

must remove the transfer card. 
You can use an empty transfer card to access a password-protected CPU when the 

password has been lost or forgotten (Page 107). Inserting the empty transfer card deletes 

the password-protected program in the internal load memory of the CPU. You can then 

download a new program to the CPU. 

 

Use a program card as external load memory for the CPU. Inserting a program card in 

the CPU erases all of the CPU internal load memory (the user program and any force 

values). The CPU then executes the program in external load memory (the program 

card). Downloading to a CPU that has a program card updates only the external load 

memory (the program card). 
Because the internal load memory of the CPU was erased when you inserted the 

program card, the program card must remain in the CPU. If you remove the program 

card, the CPU goes to STOP mode. (The error LED flashes to indicate that program card 

has been removed.) 

The program on a memory card includes the code blocks, the data blocks, the technology 

objects, and the device configuration. The memory card does not contain any force values. 

The force values are not part of the program, but are stored in the load memory, whether the 

internal load memory of the CPU, or the external load memory (a program card). If a 

program card is inserted in the CPU, then STEP 7 applies the force values only to the 

external load memory on the program card. 
You also use a memory card when downloading firmware updates from customer support 

memory card. 

4.5.1

 

Inserting a memory card in the CPU 

 

CAUTION 

 

Electrostatic discharge can damage the memory card or the receptacle on the CPU. 
Make contact with a grounded conductive pad and/or wear a grounded wrist strap when 

you handle the memory card. Store the memory card in a conductive container. 

 

 

 

 

Check that the memory card is not write-protected. Slide the protection 

switch away from the "Lock" position.       

Summary of Contents for SIMATIC S7-1200

Page 1: ...______________ ___________________ ___________________ SIMATIC S7 S7 1200 Programmable controller System Manual 11 2011 A5E02486680 05 Preface Product overview 1 STEP 7 programming software 2 Installation 3 PLC concepts 4 Device configuration 5 Programming concepts 6 Basic instructions 7 Extended instructions 8 Technology instructions 9 Communication 10 Web server 11 Communication processor 12 Tel...

Page 2: ... the relevant documentation in particular its warning notices and safety instructions Qualified personnel are those who based on their training and experience are capable of identifying risks and avoiding potential hazards when working with these products systems Proper use of Siemens products Note the following WARNING Siemens products may only be used for the applications described in the catalo...

Page 3: ...ogrammable logic controllers Scope of the manual This manual describes the following products STEP 7 V11 Basic and Professional S7 1200 CPU firmware release V2 2 For a complete list of the S7 1200 products described in this manual refer to the technical specifications Page 657 Certification CE label C Tick and other standards Refer to the technical specifications Page 657 for more information Serv...

Page 4: ...reate your own custom manual The customer support entry portal http support automation siemens com provides a link to My Documentation Manager under mySupport The customer support web site also provides podcasts FAQs and other helpful documents for S7 1200 and STEP 7 The podcasts utilize short educational video presentations that focus on specific features or scenarios in order to demonstrate the ...

Page 5: ... and configuration of STEP 7 33 2 3 8 Dragging and dropping between editors 33 2 3 9 Changing the operating mode of the CPU 34 2 3 10 Capturing and restoring a block state 34 2 3 11 Changing the call type for a DB 36 2 3 12 Temporarily disconnecting devices from a network 37 2 3 13 Virtual unplugging of devices from the configuration 38 3 Installation 39 3 1 Guidelines for installing S7 1200 devic...

Page 6: ... and Date data types 89 4 4 5 Data structure data type 92 4 4 6 PLC data type 93 4 4 7 Pointer data types 93 4 4 7 1 Pointer pointer data type 94 4 4 7 2 Any pointer data type 95 4 4 7 3 Variant pointer data type 96 4 4 8 Accessing a slice of a tagged data type 96 4 4 9 Accessing a tag with an AT overlay 98 4 5 Using a memory card 99 4 5 1 Inserting a memory card in the CPU 100 4 5 2 Configuring t...

Page 7: ... 138 6 3 2 Function FC 140 6 3 3 Function block FB 140 6 3 4 Data block DB 141 6 4 Understanding data consistency 143 6 5 Programming language 144 6 5 1 Ladder logic LAD 144 6 5 2 Function Block Diagram FBD 145 6 5 3 SCL 145 6 5 4 EN and ENO for LAD FBD and SCL 152 6 6 Protection 153 6 6 1 Access protection for the CPU 153 6 6 2 Know how protection 154 6 6 3 Copy protection 156 6 7 Downloading the...

Page 8: ... and truncate instructions 204 7 7 4 Ceiling and floor instructions 205 7 7 5 Scale and normalize instructions 206 7 8 Program control 209 7 8 1 Overview of SCL program control statements 209 7 8 2 IF THEN statement 210 7 8 3 CASE statement 211 7 8 4 FOR statement 212 7 8 5 WHILE DO statement 213 7 8 6 REPEAT UNTIL statement 214 7 8 7 CONTINUE statement 214 7 8 8 EXIT statement 215 7 8 9 GOTO stat...

Page 9: ... REPLACE 258 8 2 4 7 FIND 259 8 3 Distributed I O PROFINET PROFIBUS or AS i 260 8 3 1 RDREC and WRREC 260 8 3 2 RALRM 263 8 3 3 STATUS parameter for RDREC WRREC and RALRM 265 8 3 4 DPRD_DAT and DPWR_DAT 269 8 3 5 DPNRM_DG 271 8 4 Interrupts 273 8 4 1 Attach and detach instructions 273 8 4 2 Cyclic interrupts 276 8 4 2 1 SET_CINT Set cyclic interrupt 276 8 4 2 2 QRY_CINT Query cyclic interrupt 278 ...

Page 10: ...l instructions 346 9 3 2 1 MC_Power instruction 346 9 3 2 2 MC_Reset instruction 349 9 3 2 3 MC_Home instruction 350 9 3 2 4 MC_Halt instruction 352 9 3 2 5 MC_MoveAbsolute instruction 354 9 3 2 6 MC_MoveRelative instruction 356 9 3 2 7 MC_MoveVelocity instruction 358 9 3 2 8 MC_MoveJog instruction 360 9 3 2 9 MC_CommandTable instruction 362 9 3 2 10 MC_ChangeDynamic 365 9 3 3 Operation of motion ...

Page 11: ...e PROFIBUS CMs 444 10 3 1 3 Other properties of the PROFIBUS CMs 446 10 3 1 4 Configuration examples for PROFIBUS 447 10 3 2 Configuring a DP master and slave device 448 10 3 2 1 Adding the CM 1243 5 DP master module and a DP slave 448 10 3 2 2 Configuring logical network connections between two PROFIBUS devices 449 10 3 2 3 Assigning PROFIBUS addresses to the CM 1243 5 module and DP slave 449 10 ...

Page 12: ...reference 500 11 3 2 6 Defining enum types 501 11 3 2 7 Referencing CPU variables with an enum type 501 11 3 2 8 Creating fragments 503 11 3 2 9 Importing fragments 504 11 3 2 10 Combining definitions 504 11 3 2 11 Handling tag names that contain special characters 505 11 3 3 Configuring use of user defined Web pages 507 11 3 4 Programming the WWW instruction for user defined web pages 508 11 3 5 ...

Page 13: ... communication 562 12 3 5 1 Configuring the communication module 563 12 3 5 2 Programming the STEP 7 program 565 12 3 5 3 Configuring the terminal emulator 566 12 3 5 4 Running the example program 567 12 4 Universal serial interface USS communication 567 12 4 1 Requirements for using the USS protocol 568 12 4 2 USS_DRV instruction 570 12 4 3 USS_PORT instruction 573 12 4 4 USS_RPM instruction 574 ...

Page 14: ...0 2 Displaying status in the program editor 643 14 10 3 Capturing the online values of a DB to reset the start values 644 14 10 4 Using a watch table to monitor and modify values in the CPU 645 14 10 4 1 Using a trigger when monitoring or modifying PLC tags 646 14 10 4 2 Enabling outputs in STOP mode 647 14 10 5 Forcing values in the CPU 647 14 10 5 1 Using the force table 647 14 10 5 2 Operation ...

Page 15: ... 6 Analog signal modules SMs 700 A 6 1 SM 1231 analog input module specifications 700 A 6 2 SM 1232 analog output module specifications 702 A 6 3 SM 1234 analog input output module specifications 704 A 6 4 Step response of the analog inputs 707 A 6 5 Sample time and update times for the analog inputs 707 A 6 6 Measurement ranges of the analog inputs for voltage 708 A 6 7 Output AQ measurement rang...

Page 16: ... CM 1243 2 749 A 10 3 2 Electrical connections of the AS i master CM 1243 2 750 A 10 4 RS232 RS422 and RS485 752 A 10 4 1 CB 1241 RS485 Specifications 752 A 10 4 2 CM 1241 RS485 Specifications 754 A 10 4 3 CM 1241 RS232 Specifications 755 A 10 4 4 CM 1241 RS422 485 Specifications 756 A 11 TeleService TS Adapter and TS Adapter modular 758 A 12 SIMATIC memory cards 758 A 13 Input simulators 758 A 14...

Page 17: ... application The CPU monitors the inputs and changes the outputs according to the logic of your user program which can include Boolean logic counting timing complex math operations and communications with other intelligent devices The CPU provides a PROFINET port for communication over a PROFINET network Additional modules are available for communicating over PROFIBUS GPRS RS485 or RS232 networks ...

Page 18: ... 100 kHz 3 at 30 kHz High speed counters Quadrature phase 3 at 80 kHz 3 at 80 kHz 1 at 20 kHz 3 at 80 kHz 3 at 20 kHz Pulse outputs1 2 2 2 Memory card SIMATIC Memory card optional Real time clock retention time 10 days typical 6 day minimum at 40 degrees C PROFINET 1 Ethernet communications port Real math execution speed 18 μs instruction Boolean execution speed 0 1 μs instruction 1 For CPU models...

Page 19: ...ode blocks can be monitored simultaneously Program cycle Multiple OB 1 OB 200 to OB 65535 Startup Multiple OB 100 OB 200 to OB 65535 Time delay interrupts and cyclic interrupts 41 1 per event OB 200 to OB 65535 Hardware interrupts edges and HSC 50 1 per event OB 200 to OB 65535 Time error interrupts 1 OB 80 OBs Diagnostic error interrupts 1 OB 82 Type IEC Quantity Limited only by memory size Timer...

Page 20: ...muncation processor CP or TS Adapter CPU Signal board SB or communication board CB Signal module SM Table 1 3 Digital signal modules and signal boards Type Input only Output only Combination In Out digital SB 4 x 24VDC In 200 kHz 4 x 5VDC In 200 kHz 4 x 24VDC Out 200 kHz 4 x 5VDC Out 200 kHz 2 x 24VDC In 2 x 24VDC Out 2 x 24VDC In 2 x 24VDC Out 200 kHz 2 x 5VDC In 2 x 5VDC Out 200 kHz 8 x 24VDC In...

Page 21: ...1 5 Communication interfaces Module Type Description RS232 Full duplex RS485 Half duplex RS422 485 Full duplex RS422 Half duplex RS485 PROFIBUS Master DPV1 PROFIBUS Slave DPV1 Communication module CM AS i Master CM 1243 2 AS Interface Communication processor CP Modem connectivity GPRS Communication board CB RS485 Half duplex TS Adapter IE Basic1 Connection to CPU TS Adapter GSM GSM GPRS TS Adapter...

Page 22: ...ctor Status LEDs Bus connector Signal modules SMs add additional functionality to the CPU SMs connect to the right side of the CPU Digital I O Analog I O RTD and thermocouple ཱ ི Removable user wiring connector Status LEDs Communication modules CMs and communications processors CPs add communication options to the CPU such as for PROFIBUS or RS232 RS485 connectivity for PtP Modbus or USS or the AS...

Page 23: ...ividual motions for a motor control axis that you can combine into a movement sequence Individual motions are configured in a technology object command table for pulse train output TO_CommandTable_PTO Additional Interrupt instructions allow you to set and query time delay and cyclic interrupts You can also use the new diagnostic instructions to read the LED status or other diagnostic information a...

Page 24: ...requirements of the Korean Certification KC Mark STEP 7 Basic and STEP 7 Professional programming packages STEP 7 provides two programming packages to provide the features you need Both include the text based high level programming language SCL Structured Control Language STEP 7 Basic provides all of the tools required for your S7 1200 project With the STEP 7 Basic package you can connect your S7 ...

Page 25: ...85 functionality A new AS i Master communication module CM 1243 2 AS i Master 1 5 Basic HMI panels Because visualization is becoming a standard component for most machine designs the SIMATIC HMI Basic Panels provide touch screen devices for basic operator control and monitoring tasks All panels have a protection rating for IP65 and have CE UL cULus and NEMA 4x certification Basic HMI Panel Descrip...

Page 26: ...s screens 200 alarms 25 curves 40 KB recipe memory 5 recipes 20 data records 20 entries KTP 1000 Basic PN 10 touch screen with 8 tactile keys Color TFT 256 colors 211 2 mm x 158 4 mm 10 4 Resolution 640 x 480 500 tags 50 process screens 200 alarms 25 curves 40 KB recipe memory 5 recipes 20 data records 20 entries TP 1500 Basic PN 15 touch screen Color TFT 256 colors 304 1 mm x 228 1 mm 15 1 Resolu...

Page 27: ...ed in Boolean algebra Page 145 SCL structured control language is a text based high level programming language When you create a code block you select the programming language to be used by that block Your user program can utilize code blocks created in any or all of the programming languages 2 1 System requirements To install the STEP 7 software on a PC running Windows XP or Windows 7 operating s...

Page 28: ... for the selected portal Selection panel for the selected action Changes to the Project view Project view Menus and toolbar Project navigator Work area Task cards Inspector window Changes to the Portal view Editor bar With all of these components in one place you have easy access to every aspect of your project For example the inspector window shows the properties and information for the object th...

Page 29: ...eate your program you drag instructions from the task card onto a network 2 3 2 Accessing instructions from the Favorites toolbar STEP 7 provides a Favorites toolbar to give you quick access to the instructions that you frequently use Simply click the icon for the instruction to insert it into your network For the Favorites in the instruction tree double click the icon You can easily customize the...

Page 30: ... the instruction into your user program The unconfigured Calculate instruction provides two input parameters and an output parameter Click the and select the data types for the input and output parameters The input and output parameters must all be the same data type For this example select the Real data type Click the Edit equation icon to enter the equation For this example enter the following e...

Page 31: ...imit for the scaled output value Out low in5 Lower limit for the scaled ouput value In the Edit Calculate box enter the equation with the parameter names OUT in4 in5 in2 in3 in1 in3 in5 When you click OK the Calculate instruction creates the inputs required for the instruction Enter the tag names for the values that correspond to the parameters 2 3 4 Adding inputs or outputs to a LAD or FBD instru...

Page 32: ...x instructions are expandable displaying only the key inputs and outputs To display the inputs and outputs click the arrow at the bottom of the instruction 2 3 6 Selecting a version for an instruction The development and release cycles for certain sets of instructions such as Modbus PID and motion have created multiple released versions for these instructions To help ensure compatibility and migra...

Page 33: ...ect the Settings command from the Options menu to change these settings 2 3 8 Dragging and dropping between editors To help you perform tasks quickly and easily STEP 7 allows you to drag and drop elements from one editor to another For example you can drag an input from the CPU to the address of an instruction in your user program You must zoom in at least 200 to select the inputs or outputs of th...

Page 34: ...you must be connected online to the CPU The Online tools task card displays an operator panel that shows the operating mode of the online CPU The operator panel also allows you to change the operating mode of the online CPU Use the button on the operator panel to change the operating mode STOP or RUN The operator panel also provides an MRES button for resetting the memory The color of the RUN STOP...

Page 35: ... ability to capture and restore the state of the program block is more powerful than the Undo function because the block state transcends the Save function Click the Capture block state button to save the current state of the user program After you capture a state of the user program the program block displays a Block state icon Click the Restore block state button to restore the program block to ...

Page 36: ...between different DBs You can switch the association between a single instance DB and a multi instance DB You can create an instance DB if an instance DB is missing or not available You can access the Change call type command either by right clicking the instruction or FB in the program editor or by selecting the Block call command from the Options menu The Call options dialog allows you to select...

Page 37: ...ou can easily restore the connection to the device Right click the interface port of the network device and select the Disconnect from subnet command from the context menu STEP 7 reconfigures the network connections but does not remove the disconnected device from the project While the network connection is deleted the interface addresses are not changed When you download the new network connectio...

Page 38: ...configuration of that module These unplugged modules are saved with your project allowing you to reinsert the module in the future without having to reconfigure the parameters One use of this feature is for temporary maintenance Consider a scenario where you might be waiting for a replacement module and plan to temporarily use a different module as a short term replacement You could drag the confi...

Page 39: ...h voltage and high electrical noise from the low voltage logic type devices such as the S7 1200 When configuring the layout of the S7 1200 inside your panel consider the heat generating devices and locate the electronic type devices in the cooler areas of your cabinet Reducing the exposure to a high temperature environment will extend the operating life of any electronic device Consider also the r...

Page 40: ...5 VDC power requirements of the signal modules signal boards and communication modules Refer to the Calculating a power budget Page 761 to determine how much power or current the CPU can provide for your configuration The CPU provides a 24 VDC sensor supply that can supply 24 VDC for input points for relay coil power on the signal modules or for other requirements If your 24 VDC power requirements...

Page 41: ...ge The DC sensor supply and any external power supply should provide power to different points Some of the 24 VDC power input ports in the S7 1200 system are interconnected with a common logic circuit connecting multiple M terminals For example the following circuits are interconnected when designated as not isolated in the data sheets the 24 VDC power supply of the CPU the power input for the rel...

Page 42: ...es Analog 16 point RTD 8 point 70 mm 35 mm CM 1241 RS232 CM 1241 RS485 and CM 1241 RS422 485 CM 1243 5 PROFIBUS master and CM 1242 5 PROFIBUS slave CM 1242 2 AS i Master CP 1242 7 GPRS 30 mm 15 mm Communication interfaces TS AdapterIE Basic 60 mm 1 15 mm 1 Because you must install a TS Adapter modular with the TS Adapter the total width width A is 60 mm Each CPU SM CM and CP supports mounting on e...

Page 43: ...position Clip in extended position for panel mounting Before you install or remove any electrical device ensure that the power to that equipment has been turned off Also ensure that the power to any related equipment has been turned off WARNING Installation or removal of S7 1200 or related equipment with the power applied could cause electric shock or unexpected operation of equipment Failure to d...

Page 44: ...e following when installing the units on the DIN rail or on a panel For DIN rail mounting make sure the upper DIN rail clip is in the latched inner position and that the lower DIN rail clip is in the extended position for the CPU and attached CMs After installing the devices on the DIN rail move the lower DIN rail clips to the latched position to lock the devices on the DIN rail For panel mounting...

Page 45: ...6 Push in the clips to latch the CPU to the rail Table 3 3 Removing the CPU from a DIN rail Task Procedure 1 Ensure that the CPU and all S7 1200 equipment are disconnected from electrical power 2 Disconnect the I O connectors wiring and cables from the CPU Page 50 3 Remove the CPU and any attached communication modules as a unit All signal modules should remain installed 4 If an SM is connected to...

Page 46: ... up and remove it from the CPU 5 Place the module straight down into its mounting position in the top of the CPU 6 Firmly press the module into position until it snaps into place 7 Replace the terminal block covers Table 3 5 Removing an SB or a CB Task Procedure 1 Ensure that the CPU and all S7 1200 equipment are disconnected from electrical power 2 Remove the top and bottom terminal block covers ...

Page 47: ...Gently pry the cover out at its top and remove the cover Retain the cover for reuse Connect the SM to the CPU 1 Position the SM beside the CPU 2 Hook the SM over the top of the DIN rail 3 Pull out the bottom DIN rail clip to allow the SM to fit over the rail 4 Rotate the SM down into position beside the CPU and push the bottom clip in to latch the SM onto the rail Extending the bus connector makes...

Page 48: ...system 3 If required cover the bus connector on the CPU to avoid contamination Follow the same procedure to remove a signal module from a signal module 3 3 5 Installing and removing a CM or CP Attach any communication modules to the CPU and install the assembly as a unit as shown in Installing and removing the CPU Page 44 Table 3 8 Installing a CM or CP Task Procedure 1 Ensure that the CPU and all...

Page 49: ...sure that the CPU and all S7 1200 equipment are disconnected from electrical power 2 Remove the I O connectors and all wiring and cables from the CPU and CMs 3 For DIN rail mounting move the lower DIN rail clips on the CPU and CMs to the extended position 4 Remove the CPU and CMs from the DIN rail or panel 5 Grasp the CPU and CMs firmly and pull apart CAUTION Do not use a tool to separate the modu...

Page 50: ... connector and locate the slot for the tip of the screwdriver 3 Insert a screwdriver into the slot 4 Gently pry the top of the connector away from the CPU The connector will release with a snap 5 Grasp the connector and remove it from the CPU Table 3 11 Installing the connector Task Procedure Prepare the components for terminal block installation by removing power from the CPU and opening the cove...

Page 51: ...ctor on the right side of the signal module or CPU To remove the male connector 1 Ensure that the CPU and all S7 1200 equipment are disconnected from electrical power 2 Pull out the male connector to release it from the signal module or CPU Table 3 13 Installing the female connector of the expansion cable Task Procedure 1 Ensure that the CPU and all S7 1200 equipment are disconnected from electric...

Page 52: ...lock the connector Place a screwdriver beside the tab on the top of the signal module Press down slightly and slide the tab fully to the right 3 Lift the connector up slightly to disengage the hook extension 4 Remove the female connector 3 3 8 TS teleservice adapter 3 3 8 1 Connecting the TeleService Adapter Before installing the TS Teleservice Adapter IE Basic you must first connect the TS Adapte...

Page 53: ...TS Adapter Cannot be opened Elements Ethernet port CAUTION Before connecting a TS module and TS adapter basic unit ensure that the contact pins are not bent When connecting ensure that the male connector and guide elements are positioned correctly Only connect a TS module into the TS adapter Do not force a connection of the TS adapter to a different device such as an S7 1200 CPU Do not change the ...

Page 54: ...ck into its slot 1 2 3 SIM card tray Note Ensure that the SIM card tray is correctly oriented in the card tray Otherwise the SIM card will not make connection with the module and the eject button may not remove the card tray 3 3 8 3 Installing the TS adapter unit Prerequisites You must have connected the TS Adapter and a TS module together and the DIN rail must have been installed Note If you inst...

Page 55: ...k until it engages 3 Push in the DIN rail clip on each module to attach the each module to the rail ཱ Removal 1 Remove the analog cable and Ethernet cable from the underside of the TS Adapter 2 Remove power from the TS Adapter 3 Use a screwdriver to disengage the rail clips on both modules 4 Rotate the unit upwards to remove the unit from the DIN rail WARNING Before you remove power from the unit ...

Page 56: ...tration shows the TS Adapter from behind with the attachment sliders in both positions 1 1 2 2 Attachment slider Drill holes for wall mounting 3 4 Wiring guidelines Proper grounding and wiring of all electrical equipment is important to help ensure the optimum operation of your system and to provide additional electrical noise protection for your application and the S7 1200 Refer to the technical ...

Page 57: ...ds that are independent of the S7 1200 to protect against possible personal injury or equipment damage WARNING Control devices can fail in an unsafe condition resulting in unexpected operation of controlled equipment Such unexpected operations could result in death severe personal injury and or property damage Use an emergency stop function electromechanical overrides or other redundant safeguards...

Page 58: ...ounding requirements and the proper operation of protective interrupting devices Guidelines for wiring the S7 1200 When designing the wiring for your S7 1200 provide a single disconnect switch that simultaneously removes power from the S7 1200 CPU power supply from all input circuits and from all output circuits Provide over current protection such as a fuse or circuit breaker to limit fault curre...

Page 59: ...ge current will nominally be 10 to 15 times the steady state current for a Tungsten lamp A replaceable interposing relay or surge limiter is recommended for lamp loads that will be switched a large number of times during the lifetime of the application Guidelines for inductive loads You should equip inductive loads with suppression circuits to limit voltage rise when the control output turns off S...

Page 60: ...le but if your application requires faster turn off times then the addition of a Zener diode B is recommended Be sure to size your Zener diode properly for the amount of current in your output circuit Typical suppressor circuit for relay outputs that switch AC inductive loads MOV 0 1 μ F 100 to 120 Ω Output point When you use a relay output to switch 115 V 230 VAC loads place the appropriately rat...

Page 61: ...s which are executed once upon entering RUN mode followed by one or more program cycle OBs which are executed cyclically An OB can also be associated with an interrupt event which can be either a standard event or an error event and executes whenever the corresponding standard or error event occurs A function FC or a function block FB is a block of program code that can be called from an OB or fro...

Page 62: ...ing a machine or process Always install an emergency stop circuit for your application or process If you insert or remove a module in a distributed I O rack PROFINET or PROFIBUS when the CPU is in RUN mode the CPU generates an entry in the diagnostics buffer and stays in RUN mode Under the default configuration all local digital and analog I O points are updated synchronously with the scan cycle u...

Page 63: ...ss image input area regardless of whether the point is configured to be stored in the process image An immediate write to the physical output updates both the process image output area if the point is configured to be stored in the process image and the physical output point Append the suffix P to the I O address if you want the program to immediately access I O data directly from the physical poi...

Page 64: ...evice configuration for the CPU under Startup When power is applied the CPU performs a sequence of power up diagnostic checks and system initialization During system initialization the CPU deletes all non retentive bit memory and resets all non retentive DB contents to the initial values from load memory The CPU retains retentive bit memory and retentive DB contents and then enters the appropriate...

Page 65: ...physical input during the startup mode you must perform an immediate read The startup OBs and any associated FCs and FBs are executed next If more than one startup OB exists each is executed in order according to the OB number with the lowest OB number executing first Each startup OB includes startup information that helps you determine the validity of retentive data and the time of day clock You ...

Page 66: ...nd the physical output itself are updated The scan cycle continues by reading the current values of the digital and analog inputs from the CPU SB and SMs configured for automatic I O update default configuration and then writing these values to the process image When a physical input is accessed by an instruction the value of the physical input is accessed by the instruction but the input process ...

Page 67: ... event occurs including rising and falling edges on built in digital inputs and HSC events A hardware interrupt OB will interrupt normal cyclic program execution in reaction to a signal from a hardware event You define the events in the properties of the hardware configuration One OB is allowed for each configured hardware event The OB must be OB 200 or greater A time error interrupt OB executes w...

Page 68: ...attached to a cyclic event Each cyclic event can be assigned a phase shift so that the execution of cyclic interrupts with the same scan time can be offset from one another by the phase shift amount The default phase shift is 0 To change the initial phase shift or to change the initial scan time for a cyclic event right click on the cyclic interrupt OB in the project tree click Properties then cli...

Page 69: ...ng section on Understanding time error events for more information regarding queue overflows Each CPU event has an associated priority You cannot change the priority of an OB In general events are serviced in order of priority highest priority first Events of the same priority are serviced on a first come first served basis Table 4 2 OB events Event OB number Quantity allowed Start event OB priori...

Page 70: ...he second time that the maximum scan cycle time was exceeded in one scan cycle After the execution of an OB with a priority of 2 to 25 has started processing of that OB cannot be interrupted by the occurrence of another event except for by OB 80 time error event which has a priority of 26 All other events are queued for later processing allowing the current OB to finish Interrupt latency The inter...

Page 71: ...ransitions to STOP regardless of whether OB 80 exists See the section on Monitoring the cycle time Page 73 OB 80 includes startup information that helps you determine which event and OB generated the time error You can program instructions inside OB 80 to examine these startup values and to take appropriate action Table 4 3 Startup information for OB 80 Input Data type Description fault_id BYTE 16...

Page 72: ...nce or removal of an error and the device and channel which reported the error You can program instructions inside OB 82 to examine these startup values and to take appropriate action Table 4 4 Startup information for OB 82 Input Data type Description IOstate WORD IO state of the device Bit 0 1 if the configuration is correct and 0 if the configuration is no longer correct Bit 4 1 if an error is p...

Page 73: ...f the maximum scan cycle time is exceeded twice within the same program cycle with no RE_TRIGR instruction execution between the two then the CPU transitions to STOP immediately The use of repeated executions of the RE_TRIGR instruction can create an endless loop or a very long scan Typically the scan cycle executes as fast as it can be executed and the next scan cycle begins as soon as the curren...

Page 74: ...fault is 150 ms 2 The fixed minimum scan cycle time is optional and is disabled by default If required configure a cycle time between 1 ms and the maximum scan cycle time Configuring the cycle time and communication load You use the CPU properties in the Device configuration to configure the following parameters Cycle time You can enter a maximum scan cycle time You can also enter a fixed minimum ...

Page 75: ...e CPU Work memory is volatile storage for some elements of the user project while executing the user program The CPU copies some elements of the project from load memory into work memory This volatile area is lost when power is removed and is restored by the CPU when power is restored Retentive memory is non volatile storage for a limited quantity of work memory values The retentive memory area is...

Page 76: ...ags being selected Similarly deselecting the option for any tag results in all tags being deselected For an FB that was configured to be Standard compatible with S7 300 400 you can change the retentive state from within the instance DB editor but all tags are set to the same retentive state together After you create the FB you cannot change the option for Standard compatible with S7 300 400 You ca...

Page 77: ...ics Diagnostics buffer For more information regarding troubleshooting and debugging refer to the Online and diagnostics chapter Page 640 Time of day clock The CPU supports a time of day clock A super capacitor supplies the energy required to keep the clock running during times when the CPU is powered down The super capacitor charges while the CPU has power After the CPU has been powered up at leas...

Page 78: ...ycle OBs Always 1 high Tag name AlwaysTRUE bit is always set to 1 Always 0 low Tag name AlwaysFALSE bit is always set to 0 You can assign one byte in M memory for clock memory Each bit of the byte configured as clock memory generates a square wave pulse The byte of clock memory provides 8 different frequencies from 0 5 Hz slow to 10 Hz fast You can use these bits as control bits especially when co...

Page 79: ...te that cycles the individual bits on and off at fixed intervals Each clock bit generates a square wave pulse on the corresponding M memory bit These bits can be used as control bits especially when combined with edge instructions to trigger actions in the user code on a cyclic basis Table 4 7 Clock memory Bit number 7 6 5 4 3 2 1 0 Tag name Period s 2 0 1 6 1 0 0 8 0 5 0 4 0 2 0 1 Frequency Hz 0 ...

Page 80: ...lic names or tags for the addresses of the data whether as PLC tags relating to memory addresses and I O points or as local variables used within a code block To use these tags in your user program simply enter the tag name for the instruction parameter For a better understanding of how the CPU structures and addresses the memory areas the following paragraphs explain the absolute addressing that ...

Page 81: ...mage output Q_ P 1 Physical output Immediate write to the physical output points on the CPU SB and SM Yes No M Bit memory Control and data memory No Yes optional L Temp memory Temporary data for a block local to that block No No DB Data block Data memory and also parameter memory for FBs No Yes optional 1 To immediately access read or write the physical inputs and physical outputs append a P to th...

Page 82: ...tor You can toggle the view in the program editor to one of these symbolic symbolic and absolute or absolute I process image input The CPU samples the peripheral physical input points just prior to the cyclic OB execution of each scan cycle and writes these values to the input process image You can access the input process image as bits bytes words or double words Both read and write access is per...

Page 83: ... P instead of Q is that the data goes directly to the points being accessed in addition to the output process image writes to both places This Q_ P access is sometimes referred to as an immediate write access because the data is sent immediately to the target point the target point does not have to wait for the next update from the output process image Because the physical output points directly c...

Page 84: ...s restricted to the OB FC or FB that created or declared the temp memory location Temp memory locations remain local and are not shared by different code blocks even when the code block calls another code block For example When an OB calls an FC the FC cannot access the temp memory of the OB that called it The CPU provides temp local memory for each of the three OB priority groups 16 Kbytes for st...

Page 85: ...range These ranges are 10V 5V 2 5V or 0 20mA The values returned by the modules are integer values where 0 to 27648 represents the rated range for current and 27648 to 27648 for voltage Anything outside the range represents either an overflow or underflow See the tables for analog input representation Page 708 and analog output representation Page 708 for details In your control program you probab...

Page 86: ...C tags editor or in the Interface editor for a block OB FC FB and DB If you enter an absolute address that has no associated tag you must use an appropriate size that matches a supported data type and a default tag will be created upon entry All data types except String are available in the PLC tags editor and the block Interface editors String is available only in the block Interface editors You ...

Page 87: ...mal 16 0 or 16 1 16 1 I1 0 Q0 1 M50 7 DB1 DBX2 3 Tag_name Binary 2 0 to 2 11111111 2 00001111 Unsigned integer 0 to 255 15 Octal 8 0 to 8 377 8 17 Byte 8 Hexadecimal B 16 0 to B 16 FF B 16 F 16 F IB2 MB10 DB1 DBB4 Tag_name Binary 2 0 to 2 1111111111111111 2 1111000011110000 Unsigned integer 0 to 65535 61680 Octal 8 0 to 8 177777 8 170360 Word 16 Hexadecimal W 16 0 to W 16 FFFF 16 0 to 16 FFFF W 16...

Page 88: ...ing point numbers are accurate up to 15 significant digits You can specify a maximum of 6 significant digits Real or 15 LReal when entering a floating point constant to maintain precision Table 4 18 Floating point real data types L Long Data type Bit size Number range Constant Examples Address examples Real 32 3 402823e 38 to 1 175 495e 38 0 1 175 495e 38 to 3 402823e 38 123 456 3 4 1 0e 5 MD100 D...

Page 89: ...20 250 Time TIME data is stored as a signed double integer interpreted as milliseconds The editor format can use information for day d hours h minutes m seconds s and milliseconds ms It is not necessary to specify all units of time For example T 5h10s and 500h are valid The combined value of all specified unit values cannot exceed the upper or lower limits in milliseconds for the Time data type 2 ...

Page 90: ...alue must match the data type of the corresponding components Table 4 21 Elements of the DTL structure Byte Component Data type Value range 0 1 Year UINT 1970 to 2554 2 Month USINT 1 to 12 3 Day USINT 1 to 31 4 Weekday 1 USINT 1 Sunday to 7 Saturday 1 5 Hour USINT 0 to 23 6 Minute USINT 0 to 59 7 Second USINT 0 to 59 8 9 10 11 Nanoseconds UDINT 0 to 999 999 999 1 The weekday is not considered in t...

Page 91: ... specify a 10 byte maximum size for MyString If you do not include the square brackets with a maximum size then 254 is assumed The following example defines a String with maximum character count of 10 and current character count of 3 This means the String currently contains 3 one byte characters but could be expanded to contain up to 10 one byte characters Table 4 23 Example of a String data type ...

Page 92: ...in array Array index Valid index data types Array index rules ARRAY Constant or variable USInt SInt UInt Int UDInt DInt Value limits 32768 to 32767 Valid Mixed constants and variables Valid Constant expressions Not valid Variable expressions ARRAY 1 20 of REAL One dimension 20 elements ARRAY 5 5 of INT One dimension 11 elements Example array declarations ARRAY 1 2 3 4 of CHAR Two dimensions 4 elem...

Page 93: ...essary to create the data structure that you want If a new PLC data type is created then the new PLC type name will appear in the data type selector drop drop lists in the DB editor and code block interface editor Potential uses of PLC data types PLC data types can be used directly as a data type in a code block interface or in data blocks PLC data types can be used as a template for the creation ...

Page 94: ...data on the address of a variable Area crossing pointer contains data on the memory area and the address of a variable DB pointer contains a data block number and the address of a variable Table 4 26 Pointer types Type Format Example entry Area internal pointer P Byte Bit P 20 0 Area crossing pointer P Memory_area_Byte Bit P M20 0 DB pointer P Data_block Data_element P DB10 DBX20 0 You can enter a...

Page 95: ...H WH WH WH WH WH WH WH WH WH 1XPEHU RU DWD W SH K IRU 6 E E E E E E E E E E E E E E E E E WH DGUHVV LW DGUHVV LW LW A pointer can not detect ANY structures It can only be assigned to local variables Table 4 28 Format and examples of the ANY pointer Format Entry example Description P Data_block Memory_area Data_address Type Number P DB 11 DBX 20 0 INT 10 10 words in global DB 11 starting from DBB 2...

Page 96: ... 4 7 3 Variant pointer data type The data type Variant is can point to variables of different data types or parameters The Variant pointer can point to structures and individual structural components The Variant pointer does not occupy any space in memory Table 4 31 Properties of the Variant pointer Length Byte Representation Format Example entry Operand MyTag Symbolic DB_name Struct_name element_...

Page 97: ...ta types that can be accessed by slice are Byte Char Conn_Any Date DInt DWord Event_Any Event_Att Hw_Any Hw_Device HW_Interface Hw_Io Hw_Pwm Hw_SubModule Int OB_Any OB_Att OB_Cyclic OB_Delay OB_WHINT OB_PCYCLE OB_STARTUP OB_TIMEERROR OB_Tod Port Rtm SInt Time Time_Of_Day UDInt UInt USInt and Word PLC Tags of type Real can be accessed by slice but data block tags of type Real cannot Examples In the...

Page 98: ...pe with an Array of Bool Declaration To overlay a parameter declare an additional parameter directly after the parameter that is to be overlaid and select the data type AT The editor creates the overlay and you can then choose the data type struct or array that you wish to use for the overlay Example This example shows the input parameters of a standard access FB The byte tag B1 is overlaid with a...

Page 99: ...ck parameter You cannot overlay parameters of type VARIANT The size of the overlaying parameter must be less than or equal to the size of the overlaid parameter The overlaying variable must be declared immediately after the variable that it overlays and identified with the keyword AT 4 5 Using a memory card NOTICE The CPU supports only the pre formatted SIMATIC memory card Page 758 Before you copy...

Page 100: ...ogram card Because the internal load memory of the CPU was erased when you inserted the program card the program card must remain in the CPU If you remove the program card the CPU goes to STOP mode The error LED flashes to indicate that program card has been removed The program on a memory card includes the code blocks the data blocks the technology objects and the device configuration The memory ...

Page 101: ...actively controlling a machine or process Always install an emergency stop circuit for your application or process Note If you insert a memory card with the CPU in STOP mode the diagnostic buffer displays a message that the memory card evaluation has been initiated The CPU will evaluate the memory card the next time you either change the CPU to RUN mode reset the CPU memory with an MRES or power c...

Page 102: ...rap whenever you handle the memory card Store the memory card in a conductive container Creating a transfer card Always remember to configure the startup parameter of the CPU Page 102 before copying a program to the transfer card To create a transfer card follow these steps 1 Insert a blank SIMATIC memory card into an SD card reader writer attached to your computer If you are reusing a SIMATIC mem...

Page 103: ...evice and paste it to the memory card Copying the CPU device to the memory card opens the Load preview dialog 6 In the Load preview dialog click the Load button to copy the CPU device to the memory card 7 When the dialog displays a message that the CPU device program has been loaded without errors click the Finish button Using a transfer card WARNING Verify that the CPU is not actively running a p...

Page 104: ...d When the RUN STOP LED turns on solid yellow and the MAINT LED flashes the copy process has finished You can then remove the memory card 4 Reboot the CPU either by restoring power or by the alternative methods for rebooting to evaluate the new program that was transferred to internal load memory The CPU then goes to the start up mode RUN or STOP that you configured for the project Note You must r...

Page 105: ...am card To create a program card follow these steps 1 Insert a blank SIMATIC memory card into an SD card reader writer attached to your computer If you are reusing a SIMATIC memory card that contains a user program or a firmware update you must delete the program files before reusing the card Use Windows Explorer to display the contents of the memory card and delete the S7_JOB S7S file and also de...

Page 106: ...ow these steps 1 Insert the program card into the CPU If the CPU is in RUN mode the CPU goes to STOP mode The maintenance MAINT LED flashes to indicate that the memory card needs to be evaluated 2 Power cycle the CPU to evaluate the memory card Alternative methods for rebooting the CPU are to perform either a STOP to RUN transition or a memory reset MRES from STEP 7 3 After the CPU reboots and eva...

Page 107: ...f the CPU You can then download a new user program from STEP 7 to the CPU For information about the creation and use of an empty transfer card see the section of transfer cards Page 102 WARNING If you insert a transfer card in a running CPU the CPU goes to STOP Control devices can fail in an unsafe condition resulting in unexpected operation of controlled equipment Such unexpected operations could...

Page 108: ...97BPLC concepts 4 6 Recovery from a lost password S7 1200 Programmable controller 108 System Manual 11 2011 A5E02486680 05 ...

Page 109: ... slots 101 102 and 103 CPU Slot 1 Ethernet port of CPU Signal board SB or communication board CB up to 1 inserted in the CPU Signal module SM for digital or analog I O up to 8 inserted in slots 2 through 9 CPU 1214C allows 8 CPU 1212C allows 2 CPU 1211C does not allow any To create the device configuration add a device to your project In the Portal view select Devices Networks and click Add new de...

Page 110: ...the Add new device dialog creates the rack and CPU Add new device dialog Device view of the hardware configuration Selecting the CPU in the Device view displays the CPU properties in the inspector window Note The CPU does not have a pre configured IP address You must manually assign an IP address for the CPU during the device configuration If your CPU is connected to a router on the network you al...

Page 111: ...ecific CPU You can also skip the device configuration entirely by selecting the Create a PLC program from the First steps STEP 7 then automatically creates an unspecified CPU From the program editor you select the Hardware detection command from the Online menu From the device configuration editor you select the option for detecting the configuration of the connected device After you select the CP...

Page 112: ... SB provides just a few additional I O points for the CPU The SB is installed on the front of the CPU Communication board CB provides an additional communication port such as RS485 The CB is installed on the front of the CPU Communication module CM and communication processor CP provide an additional communication port such as for PROFIBUS or GPRS These modules are connected to the left side of th...

Page 113: ...ding modules to the configuration S7 1200 Programmable controller System Manual 11 2011 A5E02486680 05 113 Table 5 1 Adding a module to the device configuration Module Select the module Insert the module Result SM SB or CB CM or CP ...

Page 114: ... or to go to RUN mode after a warm restart Supported hardware compatibility Configures whether modules SM SB CM CP or even the CPU can be substituted Allow acceptable substitute default Allow any substitute For example a 16 channel SM could be an acceptable substitute for an 8 channel I O Startup Page 63 Parameter assignment time for distributed I O Configures a maximum amount of time default 6000...

Page 115: ... module SM or a signal board SB Digital I O Inputs can be configured for rising edge detection or falling edge detection associating each with an event and hardware interrupt and also for pulse catch to stay on after a momentary pulse through the next update of the input process image Outputs can use a freeze or substitute value Analog I O For individual inputs configure parameters such as measure...

Page 116: ...e parameters of the modules S7 1200 Programmable controller 116 System Manual 11 2011 A5E02486680 05 Configuring a communication interface CM CP or CB Depending on the type of communication interface you configure the parameters for the network ...

Page 117: ...ion to create the network connections between the devices in your project After creating the network connection use the Properties tab of the inspector window to configure the parameters of the network Table 5 3 Creating a network connection Action Result Select Network view to display the devices to be connected Select the port on one device and drag the connection to the port on the second devic...

Page 118: ...or the TCP ISO on TCP and UDP Ethernet protocols use the Properties of the instruction TSEND_C TRCV_C or TCON to configure the Local Partner connections The illustration shows the Connection properties of the Configuration tab for an ISO on TCP connection Note When you configure the connection properties for one CPU STEP 7 allows you either to select a specific connection DB in the partner CPU if ...

Page 119: ...rmation and a list of available communication instructions Table 5 6 Parameters for the multiple CPU connection Parameter Definition Address Assigned IP addresses End point Name assigned to the partner receiving CPU Interface Name assigned to the interfaces Subnet Name assigned to the subnets Interface type S7 communication only Type of interface Connection type Type of Ethernet protocol Connectio...

Page 120: ...n CPU must specify the remote IP address and port number of the Partner passive connection CPU In the Address Details section of the Connection Parameters dialog you define the ports to be used The port of a connection in the CPU is entered in the Local Port field The port assigned for the connection in your partner CPU is entered under the Partner Port field 5 6 3 Parameters for the PROFINET conn...

Page 121: ...P address in parameter rem_staddr only for TCP and ISO on TCP 10 rem_tsap_id_len USInt Length of parameter rem_tsap_id used in bytes possible values TCP 0 passive or 2 active default ISO on TCP 2 to 16 UDP 0 11 next_staddr_len USInt This parameter is not used 12 27 local_tsap_id Array 1 16 of Byte Local address component of connection TCP and ISO on TCP local port no possible values 1 to 49151 rec...

Page 122: ...dr 4 003 rem_staddr 5 6 irrelevant 40 55 rem_tsap_id Array 1 16 of Byte Partner address component of connection TCP partner port number Range 1 to 49151 Recommended values 2000 to 5000 rem_tsap_id 1 high byte of the port number in hexadecimal notation rem_tsap_id 2 low byte of the port number in hexadecimal notation rem_tsap_id 3 16 irrelevant ISO on TCP partner TSAP ID rem_tsap_id 1 B 16 E0 rem_t...

Page 123: ... operation defines the boundaries of an IP subnet Note In a world wide web scenario where your programming devices network devices and IP routers will communicate with the world unique IP addresses must be assigned to avoid conflict with other network users Contact your company IT department personnel who are familiar with your plant networks for assignment of your IP addresses If your programming...

Page 124: ...Network ID of your CPU and the programming device s Ethernet to USB adapter card must be exactly the same The Network ID is the first part of the IP address first three octets for example 211 154 184 16 that determines what IP network you are on The subnet mask of your CPU and the Ethernet to USB adapter card must be exactly the same The subnet mask normally has a value of 255 255 255 0 The subnet...

Page 125: ...ations and select Industrial Ethernet The MAC and IP addresses of the programming device are displayed 5 6 4 3 Assigning an IP address to a CPU online You can assign an IP address to a network device online This is particularly useful in an initial device configuration 1 In the Project tree verify that no IP address is assigned to the CPU with the following menu selections Online access Adapter ca...

Page 126: ...alog make the following menu selections Functions Assign IP address 4 In the IP address field enter your new IP address and click the Assign IP address button 5 In the Project tree verify that your new IP address has been assigned to the CPU with the following menu selections Online access Adapter for the network in which the device is located Update accessible devices ...

Page 127: ...e Host ID unique for each device on the network An IP address of 192 168 x y is a standard designation recognized as part of a private network that is not routed on the Internet Subnet mask A subnet is a logical grouping of connected network devices Nodes on a subnet tend to be located in close physical proximity to each other on a Local Area Network LAN A mask known as the subnet mask or network ...

Page 128: ...ter The Set IP address using a different method radio button allows you to change the IP address online or by using the T_CONFIG Page 421 instruction after the program is downloaded This IP address assignment method is for the CPU only WARNING When changing the IP address of a CPU online or from the user program it is possible to create a condition in which the PROFINET network may stop If the IP ...

Page 129: ...n IP router IP protocol Router address Assigned IP address for the router if applicable 5 6 5 Testing the PROFINET network After completing the configuration download the project Page 157 to the CPU All IP addresses are configured when you download the project Assigning an IP address to a device online The S7 1200 CPU does not have a pre configured IP address You must manually assign an IP address...

Page 130: ...eason The device and network must be investigated for hardware and or configuration errors 5 6 6 Locating the Ethernet MAC address on the CPU In PROFINET networking a Media Access Control address MAC address is an identifier assigned to the network interface by the manufacturer for identification A MAC address usually encodes the manufacturer s registered identification number The standard IEEE 80...

Page 131: ... all important in identifying devices that are missing the required unique IP address 5 6 7 Configuring Network Time Protocol synchronization The Network Time Protocol NTP is widely used to synchronize the clocks of computer systems to Internet time servers In NTP mode the CP sends time of day queries at regular intervals in the client mode to the NTP server in the subnet LAN Based on the replies ...

Page 132: ...network time server 1 Server 2 Assigned IP Address for network time server 2 Server 3 Assigned IP Address for network time server 3 Server 4 Assigned IP Address for network time server 4 Time synchronization interval Interval value sec 5 6 8 PROFINET device start up time naming and address assignment PROFINET IO can extend the start up time for your system configurable time out figure More devices...

Page 133: ...address assignment at system start up The controller broadcasts the names of the devices to the network and the devices respond with their MAC addresses The controller then assigns an IP address to the device using PROFINET DCP protocol If the MAC address has a configured IP address then the station performs start up If the MAC address does not have a configured IP address STEP 7 assigns the addre...

Page 134: ...98BDevice configuration 5 6 Configuring the CPU for communication S7 1200 Programmable controller 134 System Manual 11 2011 A5E02486680 05 ...

Page 135: ...Where unexpected or incorrect operation of the machinery could result in physical injury to people or significant property damage consider the implementation of electromechanical overrides which operate independently of the PLC to prevent unsafe operations The following tasks should be included in the design of safety circuits Identify any improper or unexpected operation of actuators that could b...

Page 136: ...s or for executing specific program code at specific time intervals A function block FB is a subroutine that is executed when called from another code block OB FB or FC The calling block passes parameters to the FB and also identifies a specific data block DB that stores the data for the specific call or instance of that FB Changing the instance DB allows a generic FB to control the operation of a...

Page 137: ...d by different applications or solutions When you structure the user program into modular components that relate to functional tasks the design of your program can be easier to understand and to manage The modular components not only help to standardize the program design but can also help to make updating or modifying the program code quicker and easier Creating modular components simplifies the ...

Page 138: ...block Processing continues with execution of the instruction that follows after the block call A Calling block B Called or interrupting block Program execution Instruction or event that initiates the execution of another block Program execution 2 2 ི ཱ ཱི Block end returns to calling block You can nest the block calls for a more modular structure In the following example the nesting depth is 4 the ...

Page 139: ... Interrupt handling is always event driven When such an event occurs the CPU interrupts the execution of the user program and calls the OB that was configured to handle that event After finishing the execution of the interrupting OB the CPU resumes the execution of the user program at the point of interruption The CPU determines the order for handling interrupt events by a priority assigned to eac...

Page 140: ...meters and static data FBs have variable memory that is located in a data block DB or instance DB The instance DB provides a block of memory that is associated with that instance or call of the FB and stores data after the FB finishes You can associate different instance DBs with different calls of the FB The instance DBs allow you to use one generic FB to control multiple devices You structure yo...

Page 141: ...lue in the associated instance DB If you do not assign a new start value for a parameter in the FB interface the default value from instance DB is copied to start value Using a single FB with DBs The following figure shows an OB that calls one FB three times using a different data block for each call This structure allows one generic FB to control several similar devices such as motors by assignin...

Page 142: ...ic data for the FB The Temp memory for the FB is not stored in the instance DB Note Although the instance DB reflects the data for a specific FB any code block can access the data in an instance DB You can configure a DB as being read only 1 Right click the DB in the project navigator and select Properties from the context menu 2 In the Properties dialog select Attributes 3 Select the Data block w...

Page 143: ...the end of the sequence to cancel the DIS_AIRT and allow the execution of the interrupt OB A communication request from an HMI device or another CPU can also interrupt execution of the program cycle OB The communication requests can also cause issues with data consistency The CPU ensures that the elementary data types are always read and written consistently by the user program instructions Becaus...

Page 144: ...ock you select the programming language to be used by that block Your user program can utilize code blocks created in any or all of the programming languages 6 5 1 Ladder logic LAD The elements of a circuit diagram such as normally closed and normally open contacts and coils are linked to form networks To create the logic for complex operations you can insert branches to create the logic for paral...

Page 145: ...tion of the logic is based on the graphical logic symbols used in Boolean algebra To create the logic for complex operations insert parallel branches between the boxes Mathematical functions and other complex functions can be represented directly in conjunction with the logic boxes STEP 7 does not limit the number of instructions rows and columns in an FBD network 6 5 3 SCL Structured Control Lang...

Page 146: ...mation about specific instructions refer to the specific instructions in the chapters for Basic instructions Page 163 and Extended instructions Page 233 You can designate any type of block OB FB or FC to use the SCL programming language at the time you create the block STEP 7 provides an SCL program editor that includes the following elements Interface section for defining the parameters of the co...

Page 147: ...the parameters of the SCL code block appear as inputs or outputs In this example the tags for Start and On from the project tag table correspond to StartStopSwitch and RunYesNo in the declaration table of the SCL program Constructing an SCL expression An SCL expression is a formula for calculating a value The expression consists of operands and operators such as or The operands can be tags constan...

Page 148: ...Variable name preceded by symbol The following examples show different expressions for different uses C A B Assigns the sum of two local variables to a tag Data_block_1 Tag A Assignment to a data block tag IF A B THEN C A Condition for the IF THEN statement C SQRT SQR A SQR B Parameters for the SQRT instruction Arithmetic operators can process various numeric data types The data type of the result...

Page 149: ...anguage reference Conditions A condition is a comparison expression or a logical expression whose result is of type BOOL with the value of either TRUE or FALSE The following example shows conditions of various types Temperature 50 Counter 100 CHAR1 S Relational expression Alpha 12 AND NOT Beta Comparison and logical expression 5 Alpha Arithmetic expression A condition can use arithmetic expression...

Page 150: ...bNumber 1 byteOffset i PEEK_WORD area _in_ dbNumber _in_ byteOffset _in_ Reads the word referenced by byteOffset of the referenced data block I O or memory area Example MW200 PEEK area 16 84 dbNumber 1 byteOffset i PEEK_DWORD area _in_ dbNumber _in_ byteOffset _in_ Reads the double word referenced by byteOffset of the referenced data block I O or memory area Example MW200 PEEK area 16 84 dbNumber ...

Page 151: ... data block I O or memory area Example POKE_BLK area_src 16 84 dbNumber_src src_db byteOffset_src src_byte area_dest 16 84 dbNumber_dest src_db byteOffset_dest src_byte count 10 For PEEK and POKE instructions the following values for the area area_src and area_dest parameters are applicable For areas other than data blocks the dbNumber parameter must be 0 16 1 PI 16 2 PQ 16 81 I 16 82 Q 16 83 M 16...

Page 152: ...ower flow at the EN input and the box executes its function without error then the ENO output passes power flow ENO 1 to the next element If an error is detected in the execution of the box instruction then power flow is terminated ENO 0 at the box instruction that generated the error Table 6 3 Operands for EN and ENO Program editor Inputs outputs Operands Data type LAD EN ENO Power flow Bool EN I...

Page 153: ...cimal Status A value from 16 0000 16 7FFF typically sets ENO 1 or TRUE A value from 16 8000 to 16 FFFF typically sets ENO 0 or FALSE Instructions that take more than one scan to execute often provide a Busy parameter Bool to signal that the instruction is active but has not completed execution These instructions often also provide a Done parameter Bool and an Error parameter Bool Done signals that...

Page 154: ... PLC to PLC communications without password protection Password is required for modifying writing to the CPU and for changing the CPU mode RUN STOP Read write protection Allows HMI access and all forms of PLC to PLC communications without password protection Password is required for reading the data in the CPU for modifying writing to the CPU and for changing the CPU mode RUN STOP 6 6 2 Know how p...

Page 155: ... controller System Manual 11 2011 A5E02486680 05 155 1 In the Properties for the code block click the Protection button to display the Know how protection dialog 2 Click the Define button to enter the password After entering and confirming the password click OK ...

Page 156: ...ck for use only with a specific memory card or CPU This feature allows you to distribute a program or code block electronically such as over the Internet or through email or by sending a memory cartridge Use the Properties task card of the code block to bind the block to a specific CPU or memory card 1 After opening the code block select Protection 2 From the drop down list under Copy protection t...

Page 157: ... programming device to your CPU from any of the following locations Project tree Right click the program element and then click the context sensitive Download selection Online menu Click the Download to device selection Toolbar Click the Download to device icon 6 8 Uploading from the CPU 6 8 1 Copying elements of the project You can also copy the program blocks from an online CPU or a memory card ...

Page 158: ...Expand the node for the CPU 4 Drag the Program blocks folder from the online CPU and drop the folder into the Program blocks folder of your offline project 5 In the Upload preview dialog select the box for Continue and then click the Upload from device button When the upload is complete all of the program blocks technology blocks and tags will be displayed in the offline area Note You can copy the...

Page 159: ...e CPU Page 642 6 9 2 Watch tables and force tables You use watch tables for monitoring and modifying the values of a user program being executed by the online CPU You can create and save different watch tables in your project to support a variety of test environments This allows you to reproduce tests during commissioning or for service and maintenance purposes With a watch table you can monitor a...

Page 160: ...w cross references command In the Project view find the cross references in the Tools menu Note You do not have to close the editor to see the cross reference information You can sort the entries in the cross reference The cross reference list provides an overview of the use of memory addresses and tags within the user program When creating and changing a program you retain an overview of the oper...

Page 161: ... calls another block the called block is shown as an indentation under the calling block The call structure only displays those blocks that are called by a code block You can selectively display only the blocks causing conflicts within the call structure The following conditions cause conflicts Blocks that execute any calls with older or newer code time stamps Blocks that call a block with modifie...

Page 162: ...99BProgramming concepts 6 9 Debugging and testing the program S7 1200 Programmable controller 162 System Manual 11 2011 A5E02486680 05 ...

Page 163: ...t then the bit value is read from the process image register The physical contact signals in your control process are wired to I terminals on the PLC The CPU scans the wired input signals and continuously updates the corresponding state values in the process image input register You can specify an immediate read of a physical input using P following the I offset example I3 4 P For an immediate rea...

Page 164: ...ut connector and select Insert input Box inputs and outputs can be connected to another logic box or you can enter a bit address or bit symbol name for an unconnected input When the box instruction is executed the current input states are applied to the binary box logic and if true the box output will be true Table 7 3 AND OR and XOR boxes FBD SCL1 Description out in1 AND in2 All inputs of an AND ...

Page 165: ... bit equal to power flow status The output signals for your control actuators are wired to the Q terminals of the CPU In RUN mode the CPU system continuously scans your input signals processes the input states according to your program logic and then reacts by setting new output state values in the process image output register After each program execution cycle the CPU system transfers the new ou...

Page 166: ... output coil or an FBD box is not enabled then the output bit is set to 1 7 1 2 Set and reset instructions Set and Reset 1 bit Table 7 8 S and R instructions LAD FBD SCL Description Not available When S Set is activated then the data value at the OUT address is set to 1 When S is not activated OUT is not changed Not available When R Reset is activated then the data value at the OUT address is set ...

Page 167: ...o replicate this function within your application Table 7 11 Data types for the parameters Parameter Data type Description OUT Bool Starting element of a bit field to be set or reset Example MyArray 3 n Constant UInt Number of bits to write Set dominant and Reset dominant bit latches Table 7 12 RS and SR instructions LAD FBD SCL Description Not available RS is a set dominant latch where the set do...

Page 168: ...tate of this contact is TRUE when a positive transition OFF to ON is detected on the assigned IN bit The contact logic state is then combined with the power flow in state to set the power flow out state The P contact can be located anywhere in the network except the end of a branch FBD The output logic state is TRUE when a positive transition OFF to ON is detected on the assigned input bit The P b...

Page 169: ... always passes through the box as the output logic state The N box can be located anywhere in the branch 1 For SCL You must write code to replicate this function within your application Table 7 15 P_TRIG and N_TRIG instructions LAD FBD SCL Description Not available The Q output power flow or logic state is TRUE when a positive transition OFF to ON is detected on the CLK input state FBD or CLK powe...

Page 170: ...s bit any other place in your program You should also avoid temporary memory and memory that can be affected by other system functions such as an I O update Use only M global DB or Static memory in an instance DB for M_BIT memory assignments 7 2 Timers You use the timer instructions to create programmed time delays The number of timers that you can use in your user program is limited only by the a...

Page 171: ...insert the instruction 2 In the SCL examples IEC_Timer_0_DB is the name of the instance DB Table 7 18 Data types for the parameters Parameter Data type Description Box IN Coil Power flow Bool TP TON and TONR Box 0 Disable timer 1 Enable timer Coil No power flow Disable timer Power flow Enable timer TOF Box 0 Enable timer 1 Disable timer Coil No power flow Enable timer Power flow Disable timer R Bo...

Page 172: ...the T identifier and can be entered as a simple time unit T 200ms or 200 and as compound time units like T 2s_200ms Table 7 20 Size and range of the TIME data type Data type Size Valid number ranges1 TIME 32 bits stored as DInt data T 24d_20h_31m_23s_648ms to T 24d_20h_31m_23s_647ms Stored as 2 147 483 648 ms to 2 147 483 647 ms 1 The negative range of the TIME data type shown above cannot be used...

Page 173: ...set to 0 Note When you place timer instructions in an FB you can select the Multi instance data block option The timer structure names can be different with separate data structures but the timer data is contained in a single data block and does not require a separate data block for each timer This reduces the processing time and data storage necessary for handling the timers There is no interacti...

Page 174: ...ge on the input of a TP TON TOF or TONR instruction the value of the continuously running internal CPU timer is copied into the START member of the DB structure allocated for this timer instruction This start value remains unchanged while the timer continues to run and is used later each time the timer is updated Each time the timer is started a new start value is loaded into the timer structure f...

Page 175: ... the timer instruction is executed again or some other instruction is executed using ELAPSED or Q from the timer structure as a parameter Although not typical you can assign the same DB timer structure to multiple timer instructions In general to avoid unexpected interaction you should only use one timer instruction TP TON TOF TONR per DB timer structure Self resetting timers are useful to trigger...

Page 176: ... elements in this DB as retentive be sure the DB type Optimized box is checked The other DB type option Standard compatible with S7 300 400 only allows setting all DB data elements retentive or none retentive Click OK 2 Add timer structure s to the DB In the new global DB add a new static tag using data type IEC_Timer In the Retain column check the box so that this structure will be retentive Repe...

Page 177: ... Interface under Static 6 If necessary open the FB interface editor may have to click on the small arrow to expand the view 7 Under Static locate the timer structure that was just created for you 8 In the Retain column for this timer structure change the selection to Retain Whenever this FB is called later from another program block an instance DB will be created with this interface definition whi...

Page 178: ...ue data type from the drop down list below the instruction name 2 STEP 7 automatically creates the DB when you insert the instruction 3 In the SCL examples IEC_Counter_0_DB is the name of the instance DB Table 7 23 Data types for the parameters Parameter Data type1 Description CU CD Bool Count up or count down by one count R CTU CTUD Bool Reset count value to zero LD CTD CTUD Bool Load control for...

Page 179: ...storage necessary for the counters There is no interaction between the counter data structures in the shared multi instance DB Operation of the counters Table 7 24 Operation of the CTU counter Counter Operation The CTU counter counts up by 1 when the value of parameter CU changes from 0 to 1 The CTU timing diagram shows the operation for an unsigned integer count value where PV 3 If the value of p...

Page 180: ...hanges from 0 to 1 then the value at parameter PV is loaded to the counter as the new CV If the value of the reset parameter R is changes from 0 to 1 the current count value is reset to 0 8 9 48 4 5 2 Counter data retention after a RUN STOP RUN transition or a CPU power cycle If a run mode session is ended with stop mode or a CPU power cycle and a new run mode session is started then the counter d...

Page 181: ...reate structures for all the counters that you want to store in this DB You can either place each counter structure in a unique global DB or you can place multiple counter structures into the same global DB You can also place other static tags besides counters in this global DB Placing multiple counter structures into the same global DB allows you to reduce your overall number of blocks Rename the...

Page 182: ...cture will change correspondingly Type shown in counter instruction for preset and count values Corresponding structure Type shown in FB interface INT IEC_Counter SINT IEC_SCounter DINT IEC_DCounter UINT IEC_UCounter USINT IEC_USCounter UDINT IEC_UDCounter 1 If necessary open the FB interface editor may have to click on the small arrow to expand the view 2 Under Static locate the counter structure...

Page 183: ...te the counter structure of interest In the Retain column for this counter structure check the box to make this structure retentive 7 4 Compare 7 4 1 Compare Table 7 27 Compare instructions LAD FBD SCL Description out in1 in2 or IF in1 in2 THEN out 1 ELSE out 0 END_IF Compares two values of the same data type When the LAD contact comparison is TRUE then the contact is activated When the FBD box co...

Page 184: ... Range instructions LAD FBD SCL Description out IN_RANGE min val max out OUT_RANGE min val max Tests whether an input value is in or out of a specified value range If the comparison is TRUE then the box output is TRUE 1 For LAD and FBD Click the and select the data type from the drop down list Table 7 31 Data types for the parameters Parameter Data type1 Description MIN VAL MAX SInt Int DInt USInt...

Page 185: ...ata Table 7 34 Operation Instruction The Real number test is TRUE if OK The input value is a valid real number 1 NOT_OK The input value is not a valid real number 1 1 A Real or LReal value is invalid if it is INF infinity NaN Not a Number or if it is a denormalized value A denormalized value is a number very close to zero The CPU substitutes a zero for a denormalized value in calculations When the...

Page 186: ...utput must be the same data type To add another input click the icon at the last input Table 7 37 Data types for the parameters Parameter Data type1 IN1 IN2 INn SInt Int DInt USInt UInt UDInt Real LReal Byte Word DWord OUT SInt Int DInt USInt UInt UDInt Real LReal Byte Word DWord 1 The IN and OUT parameters must be the same data type with implicit conversions of the input parameters For example A ...

Page 187: ...iplication IN1 IN2 OUT DIV Division IN1 IN2 OUT An Integer division operation truncates the fractional part of the quotient to produce an integer output 1 For LAD and FBD Click the and select a data type from the drop down menu Table 7 39 Data types for the parameters LAD and FBD Parameter Data type1 Description IN1 IN2 SInt Int DInt USInt UInt UDInt Real LReal Constant Math operation inputs OUT S...

Page 188: ...UL Real LReal If one IN value is zero and the other is INF this is an illegal operation and NaN is returned 0 DIV Real LReal If both IN values are zero or INF this is an illegal operation and NaN is returned 7 5 3 Modulo instruction Table 7 41 MOD instruction LAD FBD SCL Description out in1 MOD in2 You can use the MOD instruction to return the remainder of an integer division operation The value a...

Page 189: ...tion input OUT SInt Int DInt Real LReal Math operation output 1 The IN and OUT parameters must be the same data type Table 7 46 ENO status ENO Description 1 No error 0 The resulting value is outside the valid number range of the selected data type Example for SInt NEG 128 results in 128 which exceeds the data type maximum 7 5 5 Increment and decrement instructions Table 7 47 INC and DEC instructio...

Page 190: ... 50 ABS instruction LAD FBD SCL Description out ABS in Calculates the absolute value of a signed integer or real number at parameter IN and stores the result in parameter OUT 1 For LAD and FBD Click the and select a data type from the drop down menu Table 7 51 Data types for parameters Parameter Data type1 Description IN SInt Int DInt Real LReal Math operation input OUT SInt Int DInt Real LReal Ma...

Page 191: ...ype from the drop down menu Table 7 54 Data types for the parameters Parameter Data type1 Description IN1 IN2 IN32 SInt Int DInt USInt UInt UDInt Real LReal Constant Math operation inputs up to 32 inputs OUT SInt Int DInt USInt UInt UDInt Real LReal Math operation output 1 The IN1 IN2 and OUT parameters must be the same data type To add an input click the Create icon or right click on an input stu...

Page 192: ...eters must be the same data type If the value of parameter IN is within the specified range then the value of IN is stored in parameter OUT If the value of parameter IN is outside of the specified range then the OUT value is the value of parameter MIN if the IN value is less than the MIN value or the value of parameter MAX if the IN value is greater than the MAX value Table 7 58 ENO status ENO Des...

Page 193: ...se tangent arctan IN OUT radians where the tan OUT radians IN Table 7 59 Examples of floating point math instructions LAD FBD SCL Description out SQR in or out in in Square IN 2 OUT For example If IN 9 then OUT 81 out EXPT in1 in2 or out in1 in2 General exponential IN1 IN2 OUT For example If IN1 3 and IN2 2 then OUT 9 1 For LAD and FBD Click the by the instruction name and select a data type from ...

Page 194: ...eal LReal INF otherwise IN1 or IN2 is NaN NaN EXPT IN1 is 0 0 and IN2 is Real LReal only NaN 7 6 Move 7 6 1 Move and block move instructions Use the Move instructions to copy data elements to a new memory address and convert from one data type to another The source data is not changed by the move process The MOVE instruction copies a single data element from the source address specified by the IN ...

Page 195: ...nstructions Table 7 63 Data types for the MOVE instruction Parameter Data type Description IN SInt Int DInt USInt UInt UDInt Real LReal Byte Word DWord Char Array Struct DTL Time Source address OUT SInt Int DInt USInt UInt UDInt Real LReal Byte Word DWord Char Array Struct DTL Time Destination address To add MOVE outputs click the Create icon or right click on an output stub for one of the existin...

Page 196: ...ve destination address is not used within an interrupt OB subprogram or if used the destination data does not have to be consistent If a MOVE_BLK operation is interrupted then the last data element moved is complete and consistent at the destination address The MOVE_BLK operation is resumed after the interrupt OB execution is complete Interrupt events are queued but not processed until UMOVE_BLK e...

Page 197: ...d transfers the value at the location specified by the VALUE parameter to the array whose first element is specified by the MEMBER parameter The value is transferred to the array element whose array index is specified by the INDEX parameter 1 For LAD and FBD Click the and select a data type from the drop down menu Table 7 67 Data types for parameters Parameter and type Data type Description Index ...

Page 198: ...g To access elements of an array with a variable simply use the variable as an array index in your program logic For example the network below sets an output based on the Boolean value of an array of Booleans in Data_block_1 referenced by the PLC tag Index The logic with the variable array index is equivalent to the former method using the FieldRead instruction FieldWrite and FieldRead instruction...

Page 199: ...with a single elementary data type use MOVE To fill an array with an elementary data type use FILL_BLK or UFILL_BLK To fill a single character in a string use MOVE The FILL_BLK and UFILL_BLK instructions cannot be used to fill arrays in the I Q or M memory areas The FILL_BLK and UFILL_BLK instructions copy the source data element IN to the destination where the initial address is specified by the ...

Page 200: ...e data elements No change is made to the bit order within each byte ENO is always TRUE following execution of the SWAP instruction 1 For LAD and FBD Click the and select a data type from the drop down menu Table 7 72 Data types for the parameters Parameter Data type Description IN Word DWord Ordered data bytes IN OUT Word DWord Reverse ordered data bytes OUT Example 1 Parameter IN MB0 before execu...

Page 201: ...nt UDInt Real LReal BCD16 BCD32 Input value OUT Bit string1 SInt USInt Int UInt DInt UDInt Real LReal BCD16 BCE32 Input value converted to a new data type 1 The instruction does not allow you to select Bit strings Byte Word DWord To enter an operand of data type Byte Word or DWord for a parameter of the instruction select an unsigned integer with the same bit length For example select USInt for a ...

Page 202: ...o the target data type Word WORD _TO_DINT WORD _TO_UDINT The value is transferred to the low byte of the target data type DWORD_TO_BYTE DWORD_TO_WORD DWORD_TO_SINT DWORD_TO_USINT DWORD_TO_INT DWORD_TO_UINT The low byte of the source value is transferred to the target data type DWord DWORD_TO_DINT DWORD_TO_UDINT DWORD_TO_REAL The value is transferred to the target data type Table 7 77 Conversion fr...

Page 203: ... from a double integer Dint or UDInt Data type Instruction Result DINT_TO_BYTE DINT_TO_WORD DINT_TO_SINT DINT_TO_USINT DINT_TO_INT DINT_TO_UINT DINT_TO_UDINT DINT_TO_REAL DINT_TO_LREAL DINT_TO_CHAR DINT_TO_STRING The value is converted DInt DINT_TO_DWORD DINT_TO_TIME The value is transferred to the target data type UDINT_TO_BYTE UDINT_TO_WORD UDINT_TO_SINT UDINT_TO_USINT UDINT_TO_INT UDINT_TO_UINT...

Page 204: ...INT STRING_TO_USINT STRING_TO_INT STRING_TO_UINT STRING_TO_DINT STRING_TO_UDINT STRING_TO_REAL STRING_TO_LREAL The value is converted String STRING_TO_CHAR The first character of the string is copied to the Char 7 7 3 Round and truncate instructions Table 7 83 ROUND and TRUNC instructions LAD FBD SCL Description out ROUND in Converts a real number to an integer The real number fraction is rounded ...

Page 205: ...SCL Description out CEIL in Converts a real number Real or LReal to the closest integer greater than or equal to the selected real number IEEE round to infinity out FLOOR in Converts a real number Real or LReal to the closest integer smaller than or equal to the selected real number IEEE round to infinity 1 For LAD and FBD Click the by the instruction name and select a data type from the drop down...

Page 206: ...the value range specified by the MIN and MAX parameters OUT VALUE MIN MAX MIN where 0 0 OUT 1 0 1 For LAD and FBD Click the and select a data type from the drop down menu Table 7 90 Data types for the parameters Parameter Data type1 Description MIN SInt Int DInt USInt UInt UDInt Real LReal Input minimum value for range VALUE SCALE_X Real LReal NORM_X SInt Int DInt USInt UInt UDInt Real LReal Input...

Page 207: ...ficant portion of the scaled real number prior to final conversion to the OUT data type SCALE_X execution sets ENO FALSE in this case NORM_X parameter VALUE should be restricted to MIN VALUE MAX If parameter VALUE is less than MIN or greater than MAX the linear scaling operation can produce normalized OUT values that are less than 0 0 or greater than 1 0 NORM_X execution sets ENO TRUE in this case...

Page 208: ...struction would be 27648 instead of 0 Example LAD normalizing and scaling an analog output value An analog output to be set in an analog signal module or signal board using output in current must be in the range 0 to 27648 for valid values Suppose an analog output represents a temperature setting where the 0 value of the analog input represents 30 0 degrees C and 27648 represents 70 0 degrees C To...

Page 209: ...ment Description IF THEN statement Page 210 Enables you to direct program execution into one of two alternative branches depending on a condition being TRUE or FALSE Selective CASE statement Page 211 Enables the selective execution into 1 of n alternative branches based on the value of a variable FOR statement Page 212 Repeats a sequence of statements for as long as the control variable remains wi...

Page 210: ...the IF THEN statement is FALSE END_IF The END_IF statement terminates the IF THEN instruction 1 You can include multiple ELSIF statements within one IF THEN statement Table 7 94 Variables for the IF THEN statement Variables Description condition Required The logical expression is either TRUE 1 or FALSE 0 statement_A Optional One or more statements to be executed when condition is TRUE condition n ...

Page 211: ...ment _B 3 5 7 9 Statement _C Statement Required One or more statements that are executed when Test_Value matches any value in the value list Else statement Optional One or more statements that are executed if no match with a value of the ValueList stated matches The CASE statement is executed according to the following rules The selection expression must return a value of the type Int When a CASE ...

Page 212: ...the run tags will be increased by 1 after each loop You cannot change increment during the execution of the FOR statement The FOR statement executes as follows At the start of the loop the control variable is set to the initial value initial assignment and each time the loop iterates it is incremented by the specified increment positive increment or decremented negative increment until the final v...

Page 213: ...WHILE statement evaluates the state of condition before executing any of the statements To execute the statements at least one time regardless of the state of condition use the REPEAT statement The WHILE statement executes according to the following rules Prior to each iteration of the loop body the execution condition is evaluated The loop body following DO iterates as long as the execution condi...

Page 214: ...FALSE Note Before evaluating the state of condition the REPEAT statement executes the statements during the first iteration of the loop even if condition is FALSE To review the state of condition before executing the statements use the WHILE statement To end the loop regardless of the state of the condition expression use the EXIT statement Page 215 The EXIT statement executes the statement immedi...

Page 215: ...n test use the EXIT statement The following example shows the use of the CONTINUE statement to avoid a division by 0 error when calculating the percentage of a value FOR x 0 TO 10 DO IF value i 0 THEN CONTINUE END_IF p part value i 100 s INT_TO_STRING p percent CONCAT IN1 s IN2 END_FOR 7 8 8 EXIT statement Table 7 104 Exit instruction SCL Description EXIT An EXIT statement is used to exit a loop F...

Page 216: ... Depending on the value of the Tag_value operand the execution of the program resumes at the point defined by the corresponding jump label If Tag_value equals 2 the program execution resumes at the jump label MyLabel2 and skips MyLabel1 CASE Tag_value OF 1 GOTO MyLabel1 2 GOTO MyLabel2 ELSE GOTO MYLabel3 END_CASE MyLabel1 Tag_1 1 MyLabel2 Tag_2 1 MyLabel3 Tag_4 1 7 8 10 RETURN statement Table 7 10...

Page 217: ...ctly into the JMP or JMPN instruction Table 7 108 Data types for the parameters Parameter Data type Description Label_name Label identifier Identifier for Jump instructions and the corresponding jump destination program label Each label must be unique within a code block You can jump within a code block but you cannot jump from one code block to another code block You can jump forward or backward ...

Page 218: ...destinations Click the create icon inside the box on the left of the last DEST parameter to add new outputs for jump labels Right click on an output stub and select the Insert output command Right click on an output stub and select the Delete command 7 8 13 SWITCH instruction Table 7 111 SWITCH instruction LAD FBD SCL Description Not available The SWITCH instruction acts as a program jump distribu...

Page 219: ... next comparison test uses the next input below and causes a jump to the label assigned to DEST1 if the comparison is true The remaining comparisons are processed similarly and if none of the comparisons are true then a jump to the label assigned to the ELSE output occurs 1 The K input and comparison inputs must be the same data type Adding inputs deleting inputs and specifying comparison types Wh...

Page 220: ...re is power flow to the RET coil LAD or if the RET box input is true FBD then program execution of the current block will end at that point and instructions beyond the RET instruction will not be executed If the current block is an OB the Return_Value parameter is ignored If the current block is a FC or FB the value of the Return_Value parameter is passed back to the calling routine as the ENO val...

Page 221: ...FC for which power flow to the RET instruction is true 7 8 15 Re trigger scan cycle watchdog instruction Table 7 116 RE_TRIGR instruction LAD FBD SCL Description RE_TRIGR RE_TRIGR Re trigger scan time watchdog is used to extend the maximum time allowed before the scan cycle watchdog timer generates an error Use the RE_TRIGR instruction to restart the scan cycle timer during a single scan cycle Thi...

Page 222: ...meout occurs in the same program scan 2 times the maximum cycle time value an error is triggered that causes the CPU to transition to STOP mode In STOP mode your program execution stops while CPU system communications and system diagnostics continue 7 8 16 Stop scan cycle instruction Table 7 118 STP instruction LAD FBD SCL Description STP STP Stop scan cycle puts the CPU in STOP mode When the CPU ...

Page 223: ...rorStruct data structure Structure components Data type Description ERROR_ID Word Error ID FLAGS Byte Shows if an error occurred during a block call 16 01 Error during a block call 16 00 No error during a block call REACTION Byte Default reaction 0 Ignore write error 1 Continue with substitute value 0 read error 2 Skip instruction system error CODE_ADDRESS CREF Information about the address and ty...

Page 224: ...A 16 82 M 16 83 DB 16 84 85 8A 8B DB_NUMBER UInt D Number of the data block OFFSET UDInt E Relative address of the operand GetErrorID Table 7 122 GetErrorID instruction LAD FBD SCL Description Not available Indicates that a program block execution error has occurred and reports the ID identifier code of the error Table 7 123 Data types for the parameters Parameter Data type Description ID Word Err...

Page 225: ...t the error identifier with GetErrorID instruction Normally the first error is the most important with the following errors only consequences of the first error The first execution of a GetError or GetErrorID instruction within a block returns the first error detected during block execution This error could have occurred anywhere between the start of the block and the execution of either GetError ...

Page 226: ...clusive OR 1 For LAD and FBD Click the and select a data type from the drop down menu To add an input click the Create icon or right click on an input stub for one of the existing IN parameters and select the Insert input command To remove an input right click on an input stub for one of the existing IN parameters when there are more than the original two inputs and select the Delete command Table...

Page 227: ...BD SCL Description out ENCO IN expression Encodes a bit pattern to a binary number The ENCO instruction converts parameter IN to the binary number corresponding to the bit position of the least significant set bit of parameter IN and returns the result to parameter OUT If parameter IN is either 0000 0001 or 0000 0000 then a value of 0 is returned to parameter OUT If the parameter IN value is 0000 ...

Page 228: ... a Byte OUT 4 bits values 0 15 IN are used to set 1 bit position in a Word OUT 5 bits values 0 31 IN are used to set 1 bit position in a DWord OUT Table 7 132 Examples DECO IN value DECO OUT value Decode single bit position Min IN 0 00000001 Byte OUT 8 bits Max IN 7 10000000 Min IN 0 0000000000000001 Word OUT 16 bits Max IN 15 1000000000000000 Min IN 0 00000000000000000000000000000001 DWord OUT 32...

Page 229: ...arameter K value If the parameter K value exceeds INn 1 then the parameter ELSE value is copied to parameter OUT 1 For LAD and FBD Click the and select a data type from the drop down menu To add an input click the Create icon or right click on an input stub for one of the existing IN parameters and select the Insert input command To remove an input right click on an input stub for one of the exist...

Page 230: ...t command To remove an output right click on an output stub for one of the existing OUT parameters when there are more than the original two outputs and select the Delete command To add an output click the Create icon or right click on an output stub for one of the existing OUT parameters and select the Insert output command To remove an output right click on an output stub for one of the existing...

Page 231: ...nt_in Use the shift instructions SHL and SHR to shift the bit pattern of parameter IN The result is assigned to parameter OUT Parameter N specifies the number of bit positions shifted SHR Shift bit pattern right SHL Shift bit pattern left 1 For LAD and FBD Click the and select the data types from the drop down menu Table 7 141 Data types for the parameters Parameter Data type Description IN Byte W...

Page 232: ...ht ROL Rotate bit pattern left 1 For LAD and FBD Click the and select the data types from the drop down menu Table 7 144 Data types for the parameters Parameter Data type Description IN Byte Word DWord Bit pattern to rotate N UInt Number of bit positions to rotate OUT Byte Word DWord Bit pattern after rotate operation For N 0 no rotate occurs The IN value is assigned to OUT Bit data rotated out on...

Page 233: ...me value DTL DTL Time T_COMBINE combines a Date value and a Time_and_Date value to create a DTL value For information about the structure of the DTL and Time data refer to the section on the Time and Date data types Page 89 Table 8 1 T_CONV Time Convert instruction LAD FBD SCL Description out T_CONV in _variant_in T_CONV converts a Time data type to a DInt data type or the reverse conversion from ...

Page 234: ...DTL Time DTL 1 For LAD and FBD Click the and select the data types from the drop down menu Table 8 4 Data types for the T_ADD and T_SUB parameters Parameter and type Data type Description IN11 IN DTL Time DTL or Time value IN2 IN Time Time value to add or subtract OUT OUT DTL Time DTL or Time sum or difference 1 Select the IN1 data type from the drop down list available below the instruction name ...

Page 235: ...1990 01 01 and DATE 2089 12 31 IN2 IN Time_of_Day Time_of_Day values to be combined OUT OUT DTL DTL value 8 1 2 Set and read system clock Use the clock instructions to set and read the CPU system clock The data type DTL Page 89 is used to provide date and time values Table 8 9 System time instructions LAD FBD SCL Description ret_val WR_SYS_T in _DTL_in_ WR_SYS_T Write System Time sets the CPU time...

Page 236: ...ion also specifies the month week day and hour when standard time begins The time zone offset is always applied to the system time value The daylight saving time offset is only applied when daylight saving time is in effect Note Daylight saving and standard start time configuration The Time of day properties for Start for daylight saving time of the CPU device configuration must be your local time...

Page 237: ...AL OUT Int Function result error message CQ OUT Bool Run time meter status 1 running CV OUT DInt Current run time hours value for the specified meter The CPU operates up to 10 run time hour meters to track the run time hours of critical control subsystems You must start the individual hour meters with one RTM execution for each timer All run time hour meters are stopped when the CPU makes a run to...

Page 238: ... did not save the RTM values in the memory card then the timer values would be lost in a substitute CPU Note Avoid excessive program calls for memory card write operations Minimize flash memory card write operations to extend the life of the memory card Table 8 14 Condition codes RET_VAL W 16 Description 0 No error 8080 Incorrect run time meter number 8081 A negative value was passed to the parame...

Page 239: ...meTransformationRule structure specify the local time zone and timing for automatic switching between standard time and daylight saving time Table 8 17 TimeTransformationRule structure Parameter Data type Description Bias Int Time difference between UTC and local time min DaylightBias Int Time difference between winter and summer time min DaylightStartMonth USInt Month of daylight saving time Dayl...

Page 240: ...length that is the number of valid characters in the string The current length must be smaller than or equal to the maximum length The number of stored bytes occupied by the String format is 2 bytes greater than the maximum length Initialize your String data String input and output data must be initialized as valid strings in memory before execution of any string instructions Valid String data A v...

Page 241: ...number string to a number value with format options VAL_STRG converts a number value to a number string with format options S_CONV String to value conversions Table 8 20 String conversion instruction LAD FBD SCL Description out Type _TO_ Type in Converts a character string to the corresponding value or a value to the corresponding character string The S_CONV instruction has no output formatting op...

Page 242: ...umber value OUT OUT String Output character string An integer unsigned integer or floating point value IN is converted to the corresponding character string at OUT The parameter OUT must reference a valid string before the conversion is executed A valid string consists of a maximum string length in the first byte the current string length in the second byte and the current string characters in the...

Page 243: ... FBD Click the and select the data type from the drop down list Table 8 25 Data types for the STRG_VAL instruction Parameter and type Data type Description IN IN String The ASCII character string to convert FORMAT IN Word Output format options P IN UInt Byte USInt IN Index to the first character to be converted first character 1 OUT OUT SInt Int DInt USInt UInt UDInt Real LReal Converted number va...

Page 244: ...iod character is used for the decimal point then commas to the left of the decimal point are interpreted as thousands separator characters The comma characters are allowed and ignored If the comma character is used for the decimal point then periods to the left of the decimal point are interpreted as thousands separator characters These period characters are allowed and ignored Leading spaces are ...

Page 245: ... within the OUT string length counting from character position P This instruction is useful for embedding number characters into a text string For example you can put the numbers 120 into the string Pump pressure 120 psi Parameter PREC specifies the precision or number of digits for the fractional part of the string If the parameter IN value is an integer then PREC specifies the location of the de...

Page 246: ...its When the sign bit is TRUE unsigned and signed integer data type values are written to the output buffer always with a leading sign character leading spaces sign digits without leading zeroes PREC digits When the FORMAT is set to exponential notation Real data type values are written to the output buffer as leading spaces sign digit PREC digits E sign digits without leading zero When the FORMAT...

Page 247: ...ngth 0 The converted number value is too large for the specified OUT data type 0 The OUT parameter maximum string size must be large enough to accept the number of characters specified by parameter SIZE starting at the character position parameter P 0 Illegal P value where P 0 or P is greater than the current string length 0 Parameter SIZE must be greater than parameter PREC Table 8 33 Examples of...

Page 248: ...56 TRUE 123 45 0000 Int or DInt 123 TRUE 2345 0000 Int or DInt 2345 TRUE 00123AB 0000 Int or DInt 123 TRUE 123 0000 Real 123 0 TRUE 00456 0001 Real 456 0 TRUE 00456 0001 Real 456 0 TRUE 123 45 0000 Real 123 45 TRUE 123 45 0001 Real 12345 0 TRUE 123 45 0000 Real 12345 0 TRUE 123 45 0001 Real 123 45 TRUE 00123AB 0001 Real 123 0 TRUE 1 23e 4 0000 Real 1 23 TRUE 1 23E 4 0000 Real 1 23 TRUE 1 23E 4 000...

Page 249: ... 10 0004 0 Current Temp xxxxxx 123 C TRUE Int 123 16 10 0004 0 Current Temp xxxxxx 123 C TRUE Real 0 00123 16 10 0004 4 Current Temp xxx 0 0012 C TRUE Real 0 00123 16 10 0006 4 Current Temp 1 2300E 3 C TRUE Real INF 16 10 N A 4 Current Temp xxxxxx INF C FALSE Real INF 16 10 N A 4 Current Temp xxxxxx INF C FALSE Real NaN 16 10 N A 4 Current Temp xxxxxxxNaN C FALSE UDInt 12345678 16 6 N A 3 Current ...

Page 250: ...aracters to be converted into a string The array can be declared in a DB or as local variables in the block interface Example DB1 MyArray points to MyArray 0 10 of Char element values in DB1 pChars IN Dint Element number for the first character in the array to copy Array element 0 is the default value Cnt IN UInt Count of characters to copy 0 means all Strg OUT String Target string Table 8 39 Strg...

Page 251: ...to Hex and Hex to ASCII conversions Use the ATH ASCII to hexadecimal and HTA hexadecimal to ASCII instructions for conversions between ASCII character bytes characters 0 to 9 and uppercase A to F only and the corresponding 4 bit hexadecimal nibbles Table 8 42 ATH instruction LAD FBD SCL Description ret_val ATH in _variant_in_ n _int_in_ out _variant_out_ Converts ASCII characters into packed hexad...

Page 252: ...in_ n _uint_in_ out _variant_out_ Converts packed hexadecimal digits to their corresponding ASCII character bytes Table 8 47 Data types for the HTA instruction Parameter and type Data Type Description IN IN Variant Pointer to input byte array N IN UInt Number of bytes to convert each input byte has two 4 bit nibbles and produces 2N ASCII characters RET_VAL OUT Word Execution condition code OUT OUT...

Page 253: ...g is an invalid format i e max 0 max 255 current max or grant length in pointer max FALSE 8182 Input buffer is too small for N FALSE 8151 Data type not allowed for input buffer FALSE 8301 Illegal or invalid output pointer for example an access to a DB that does not exist FALSE 8320 Output string is an invalid format i e max 0 max 255 current max or grant length in pointer max FALSE 8382 Output buf...

Page 254: ... strings joins string parameters IN1 and IN2 to form one string provided at OUT After concatenation String IN1 is the left part and String IN2 is the right part of the combined string Table 8 54 Data types for the parameters Parameter and type Data type Description IN1 IN String Input string 1 IN2 IN String Input string 2 OUT OUT String Combined string string 1 string 2 Table 8 55 ENO status ENO C...

Page 255: ...ive If the sum of L and P exceeds the current length of the string parameter IN then a substring is returned that starts at character position P and continues to the end of the IN string out RIGHT in L RIGHT Right substring provides the last L characters of a string If L is greater than the current length of the IN string then the entire IN string is returned in parameter OUT If an empty string is...

Page 256: ... of IN1 exceeds maximum length of IN1 or current length of IN2 exceeds maximum length of IN2 invalid string Maximum length of IN1 IN2 or OUT does not fit within allocated memory range 0 Maximum length of IN1 IN2 or OUT is 0 or 255 illegal length Current length is set to 0 8 2 4 4 DELETE Table 8 59 Delete substring instruction LAD FBD SCL Description out DELETE in L p Deletes L characters from stri...

Page 257: ... OUT does not fit within allocated memory 0 Maximum length of IN or OUT is 0 or 255 Current length is set to 0 8 2 4 5 INSERT Table 8 62 Insert substring instruction LAD FBD SCL Description out INSERT in1 in2 p Inserts string IN2 into string IN1 Insertion begins after the character at position P Table 8 63 Data types for the parameters Parameter and type Data type Description IN1 IN String Input s...

Page 258: ...o 0 8 2 4 6 REPLACE Table 8 65 Replace substring instruction LAD FBD SCL Description out REPLACE in1 _string_in_ in2 _string_in_ L _int_in_ p _int_in Replaces L characters in the string parameter IN1 Replacement starts at string IN1 character position P inclusive with replacement characters coming from the string parameter IN2 Table 8 66 Data types for the parameters Parameter and type Data type D...

Page 259: ...xceeds maximum length of IN1 current length of IN2 exceeds maximum length of IN2 or current length of OUT exceeds maximum length of OUT Maximum length of IN1 IN2 or OUT does not fit within allocated memory range 0 Maximum length of IN1 or IN2 is 255 or maximum length of OUT is 0 or 255 Current length is set to 0 8 2 4 7 FIND Table 8 68 Find substring instruction LAD FBD SCL Description out FIND in...

Page 260: ... _dword_out_ len _uint_out_ record _variant_inout_ Use the RDREC instruction to read a data record with the number INDEX from the component addressed by the ID such as a central rack or a distributed component PROFIBUS DP or PROFINET IO Assign the maximum number of bytes to read in MLEN The selected length of the target area RECORD should have at least the length of MLEN bytes WRREC_DB req _bool_i...

Page 261: ...e menu selections PLC tags Default tag table System constants tab All configured device Hardware identifiers are displayed INDEX IN Byte Word USInt UInt SInt Int DInt Data record number MLEN IN Byte USInt UInt Maximum length in bytes of the data record information to be fetched RDREC VALID OUT Bool New data record was received and valid RDREC The VALID bit is TRUE for one scan after the last reque...

Page 262: ... parameter LEN contains the length of the fetched data in bytes The output parameter ERROR only for one scan when ERROR TRUE indicates that a data record transmission error has occurred In this case the output parameter STATUS only for the one scan when ERROR TRUE contains the error information Data records are defined by the hardware device manufacturer Refer to the hardware manufacturer s device...

Page 263: ...se to the peripheral I O interrupt that you want to examine 1 STEP 7 automatically creates the DB when you insert the instruction 2 In the SCL example RALRM_DB is the name of the instance DB Table 8 74 Data types for the parameters Parameter and type Data type Description MODE IN Byte USInt SInt Int Operating mode F_ID IN HW_IO Word Logical start address of the component module from which interrup...

Page 264: ...t event is not an I O interrupt the instruction will provide correspondingly reduced information in its outputs Make sure to use different instance DBs when you call RALRM in different OBs If you evaluate data resulting from a RALRM call outside of the associated interrupt OB you should use a separate instance DB per OB start event Note The interface of the RALRM instruction is identical to the RA...

Page 265: ...for read data record B 16 DE for write data record B 16 DF If no DPV1 protocol element is used then B 16 C0 will be output STATUS 2 Error_Decode Location of the error ID STATUS 3 Error_Code_1 Error ID STATUS 4 Error_Code_2 Manufacturer specific error ID expansion Table 8 77 STATUS 2 values Error_decode B 16 Source Description 00 to 7F CPU No error or no warning 80 DPV1 Error according to IEC 61158...

Page 266: ...isrupted A5 Reserved pass A7 Reserved pass DP slave or modules is occupied temporary error A8 Version conflict DP slave or module reports non compatible versions A9 Feature not supported Feature not supported by DP slave or module AA to AF User specific DP slave or module reports a manufacturer specific error in its application Please check the documentation from the manufacturer of the DP slave o...

Page 267: ...the CPU is in STOP mode no evaluation by the user program is possible In this case you can only read the data online with a PG PC C1 Write constraint conflict The data of the previous write request to the module for the same data record has not yet been processed by the module C2 Resource busy The module is currently processing the maximum possible number of jobs for a CPU C3 Resource unavailable ...

Page 268: ...nformation system of STEP 7 for immediate access to information on how to interpret the AINFO returned buffers 01 Wrong syntax ID 23 Quantity structure exceeded or destination area too small 24 Wrong range ID 32 DB DI number out of user range 89 3A DB DI number is NULL for area ID DB DI or specified DB DI does not exist 8A 00 to FF Error in the 10th call parameter 8F 00 to FF Error in the 15th cal...

Page 269: ...elected module The CPU supports up to 64 bytes of consistent data For consistent data areas greater than 64 bytes the DPRD_DAT and DPWR_DAT instructions must be used If required these instructions can be used for data areas of 1 byte or greater If access is rejected error code W 16 8090 will result Note If you are using the DPRD_DAT and DPWR_DAT instructions with consistent data you must remove th...

Page 270: ... 808x System error with external DP interface module 8090 One of the following cases apply You have not configured a module for the specified logical base address You have ignored the restriction concerning the length of consistent data You have not entered the start address in the LADDR parameter in hexadecimal format 8092 A type other than Byte is specified in the Any reference 8093 No DP module...

Page 271: ... DP slave Must be the address of the station and not for the I O device Select the station and not the image of the device in the Network view of the Device configuration to determine the diagnostic address Enter the addresses in hexadecimal format For example diagnostic address 1022 means LADDR W 16 3FE RET_VAL OUT Int If an error occurs while the function is active the return value contains an e...

Page 272: ...e module specified by LADDR S7 DP modules for S7 1200 are permitted LADDR specifies the I O device instead of specifying the station Select the station and not the image of the device in the Network view of the Device configuration to determine the diagnostic address for LADDR 80A2 DP protocol error at layer 2 for example slave failure or bus problems For ET200S data record cannot be read in DPV0 ...

Page 273: ...pped due to a priority class abort restart or background Distributed I Os 8xyy1 General error codes Refer to Extended instructions Distributed I O Error information for RDREC WRREC and RALRM Page 265 for more information on general error codes 8 4 Interrupts 8 4 1 Attach and detach instructions You can activate and deactivate interrupt event driven subprograms with the ATTACH and DETACH instructio...

Page 274: ...dge occurs when the digital input transitions from OFF to ON as a response to a change in the signal from a field device connected to the input Falling edge events all built in CPU digital inputs and SB digital inputs A falling edge occurs when the digital input transitions from ON to OFF High speed counter HSC current value reference value CV RV events HSC 1 through 6 A CV RV interrupt for a HSC ...

Page 275: ...B and choose Hardware interrupt 2 Optionally you can rename the OB select the programming language LAD or FBD and select the block number switch to manual and choose a different block number than that suggested 3 Edit the OB and add the programmed reaction that you want to execute when the event occurs You can call FCs and FBs from this OB to a nesting depth of four OB_NR parameter All existing ha...

Page 276: ...cted selection in device configuration or as a result of executing a DETACH instruction the enabled hardware interrupt event is ignored DETACH operation Use the DETACH instruction to detach either a particular event or all events from a particular OB If an EVENT is specified then only this one event is detached from the specified OB_NR any other events currently attached to this OB_NR will remain ...

Page 277: ...nterrupt event is deactivated and the interrupt OB is not executed The PHASE phase shift time is a specified delay time that occurs before the CYCLE time interval begins You can use the phase shift to control the execution timing of lower priority OBs If lower and higher priority OBs are called in the same time interval the lower priority OB is only called after the higher priority OB has finished...

Page 278: ...lues that are returned existed at the time QRY_CINT was executed Table 8 93 Data types for the parameters Parameter and type Data type Description OB_NR IN OB_CYCLIC OB number accepts symbolic name like OB_MyOBName RET_VAL OUT Int Execution condition code CYCLE OUT UDInt Time interval in microseconds PHASE OUT UDInt Phase shift in microseconds STATUS OUT Word Cyclic interrupt status code Bits 0 to...

Page 279: ...ccur Table 8 96 SRT_DINT CAN_DINT and QRY_DINT instructions LAD FBD SCL Description ret_val SRT_DINT ob_nr _int_in_ dtime _time_in_ sign _word_in_ SRT_DINT starts a time delay interrupt that executes an OB when the delay time specified by parameter DTIME has elapsed ret_val CAN_DINT ob_nr _int_in_ CAN_DINT cancels a time delay interrupt that has already started The time delay interrupt OB is not e...

Page 280: ...pt OBs can be assigned to the SRT_DINT and CAN_DINT instructions No time delay interrupt OB exists in a new project You must add time delay interrupt OBs to your project To create a time delay interrupt OB follow these steps 1 Double click the Add new block item in the Program blocks branch of the project tree select Organization block OB and choose Time delay interrupt 2 You have the option to re...

Page 281: ...ew interrupt events You can execute DIS_AIRT more than once in an OB EN_AIRT EN_AIRT enables the processing of interrupt events that you previously disabled with the DIS_AIRT instruction Each DIS_AIRT execution must be cancelled by an EN_AIRT execution The EN_AIRT executions must occur within the same OB or any FC or FB called from the same OB before interrupts are enabled again for this OB Table ...

Page 282: ...uction LAD FBD SCL Description ret_val LED laddr _word_in_ LED _uint_in_ Use the LED instruction to read the state of the LEDs on a CPU or interface The specified LED state is returned by the RET_VAL output Table 8 103 Data types for the parameters Parameter and type Data type Description LADDR IN HW_IO Identification number of the CPU or interface1 LED identifier number 1 RUN STOP Color 1 green c...

Page 283: ...dr hw_io_in_ mode _uint_in_ state _variant_inout_ Retrieves the I O device operational states of an I O subsystem This information corresponds with the STEP 7 diagnostics view Table 8 106 Data types for the parameters Parameter and type Data type Description LADDR IN HW_IOSYSTEM Logical address Identifier for the I O system MODE IN UInt Status type 1 Configured stations 2 Defective stations 3 Deac...

Page 284: ...80Bx DeviceStates instruction not supported by the CPU for this LADDR 8452 The complete state data is too large for STATE The STATE parameter contains a partial result 8 5 3 ModuleStates instruction Table 8 108 ModuleStates instruction LAD FBD SCL Description ret_val ModuleStates laddr _word_in_ mode _uint_in state _variant_inout Retrieves the I O module operational states of I O devices This info...

Page 285: ...ce identified by LADDR does not address an I O device 80Bx ModuleStates instruction not supported by this CPU for this LADDR 8452 The complete state data is too large for STATE The STATE parameter contains a partial result 8 5 4 GET_DIAG instruction Table 8 111 GET_DIAG instruction LAD FBD SCL Description ret_val GET_DIAG mode _uint_in_ laddr _word_in_ cnt_diag _uint_out_ diag _variant_inout_ deta...

Page 286: ...ucture of the diagnostic information source DIS DIS Struct OwnState UInt MaintenanceState DWord IOState Word ComponentStateDetail DWord OperatingState UInt End_Struct Table 8 115 Structure of the diagnostic navigation node DNN DNN Struct SubordinateState UInt SubordinateIOState Word DNNmode Word End_Struct Table 8 116 Condition codes RET_VAL W 16 Description 0 No error n All of the n existing diag...

Page 287: ...es of enabled pulse generators will become tags in the constant tag table and will be available for use as the PWM parameter Default value 0 ENABLE IN Bool 1 start pulse generator 0 stop pulse generator BUSY OUT Bool Function busy Default value 0 STATUS OUT Word Execution condition code Default value 0 The CTRL_PWM instruction stores the parameter information in the DB The data block parameters ar...

Page 288: ...pulse width modulation PWM and pulse train output PTO devices are assigned during device configuration When digital I O point addresses are assigned to these devices the values of the assigned I O point addresses cannot be modified by the Watch table force function Table 8 119 Value of the STATUS parameter STATUS Description 0 No error 80A1 PWM identifier does not address a valid PWM Table 8 120 C...

Page 289: ...rs are mapped to specific digital outputs as shown in the following table You can use onboard CPU outputs or you can use the optional signal board outputs The output point numbers are shown in the following table assuming the default output configuration If you have changed the output point numbering then the output point numbers will be those you assigned Regardless PTO1 PWM1 uses the first two d...

Page 290: ...t in the Name edit box but it must be a unique name Names of enabled pulse generators will become tags in the constant tag table and will be available for use as the PWM parameter of the CTRL_PWM instruction NOTICE The maximum pulse frequency of the pulse output generators for the digital output is 100 KHz for the CPU 20 KHz for a SB or 200 KHz for a high speed SB However STEP 7 does not alert you...

Page 291: ...his Q word value during run time to cause a change in the pulse width 8 7 Data logging Your control program can use the Data log instructions to store run time data values in persistent log files The data log files are stored in flash memory CPU or memory card Log file data is stored in standard CSV Comma Separated Value format The data records are organized as a circular log file of a pre determi...

Page 292: ...ion keeps your record inside the 256 column limit of a Microsoft Excel sheet The DATA parameter can assign either retentive or non retentive data elements in a Standard compatible with S7 300 400 or Optimized DB type In order to write a Data log record you must first load the temporary DATA record with new process values and then execute the DataLogWrite instruction that saves new record values in...

Page 293: ...3 Data types for the parameters Parameter and type Data type Description REQ IN Bool A low to high positive edge signal starts the operation Default value False RECORDS IN UDint The maximum number of data records the circular data log can contain before overwriting the oldest entry The header record is not included Sufficient available PLC load memory must exist in order to successfully create the...

Page 294: ...declared should correspond to the number of columns specified in the header parameter The maximum number of data elements you can assign is 253 with a timestamp or 255 without a timestamp This restriction keeps your record inside the 256 column limit of a Microsoft Excel sheet DONE OUT Bool The DONE bit is TRUE for one scan after the last request was completed with no error Default value False BUS...

Page 295: ...NE bit s transition to the TRUE state before the new data log can be used for other data log operations Table 8 124 Values of ERROR and STATUS ERROR STATUS W 16 Description 0 0000 No error 0 7000 Call with no REQ edge BUSY 0 DONE 0 0 7001 First call with REQ edge working BUSY 1 DONE 0 0 7002 Nth call working BUSY 1 DONE 0 1 8070 All internal instance memory is in use 1 807F Internal error 1 8090 I...

Page 296: ...tion Default value False MODE IN UInt Operation mode 0 Append to existing data Default value 1 Clear all existing records NAME IN Variant Name of an existing data log This variant only supports a String data type and can only be located in local DB or M memory Default value ID In Out DWord Numeric identifier of a data log Default value 0 Note Symbolic name access for this parameter is not allowed ...

Page 297: ... Data log file already open by this application program 0 7000 Call with no REQ edge BUSY 0 DONE 0 0 7001 First call with REQ edge working BUSY 1 DONE 0 0 7002 Nth call working BUSY 1 DONE 0 1 8070 All internal instance memory is in use 1 8090 Data log definition is inconsistent with existing data log file 1 8091 Name parameter is not a String reference 1 8092 Data log does not exist 1 80C0 Data l...

Page 298: ... error The error code value at the STATUS parameter is valid only during the single scan where ERROR TRUE STATUS OUT Word Execution condition code Default value 0 Table 8 130 Values of ERROR and STATUS ERROR STATUS W 16 Description 0 0000 No error 0 0001 Data log not open 0 7000 Call with no REQ edge BUSY 0 DONE 0 0 7001 First call with REQ edge working BUSY 1 DONE 0 0 7002 Nth call working BUSY 1...

Page 299: ...e record buffer with current run time process values and then execute the DataLogWrite instruction to move new record data from the buffer to the data log The ID parameter identifies a data log and data record configuration The ID number is generated when a data log is created If there are empty records in the circular data log file then the next available empty record will be written If all recor...

Page 300: ...emory must exist in order to successfully create the data log NAME IN Variant Data log name You provide the name This variant only supports a String data type and can only be located in local DB or M memory Default value The string reference is also used as the name of the data log file The name characters must follow the Windows file system naming restrictions Characters and the space character a...

Page 301: ... operation You must execute DataLogNewFile with the ID of an existing usually full and open data log but a new unique NAME parameter After the DataLogNewFile operation is done a new data log ID value is returned as an output parameter that corresponds to the new data log name The new data log file is implicitly opened and is ready to store new records New DataLogWrite operations that are directed ...

Page 302: ... log file is downloaded to your PC you can open the csv file with a spreadsheet application like Microsoft Excel Viewing data logs on a PLC memory card If the S7 1200 CPU has a Program type S7 1200 memory card inserted then you can remove the memory card and insert the card into a standard SD Secure Digital or MMC MultiMediaCard card slot on a PC or PG The PLC is in stop mode when the memory card ...

Page 303: ...is case you can use a Program card to increase the size of load memory S7 1200 CPUs can use either internal or external load memory but not both at once Refer to the memory card chapter for details about how to create a Program card Page 104 Maximum size rule for one Data log file The maximum size of one Data log file may not exceed 25 of the load memory size internal or external If your applicati...

Page 304: ...e rule for all data logs combined The amount of load memory free space varies during normal operations as the operating system uses and releases memory You should limit the combined size of all data log files to one half of the available free space Calculate the memory requirement for a single data log record Log data is stored as character bytes in the CSV comma separated values file format The f...

Page 305: ...LogCreate instruction sets the maximum number of records in a data log file When the data log file is created the maximum memory size is allocated Size of data log file number of bytes in one record x number of records 8 7 5 Data log example program This Data log example program does not show all the program logic necessary to get sample values from a dynamic process but does show the key operatio...

Page 306: ...MyData structure are created in a data block The three MyData variables temporarily store new sample values The process sample values at these DB locations are transferred to a data log file by executing the DataLogWrite instruction Network 1 REQ rising edge starts the data log creation process Network 2 Capture the DONE output from DataLogCreate because it is only valid for one scan ...

Page 307: ...on when the DataLogCreate operation is complete A create operation extends over many scan cycles and must be complete before executing a write operation The positive edge signal on the REQ input is the event that triggers an enabled write operation Network 5 Close the data log once the last record has been written After executing the DataLogWrite operation that writes the last record the log file ...

Page 308: ...DataLogWrite operation will overwrite the oldest record You may want to preserve the old Data log and instead create a new data log as shown in network 7 Network 7 The ID parameter is an IN OUT type First you supply the ID value of the existing Data log whose structure you want to copy After the DataLogNewFile operation is complete a new and unique ID value for the new Data log is written back to ...

Page 309: ...Table 8 139 Downloaded csv file examples viewed with Microsoft Excel Two records written in a five record maximum file Five records in a Data log file with a five record maximum After one additional record is written to the file above which is full the sixth write operation overwrites the oldest record one with record six Another write operation will overwrite record two with record seven and so o...

Page 310: ...blk _variant_in_ busy _bool_out_ dstblk _variant_out_ Copies DB current values or part of the values from work memory to a target DB in load memory The content of work memory is not changed during the copy process Table 8 141 Data types for the parameters Parameter and type Data type Description REQ IN BOOL A high signal starts the operation if BUSY 0 SRCBLK IN VARIANT READ_DBL Pointer to the sour...

Page 311: ...he specified size Byte Word or DWord Thus you can copy part or all of a DB If the DBs are optimized you can only specify a tag name you cannot use the P operator If you specify a tag name for either standard or optimized DBs or for other work memory types then whatever is referenced by this tag name is copied This could be a user defined type an array or a basic element Type Struct can only be use...

Page 312: ...could save recipe information or machine setup information from work memory to load memory using the WRIT_DBL instruction and you could retrieve such information from load memory into work memory using the READ_DBL instruction Table 8 142 Condition codes RET_VAL W 16 Description 0000 No error 0081 Warning that the source area is smaller than the destination area The source data is copied completel...

Page 313: ...on code W 16 1 Description 8022 Area too small for input 8023 Area too small for output 8024 Illegal input area 8025 Illegal output area 8028 Illegal input bit assignment 8029 Illegal output bit assignment 8030 Output area is a read only DB 803A DB does not exist 1 If one of these errors occurs when a code block is executed the the CPU goes to STOP mode unless you use the GetError or GetErrorID in...

Page 314: ...101BExtended instructions 8 9 Common error codes for the Extended instructions S7 1200 Programmable controller 314 System Manual 11 2011 A5E02486680 05 ...

Page 315: ...Description HSC IN HW_HSC HSC identifier DIR1 2 IN Bool 1 Request new direction CV1 IN Bool 1 Request to set new counter value RV1 IN Bool 1 Request to set new reference value PERIOD1 IN Bool 1 Request to set new period value only for frequency measurement mode NEW_DIR IN Int New direction 1 forward 1 backward NEW_CV IN DInt New counter value NEW_RV IN DInt New reference value NEW_PERIOD IN Int Ne...

Page 316: ... PERIOD 1 is a request to load a NEW_PERIOD value 0 no change The CTRL_HSC instruction is typically placed in a hardware interrupt OB that is executed when the counter hardware interrupt event is triggered For example if a CV RV event triggers the counter interrupt then a hardware interrupt OB code block executes the CTRL_HSC instruction and can change the reference value by loading a NEW_RV value...

Page 317: ...vides an interrupt when the current count is equal to preset when reset occurs and also when there is a direction change As each current count value equals preset value interrupt event occurs a new preset is loaded and the next state for the outputs is set When the reset interrupt event occurs the first preset and the first output states are set and the cycle is repeated Since the interrupts occur...

Page 318: ...he total number of counts in the last measuring period If the frequency is rapidly changing the reported value will be an intermediate between the highest and lowest frequency occurring during the measuring period The frequency is always reported in Hertz pulses per second regardless of the frequency measuring period setting Counter modes and inputs The following table shows the inputs used for th...

Page 319: ...the inputs for HSC 2 Always ensure that you have configured your HSCs so that any one input is not being used by two HSCs The following table shows the HSC input assignments for both the on board I O of the CPU 1211C and an SB If the SB has only 2 inputs only 4 0 and 4 1 inputs are available For single phase C is the Clock input d is the optional direction input and R is an optional external reset...

Page 320: ...de For two phase CU is the Clock Up input CD is the Clock Down input and R is an optional external reset input Reset is available only for Counting mode For AB phase quadrature A is the Clock A input B is the Clock B input and R is an optional external reset input Reset is available only for Counting mode Table 9 7 HSC input assignments for CPU 1212C CPU on board input 0 x SB input 4 x 3 HSC 0 1 2...

Page 321: ...input and R is an optional external reset input Reset is available only for Counting mode Table 9 8 HSC input assignments for CPU 1214C on board inputs only Digital input 0 default 0 x Digital input 1 default 1 x HSC 0 1 2 3 4 5 6 7 0 1 2 3 4 5 1 phase C d R 2 phase CU CD R HSC 11 AB phase A B R 1 phase R C d 2 phase R CU CD HSC 21 AB phase R A B 1 phase C d R 2 phase CU CD R HSC 3 AB phase A B R ...

Page 322: ...ssigned to this PTO HSC1 is assigned for PTO1 and HSC2 is assigned for PTO2 The assigned HSC belongs completely to the PTO channel and the ordinary output of the HSC is disabled The HSC value is only used for the internal functionality You cannot monitor the current value for example in ID1000 when pulses are occurring The CPU stores the current value of each HSC in an input I address The followin...

Page 323: ... of the CPU to configure the parameters of each individual HSC Use the CTRL_HSC instruction in your user program to control the operation of the HSC Enable the specific HSC by selecting the Enable option for that HSC After enabling the HSC configure the other parameters such as counter function initial values reset options and interrupt events For information about configuring the HSC refer to the...

Page 324: ... value The output value is calculated during self tuning and rounded to a multiple of the cycle time All other functions of PID instruction are executed at every call PID algorithm The PID Proportional Integral Derivative controller measures the time interval between two calls and then evaluates the results for monitoring the sampling time A mean value of the sampling time is generated at each mod...

Page 325: ...nent a Derivative delay coefficient D component T1 Integral action time I component b Proportional action weighting P component TD Derivative action time D component c Derivative action weighting D component 9 2 1 Inserting the PID instruction and technological object STEP 7 provides two instructions for PID control The PID_Compact instruction and its associated technological object provide a univ...

Page 326: ...o your user program STEP 7 automatically creates a technology object and an instance DB for the instruction The instance DB contains all of the parameters that are used by the PID instruction Each PID instruction must have its own unique instance DB to operate properly After inserting the PID instruction and creating the technological object and instance DB you configure the parameters for the tec...

Page 327: ...n By creating the technological object before inserting a PID instruction into your user program you can then select the technological object when you insert the PID instruction To create a technological object double click the Add new object icon in the project navigator Click the Control icon and select the technological object for the type of PID controller PID_Compact or PID_3Step You can crea...

Page 328: ...ool_in_ ManualValue _real_in_ Reset _bool_in_ ScaledInput _real_out_ Output _real_out_ Output_PER _word_out_ Output_PWM _bool_out_ SetpointLimit_H _bool_out_ SetpointLimit_L _bool_out_ InputWarning_H _bool_out_ InputWarning_L _bool_out_ State _int_out_ Error _dword_out_ PID_Compact provides a PID controller with self tuning for automatic and manual mode PID_Compact is a PIDT1 controller with anti ...

Page 329: ...d process value Default value 0 0 Output1 OUT Real Output value Default value 0 0 Output_PER1 OUT Word Analog output value Default value W 16 0 Output_PWM1 OUT Bool Output value for pulse width modulation Default value FALSE SetpointLimit_H OUT Bool Setpoint high limit Default value FALSE If SetpointLimit_H TRUE the absolute upper limit of the setpoint is reached Default value FALSE SetpointLimit_...

Page 330: ...QSXW DUQLQJB 0DQXDO QDEOH EB QSXWB3 5B2Q EB QY WUO X 39B 50 53B 1 LPLW 3 0 19 LPLW 53B287 QSXW 2XWSXW 2XWSXWB3 5 2XWSXWB3 0 0DQXDO9DOXH QSXWB3 5 6HWSRLQW 6FDOH Figure 9 1 Operation of the PID_Compact controller 6FDOHG QSXW 6HWSRLQW Z 0 7 3 F E 7 QWL LQGXS Figure 9 2 Operation of the PID_Compact controller as a PIDT1 controller with anti windup ...

Page 331: ...dback _real_in_ InputPer _word_in_ FeedbackPer _word_in_ ManualEnable _bool_in_ ManualUP _bool_in_ ManualDN _bool_in_ ActuatorH _bool_in_ ActuatorL _bool_in_ Reset _bool_in_ ScaledInput _real_out_ ScaledFeedback _real_out_ ErrorBits _dword_out_ OutputPer _word_out_ State _int_out_ OutputUP _bool_out_ OutputDN _bool_out_ SetpoIntLimitH _bool_out_ SetpoIntLimitL _bool_out_ InputWarningH _bool_out_ I...

Page 332: ...he device If Config ActuatorEndStopOn is TRUE then Output_UP does not come on if Actuator_H is TRUE ManualDN IN Bool In manual mode every rising edge closes the valve by 5 of the total actuating range or for the duration of the minimum motor actuation time ManualDN is evaluated only if you are using OutputPer and if position feedback is available Default value FALSE If Output_PER is FALSE the manu...

Page 333: ...t value FALSE If SetpointLimitH TRUE the absolute upper limit of the setpoint is reached In the CPU the setpoint is limited to the configured absolute upper limit of the actual value SetpointLimitL OUT Bool Setpoint low limit Default value FALSE If SetpointLimitL TRUE the absolute lower limit of the setpoint is reached In the CPU the setpoint is limited to the configured absolute lower limit of th...

Page 334: ... 2 PID control S7 1200 Programmable controller 334 System Manual 11 2011 A5E02486680 05 F E 3 7L DF 7W HDGB 7 QWL LQGXS 6FDOHG QSXW 6HWSRLQW Z Figure 9 3 Operation of the PID_3Step controller as a PIDT1 controller with anti windup ...

Page 335: ...QLQJB QSXW DUQLQJB 39B 50 LPLW QWL LQGXS 3XOVH2XW 2XWSXWB3 5 LPLW Y 53B 1 7KU6WS GHDGB 2XWSXW3HU2Q 2XWSXWB 1 2XWSXWB83 QSXW3HU2Q QSXW 0DQXDO QDEOH 3 7 QWL LQGXS QSXWB3 5 6HWSRLQW 5RFB LP 0DQXDO9DOXH 0DQXDOB 1 0DQXDOB83 0DQXDO QDEOH 6FDOH DF QW 53B287 Figure 9 4 Operation of the PID_3Step controller without position feedback ...

Page 336: ... 53B 1 LPLW DF 7KU6WS GHDGB 53B287 3XOVH2XW 6FDOH 6FDOH QSXW3HU2Q HHGEDFNB3 5 HHGEDFN3HU2Q QSXW QWL LQGXS 6HWSRLQW QSXWB3 5 HHGEDFN 2XWSXWB 1 2XWSXWB83 0DQXDO QDEOH 0DQXDOB 1 0DQXDOB83 2XWSXW3HU2Q 2XWSXWB3 5 0DQXDO QDEOH 0DQXDO9DOXH QSXW DUQLQJB QSXW DUQLQJB 39B 50 9 Figure 9 5 Operation of the PID_3Step controller the position feedback enabled ...

Page 337: ...ting point 0020 Pretuning is set to automatic mode which is not allowed during fine tuning 0040 Pretuning The setpoint is too close to the limits for the output value 0080 Pretuning Incorrect configuration of the limits for the output value 0100 An error during fine tuning resulted in invalid parameters 0200 Invalid value for the Input parameter Value outside the number range less than 1e12 or gre...

Page 338: ...t mode after CPU restart Restarts the PID loop after it is reset or if an input limit has been exceeded and returned to the valid range Input Selects either the Input parameter or the Input_PER parameter for analog for the process value Input_PER can come directly from an analog input module Basic Output Selects either the Output parameter or the Output_PER parameter for analog for the output valu...

Page 339: ...mit the PID loop goes to inactive mode and sets the output value to 0 To use Input_PER you must scale the analog process value input value Motor transition time Sets the time from open to close for the valve Locate this value on the data sheet or the faceplate of the valve Minimum ON time Sets the minimum movement time for the valve Locate this value on the data sheet or the faceplate of the valve...

Page 340: ...n of the tuning process you can store the new parameters by clicking the Upload PID parameters button in the PID Parameters section of the commissioning editor If an error occurs during tuning the output value of the PID goes to 0 The PID mode then is set to inactive mode The status indicates the error 9 3 Basic motion control The CPU provides motion control functionality for the operation of step...

Page 341: ... to control two motors Built in relay outputs cannot be used as pulse outputs to control motors Note Pulse train outputs cannot be used by other instructions in the user program When you configure the outputs of the CPU or signal board as pulse generators for use with the PWM or basic motion control instructions the corresponding output addresses Q0 0 to Q0 3 Q4 0 to Q4 3 are removed from the Q me...

Page 342: ...se generator Select the Pulse generators PTO PWM properties for a CPU in Device configuration and enable a pulse generator Two pulse generators are available for each S7 1200 CPU In this same configuration area under Pulse options select Pulse generator used as PTO 2 Add a Technological object In the Project tree expand the node Technological Objects and select Add new object Select the Axis icon ...

Page 343: ...er of the current slice plus the queued slice 9 3 1 Configuration of the axis STEP 7 provides the configuration tools the commissioning tools and the diagnostic tools for the Axis technological object Drive Commissioning Technological object Diagnostics Configuration Note The PTO requires the internal functionality of a high speed counter HSC This means the corresponding high speed counter cannot ...

Page 344: ... and disable axis Move axis in jog mode Position axis in absolute and relative terms Home axis Acknowledge errors The velocity and the acceleration deceleration can be specified for the motion commands The control panel also shows the current axis status Diagnostics Monitors of the current status and error information for the axis and drive After you create the technological object for the axis yo...

Page 345: ...onfigure the motion dynamics and the behavior of the emergency stop command You also configure the homing behavior passive and active Use the Commissioning control panel to test the functionality independently from your user program Click the Startup icon to commission the axis The control panel shows the current status of the axis Not only can you enable and disable the axis but you can also test...

Page 346: ... SCL Description MC_Power_DB Axis _multi_fb_in_ Enable _bool_in_ StopMode _int_in_ Status _bool_out_ Busy _bool_out_ Error _bool_out_ ErrorID _word_out_ ErrorInfo _word_out_ The MC_Power motion control instruction enables or disables an axis Before you can enable or disable the axis ensure the following conditions The technology object has been configured correctly There is no pending enable inhib...

Page 347: ...ccept any new tasks exception MC_Reset task The axis is not homed Upon disabling the status does not change to FALSE until the axis reaches a standstill TRUE The axis is enabled The axis is ready to execute motion control tasks Upon axis enabling the status does not change to TRUE until the signal Drive ready is pending If the Drive ready drive interface was not configured in the axis configuratio...

Page 348: ...Enable to TRUE The enable output for Drive enabled changes to TRUE to enable the power to the drive The CPU waits for the Drive ready signal of the drive When the Drive ready signal is available at the configured ready input of the CPU the axis becomes enabled Output parameter Status and technology object tag Axis name StatusBits Enable indicates the value TRUE To enable an axis without configured...

Page 349: ...on 2 In the SCL example MC_Reset_DB is the name of the instance DB The MC_Reset task cannot be aborted by any other motion control task The new MC_Reset task does not abort any other active motion control tasks Table 9 27 Parameters of the MC_Reset instruction Parameter and type Data type Description Axis IN TO_Axis_1 Axis technology object Execute IN Bool Start of the task with a positive edge Do...

Page 350: ...ollowing types of homing are available Direct homing absolute Mode 0 The current axis position is set to the value of parameter Position Direct homing relative Mode 1 The current axis position is offset by the value of parameter Position Passive homing Mode 2 During passive homing the MC_Home instruction does not carry out any homing motion The traversing motion required for this step must be impl...

Page 351: ...UT Bool TRUE During execution the task was aborted by another task Error OUT Bool TRUE An error has occurred during execution of the task The cause of the error can be found in parameters ErrorID and ErrorInfo ErrorID OUT Word Error ID for parameter Error ErrorInfo OUT Word Error info ID for parameter ErrorID Note Axis homing is lost under the following conditions Disabling of axis by the MC_Power...

Page 352: ...oveAbsolute MC_MoveRelative MC_MoveVelocity MC_MoveJog The new MC_Home task aborts the following active motion control tasks MC_Home Mode 2 3 MC_Halt MC_MoveAbsolute MC_MoveRelative MC_MoveVelocity MC_MoveJog 9 3 2 4 MC_Halt instruction Table 9 31 MC_Halt instruction LAD FBD SCL Description MC_Halt_DB Axis _multi_fb_in_ Execute _bool_in_ Done _bool_out_ Busy _bool_out_ CommandAborted _bool_out_ Er...

Page 353: ...XV RPPDQG ERUWHG UURU UURU UURU QIR LVB HB RQHB ERUWB 0 B DOW XV B W W W W W W W W W 9HORFLW 0 B DOW HB HB Q9HOB ERUWB RQHB 9HORFLW LVB ERUWB XV B XV B The following values were configured in the Dynamics General configuration window Acceleration 10 0 and Deceleration 5 0 The axis is braked by an MC_Halt task until it comes to a standstill The axis standstill is signaled via Done_2 While an MC_Hal...

Page 354: ...rs for the MC_MoveAbsolute instruction Parameter and type Data type Description Axis IN TO_Axis_1 Axis technology object Execute IN Bool Start of the task with a positive edge Default value False Position IN Real Absolute target position Default value 0 0 Limit values 1 0e12 Position 1 0e12 Velocity IN Real Velocity of axis Default value 10 0 This velocity is not always reached because of the conf...

Page 355: ...e_1 When Done_1 TRUE another MC_MoveAbsolute task with target position 1500 0 is started Because of the response times e g cycle time of user program etc the axis comes to a standstill briefly see zoomed in detail When the axis reaches the new target position this is signaled via Done_2 An active MC_MoveAbsolute task is aborted by another MC_MoveAbsolute task The abort is signaled via Abort_1 The ...

Page 356: ...eRelative instruction Parameter and type Data type Description Axis IN TO_Axis_1 Axis technology object Execute IN Bool Start of the task with a positive edge Default value False Distance IN Real Travel distance for the positioning operation Default value 0 0 Limit values 1 0e12 Distance 1 0e12 Velocity IN Real Velocity of axis Default value 10 0 This velocity is not always reached on account of t...

Page 357: ..._1 When Done_1 TRUE another MC_MoveRelative task with travel distance 500 0 is started Because of the response times for example cycle time of user program the axis comes to a standstill briefly see zoomed in detail When the axis reaches the new target position this is signaled via Done_2 An active MC_MoveRelative task is aborted by another MC_MoveRelative task The abort is signaled via Abort_1 Th...

Page 358: ...struction Parameter and type Data type Description Axis IN TO_Axis_1 Axis technology object Execute IN Bool Start of the task with a positive edge Default value False Velocity IN Real Velocity specification for axis motion Default value 10 0 Limit values Start stop velocity Velocity maximum velocity Velocity 0 0 is allowed Direction IN Int Direction specification 0 Direction of rotation correspond...

Page 359: ...RFLW XV RPPDQG ERUWHG UURU UURU UURU QIR XUUHQW LVB HB Q9HOB ERUWB 0 B0RYH9HORFLW XV B LV HFXWH 9HORFLW LUHFWLRQ Q9HORFLW XV RPPDQG ERUWHG UURU UURU UURU QIR XUUHQW LVB HB Q9HOB 0 B0RYH9HORFLW XV B W W W W W W W W 0RYH 0RYH HB HB Q9HOB ERUWB Q9HOB 9HORFLW LVB XV B XV B The following values were configured in the Dynamics General configuration window Acceleration 10 0 and Deceleration 10 0 An activ...

Page 360: ...ion and changes to FALSE together with InVelocity If parameter Execute TRUE is set InVelocity and Busy are latched When the MC_MoveVelocity task is started status bit SpeedCommand is set in the technology object Status bit ConstantVelocity is set upon axis standstill Both bits are adapted to the new situation when a new motion task is started 9 3 2 8 MC_MoveJog instruction Table 9 39 MC_MoveJog in...

Page 361: ...cution the task was aborted by another task Error OUT Bool TRUE An error has occurred during execution of the task The cause of the error can be found in parameters ErrorID and ErrorInfo ErrorID OUT Word Error ID for parameter Error Default value 0000 ErrorInfo OUT Word Error info ID for parameter ErrorID Default value 0000 1 If both the JogForward and JogBackward parameters are simultaneously TRU...

Page 362: ...ID _word_out_ ErrorInfo _word_out_ CurrentIndex _uint_out_ Code _word_out_ Executes a series of individual motions for a motor control axis that can combine into a movement sequence Individual motions are configured in a technology object command table for pulse train output TO_CommandTable_PTO 1 STEP 7 automatically creates the DB when you insert the instruction 2 In the SCL example MC_CommandTab...

Page 363: ... You can create the desired movement sequence in the Command Table configuration window and check the result against the graphic view in the trend diagram You can select the command types that are to be used for processing the command table Up to 32 jobs can be entered The commands are processed in sequence Table 9 43 MC_CommandTable command types Command type Description Empty The empty serves as...

Page 364: ...le execution The technology object TO_Axis_PTO V2 0 must be correctly configured The technology object TO_CommandTable_PTO must be correctly configured The axis must be released Override response The MC_CommandTable task can be aborted by the following motion control tasks MC_Home Mode 3 MC_Halt MC_MoveAbsolute MC_MoveRelative MC_MoveVelocity MC_MoveJog The new MC_CommandTable task aborts the foll...

Page 365: ...echnology object Execute IN Bool Start execution on rising edge Inital value FALSE ChangeRampUp IN Bool TRUE Change Ramp up time to the value specified by parameter RampUp Time Inital value FALSE RampUpTime IN Real Time in seconds without jerk limitation to accelerate from standstill to the configured maximum speed Inital value 5 00 You can see the status affected variable in the value of Axisname...

Page 366: ...en to the technology DB Inital value FALSE Error OUT Bool TRUE An error has occurred during processing The cause of the error can be found in the ErrorID and ErrorInfo parameters Inital value FALSE ErrorID OUT Word Error identifier Inital value 16 0000 ErrorInfo IN Word Error information Inital value 16 0000 Prerequisites for MC_ ChangeDynamic execution The technology object TO_Axis_PTO V2 0 must ...

Page 367: ...utputs PTO1 1 2 Outputs PTO2 1 2 CPU type CPU 1211C CPU 212C and CPU 1214C Pulse Direction Pulse Direction Without signal board Qx 0 Qx 1 Qx 2 Qx 3 Qx 0 Qx 1 Signal boards DI2 DO2 3 Qy 0 Qy 1 Qx 2 Qx 3 Qx 0 Qx 1 Qx 2 Qx 3 DC DC DC Signal boards DO4 4 Qy 0 Qy 1 Qy 2 Qy 3 Without signal board Signal boards DI2 DO2 Qy 0 Qy 1 AC DC RLY Signal boards DO4 Qy 0 Qy 1 Qy 2 Qy 3 Without signal board Signal ...

Page 368: ... value of the process image and does not match the actual status of the I O output in any respect For all other CPU outputs that are not used permanently by the CPU firmware the status of the I O output can be controlled or monitored via the process image as usual 9 3 3 2 Hardware and software limit switches for motion control Use the hardware and software limit switches to limit the allowed trave...

Page 369: ...hanical stop E Lower hardware limit switch F Upper hardware limit switch Software limit switches Software limit switches limit the working range of the axis They should fall inside the hardware limit switches relative to the travel range Because the positions of the software limit switches can be set flexibly the working range of the axis can be restricted on an individual basis depending on the c...

Page 370: ...unctionality The selection is made from the Axis DB To enable or disable the hardware limit functionality access the Active tag Bool in the DB path axis name Config PositonLimits_HW The state of the Active tag enables or disables the use of hardware position limits To enable or disable software position limit functionality access Active tag Bool in the DB path axis name Config Position Limits_SW T...

Page 371: ...rect Referencing Absolute When executed this mode tells the axis exactly where it is It sets the internal position variable to the value of the Position input of the Homing instruction This is used for machine calibration and setup The axis position is set regardless of the reference point switch Active traversing motions are not aborted The value of the Position input parameter of the MC_Home ins...

Page 372: ...sition was used as the Home signal then there would be a possibility for error in the Homing position since the On signal active range would cover a range of distance By using either the leading or falling edge of that signal a much more precise Home position results As with all other modes the value of the Position input on the Homing instruction is added to the Hardware referenced position In ac...

Page 373: ...verses direction The reference point switch is then sensed in reverse direction If the direction reversal is not active and the axis reaches the hardware limit switch during active homing the reference point approach is aborted with an error and the axis is braked at the emergency deceleration Approach direction Active and passive homing With the direction selection you determine the approach dire...

Page 374: ... instruction MC_Home Limit values independent of the selected user unit 1 0e12 home position offset 1 0e12 Table 9 48 Factors that affect homing Influencing factors Result Configuration Approach direction Configuration Reference point switch Current travel direction Homing on Reference point switch Positive direction Left Positive Left negative side Negative direction Right Positive direction Righ...

Page 375: ...ference point switch the axis travels to the Reference point coordinates at the reduced velocity On reaching the Reference point coordinates the axis is stopped at the position value that was specified in the Position input parameter of the MC_Home instruction Note If the homing search does not function as you expected check the inputs assigned to the hardware limits or to the reference point Thes...

Page 376: ... The value for the acceleration and deceleration is not changed abruptly when the step limiter is active it is adapted in a transition phase The figure below shows the velocity and acceleration curve without and with jerk limit Table 9 50 Jerk limit Travel without step limiter Travel with step limiter Y D W W Y D W W The jerk limit gives a smoothed velocity profile of the axis motion This ensures ...

Page 377: ...xis name StatusBits HomingDone Error An error has occurred in the Axis technology object More information about the error is available in automatic control at the ErrorID and ErrorInfo parameters of the motion control instructions In manual mode the Last error field of the control panel displays detailed information about the cause of error Tag of technology object Axis name StatusBits Error Contr...

Page 378: ...re limit switch has been reached Tag of technology object Axis name ErrorBits SwLimitMinReached Min software limit exceeded The lower software limit switch has been exceeded Tag of technology object Axis name ErrorBits SwLimitMinExceeded Max software limit reached The upper software limit switch has been reached Tag of technology object Axis name ErrorBits SwLimitMaxReached Max software limit exce...

Page 379: ...tionStatus TargetPosition Current position The Current position field indicates the current axis position If the axis is not homed the value indicates the position value relative to the enable position of the axis Tag of technology object Axis name MotionStatus Position Current velocity The Current velocity field indicates the actual axis velocity Tag of technology object Axis name MotionStatus Ve...

Page 380: ...Done CommandAborted and Error indicate the value TRUE for at least one cycle These status messages are latched while input parameter Execute is set to TRUE The tasks of the following motion control instructions have a defined conclusion MC_Reset MC_Home MC_Halt MC_MoveAbsolute MC_MoveRelative The behavior of the status bits is presented below for various example situations The first example shows ...

Page 381: ...g Execute can still be reset to the value FALSE during the task or the value TRUE can be retained until after completion of the task While the task is active the output parameter Busy indicates the value TRUE With conclusion of the task for example for motion control instruction MC_Home Homing was successful output parameter Busy changes to FALSE and Done to TRUE If Execute retains the value TRUE ...

Page 382: ...still be reset to the value FALSE during the task or the value TRUE can be retained until after completion of the task While the task is active the output parameter Busy indicates the value TRUE During task execution the task is aborted by another motion control task If the task is aborted output parameter Busy changes to FALSE and CommandAborted to TRUE If Execute retains the value TRUE until aft...

Page 383: ...on the programming Execute can still be reset to the value FALSE during the task or the value TRUE can be retained until after completion of the task While the task is active the output parameter Busy indicates the value TRUE An error occurred during task execution When the error occurs the output parameter Busy changes to FALSE and Error to TRUE If Execute retains the value TRUE until after the e...

Page 384: ... at input parameter Execute The output parameters InVelocity CommandAborted and Error indicate the value TRUE for at least one cycle when their conditions are met These status messages are latched while input parameter Execute is set to TRUE The behavior of the status bits is presented below for various example situations The first example shows the behavior when the axis reaches the parameterized...

Page 385: ...vent before the parameterized velocity is reached or alternatively only after it has been reached While the task is active the output parameter Busy indicates the value TRUE When the parameterized velocity is reached the output parameter InVelocity changes to TRUE If Execute retains the value TRUE even after the parameterized velocity has been reached the task remains active InVelocity and Busy re...

Page 386: ...cates the value TRUE During task execution the task is aborted by another motion control task If the task is aborted output parameter Busy changes to FALSE and CommandAborted to TRUE If Execute retains the value TRUE until after the task is aborted then CommandAborted also remains TRUE and changes its status to FALSE together with Execute If Execute has been reset to FALSE before the task is abort...

Page 387: ... value TRUE An error occurred during task execution When the error occurs the output parameter Busy changes to FALSE and Error to TRUE If Execute retains the value TRUE until after the error has occurred then Error also remains TRUE and only changes its status to FALSE together with Execute If Execute has been reset to FALSE before the error occurs Error indicates the value TRUE for only one execu...

Page 388: ...ALSE The output parameter InVelocity indicates the status TRUE as long as the axis is moving at the parameterized velocity The output parameters CommandAborted and Error indicate the status for at least one cycle These status messages are latched as long as either input parameter JogForward or JogBackward is set to TRUE The behavior of the status bits is presented below for various example situati...

Page 389: ... parameter JogForward or JogBackward While the task is active the output parameter Busy indicates the value TRUE When the parameterized velocity is reached the output parameter InVelocity changes to TRUE When the input parameter JogForward or JogBackward is reset to the value FALSE the axis motion ends The axis starts to decelerate As a result the axis no longer moves at constant velocity and the ...

Page 390: ...ive the output parameter Busy indicates the value TRUE During task execution the task is aborted by another motion control task If the task is aborted output parameter Busy changes to FALSE and CommandAborted to TRUE When the input parameter JogForward or JogBackward is reset to the value FALSE the output parameter CommandAborted changes its value to FALSE Note The task abort is indicated in the o...

Page 391: ...he task is active the output parameter Busy indicates the value TRUE An error occurred during task execution When the error occurs the output parameter Busy changes to FALSE and Error to TRUE When the input parameter JogForward or JogBackward is reset to the value FALSE the output parameter Error changes its value to FALSE Note An error occurrence is indicated in the output parameter Error for onl...

Page 392: ...102BTechnology instructions 9 3 Basic motion control S7 1200 Programmable controller 392 System Manual 11 2011 A5E02486680 05 ...

Page 393: ...nk Refer to PROFIBUS and PROFINET International PI www us profinet com for more information PROFIBUS CM 1242 5 Operates as DP slave CM 1243 5 Operates as DP master class1 For PROFINET and PROFIBUS the CPU supports a total of 16 devices and 256 submodules with a maximum of 16 PROFIBUS DP slave devices and 256 submodules if no PROFINET IO devices or submodules are configured Note The 16 devices incl...

Page 394: ...to your CPU or you could have up to two SIMATIC Comfort panels with one additional Basic panel PG connections The CPU provides connections to support 1 programming device PG Webserver HTTP connections The CPU provides connections for the Webserver 10 2 PROFINET 10 2 1 Local Partner connection A Local Partner remote connection defines a logical assignment of two communication partners to establish ...

Page 395: ...device connected to the CPU HMI connected to the CPU A CPU connected to another CPU The PROFINET port on the CPU does not contain an Ethernet switching device A direct connection between a programming device or HMI and a CPU does not require an Ethernet switch However a network with more than two CPUs or HMI devices requires an Ethernet switch CSM1277 Ethernet switch You can use the rack mounted C...

Page 396: ...ction ID must be unique for the CPU Each connection that you create must have a different DB and connection ID Both the local CPU and the partner CPU can use the same connection ID number for the same connection but the connection ID numbers are not required to match The connection ID number is relevant only for the PROFINET instructions within the user program of the individual CPU You can use an...

Page 397: ...the TSEND_C in CPU_2 over the second connection connection ID 2 on both CPU_1 and CPU_2 TSEND_C on CPU_1 creates a connection and assigns a connection ID to that connection connection ID 1 for CPU_1 TRCV_C on CPU_2 creates the connection for CPU_2 and assigns the connection ID connection ID 1 for CPU_2 TRCV_C on CPU_1 creates a second connection for CPU_1 and assigns a different connection ID for ...

Page 398: ...on ID 1 that was configured by the TCON instruction in CPU_2 The TSEND instruction in CPU_2 links to the TRCV instruction in CPU_1 by using the connection ID connection ID 1 that was configured by the TCON instruction in CPU_2 The TRCV instruction in CPU_1 links to the TSEND instruction in CPU_2 by using the connection ID connection ID 1 that was configured by the TCON instruction in CPU_1 TCON on...

Page 399: ...r TCON instruction TSEND_C on CPU_1 creates a connection and assigns a connection ID to that connection ID 1 TRCV_C on CPU_2 creates a connection and assigns the connection ID to that connection on CPU_2 ID 1 ཱ 76 1 75 9 75 9 76 1 ི 38B 38B 76 1 B 75 9B TSEND and TRCV on CPU_1 use the connection ID created by the TSEND_C on CPU_1 ID 1 TSEND and TRCV on CPU_2 use the connection ID created by the TR...

Page 400: ...to CPU communication Read write data from to a CPU Data transmission and reception with specified length GET and PUT Assigns TSAPs to the Local active and Partner passive devices PROFINET RT CPU to PROFINET IO device communication Data transmission and reception with specified length Built in Built in 10 2 2 3 Ad hoc mode Typically TCP and ISO on TCP receive data packets of a specified length rang...

Page 401: ...ta management due to the SEND RECEIVE programming interface International Standards Organization ISO on Transport Control Protocol TCP RFC 1006 ISO on TCP is a mechanism that enables ISO applications to be ported to the TCP IP network This protocol has the following features An efficient communications protocol closely tied to the hardware Suitable for medium sized to large data amounts up to 8192...

Page 402: ...ust manually configure the DB on both CPUs Table 10 2 TSEND_C and TRCV_C instructions LAD FBD SCL Description TSEND_C_DB req _bool_in_ cont _bool_in_ len _uint_in_ done _bool_out_ busy _bool_out_ error _bool_out_ status _word_out_ connect _struct_inout_ data _variant_inout_ com_rst _bool_inout_ TSEND_C establishes a TCP or ISO on TCP communication connection to a partner station sends data and can...

Page 403: ...ND_C Contains start address and maximum length of received data TRCV_C COM_RST IN_OUT Bool Allows restart of the instruction 0 Irrelevant 1 Complete restart of the function block existing connection will be terminated DONE OUT Bool 0 Job is not yet started or still running 1 Job completed without error BUSY OUT Bool 0 Job is completed 1 Job is not yet completed A new job cannot be triggered ERROR ...

Page 404: ...meter for one cycle To establish a connection and send data execute TSEND_C with CONT 1 and REQ 1 After a successful send operation TSEND_C sets the DONE parameter for one cycle TRCV_C operations The following functions describe the operation of the TRCV_C instruction To establish a connection execute TRCV_C with parameter CONT 1 To receive data execute TRCV_C with parameter EN_R 1 TRCV_C receives...

Page 405: ...ameter If you import an S7 300 400 STEP 7 project containing ad hoc mode into the S7 1200 you must change the LEN parameter to 65535 Note Due to the asynchronous processing of TSEND_C you must keep the data in the sender area consistent until the DONE parameter or the ERROR parameter assumes the value TRUE For TSEND_C a TRUE state at the parameter DONE means that the data was sent successfully It ...

Page 406: ...pth exceeded 1 809A The CONNECT parameter points to a field that does not match the length of the connection description 1 809B The local_device_id in the connection description does not match the CPU 1 80A1 Communications error The specified connection was not yet established The specified connection is currently being terminated transmission over this connection is not possible The interface is ...

Page 407: ...ues from 20 to 7E hexadecimal 1 80B7 Data type and or length of the transmitted data does not fit in the area in the partner CPU in which it is to be written 1 80C3 All connection resources are in use 1 80C4 Temporary communications error The connection cannot be established at this time The interface is receiving new parameters The configured connection is currently being removed by a TDISCON 1 8...

Page 408: ...ot support the transmission of data from boolean locations and TRCV will not receive data into boolean locations For information transferring data with these instructions see the section on data consistency Page 143 TCON TDISCON TSEND and TRCV operate asynchronously which means that the job processing extends over multiple instruction executions For example you start a job for setting up and estab...

Page 409: ... communications connection from the CPU to a communication partner TDISCON_DB req _bool_in_ ID _word_in_ done _bool_out_ busy _bool_out_ error _bool_out_ status _word_out_ TCP and ISO on TCP TDISCON terminates a communications connection from the CPU to a communication partner 1 STEP 7 automatically creates the DB when you insert the instruction Table 10 9 Data types for the parameters of TCON and...

Page 410: ...connection is terminated and the set up connection is removed when the TDISCON instruction is executed or when the CPU has gone into STOP mode To set up and re establish the connection you must execute TCON again Table 10 10 ERROR and STATUS condition codes for TCON and TDISCON ERROR STATUS Description 0 0000 Connection was established successfully 0 7000 No job processing active 0 7001 Start job ...

Page 411: ...racters For a local TSAP length of 3 or greater and the first byte of the TSAP ID does not have a value of either E0 or E1 hexadecimal then all bytes of the TSAP ID must be valid ASCII characters Valid ASCII characters are byte values from 20 to 7E hexadecimal 1 80B6 TCON Parameter assignment error in parameter connection_type 1 80B7 TCON Data type and or length of the transmitted data does not fi...

Page 412: ...sert the instruction Table 10 12 Data types for the parameters of TSEND and TRCV Parameter and type Data type Description REQ IN Bool TSEND Starts the send job on a rising edge The data is transferred from the area specified by DATA and LEN EN_R IN Bool TRCV Enables the CPU to receive with EN_R 1 the TRCV is ready to receive The receive job is processed ID IN CONN_OUC Word Reference to the associa...

Page 413: ...actually received in bytes Note The TSEND instruction requires a low to high transition at the REQ input parameter to start a send job The BUSY parameter is then set to 1 during processing Completion of the send job is indicated by either the DONE or ERROR parameters being set to 1 for one scan During this time any low to high transition at the REQ input parameter is ignored TRCV Operations The TR...

Page 414: ...receiving a block of data TRCV enters the data in the receive area and sets NDR to 1 If you store the data in an optimized DB symbolic only you can receive data only in arrays of Byte Char USInt and SInt data types Note Importing of S7 300 400 STEP 7 projects containing ad hoc mode into the S7 1200 In S7 300 400 STEP 7 projects ad hoc mode is selected by assigning 0 to the LEN parameter In the S7 ...

Page 415: ...ble TSEND and TRCV The interface is being reinitialized TSEND The interface is receiving new parameters TRCV 1 80C3 Internal lack of resources A block with this ID is already being processed in a different priority class 1 80C4 Temporary communications error The connection to the communications partner cannot be established at this time The interface is receiving new parameter settings or the conn...

Page 416: ...d and receive data TDISCON disconnects the communication between the client and server Refer to TCON TDISCON TSEND and TRCV Page 408 in the TCP and ISO on TCP section for more information on the TCON and TDISCON communication instructions Table 10 15 TUSEND and TURCV instructions LAD FBD SCL Description TUSEND_DB req _bool_in_ ID _word_in_ len _uint_in_ done _bool_out_ busy _bool_out_ error _bool_...

Page 417: ...D must be identical to the associated parameter ID in the local connection description Range of values W 16 0001 to W 16 0FFF LEN IN UInt Number of bytes to be sent TUSEND or received TURCV Default 0 The DATA parameter determines the length of the data to be sent or received Otherwise range of values 1 to 1472 DONE TUSEND IN Bool Status parameter DONE TUSEND 0 Job is not yet started or still runni...

Page 418: ...u can determine the current status of the instruction TUSEND or TURCV or when the sending transmission receiving process is complete Table 10 17 Status of BUSY DONE TUSEND NDR TURCV and ERROR parameters BUSY DONE NDR ERROR Description TRUE irrelevant irrelevant The job is being processed FALSE TRUE FALSE The job was completed successfully FALSE FALSE TRUE The job was ended with an error The cause ...

Page 419: ... area TURCV specified in DATA Receive area is too small TURCV 1 8089 ADDR parameter does not point to a data block 1 80A1 Communications error The specified connection between user program and communications layer of the operating system has not yet been established The specified connection between the user program and the communication layer of the operating system is currently being terminated T...

Page 420: ...on Typical parameter start values for the TCON_Param data type are shown in the following table Port numbers LOCAL_TSAP_ID are written in a 2 byte format All ports except for 161 34962 34963 and 34964 are allowed Table 10 19 TCON_Param data type parameter values TCON instruction TCON UDP Conn DB The TUSEND instruction sends data through UDP to the remote partner specified in the TADDR_Param data t...

Page 421: ...ame online or by using the T_CONFIG instruction after the program is downloaded This PROFINET device name assignment method is for the CPU only WARNING After you use the T_CONFIG to change an IP configuration parameter the CPU restarts The CPU will go to STOP mode warm restart and return to RUN mode Control devices can fail in an unsafe condition resulting in unexpected operation of controlled equ...

Page 422: ...A data block along with a Variant pointer on parameter CONF_DATA referenced above The successful execution of the T_CONFIG instruction ends with the handover of the IP configuration data to the network interface Errors such as conflicts between IP addresses are assigned to the diagnostic buffer and written to the diagnostics buffer Table 10 23 Condition codes for ERROR and STATUS ERROR STATUS Desc...

Page 423: ... configuration or PNIO mode is enabled 1 C0809100 Reserved 1 C0809400 A parameter in the Sub block IP configuration has not been defined or may not be used 1 C0809500 There is an inconsistency between a parameter of the Sub block IP configuration and other parameters 1 C080C200 Instruction cannot be executed This error can occur if for example communication with the interface has been lost 1 C080C...

Page 424: ...ype_id and field_id are subject to future extensions In the IF_CONF_Header field only two subfields addr IP address and nos Name of station are currently allowed Table 10 24 Subfields supported subfield_type_id Data type Explanation 30 IF_CONF_V4 IP parameters IP address subnet mask router address 40 IF_CONF_NOS PROFINET IO device name Name of station Table 10 25 Elements of the IF_CONF_V4 data ty...

Page 425: ...61158 6 10 Otherwise nos is rejected and the T_CONFIG Page 421 instruction enters the error code DW 16 C0809400 in STATUS If you occupy the first byte with zero the station name is deleted The station name is subject to the following limitations Restricted to a total of 240 characters lower case letters numbers dash or dot A name component within the station name i e a character string between two...

Page 426: ...n the addr subfield the InterfaceAddress IP address SubnetMask and DefaultRouter IP router are changed In the CPU Properties Ethernet address page the Set IP address using a different method radio button must be clicked to enable you to change the IP address using the T_CONFIG instruction after the program is downloaded Table 10 27 How to change IP parameters ...

Page 427: ... for instructions REQ input parameter Many of the Open User Communication instructions use the REQ input to initiate the operation on a low to high transition The REQ input must be high TRUE for one execution of an instruction but the REQ input can remain TRUE for as long as desired The instruction does not initiate another operation until it has been executed with the REQ input FALSE so that the ...

Page 428: ...herwise FALSE NDR Bool FALSE Is set TRUE for one execution to indicate that the requested action has completed without error and new data has been received otherwise FALSE BUSY Bool FALSE Is set TRUE when active to indicate that The job is not yet complete A new job cannot be triggered Is set FALSE when job is complete ERROR Bool FALSE Is set TRUE for one execution to indicate that the last reques...

Page 429: ...th a programming device A CPU can communicate with a STEP 7 programming device on a network Consider the following when setting up communications between a CPU and a programming device Configuration Setup Hardware configuration is required No Ethernet switch is required for one to one communications an Ethernet switch is required for more than two devices in a network 10 2 3 1 Establishing the har...

Page 430: ...the Ethernet cable into the PROFINET port shown below 3 Connect the Ethernet cable to the programming device PROFINET port An optional strain relief is available to strengthen the PROFINET connection 10 2 3 2 Configuring the devices If you have already created a project with a CPU open your project in the TIA Portal If not create a project and insert a CPU Page 110 into the rack In the project bel...

Page 431: ...ine Page 123 for more information After you have configured your CPU or network device in your project you can configure parameters for the PROFINET interface to include its IP address Refer to Configuring an IP address for a CPU in your project Page 125 for more information 10 2 3 4 Testing your PROFINET network After completing the configuration you must download your project to the CPU All IP a...

Page 432: ...ommunication with a programming device Establishing the hardware communications connection Page 429 for more information 2 Configuring the devices Refer to Communication with a programming device Configuring the devices Page 430 for more information 3 Configuring the logical network connections between an HMI and a CPU Refer to HMI to PLC communication Configuring the logical network connections b...

Page 433: ... two CPUs Step Task 1 Establishing the hardware communications connection A PROFINET interface establishes the physical connection between two CPUs Since Auto Cross Over functionality is built into the CPU you can use either a standard or crossover Ethernet cable for the interface An Ethernet switch is not required to connect the two CPUs Refer to Communication with a programming device Establishi...

Page 434: ...n the second device Release the mouse button and your PROFINET connection is joined Refer to Device Configuration Creating a network connection Page 117 for more information 10 2 5 2 Configuring the Local Partner connection path between two devices Configuring General parameters You specify the communication parameters in the Properties configuration dialog of the communication instruction This di...

Page 435: ...disconnect by the instruction The TSEND_C instruction combines the functions of the TCON TDISCON and TSEND instructions From the Device configuration in STEP 7 you can configure how a TSEND_C instruction transmits data To begin you insert the instruction into the program from the Communications folder in the Instructions task card The TSEND_C instruction is displayed along with the Call options di...

Page 436: ...nstruction Page 401 creates a communications connection to a partner station The connection is set up established and automatically monitored until it is commanded to disconnect by the instruction The TRCV_C instruction combines the functions of the TCON TDISCON and TRCV instructions From the CPU configuration in STEP 7 you can configure how a TRCV_C instruction receives data To begin insert the i...

Page 437: ... of the TRCV_C instruction 10 2 6 Configuring a CPU and PROFINET IO device Adding a PROFINET IO device Use the hardware catalog to add PROFINET IO devices Note To add a PROFINET IO device you can use STEP 7 Professional or Basic V11 or greater For example expand the following containers in the hardware catalog to add an ET200S IO device Distributed I O ET200S Interface modules and PROFINET You can...

Page 438: ...formation Assigning CPUs and device names Network connections between the devices also assign the PROFINET IO device to the CPU which is required for that CPU to control the device To change this assignment click the PLC Name shown on the PROFINET IO device A dialog box opens that allows the PROFINET IO device to be disconnected from the current CPU and reassigned or left unassigned if desired The...

Page 439: ...in an IO cycle time period The update time can be separately configured for each device and determines the time interval in which data is transmitted from the CPU to and from the device STEP 7 calculates the IO cycle update time automatically in the default setting for each device of the PROFINET network taking into account the volume of data to be exchanged and the number of devices assigned to t...

Page 440: ...ected or no longer exists and no further components require maintenance outgoing event If OB82 does not exist these errors are written to the diagnostics buffer The CPU does not take any action or switch to STOP If OB82 does exist the operating system can call OB82 in response to an incoming event You must create OB82 and this OB allows you to configure local error handling and a more detailed rea...

Page 441: ...ers DPRD_DAT instruction Page 269 The S7 1200 CPU supports up to 64 bytes of consistent data You must read consistent data areas greater than 64 bytes from a PROFINET IO device with the DPRD_DAT instruction DPWR_DAT instruction Page 269 The S7 1200 CPU supports up to 64 bytes of consistent data You must write consistent data areas greater than 64 bytes to a PROFINET IO device with the DPWR_DAT ins...

Page 442: ...that is not communicating Use the GET_DIAG instruction Page 285 for each station to obtain the diagnostic information This will allow you to programmatically handle the errors encountered on the device and if desired take the CPU to STOP mode This method requires you to specify the hardware device from which to read the status information The GET_DIAG instruction uses the L address LADDR of the st...

Page 443: ... used for commissioning slaves and for diagnostic purposes The S7 1200 is connected to a PROFIBUS network as a DP slave with the CM 1242 5 communication module The CM 1242 5 DP slave module can be the communications partner of DP V0 V1 masters In the figure below the S7 1200 is a DP slave to an S7 300 controller The S7 1200 is connected to a PROFIBUS network as a DP master with the CM 1243 5 commu...

Page 444: ...PROFIBUS fieldbus system with the following communications modules CM 1242 5 Operates as DP slave CM 1243 5 Operates as DP master class 1 If a CM 1242 5 and a CM 1243 5 are installed together an S7 1200 can perform the following tasks simultaneously Slave of a higher level DP master system and Master of a lower level DP master system 10 3 1 2 Communications services of the PROFIBUS CMs Bus protoco...

Page 445: ...module EM 277 SINAMICS converter Drives and actuators from various vendors Sensors of various vendors S7 300 400 CPU with PROFIBUS interface S7 300 400 CPU with PROFIBUS CP for example CP 342 5 SIMATIC PC stations with PROFIBUS CP Types of communication with DP V1 The following types of communication are available with DP V1 Cyclic communication CM 1242 5 and CM 1243 5 Both PROFIBUS modules suppor...

Page 446: ...BUS CMs Configuration and module replacement You configure the modules networks and connections in STEP 7 as of version V11 0 If you want to configure the module in a third party system there is a GSD file available for the CM 1242 5 DP slave on the CD that ships with the module and on Siemens Automation Customer Support pages on the Internet The configuration data of the PROFIBUS CMs is stored on...

Page 447: ... siemens com WW view en 49851842 10 3 1 4 Configuration examples for PROFIBUS Below you will find examples of configurations in which the CM 1242 5 is used as a PROFIBUS slave and the CM 1243 5 is used as a PROFIBUS master Operator control monitoring Operator control monitoring SIMATIC S7 1200 with CM 1242 5 SIMATIC S7 1200 with CM 1242 5 PROFIBUS PROFINET Industrial Ethernet PROFIBUS LWL SIMATIC ...

Page 448: ...er double click or drag the module to the highlighted slot Table 10 35 Adding a PROFIBUS CM 1243 5 DP master module to the device configuration Module Select the module Insert the module Result CM 1243 5 DP master Use the hardware catalog to add DP slaves as well For example to add an ET200 S DP slave in the Hardware Catalog expand the following containers Distributed I O ET200 S Interface modules...

Page 449: ...re logical network connections between two PROFIBUS devices you can configure parameters for the PROFIBUS interfaces To do so click the purple PROFIBUS box on the CM 1243 5 module and the Properties tab in the inspector window displays the PROFIBUS interface The DP slave PROFIBUS interface is configured in the same manner Table 10 37 Configuring the CM 1243 5 DP master module and ET200 S DP slave ...

Page 450: ...PROFIBUS address for the device Highest address The highest PROFIBUS address is based on the active stations on the PROFIBUS for example DP master Passive DP slaves independently have PROFIBUS addresses from 1 to 125 even if the highest PROFIBUS address is set to 15 for example The highest PROFIBUS address is relevant for token forwarding forwarding of the send rights and the token is only forward...

Page 451: ...AT instruction DPNRM_DG instruction Page 271 You can read the current diagnostic data of a DP slave in the format specified by EN 50 170 Volume 2 PROFIBUS 10 3 4 Diagnostic instructions The following diagnostic instructions can be used with either PROFINET or PROFIBUS GET_DIAG instruction You can read the diagnostic information from a specified device DeviceStates instruction You can retrieve the ...

Page 452: ... of the entire station This L Address can be found within the Network Configuration view and by selecting the entire station rack entire gray area the L Address is shown in the Properties Tab of the station You can find the LADDR for each individual module either in the properties for the module in the device configuration or in the default tag table for the CPU 10 4 AS i The S7 1200 CM 1243 2 AS ...

Page 453: ...S i Master module to the device configuration Module Select the module Insert the module Result CM 1243 2 AS i Master Use the hardware catalog to add AS i slaves as well For example to add an I O module compact digital input slave in the Hardware Catalog expand the following containers Field devices AS Interface slaves Next select 3RG9 001 0AA00 AS i SM U 4DI from the list of part numbers and add ...

Page 454: ...le 10 42 Configuring the CM 1243 2 AS i Master module and AS i I O module compact digital input slave interface CM 1243 2 AS i Master module AS i I O module compact digital input slave 1 1 AS i port Assigning the AS i address In an AS i network each device is assigned an AS i address This address can range from 0 through 31 however address 0 is reserved only for new slave devices The slave address...

Page 455: ...een the user program and AS i slaves 10 4 2 1 Configuring slaves with STEP 7 Transferring AS i digital values The CPU accesses the digital inputs and outputs of the AS i slaves through the CM 1243 2 AS i master in cyclic operation The data is accessed through I O addresses or by means of a data record transfer A 62 byte data area is reserved in the I O area of the SIMATIC Access to the digital dat...

Page 456: ... 2 Bit 1 Bit 0 Bit 3 Bit 2 Bit 1 Bit 0 Slave no 3 Not used Slave 2B Bit 3 Bit 2 Bit 1 Bit 0 Bit 3 Bit 2 Bit 1 Bit 0 Control bits Control bits CM 1243 2 IO bit no Bit 3Bit 2Bit 1Bit 0 Bit 3Bit 2Bit 1Bit 0 Bit 3Bit 2Bit 1Bit 0 Control bits Control bits Control bits Not used Not used Bit 3 Bit 2 Bit 1 Bit 0 Bit 3 Bit 2 Bit 0 Bit 1 Not used Not used Bit 3 Bit 2 Bit 1 Bit 0 Bit 3 Bit 2 Bit 1 Bit 0 Not ...

Page 457: ...s Note A configuration of the AS i slaves specified through STEP 7 and downloaded into the S7 station is transferred by the CPU on the AS i master CM 1243 2 during S7 station start up Any existing configuration that was determined through the System assignment online function Page 457 ACTUAL EXPECTED will be overwritten Further information You will find detailed information on the AS i CM 1243 2 i...

Page 458: ...ation on the AS i CM 1243 2 in the CM 1243 2 and AS i data decoupling unit DCM 1271 for SIMATIC S7 1200 Manual 10 4 3 Distributed I O Instructions The following Distributed I O instructions Page 260 can be used as indicated with AS i RDREC instruction Page 260 You can read a data record with the number INDEX from an AS i component WRREC instruction Page 260 You can transfer a data record with the ...

Page 459: ...2011 A5E02486680 05 459 There are two AS i operational modes Protection mode You cannot change AS i slave device and CPU I O addresses The green CM LED is OFF Configuration mode You can make required changes in your AS i slave device and CPU I O addresses The green CM LED is ON ...

Page 460: ... either absolute addresses or symbolic names to address variables of an S7 300 400 CPU Data types of the remote communication partner that are not supported by the calling S7 1200 CPU may only be accessed as a byte array For example S7 300 data type DT is accessed as an array of 8 bytes Accessing data in a standard DB An S7 1200 CPU can use either absolute addresses or symbolic names to address DB...

Page 461: ...ord_in_ done _bool_out_ error _bool_out_ status _word_out_ addr_1 _remote_inout_ addr_4 _remote_inout_ sd_1 _variant_inout_ sd_4 _variant_inout_ Use the PUT instruction to write data to a remote S7 CPU The remote CPU can be in either RUN or STOP mode STEP 7 automatically creates the DB when you insert the instruction Table 10 45 Data types for the parameters Parameter and type Data type Descriptio...

Page 462: ...sure that the length number of bytes and data types for the ADDR_x remote CPU and RD_x or SD_x local CPU parameters match The number after the identifier Byte is the number of bytes referenced by the ADDR_x RD_x or SD_x parameter Note The total number of bytes received on a GET instruction or the total number of bytes sent on a PUT instruction is limited The limitations are based on how many of th...

Page 463: ... for PUT before accessing the data or initiating another read or write operation The ERROR and STATUS parameters provide information about the status of the read GET or write PUT operation Table 10 46 Error information ERROR STATUS decimal Description 0 11 New job cannot take effect since previous job is not yet completed The job is now being processed in a priority class having lower priority 0 2...

Page 464: ...FINET box on the first device and drag a line to the PROFINET box on the second device Release the mouse button and your PROFINET connection is joined Refer to Creating a network connection Page 117 for more information Click the Highlighted Connection button to access the Properties configuration dialog of the communication instruction 10 5 3 Configuring the Local Partner connection path between ...

Page 465: ...nnection whenever you have selected any part of the instruction You can specify the communication parameters in the Configuration tab of the Properties for the communication instruction 10 5 4 1 Connection parameters The Connection parameters page allows the user to configure the necessary S7 connection and to configure the parameter Connection ID that is referenced by the GET PUT block parameter ...

Page 466: ...nterface type Type of interface Subnet name Name assigned to the subnets Address Assigned IP addresses Note The user can specify the remote address of a third party device for an unspecified communication partner Connection ID ID number Automatically generated by the GET PUT connection parameter assignment Connection name Local and Partner CPU data storage location Automatically generated by the G...

Page 467: ... can change the current ID through the Connection overview dialog The user input is synchronized with the ID parameter on the corresponding GET PUT block Note The parameter ID of the GET PUT block is not a connection name but a numerical expression which is written like the following example W 16 1 Connection name parameter The connection name is editable through a special user control the Connect...

Page 468: ...Configuring a CPU to CPU S7 connection Given the configuration of PLC_1 PLC_2 and PLC_3 as shown in the figure below insert GET or PUT blocks for PLC_1 For the GET or PUT instruction the Properties tab is automatically displayed in the inspector window with the following menu selections Configuration Connection parameters ...

Page 469: ...ntains CPU1214C DC DC DC PROFINET interface R0 S1 Partner Interface contains CPU319 3PN DP PROFINET interface R0 S2 Interface type Local Interface type contains Ethernet IP control is read only Partner Interface type contains Ethernet IP control is read only Interface type images are shown at the right beside the Local and Partner Interface type green Ethernet icon Subnet name Local Subnet name co...

Page 470: ...hecked and enabled to select the Local CPU as the active connection One way Read only and unchecked Note PLC_1 an S7 1200 CPU 1214CDC DC Rly and PLC_3 an S7 300 CPU 319 3PN DP can both act as a server and a client in a PROFINET GET PUT connection allowing a two way connection The GET PUT icon in the Property View tree also changes from red to green Completed PROFINET S7 connection In the Network v...

Page 471: ...tains CPU1214C DC DC DC PROFIBUS interface R0 S1 Partner Interface contains CPU319 3PN DP PROFIBUS interface R0 S2 Interface type Local Interface type contains PROFIBUS control is read only Partner Interface type contains PROFIBUS control is read only Interface type images are shown at the right beside the Local and Partner Interface type purple PROFIBUS icon Subnet name Local Subnet name contains...

Page 472: ...shment Read only checked and enabled to select the Local CPU as the active connection One way Read only and checked Note PLC_3 an S7 300 CPU319 3PN DP can act only as a server cannot also be a client in a PROFIBUS GET PUT connection allowing only a one way connection The GET PUT icon in the Property View tree also changes from red to green Completed PROFIBUS S7 connection In the Network view a one...

Page 473: ...ssible by address or PLC tag name Data Logs Page 486 data log files stored internally in the CPU or on a memory card These pages are built in to the S7 1200 For details about the standard Web pages and how to access them refer to the Standard web pages Page 474 section User defined Web pages The S7 1200 also provides support for you to create user defined Web pages that can access CPU data You can...

Page 474: ...user defined Web pages you can access them from the standard Web page menu Note If a Download in RUN Page 650 is in progress standard and user defined Web pages do not update data values or permit you to write data values until the download is complete Any attempts to write data values while the download is in progress are discarded 11 2 Standard web pages 11 2 1 Accessing the standard Web pages f...

Page 475: ...ostic Page 480 the diagnostic buffer variable Page 484 CPU variables and I O accessible by address or PLC tag name datalog Page 486 data log files stored internally in the CPU or on a memory card index Page 478 introduction page to enter the standard Web pages For example if you enter http ww xx yy zz communication html the browser will display the communication page Secure access You can use http...

Page 476: ...tion for pages without automatic refresh causes the page to update with current data Print icon prepares and displays a printable version of the information available from the displayed page Navigation area to switch to another page Content area for specific standard Web page that you are viewing This example is the CPU Identification page Note Printing standard Web pages When printing standard We...

Page 477: ...or the Name field 2 Enter the CPU password if one is configured in the Password field otherwise press the Enter key You are now logged in as the admin user If you encounter any errors logging in return to the Introduction page Page 478 and download the Siemens security certificate Page 490 You can then log in with no errors Logging out To log out the admin user simply click the Log out link from a...

Page 478: ...1 2 3 Introduction The Introduction page is the welcome screen for entry into the S7 1200 standard Web pages From this page you click Enter to access the S7 1200 standard Web pages At the top of the screen are links to useful Siemens Web sites as well as a link to download the Siemens security certificate Page 490 ...

Page 479: ...age displays a representation of the CPU to which you are connected and lists general information about the CPU If you log in as the admin user you can also change the operating mode of the CPU and flash the LEDs 2 1 and Buttons for flashing LEDs and changing operating mode only appear on the Start page when you log in as the admin user ...

Page 480: ...e displays diagnostic events From the selector you can choose what range of diagnostic buffer entries to display either 1 to 25 or 26 to 50 The top part of the page displays those entries with the CPU time and date of when the event occurred The times are CPU times which correspond to the Time of day and Time zone setting in the device configuration for the CPU The CPU time is not necessarily the ...

Page 481: ...nostic buffer page does not vary with the admin login 11 2 7 Module Information The module information page provides information about all the modules in the local rack The top section of the screen shows a summary of the modules and the bottom section shows status and identification of the selected module Status display ...

Page 482: ...log initially displays the name of the SIMATIC 1200 station a status indicator and a comment If you drill down to the CPU the module information displays the name of the digital and analog inputs and outputs that the CPU model provides for example DI14 DO10 AI2 addressing information for the I O status indicators slot numbers and comments As you drill down the module information page shows the pat...

Page 483: ... tab in the bottom section of the module information page displays a description of the current status of the module that is selected in the top section Identification The identification tab displays the serial number and revision numbers of the selected module The module information page does not vary with the admin login 11 2 8 Communication The communication page displays the parameters of the ...

Page 484: ... format for the data You can continue entering and specifying values until you have as many as you want within the limitations for the page The monitor values show up automatically and refresh by default unless you click the Off icon in the upper right area of the page When refresh is disabled you can click On to re enable automatic refresh With the admin log in you can also modify data values Ent...

Page 485: ...andard Variable Status page The Variable Status page does not allow you to modify a string longer than 198 characters When using exponential notation to enter a value for a Real or LReal data type in the Variable Status page To enter a real number value Real or LReal with a positive exponent such as 3 402823e 25 do not enter the for the exponent Instead of entering 3 402823e 25 you must enter the ...

Page 486: ...ecial characters such that it is rejected as an entry on the Variable Status page you can enclose the tag name in double quotation marks In most cases the Variable Status page will then recognize the tag name 11 2 10 Data Logs The Data Logs page allows you to view or download a specified number of data log entries With the admin log in you can also clear these entries after downloading them or you...

Page 487: ...rds are sorted in decreasing record number order You will be prompted by Microsoft Windows to open or save the log file By default the Data Logs page shows the most recent 25 entries of a log file regardless of how many entries are actually in the log You can change this value in the Maximum most recent entries to read field by entering a number or by using the or button to increment or decrement ...

Page 488: ...r is not present you can sort the data rows using the record number Deleting a log file To delete a log file you must be logged in as the admin user Then click the Delete icon that corresponds to a specific log file The Web server then deletes the selected log file Additional information For information on programming with the Data log instructions see the Data logging Page 291 chapter 11 2 11 Con...

Page 489: ...not update dynamically You must manually refresh the page with the Refresh icon Page 476 to view fresh data Diagnostic Buffer page Displaying the event details With JavaScript you select a row in the diagnostic buffer to see the details in the bottom section Without JavaScript you must click the event field hyperlink of a diagnostic buffer entry to see the event data in the bottom section Changing...

Page 490: ...n this field from Mozilla Firefox the display goes blank You must reselect Data Logs from the navigation pane to restore the Data Logs display The number of recent entries field remains unchanged Note that you can leave the Data Logs page and re enter to get the most recent 25 entries 11 2 11 2 Features restricted when cookies are not allowed If your Web browser does not allow cookies you cannot l...

Page 491: ...the MiniWebCA_Cer crt entries 4 Click OK if prompted to open an executable file 5 Click Open on the Open File Security Warning dialog if it appears A Certificate dialog appears 6 On the Certificate dialog click the Install Certificate button 7 Follow the dialogs of the Certificate Import Wizard to import the certificate letting the operating system automatically select the certificate store 8 If t...

Page 492: ...to another format 9 Complete the remaining steps of the Text Import Wizard to import the file 11 3 User defined web pages The S7 1200 Web server also provides the means for you to create your own application specific HTML pages that incorporate data from the PLC You create these pages using the HTML editor of your choice and download them to the CPU where they are accessible from the standard Web ...

Page 493: ...he following line in your HTML page to set the charset for the page to UTF 8 meta http equiv content type content text html charset utf 8 Also be sure to also save the file from the editor in UTF 8 character encoding You use STEP 7 to compile everything in your HTML pages into STEP 7 data blocks These data blocks consist of one control data block that directs the display of the Web pages and one o...

Page 494: ...ovides AWP commands that you embed in your user defined Web pages as HTML comments for the following purposes Reading variables Page 495 Writing variables Page 496 Reading special variables Page 497 Writing special variables Page 499 Defining enum types Page 501 Assigning variables to enum types Page 501 Creating fragment data blocks Page 503 General syntax Except for the command to read a variabl...

Page 495: ...Name Use Varname Defining enum types AWP_Enum_Def Name Enum type name Values Value Value Referencing enum types AWP_Enum_Ref Name VarName Enum EnumType Creating fragments AWP_Start_Fragment Name Name Type Type ID id Importing fragments AWP_Import_Fragment Name Name 11 3 2 1 Reading variables User defined Web pages can read variables PLC tags from the CPU Syntax Varname Parameters Varname The varia...

Page 496: ...correspond to writable CPU variables As with all user defiined pages you then generate the blocks from STEP 7 such that they are included in your STEP 7 program When an admin user subsequently accesses this page and types data into the input fields or selects a choice from a select list the Web server converts the input to the appropriate data type for the variable and writes the value to the vari...

Page 497: ...k_1 Braking form method post p Braking input name Braking type text p form Example using HTML select list AWP_In_Variable Name Data_block_1 ManualOverrideEnable form method post select name Data_block_1 ManualOverrideEnable option value Data_block_1 ManualOverrideEnable option option value 1 Yes option option value 0 No option select input type submit value Submit setting form Note Only an admin u...

Page 498: ...ation marks and the PLC tag in double quotation marks The special variable name and PLC tag name must match exactly Varname Name of the PLC tag or data block tag for the variable to be read into The Varname must be enclosed in single quotation marks Within the single quotes use double quotation marks around a PLC tag or data block name The data block name is within the double quotes but not the da...

Page 499: ...e of the named cookie Enclose the Name clause in single quotation marks If no Use clause is specified the special variable name corresponds to a PLC variable name Enclose the complete Name clause within single quotation marks and the PLC tag in double quotation marks The special variable name must match the PLC tag name exactly Refer to HTTP documentation for a list of all the names of HEADER vari...

Page 500: ...be enclosed in single or double quotation marks Varname2 Name of the PLC variable for which you want to assign an alias name The variable can be a PLC tag a data block tag or a special variable Varname2 must be enclosed in single quotation marks Within the single quotes use double quotation marks around a PLC tag special variable or data block name The data block name is within the double quotes b...

Page 501: ...gnments is enclosed in single quotation marks and each individual enum type element assignment is enclosed in double quotation marks The scope of an enum type definition is global for the user defined Web pages If you have set up your user defined Web pages in language folders Page 522 the enum type definition is global for all pages in the language folder Example AWP_Enum_Def Name AlarmEnum Value...

Page 502: ...y AWP_Enum_Ref Name Alarm Enum AlarmEnum p The current value of Alarm is Alarm p If the value of Alarm in the CPU is 2 the HTML page displays The current value of Alarm is Tank is empty because the enum type definion Page 501 assigns the text string Tank is empty to the numerical value 2 Example usage in a variable write AWP_In_Variable Name Alarm AWP_Enum_Def Name AlarmEnum Values 0 No alarms 1 T...

Page 503: ... of specific pages You can identify these fragments by a name and number with the Start_Fragment AWP command Everything in the page following the AWP_Start_Fragment command belongs to that fragment until another AWP_Start_Command is issued or until end of file is reached Syntax AWP_Start_Fragment Name Name Type Type ID id Parameters Name Text string name of fragment DB Fragment names must begin wi...

Page 504: ...mplement this by creating a fragment Page 503 that loads the image of the company logo Each individual HTML page could then import this fragment to display the company logo You use the AWP Import_Fragment command for this purpose The HTML code for the fragment only exists in one fragment but you can import this fragment DB as many times as necessary in as many Web pages as you choose Syntax AWP_Im...

Page 505: ... names that are data block tags enclose the data block name in double quotation marks The tag is outside of the quotation marks For variable names that are direct I O addresses memory addresses or alias names do not use quotation marks around the read variable For tag names or data block tag names that contain a backslash precede the backslash with another backslash If a tag name or data block tag...

Page 506: ...r a Name or Use clause must be enclosed within single quotation marks If the enclosed name is a PLC tag or Data block name use single quotation marks for the full clause Within a Name or Use clause data block names and PLC tag names must be enclosed within double quotation marks If a tag name or Data block name includes a single quote character or backslash escape that character with a backslash T...

Page 507: ...r the name of the default page 7 Provide a name for your application optional The application name is used to further subcategorize or group web pages When an application name exists the URL will appear in the following format http ww xx yy zz awp application name pagename html 8 Specify filename extensions to be examined for the presence of AWP commands By default STEP 7 analyzes files with htm h...

Page 508: ...te data blocks button STEP 7 deletes the control data block and all of the fragment data blocks from your project that correspond to user defined Web pages 11 3 4 Programming the WWW instruction for user defined web pages Your STEP 7 user program must include and execute the WWW instruction in order for the user defined Web pages to be accessible from the standard Web pages The control data block ...

Page 509: ...and last_error has been set in the control DB 16 803a The control DB is not loaded 16 8081 The control DB is of the wrong type format or version 16 80C1 No resources are available to initialize the web application Usage of the Control DB STEP 7 creates the control data block when you click Generate blocks and displays the control DB number in the User defined Web pages properties You can find the ...

Page 510: ...work of the standard Web page display That is the header frame at the top and the login and navigation frames at the left remain in fixed positions 1 2 Link to default page of user defined Web pages Content area of user defined Web pages 11 3 7 Constraints specific to user defined Web pages The constraints for standard Web pages Page 488 also apply to user defined Web pages In addition user define...

Page 511: ...tes from your user defined Web pages and see the load memory consumption Note If you need to reduce the space required for your user defined Web pages reduce your use of images if applicable 11 3 8 Example of a user defined web page 11 3 8 1 Web page for monitoring and controlling a wind turbine As an example of a user defined Web page consider a Web page that is used to remotely monitor and contr...

Page 512: ...ge example consists of three files Wind_turbine html This is the HTML page that implements the display shown above using AWP commands to access controller data Wind_turbine css This is the cascading style sheet that contains formatting styles for the HTML page Use of a cascading style sheet is optional but it can simplify the HTML page development Wind_turbine jpg This is the background image that...

Page 513: ...ride settings to the controller The braking user input field provides a manual setting for a braking percentage The STEP 7 user program does not require manual override to accept a braking value In addition the HTML page uses an AWP command to write the special variable Page 499 that contains the user ID of the user that is accessing the page to a tag in the PLC tag table 11 3 8 2 Reading and disp...

Page 514: ...ock named Data_block_1 Note that for each AWP_Enum_Ref declaration there must be a corresponding AWP_In_Variable declaration for the data block tag or PLC variable if the HTML page writes to the variable through an enum type AWP_In_Variable Name Data_block_1 ManualOverrideEnable AWP_Enum_Def Name OverrideStatus Values 0 Off 1 On AWP_Enum_Ref Name Data_block_1 ManualOverrideEnable Enum OverrideStat...

Page 515: ...user to subsequently set floating point values for the turbine speed yaw pitch and braking percentage The page uses an HTTP form post command to write the AWP_In_Variables to the controller For example consider the HTML code for manually setting the braking value Sample HTML code The following excerpt from the Remote Wind Turbine Monitor HTML page first declares an AWP_In_Variable for Data_block_1...

Page 516: ...with a declaration such as AWP_In_Variable Name Data_block_1 Braking 11 3 8 5 Writing a special variable The Remote Wind Turbine Monitor Web page writes the special variable SERVER current_user_id to a PLC tag in the CPU In this case the PLC tag value contains the user ID of whoever is accessing the Remote Wind Turbine Monitor Web page Currently the admin user has a user ID of 1 so the PLC tag val...

Page 517: ...ociated booleans were set The only STEP 7 requirement is to call the WWW instruction with the DB number of the generated data blocks for this page AWP_In_Variable Name Data_block_1 AWP_In_Variable Name Data_block_1 ManualOverrideEnable AWP_In_Variable Name Data_block_1 PitchOverride AWP_In_Variable Name Data_block_1 YawOverride AWP_In_Variable Name SERVER current_user_id Use User_ID AWP_Enum_Def N...

Page 518: ...tr form method POST action tr style height 2 td style width 24 border top style Solid border top width 2px border top color ffffff p Manual override Data_block_1 ManualOverrideEnable p td td class Text Set select name Data_block_1 ManualOverrideEnable option value Data_block_1 ManualOverrideEnable option option value On Yes option option value Off No option select td tr tr style vertical align top...

Page 519: ...verride Data_block_1 PitchOverride p td td class Text Set select name Data_block_1 PitchOverride option value Data_block_1 PitchOverride option option value On Yes option option value Off No option select td tr tr style vertical align top height 2 td style width 24 border bottom style Solid border bottom width 2px border bottom color ffffff p Blade pitch p td td p style margin bottom 5px input nam...

Page 520: ... 0pt color FFFFFF margin top 0px margin bottom 10px P font family Arial font weight bold color FFFFFF font size 12 0pt margin top 0px margin bottom 0px TD Text font family Arial font weight bold color FFFFFF font size 12 0pt margin top 0px margin bottom 0px 11 3 8 7 Configuration in STEP 7 of the example Web page To include the Remote Wind Turbine Monitor HTML page as a user defined Web page for t...

Page 521: ...age This field specifies the filename of the default page or home page of the HTML application The button allows you to select the file that you need For this example WindTurbine html is the default HTML page The Remote Wind Turbine Monitor example only consists of a single page but in other user defined applications the default page can call up additional pages from links on the default page With...

Page 522: ...following languages German de English en Spanish es French fr Italian it Chinese zh You do this by setting up your HTML pages in a folder structure Page 522 that corresponds to the languages and by setting a specific cookie named siemens_automation_language from your pages Page 523 The Web server responds to this cookie and switches to the default page in the corresponding language folder 11 3 9 1...

Page 523: ...der includes a JavaScript file named lang js Each langswitch html page uses this JavaScript to set the language cookie siemens_automation_language HTML for langswitch html in en folder The header of the HTML page sets the language to English sets the character set to UTF 8 and sets the path to the JavaScript file lang js DOCTYPE HTML PUBLIC W3C DTD HTML 4 01 Transitional EN html head meta http equ...

Page 524: ...de Language Selection table tr td align right valign top nowrap change language immediately on change of the selection select name Language onchange DoLocalLanguageChange this size 1 option value de selected Deutsch option option value en Englisch option select td tr table Language Selection End JavaScript lang js in script folder The function DoLocalLanguageChange is in the lang js file This func...

Page 525: ...cookie strval 11 3 9 3 Configuring STEP 7 to use a multi language page structure The procedure for configuring multi language user defined Web pages is similar to the general process for configuring user defined Web pages Page 507 When you have folders set up for languages however you set your HTML directory setting to the folder that contains the individual language folders You do not set the HTM...

Page 526: ...Global commands in the Commandstate structure The global commands apply to the Web server in general You can deactivate the Web server or restart it from the control DB parameters Block tag Data type Description init BOOL Evaluate the control DB and initialize the Web application deactivate BOOL Deactivate the Web application Global states in the Commandstate structure The global states apply to t...

Page 527: ...OL Enables current page fragment for resending and continues with the same fragment abort BOOL Close http connection without sending finish BOOL Send this fragment page is complete do not process any additional fragments Request states The request states are read only idle BOOL Nothing to do but active waiting BOOL Fragment is waiting to be enabled sending BOOL Fragment is sending aborting BOOL Us...

Page 528: ...more than one request command the WWW instructions processes only one in this of precedence abort finish repeat continue The WWW instruction clears all of the request commands after processing Examples The following example shows a STEP 7 user program that is checking for a fragment with an ID of 1 to be in the waiting state following a prior call to the WWW instruction It might also wait for othe...

Page 529: ...ansmit and receive activity by means of LEDs Display a diagnostic LED CMs only Are powered by the CPU No external power connection is needed Refer to the technical specifications for communication interfaces Page 743 LED indicators The communication modules have three LED indicators Diagnostic LED DIAG This LED flashes red until it is addressed by the CPU After the CPU powers up it checks for a CB...

Page 530: ...terminated or biased A B A B A B A B A B A B 2Q 2II 2Q ཱ ི End terminating devices Switch position ON to terminate and bias the connector Other non terminating devices on the network Switch position OFF no termination or bias for the connector Bare cable shielding Approximately 12 mm must contact the metal guides of all locations Table 12 1 Termination and bias for the RS485 connector Terminating ...

Page 531: ... in the user program PtP Page 531 USS Page 567 Modbus Page 581 PtP enables a wide variety of possibilities The ability to send information directly to an external device such as a printer The ability to receive information from other devices such as barcode readers RFID readers third party camera or vision systems and many other types of devices The ability to exchange information sending and rece...

Page 532: ...re identifier The port symbolic name is assigned in the Constants tab of the PLC tag table Bit time resolution Several parameters are specified in a number of bit times at the configured baud rate Specifying the parameter in bit times allows the parameter to be independent of baud rate All parameters that are in units of bit times can be specified to a maximum number of 65535 However the maximum a...

Page 533: ...ause parameterization is in progress in background 8083 Buffer overflow The CM or CB returned a received message with a length greater than the length parameter allowed 8090 Internal error Wrong message length wrong sub module or illegal message Contact customer support 8091 Internal error Wrong version in parameterization message Contact customer support 8092 Internal error Wrong record length in...

Page 534: ... to STOP mode and after a power cycle See Configuring the communication ports Page 549 and Managing flow control Page 550 for more information Table 12 8 Data types for the parameters Parameter and type Data type Description REQ IN Bool Activate the configuration change on rising edge of this input Default value False PORT IN PORT After you install and configure a CM or CB communication device the...

Page 535: ...execution after the last request was completed with no error ERROR OUT Bool TRUE for one execution after the last request was completed with an error STATUS OUT Word Execution condition code Default value 0 Table 12 9 Condition codes STATUS W 16 Description 80A0 Specific protocol does not exist 80A1 Specific baud rate does not exist 80A2 Specific parity option does not exist 80A3 Specific number o...

Page 536: ... RTS before any Tx data transmission occurs This parameter is only valid when hardware flow control is enabled The valid range is 0 65535 ms A value of 0 disables the feature Default value 0 RTSOFFDLY IN UInt Number of milliseconds to wait after the Tx data transmission occurs before RTS is disabled This parameter is only valid when hardware flow control is enabled The valid range is 0 65535 ms A ...

Page 537: ...or more information Table 12 14 Data types for the parameters Parameter and type Data type Description REQ IN Bool Activate the configuration change on the rising edge of this input Default value False PORT IN PORT After you install and configure a CM or CB communication device the port identifier appears in the parameter helper drop list available at the PORT box connection The assigned CM or CB ...

Page 538: ... the start character condition Default value B 16 2 STRSEQ1CTL IN Byte Sequence 1 ignore compare control for each character Default value B 16 0 These are the enabling bits for each character in start sequence 01H Character 1 02H Character 2 04H Character 3 08H Character 4 10H Character 5 Disabling the bit associated with a character means any character will match in this sequence position STRSEQ1...

Page 539: ...6 Start conditions Start condition First Character First Character 1 First Character 2 First Character 3 First Character 4 1 68H xx xx 68H xx 2 10H aaH xx xx xx 3 dcH aaH xx xx xx 4 e5H xx xx xx xx End conditions for the RCV_PTP instruction The end of a message is determined by the specification of end conditions The end of a message is determined by the first occurrence of one or more configured ...

Page 540: ... LEN M end condition 0 to 255 bytes RCVTIME IN UInt 200 Specify how long to wait for the first character to be received The receive operation will be terminated with an error if a character is not successfully received within the specified time This is only used with the response time condition 0 to 65535 bit times with an 8 second maximum This parameter is not a message end condition since evalua...

Page 541: ...is not 1 2 or 4 80C6 Calculated length is enabled and M value is 255 80C7 Calculated length is enabled and calculated length is 1024 80C8 Response timeout is enabled and response timeout is zero 80C9 Inter character gap timeout is enabled and it is zero 80CA Idle line timeout is enabled and it is zero 80CB End sequence is enabled but all chars are don t care 80CC Start sequence any one of 4 is ena...

Page 542: ...or CB Default value False FALSE user program controlled point to point operations only valid option DONE OUT Bool TRUE for one scan after the last request was completed with no error ERROR OUT Bool TRUE for one scan after the last request was completed with an error STATUS OUT Word Execution condition code Default value 0 While a transmit operation is in progress the DONE and ERROR outputs are FAL...

Page 543: ... while transmitter active 80D1 Transmit aborted because of no CTS within wait time 80D2 Transmit aborted because of no DSR from the DCE device 80D3 Transmit aborted because of queue overflow transmit more than 1024 bytes 80D5 Reverse bias signal wire break condition 833A The DB for the BUFFER parameter does not exist Interaction of the LENGTH and BUFFER parameters for SEND_PTP The minimum size of ...

Page 544: ... structure Array The LENGTH value must contain a byte count that is less than the complete byte length of the array and which must be a multiple of the data element byte count For example the LENGTH parameter for an array of Words must be a multiple of two and for an array of Reals a multiple of four When LENGTH is specified the number of array elements which are contained in LENGTH bytes is trans...

Page 545: ...nt Length of the returned message in bytes Default value 0 The STATUS value is valid when either NDR or ERROR is TRUE The STATUS value provides the reason for termination of the receive operation in the CM or CB This is typically a positive value indicating that the receive operation was successful and that the receive process terminated normally If the STATUS value is negative the Most Significan...

Page 546: ...arameters Parameter and type Data type Description REQ IN Bool Activates the receiver reset on the rising edge of this enable input Default value False PORT IN PORT After you install and configure a CM or CB communication device the port identifier appears in the parameter helper drop list available at the PORT box connection The assigned CM or CB port value is the device configuration property ha...

Page 547: ...pears in the parameter helper drop list available at the PORT box connection The assigned CM or CB port value is the device configuration property hardware identifier The port symbolic name is assigned in the System constants tab of the PLC tag table NDR OUT Bool TRUE for one scan when new data is ready and the operation is complete with no errors ERROR OUT Bool TRUE for one scan after the operati...

Page 548: ...r you install and configure a CM or CB communication device the port identifier appears in the parameter helper drop list available at the PORT box connection The assigned CM or CB port value is the device configuration property hardware identifier The port symbolic name is assigned in the System constants tab of the PLC tag table Default value 0 SIGNAL IN Byte Selects which signal to set multiple...

Page 549: ...P transition Use the PORT_CFG Page 534 SEND_CFG Page 535 and RCV_CFG Page 537 instructions to set the parameters The port settings set by the instructions are valid while the CPU is in RUN mode The port settings revert to the device configuration settings after a STOP transition or power cycle After configuring the hardware devices Page 109 you configure parameters for the communication interfaces...

Page 550: ...If you select software flow control you can define the XON and XOFF characters The RS485 communication interfaces do not support flow control Wait time Wait time specifies the time that the CM or CB waits to receive CTS after asserting RTS or for receiving an XON after receiving an XOFF depending on the type of flow control If the wait time expires before the communication interface receives an ex...

Page 551: ...s a clear to send The modem only transmits to the CM when RTS is active that is when the telephone modem sees an active CTS If RTS is inactive the telephone module does not transmit to the CM To allow the modem to send data to the CM at any time configure RTS always on hardware flow control The CM thus sets the RTS signal active all the time The CM will not set RTS inactive even if the module cann...

Page 552: ...iguration of transmitted message properties for the selected interface You can also dynamically configure or change the transmit message parameters from the user program by using the SEND_CFG Page 535 instruction Note Parameter values set from the SEND_CFG instruction in the user program override the port configuration settings Note that the CPU does not retain parameters set from the SEND_CFG ins...

Page 553: ...art of and the end of a message Specify these parameters in the Receive message configuration for the selected interface You can also dynamically configure or change the receive message parameters from the user program by using the RCV_CFG instruction Page 537 Note Parameter values set from the RCV_CFG instruction in the user program override the port configuration settings Note that the CPU does ...

Page 554: ...STX Special condition Recognize message start with a character sequence Specifies that a particular character sequence from up to four configured sequences indicates the start of a message For each sequence you can specify up to five characters For each character position you specify either a specific hex character or that the character is ignored in sequence matching wild card character The last ...

Page 555: ...Point to Point PtP communication S7 1200 Programmable controller System Manual 11 2011 A5E02486680 05 555 Sample configuration start message on one of two character sequences Consider the following start message condition configuration ...

Page 556: ...s begins after the second 0x6A is received 3 characters The character preceding the first 0x6A is included in the start condition Example sequences that would satisfy this start condition are any character 6A 6A 6A 12 14 18 1C 6A 44 A5 D2 1C Message end conditions You also configure how the communication interface recognizes the end of a message You can configure multiple message end conditions If...

Page 557: ...out The message end occurs when the configured amount of time to wait for a response expires before a valid start sequence is received The response timeout period begins when a transmission ends and the CM or CB begins the receive operation The default response timeout is 200 ms and the range is 0 to 65535 ms If a character is not received within the response time period RCVTIME then an error is r...

Page 558: ...n is combined with timeout end conditions and the timeout condition occurs any valid received characters are provided even if the maximum length is not reached This allows support for varying length protocols when only the maximum length is known Read message length from message The message itself specifies the length of the message The message end occurs when a message of the specified length has...

Page 559: ...tisfy the end condition Specification of message length within the message When you select the special condition where the message length is included in the message you must provide three parameters that define information about the message length The actual message structure varies according to the protocol in use The three parameters are as follows n the character position 1 based within the mes...

Page 560: ...l Characters 5 to 10 counted by length SD1 Len n Len n SD2 DA SA FA Data unit 3 bytes FCS ED 1 2 3 4 5 6 7 8 9 10 11 12 xx 0x06 0x06 xx xx xx xx xx xx xx xx xx Configure the receive message length parameters for this message as follows n 3 The message length starts at byte 3 Length size 1 The message length is defined in one byte Length m 3 There are three characters following the length specifier...

Page 561: ...nsmissions and receptions SEND_PTP and RCV_PTP can execute concurrently The communication modules and communication board buffer the transmit and receive messages as necessary up to a maximum buffer size of 1024 bytes The CMs and CB send messages to and receive messages from the actual point to point devices The message protocol is in a buffer that is either received from or sent to a specific com...

Page 562: ...r program services the request and generates a response 4 Use a SEND_PTP instruction to send the response back to the master 5 Repeatedly execute SEND_PTP to be sure the transmit occurs 6 Go to step 1 and repeat the cycle The slave must be responsible for calling RCV_PTP frequently enough to receive a transmission from the master before the master times out while waiting for a response To accompli...

Page 563: ... already has pins 2 and 3 swapped You can usually identify a NULL modem cable as one with two female 9 pin D connector ends 12 3 5 1 Configuring the communication module You can configure the CM 1241 from the Device configuration in STEP 7 or with user program instructions This example uses the Device configuration method Port configuration Click the communication port of the CM module from the De...

Page 564: ...Receive message end configuration Configure the CM 1241 to end a message when it receives a maximum of 100 bytes or a linefeed character 10 decimal or A hexadecimal The end sequence allows up to five end characters in sequence The fifth character in the sequence is the linefeed character The preceding four end sequence characters are don t care or unselected characters The CM 1241 does not evaluat...

Page 565: ... add the data block configuration and program OB1 as described below Global data block Comm_Buffer Create a global data block DB and name it Comm_Buffer Create one value in the data block called buffer with a data type of array 0 99 of byte Network 1 Enable the RCV_PTP instruction whenever SEND_PTP is not active Tag_8 at MW20 0 indicates when sending is complete in Network 4 and when the communica...

Page 566: ...of SEND_PTP and reset the transmit flag Tag_8 at M20 0 when the transmit operation is complete When the transmit flag is reset the RCV_PTP instruction in Network 1 is enabled to receive the next message 12 3 5 3 Configuring the terminal emulator You must set up the terminal emulator to support the example program You can use most any terminal emulator on your PC such as HyperTerminal Make sure tha...

Page 567: ...ons control the operation of motor drives which support the universal serial interface USS protocol You can use the USS instructions to communicate with multiple drives through RS485 connections to CM 1241 RS485 communication modules or a CB 1241 RS485 communication board Up to three CM 1241 RS485 modules and one CB 1241 RS485 board can be installed in a S7 1200 CPU Each RS485 port can operate up ...

Page 568: ...nt USS network Each USS network is managed using a unique data block All instructions associated with a single USS network must share this data block This includes all USS_DRV USS_PORT USS_RPM and USS_WPM instructions used to control all drives on a single USS network The USS_DRV instruction is a Function Block FB When you place the USS_DRV instruction into the program editor you will be prompted ...

Page 569: ...S_WPM in a higher priority OB than the corresponding USS_PORT instruction For example do not place the USS_PORT in the main and a USS_RPM in a cyclic interrupt OB Failure to prevent interruption of USS_PORT execution may produce unexpected errors The USS_RPM and USS_WPM functions read and write the remote drive operating parameters These parameters control the internal operation of the drive See t...

Page 570: ... STATUS _word_out_ RUN_EN _bool_out_ D_DIR _bool_out_ INHIBIT _bool_out_ FAULT _bool_out_ SPEED _real_out_ STATUS1 _word_out_ STATUS3 _word_out_ STATUS4 _word_out_ STATUS5 _word_out_ STATUS6 _word_out_ STATUS7 _word_out_ STATUS8 _word_out_ The USS_DRV instruction exchanges data with a drive by creating request messages and interpreting the drive response messages A separate function block should b...

Page 571: ...er configurable parameter on the drive You must configure this on the drive optional parameter CTRL4 IN Word Control word 4 A value written to a user configurable parameter on the drive You must configure this on the drive optional parameter CTRL5 IN Word Control word 5 A value written to a user configurable parameter on the drive You must configure this on the drive optional parameter CTRL6 IN Wo...

Page 572: ...gurable status word on the drive When the initial USS_DRV execution occurs the drive indicated by the USS address parameter DRIVE is initialized in the Instance DB After this initialization subsequent executions of USS_PORT can begin communication to the drive at this drive number Changing the drive number requires a CPU STOP to RUN mode transition that initializes the instance DB Input parameters...

Page 573: ... PLC tag table BAUD IN DInt The baud rate used for USS communication USS_DB INOUT USS_BASE The name of the instance DB that is created and initialized when a USS_DRV instruction is placed in your program ERROR OUT Bool When true this output indicates that an error has occurred and the STATUS output is valid STATUS OUT Word The status value of the request indicates the result of the scan or initial...

Page 574: ... UInt Parameter number PARAM designates which drive parameter is written The range of this parameter is 0 to 2047 On some drives the most significant byte can access PARAM values greater than 2047 See your drive manual for details on how to access an extended range INDEX IN UInt Parameter index INDEX designates which Drive Parameter index is to be written A 16 bit value where the Least Significant...

Page 575: ...ic drive becomes available for use Immediately calling a USS_RPM or USS_WPM FC for the specified motor drive will result in a 0x818A error 12 4 5 USS_WPM instruction Note EEPROM write operations for the EEPROM inside a USS drive Do not overuse the EEPROM permanent write operation Minimize the number of EEPROM write operations to extend the EEPROM life Table 12 42 USS_WPM instruction LAD FBD SCL De...

Page 576: ...s set when USS_DRV sees the write response data from the drive This bit is reset when either you request the response data via another USS_RPM poll or on the second of the next two calls to USS_DRV ERROR OUT Bool When true ERROR indicates that an error has occurred and the STATUS output is valid All other outputs are set to zero on an error Communication errors are only reported on the USS_PORT in...

Page 577: ...ized This error code is returned to USS_RPM or USS_WPM when USS_DRV for that drive has not been called at least once This keeps the initialization on first scan of USS_DRV from overwriting a pending parameter read or write request since it initializes the drive as a new entry To fix this error call USS_DRV for this drive number 80Ax 80Fx Specific errors returned from PtP communication FBs called b...

Page 578: ...e value is only valid for the last execution of a USS_RPM or USS_WPM instruction The drive error code is put into USS_Extended_Error variable when the STATUS code value is hexadecimal 818C The error code value of USS_Extended_Error depends on the drive model See the drive s manual for a description of the extended error codes for read and write parameter operations 12 4 7 General drive setup infor...

Page 579: ...urrent flows The shield must be tied to chassis ground or pin 1 on the 9 pin connector It is recommended that you tie wiring terminal 2 0V on the MicroMaster drive to chassis ground The two wires at the opposite end of the RS 485 cable must be inserted into the MM4 drive terminal blocks To make the cable connection on a MM4 drive remove the drive cover s to access the terminal blocks See the MM4 u...

Page 580: ... length P2013 Index 0 4 2 Enable the read write access to all parameters Expert mode P0003 3 3 Check the motor settings for your drive The settings will vary according to the motor s being used To set the parameters P304 P305 P307 P310 and P311 you must first set parameter P010 to 1 quick commissioning mode When you are finished setting the parameters set parameter P010 to 0 Parameters P304 P305 P...

Page 581: ...0 0 to 65 535 ms 0 timeout disabled 13 Transfer the data from RAM to EEPROM P0971 1 Start transfer Save the changes to the parameter settings to EEPROM 12 5 Modbus communication 12 5 1 Overview of Modbus RTU and TCP communication Modbus function codes A CPU operating as a Modbus RTU master or Modbus TCP client can read write both data and I O states in a remote Modbus RTU slave or Modbus TCP serve...

Page 582: ...on Extended station address 1 to 65535 TCP station Station address IP address and port number Modbus memory addresses The actual number of Modbus memory addresses available depends on the CPU model how much work memory exists and how much CPU memory is used by other program data The table below gives the nominal value of the address range Table 12 48 Modbus memory addresses Station Address range S...

Page 583: ...sult in an error A Modbus TCP client master must control the client server connection with the DISCONNECT parameter The basic Modbus client actions are shown below 1 Initiate a connection to a particular server slave IP address and IP port number 2 Initiate client transmission of a Modbus messages and receive the server responses 3 When desired initiate the disconnection of client and server to en...

Page 584: ... Request to communicate with a Modbus TCP server DISCONNECT IN Bool The DISCONNECT parameter allows your program to control connection and disconnection with a Modbus server device If DISCONNECT 0 and a connection does not exist then MB_CLIENT attempts to make a connection to the assigned IP address and port number If DISCONNECT 1 and a connection exists then a disconnect operation is attempted Wh...

Page 585: ...TRUE STATUS OUT Word Execution condition code REQ parameter FALSE No Modbus communication request TRUE Request to communicate with a Modbus TCP server If no instance of MB_CLIENT is active and parameter DISCONNECT 0 when REQ 1 a new Modbus request will start If the connection is not already established then a new connection will be made If the same instance of MB_CLIENT is executed again with DISC...

Page 586: ... to 125 words per request 40001 to 49999 or 400001 to 465535 0 04 1 to 125 Read input words 1 to 125 words per request 30001 to 39999 1 05 1 Write one output bit One bit per request 1 to 9999 1 06 1 Write one holding register 1 word per request 40001 to 49999 or 400001 to 465535 1 15 2 to 1968 Write multiple output bits 2 to 1968 bits per request 1 to 9999 1 16 2 to 123 Write multiple holding regi...

Page 587: ... M1000 0 WORD 500 MB_DATA_PTR assigns a communication buffer MB_CLIENT communication functions Read and write 1 bit data from Modbus server addresses 00001 to 09999 Read 1 bit data from Modbus server addresses 10001 to 19999 Read 16 bit word data from Modbus server addresses 30001 to 39999 and 40001 to 49999 Write 16 bit word data to Modbus server addresses 40001 to 49999 Word or bit sized data is...

Page 588: ...Unique IP port numbers may or may not be required depending upon the server configuration The Connection ID must be unique for each individual connection This means a single unique Connection ID must only be used with each individual instance DB In summary the instance DB and the Connection ID are paired together and must be unique for every connection Table 12 52 MB_CLIENT user accessible static ...

Page 589: ...assigned time MB_CLIENT must receive a response using the transaction ID that was originally transmitted within the assigned time or this error is returned Check the connection to the Modbus server device This error is only reported after any configured retries if applicable have been attempted 8188 Invalid mode value 8189 Invalid data address value 818A Invalid data length value 818B Invalid poin...

Page 590: ...lows your program to control when a connection is accepted Whenever this input is enabled no other operation will be attempted CONNECT_ID IN UInt CONNECT_ID uniquely identifies each connection within the PLC Each unique instance of the MB_CLIENT or MB_SERVER instruction must contain a unique CONNECT_ID parameter IP_PORT IN UInt Default value 502 The IP port number that identifies the IP port that ...

Page 591: ...e words in a Modbus holding register which can be an M memory address range or a data block The type of holding register is specified by the MB_HOLD_REG parameter Note MB_HOLD_REG parameter assignment The Modbus Holding Register can be in a standard global DB or a M memory address For A Modbus holding register in M memory use the standard Any Pointer format This is in the format P Bit Address Data...

Page 592: ...odbus diagnostic functions Codes Sub function Description 08 0x0000 Return query data echo test The MB_SERVER will echo back to a Modbus client a word of data that is received 08 0x000A Clear communication event counter The MB_SEVER will clear out the communication event counter that is used for Modbus function 11 11 Get communication event counter The MB_SERVER uses an internal communication even...

Page 593: ...g PLC memory address of the holding register However you can configure the HR_Start_Offset variable to start the beginning Modbus holding register address at another value instead of 40001 For example if the holding register is configured to start at MW100 and is 100 words long An offset of 20 specifies a beginning holding register address of 40021 instead of 40001 Any address below 40021 and abov...

Page 594: ...e is reported on the first execution of a connect or disconnect operation 7002 MB_SERVER is waiting for a Modbus client to connect to the assigned TCP port This code is reported for any subsequent executions while waiting for completion of a connect or disconnect operation 7003 A disconnect operation has successfully completed Only valid for one PLC scan 8187 Invalid pointer to MB_HOLD_REG area is...

Page 595: ...ver connections To accomplish this MB_SERVER must be independently executed for each connection Each connection must use an independent instance DB connection ID and IP port The S7 1200 allows only one connection per IP port For best performance MB_SERVER should be executed every cycle for each connection Network 1 Connection 1 with independent IP_PORT connection ID and instance DB Network 2 Conne...

Page 596: ...n To accomplish this use the same instance DB connection ID and port number Only 1 client can be active at any given time Once a client completes its execution the next client begins execution Your program is responsible for the order of execution The example shows both clients writing to the same memory area Also a returned error is captured which is optional Network 1 Modbus function 1 Read 16 o...

Page 597: ...ferent instance DBs IP addresses and connection IDs must be used The port number must be different if the connections are established to the same Modbus server If the connections are on different servers there is no port number restriction The example shows both clients writing to the same memory area Also a returned error is captured which is optional Network 1 Modbus function 4 Read input words ...

Page 598: ...7 1200 output image bits 12 5 2 7 MB_CLIENT example 4 Coordinating multiple requests You must ensure that each individual Modbus TCP request finishes execution This coordination must be provided by your program The example below shows how the outputs of the first and second client requests can be used to coordinate execution The example shows both clients writing to the same memory area Also a ret...

Page 599: ...s instructions must have the same major version number 1 x 2 y or V z The individual instructions within a major version group may have different minor versions 1 x Click the icon on the instruction tree task card to enable the headers and columns of the instruction tree To change the version of the Modbus instructions select the version from the drop down list You can select the group or individu...

Page 600: ...struction in your program Table 12 64 Data types for the parameters Parameter and type Data type Description REQ IN Bool A low to high positive edge signal starts the operation Version 2 0 only PORT IN Port After you install and configure a CM or CB communication device the port identifier appears in the parameter helper drop list available at the PORT box connection The assigned CM or CB port val...

Page 601: ...r MB_MASTER is placed in your program the DB identifier appears in the parameter helper drop list available at the MB_DB box connection DONE OUT Bool The DONE bit is TRUE for one scan after the last request was completed with no error Version 2 0 only ERROR OUT Bool The ERROR bit is TRUE for one scan after the last request was terminated with an error The error code value at the STATUS parameter i...

Page 602: ...for this parameter is added to the Modbus default of 35 bit times 3 5 character times RETRIES Word Number of retries that the master will attempt before returning the no response error code 0x80C8 Table 12 66 MB_COMM_LOAD execution condition codes 1 STATUS W 16 Description 0000 No error 8180 Invalid port ID value wrong port hardware identifier for communication module 8181 Invalid baud rate value ...

Page 603: ...xtended addressing range 1 to 65535 The value of 0 is reserved for broadcasting a message to all Modbus slaves Modbus function codes 05 06 15 and 16 are the only function codes supported for broadcast MODE IN USInt Mode Selection Specifies the type of request read write or diagnostic See the Modbus functions table below for details DATA_ADDR IN UDInt Starting Address in the slave Specifies the sta...

Page 604: ...l instance is active any call to any other instance with the REQ input enabled will result in an error If the continuous execution of the original instance stops the request state remains active for a period of time specified by the static variable Blocked_Proc_Timeout Once this period of time expires the next master instruction called with an enabled REQ input will become the active instance This...

Page 605: ...e holding register 1 word per request 40001 to 49999 or 400001 to 465535 1 15 2 to 1968 2 to 1960 1 Write multiple output bits 2 to 1960 or 1968 bits per request 1 to 9999 1 16 2 to 123 2 to 122 1 Write multiple holding registers 2 to 122 or 123 words per request 40001 to 49999 or 400001 to 465535 2 15 1 to 1968 2 to 1960 1 Write one or more output bits 1 to 1960 or 1968 bits per request 1 to 9999...

Page 606: ... addresses 40001 to 49999 and 400001 to 465536 Standard array of WORD UINT or INT data types Named WORD UINT or INT structure where each element has a unique name and 16 bit data type Named complex structure where each element has a unique name and a 16 or 32 bit data type For bit reads and writes of Modbus addresses 00001 to 09999 and bit reads of 10001 to 19999 Standard array of Boolean data typ...

Page 607: ...Modbus extended addressing Page 608 Condition codes Table 12 71 MB_MASTER execution condition codes communication and configuration errors 1 STATUS W 16 Description 0000 No error 80C8 Slave timeout Check baud rate parity and wiring of slave 80D1 The receiver issued a flow control request to suspend an active transmission and never re enabled the transmission during the specified wait time This err...

Page 608: ...rect The write request returned by the slave does not match what the master actually sent 1 In addition to the MB_MASTER errors listed above errors can be returned from the underlying PtP communication instructions See also Point to Point instructions Page 532 12 5 3 3 MB_SLAVE Table 12 73 MB_SLAVE instruction LAD FBD SCL Description MB_SLAVE_DB MB_ADDR _uint_in_ NDR _bool_out_ DR _bool_out_ ERROR...

Page 609: ... read and write bits and words directly in the input process image and output process image of the CPU For these function codes the MB_HOLD_REG parameter must be defined as a data type larger than a byte The following table shows the example mapping of Modbus addresses to the process image in the CPU Table 12 75 Mapping of Modbus addresses to the process image Modbus functions S7 1200 Codes Functi...

Page 610: ...B10 DBW8 MW128 DB10 DBW58 Recipe ingredient 5 Table 12 77 Diagnostic functions S7 1200 MB_SLAVE Modbus diagnostic functions Codes Sub function Description 08 0000H Return query data echo test The MB_SLAVE will echo back to a Modbus master a word of data that is received 08 000AH Clear communication event counter The MB_SLAVE will clear out the communication event counter that is used for Modbus fu...

Page 611: ... cycle OB Executing MB_SLAVE from a cyclic interrupt OB is possible but is not recommended because of the potential for excessive time delays in the interrupt routine to temporarily block the execution of other interrupt routines Modbus signal timing MB_SLAVE must be executed periodically to receive each request from the Modbus master and then respond as required The frequency of execution for MB_...

Page 612: ...am can write values to the HR_Start_Offset and Extended_Addressing variables and control Modbus slave operations The other variables can be read to monitor Modbus status HR_Start_Offset Modbus holding register addresses begin at 40001 or 400001 These addresses correspond to the beginning PLC memory address of the holding register However you can configure the HR_Start_Offset variable to start the ...

Page 613: ...xcept that the Extended_Addressing variable is a boolean value The boolean value must be written by an output coil and not a move box Modbus slave addressing can be configured to be either a single byte which is the Modbus standard or double byte Extended addressing is used to address more than 247 devices within a single network Selecting extended addressing allows you to address a maximum of 640...

Page 614: ...e message was terminated as a result of an overrun error 80E4 The message was terminated as a result of the specified length exceeding the total buffer size 8180 Invalid port ID value or error with MB_COMM_LOAD instruction 8186 Invalid Modbus station address 8187 Invalid pointer to MB_HOLD_REG DB Area is too small 818C Invalid MB_HOLD_REG pointer to M memory or DB DB area must allow both symbolic ...

Page 615: ...uld only be done when the serial port configuration will not change at runtime Network 1 Initialize the RS 485 module parameters only once during the first scan One MB_MASTER instruction is used in the program cycle OB to communicate with a single slave Additional MB_MASTER instructions can be used in the program cycle OB to communicate with other slaves or one MB_MASTER FB could be re used to com...

Page 616: ...rogrammable controller 616 System Manual 11 2011 A5E02486680 05 Network 3 This is an optional network that just shows the values of the first 3 words once the read operation is done Network 4 Write 64 bits to the output image register starting at slave address Q2 0 ...

Page 617: ...tion will change at runtime as a result of HMI configuration Network 1 Initialize the RS 485 module parameters each time they are changed by an HMI device MB_SLAVE shown below is placed in a cyclic OB that is executed every 10ms While this does not give the absolute fastest response by the slave it does provide good performance at 9600 baud for short messages 20 bytes or less in the request Networ...

Page 618: ...ommunication Inter station communication is possible only via a GSM network For communication between a remote station and a control room the control center must have a PC with Internet access The CP 1242 7 supports the following services for communication via the GSM network GPRS General Packet Radio Service The packet oriented service for data transmission GPRS is handled via the GSM network SMS...

Page 619: ...et the following requirements to be able to communicate via the GSM network A contract with a suitable GSM network provider If GPRS is used the contract must allow the use of the GPRS service If there is to be direct communication between stations only via the GSM network the GSM network provider must assign a fixed IP address to the CPs In this case communication between stations is not via the c...

Page 620: ...etween S7 1200 stations that communicate with each other and the telecontrol server is established in the master station Communication between the stations is via the telecontrol server The CP 1242 7 operates in Telecontrol mode Direct communication between the stations For direct communication between stations without the detour via the master station SIM cards with a fixed IP address are used th...

Page 621: ...a temporary connection to the telecontrol server In this case a connection to the telecontrol server is established only when required Logging the volume of data The volumes of data transferred are logged and can be evaluated for specific purposes Configuration and module replacement To configure the module the following configuration tool is required STEP 7 version V11 0 SP1 or higher For STEP 7 ...

Page 622: ...n siemens com WW view en 42330276 12 6 4 Accessories The ANT794 4MR GSM GPRS antenna The following antennas are available for use in GSM GPRS networks and can be installed both indoors and outdoors Quadband antenna ANT794 4MR Figure 12 1 ANT794 4MR GSM GPRS antenna Short name Order no Explanation ANT794 4MR 6NH9 860 1AA00 Quadband antenna 900 1800 1900 MHz UMTS weatherproof for indoor and outdoor ...

Page 623: ...ther information You will find detailed information in the device manual You will find this on the Internet on the pages of Siemens Industrial Automation Customer Support under the following entry ID 23119005 http support automation siemens com WW view en 23119005 12 6 5 Configuration examples for telecontrol Below you will find several configuration examples for stations with a CP 1242 7 Sending ...

Page 624: ...ter station This results in the following use cases Telecontrol communication between station and control center In this use case data from the field is sent by the stations to the telecontrol server in the master station via the GSM network and Internet The telecontrol server is used to control and monitor remote stations Communication between a station and a control center PC with OPC client As ...

Page 625: ... HG 3 DGGUHVVHV 356 Figure 12 5 Direct communication between two S7 1200 stations In this configuration two SIMATIC S7 1200 stations communicate directly with each other using the CP 1242 7 via the GSM network Each CP 1242 7 has a fixed IP address The relevant service of the GSM network provider must allow this TeleService via GPRS 6WDWLRQ 6 ಣ ZLWK 3 ಣ QJLQHHULQJ VWDWLRQ ZLWK 67 3 6 URXWHU QWHUQHW...

Page 626: ...ystem Manual 11 2011 A5E02486680 05 In TeleService via GPRS an engineering station on which STEP 7 is installed communicates via the GSM network and the Internet with a SIMATIC S7 1200 station with a CP 1242 7 The connection runs via a telecontrol server that serves as an intermediary and is connected to the Internet ...

Page 627: ...f the CPU from STOP to RUN and that a new TM_MAIL operation can be triggered 1 STEP 7 automatically creates the instance DB when you insert the instruction You start sending an e mail with a positive edge change from 0 to 1 at input parameter REQ The following table shows the relationship between BUSY DONE and ERROR You can monitor the progress of TM_MAIL execution and detect completion by evaluat...

Page 628: ... ADDR_MAIL_SERVER is read when the operation is started A new value does not take effect until the current operation is complete and a new TM_MAIL operation is initiated In contrast the parameters WATCH_DOG_TIME TO_S CC FROM SUBJECT TEXT ATTACHMENT USERNAME and PASSWORD are read during the execution of TM_MAIL and may be changed only when the job is finished BUSY 0 Configuring the TS Adapter IE pa...

Page 629: ...nated with an error The error code value at the STATUS output is valid only during the single scan where ERROR TRUE STATUS OUT Word Return value or error information of the TM_MAIL instruction ADDR_MAIL_SERVER Static DWord IP address input parameter of the mail server Specify as a data word in HEX format for example IP address 192 168 0 200 ADDR_MAIL_SERVER DW 16 C0A800C8 where 192 16 C0 168 16 A8...

Page 630: ...xamples TO_S wenna mydomain com ruby mydomain com CC admin mydomain com judy mydomain com FROM admin mydomain com The following rules must be used when entering these parameters The characters TO_S CC and FROM must be entered A space and an opening angle bracket must be the entered before each address An ending angle bracket must be entered after each address A comma character must be entered afte...

Page 631: ...ail server IP address ADDR_MAIL_SERVER or too little time WATCH_DOG_TIME for the connection It is also possible that the CPU has no connection to the network or the CPU configuration is incorrect 82xx 84xx 85xx The error message comes from the mail server and corresponds to error number 8 of the SMTP protocol See the second item in the note following this table 8450 Operation does not run Mailbox ...

Page 632: ... address does not generate a STATUS error for TM_MAIL In this case there is no guarantee that additional recipients with correctly specified e mail addresses will receive the e mail More information on SMTP error codes can be found on the Internet or in the error documentation for the mail server You can also read the last error message from the mail server The error message in stored in buffer1 o...

Page 633: ...ismatched modules Solid red indicates defective hardware MAINT Maintenance flashes whenever you insert a memory card The CPU then changes to STOP mode After the CPU has changed to STOP mode perform one of the following functions to initiate the evaluation of the memory card Change the CPU to RUN mode Perform a memory reset MRES Power cycle the CPU You can also use the LED instruction Page 282 to d...

Page 634: ... LED that indicates the status of the module Green indicates that the module is operational Red indicates that the module is defective or non operational Each analog SM provides an I O Channel LED for each of the analog inputs and outputs Green indicates that the channel has been configured and is active Red indicates an error condition of the individual analog input or output In addition each ana...

Page 635: ...ng and downloading program blocks Displaying diagnostics and the diagnostics buffer Page 640 Using a watch table Page 645 to test the user program by monitoring and modifying values Using a force table to force values in the CPU Page 647 To establish an online connection to a configured CPU click the CPU from the Project Navigation tree and click the Go online button from the Project View If this ...

Page 636: ...he Devices networks editor to assign names to your PROFINET devices if the devices have not already been assigned a name or if the name of the device is to be changed For each PROFINET IO device you must assign the same name to that device in both the STEP 7 project and using the Online diagnostics tool to the PROFINET IO device configuration memory for example an ET200 S interface module configur...

Page 637: ...ed PROFINET IO device and select Online diagnostics 2 In the Online diagnostics dialog make the following menu selections Functions Assign name Click the Accessible devices in the network icon to display all of the PROFINET IO devices on the network 3 In the list that is displayed click the required PROFINET IO device and click the Assign name button to write the name to the PROFINET IO device con...

Page 638: ...d date parameters of the online CPU Refer to the section on the IP address for more information Note This feature is available only for a CPU that either has only a MAC address has not yet been assigned an IP address or has been reset to factory settings 14 5 Resetting to factory settings You can reset an S7 1200 to its original factory settings under the following conditions No memory card is ins...

Page 639: ...he module is switched to STOP mode if necessary and it is reset to the factory settings The work memory and internal load memory and all operand areas are cleared All parameters are reset to their defaults The diagnostics buffer is cleared The time of day is reset The IP address is retained or deleted based on the setting you made The MAC address is fixed and is never changed 14 6 CPU operator pan...

Page 640: ...e CPU After connecting to the online CPU open the Online tools task card to view the following measurements Cycle time Memory usage 14 8 Displaying diagnostic events in the CPU Use the diagnostics buffer to review the recent activity in the CPU The diagnostics buffer is accessible from Online Diagnostics for an online CPU in the Project tree It contains the following entries Diagnostic events Chan...

Page 641: ...the diagnostic information 14 9 Comparing offline and online CPUs You can compare the code blocks in an online CPU with the code blocks in your project If the code blocks of your project do not match the code blocks of the online CPU the Compare editor allows you to synchronize your project with the online CPU by downloading the code blocks of your project to the CPU or by deleting blocks from the...

Page 642: ...ion about the program sequence and the data of the program in the CPU You can also use other functions to control the sequence and the data of the user program You can modify the value for the tags in the online CPU to see how the user program responds You can force a peripheral output such as Q0 1 P or Start P to a specific value You can enable outputs in STOP mode Note Always exercise caution wh...

Page 643: ...bles show the tags Watch tables can also show the tags as well as direct addresses To monitor the execution of the user program and to display the values of the tags click the Monitor all button in the toolbar The Monitor value field shows the value for each tag 14 10 2 Displaying status in the program editor You can monitor the status of the tags in the LAD and FBD program editors Use the editor ...

Page 644: ...lue column of the DB 1 In the DB editor click the Monitor all tags button The Monitor value column displays the current data values 2 Click the Show a snapshot of the monitored values button to display the current values in the Snapshot column 3 Click the Monitor all button to stop monitoring the data in the CPU 4 Copy a value in the Snapshot column for a tag Select a value to be copied Right clic...

Page 645: ...ollowing online functions Monitoring the status of the tags Modifying values for the individual tags You select when to monitor or modify the tag Beginning of scan cycle Reads or writes the value at the beginning of the scan cycle End of scan cycle Reads or writes the value at the end of the scan cycle Switch to stop To create a watch table 1 Double click Add new watch table to open a new watch ta...

Page 646: ...the scan cycle before the CPU writes the outputs Permanent Continuously collects data when the CPU transitions to STOP At transition to STOP Once Collects the data once after the CPU transitions to STOP For modifying a PLC tag at a given trigger select either the start or the end of cycle Modifying an output The best trigger event for modifying an output is at the end of the scan cycle immediately...

Page 647: ...Online menu or by right clicking the row of the Watch table You cannot enable outputs in STOP mode if you have configured distributed I O An error is returned when you try to do this Setting the CPU to RUN mode disables Enable peripheral outputs option If any inputs or outputs are forced the CPU is not allowed to enable outputs while in STOP mode The force function must first be cancelled 14 10 5 ...

Page 648: ... forced elements you must use STEP 7 to connect with the online CPU and then use the force table to turn off or stop the force function for those elements 14 10 5 2 Operation of the Force function The CPU allows you to force input and output point s by specifying the physical input or output address I_ P or Q_ P in the watch table and then starting the force function In the program reads of physic...

Page 649: ...igned I O point addresses cannot be modified by the force function of the watch table ཱ ུ ཱི ི Startup RUN A The clearing of the I memory area is not affected by the Force function While writing Q memory to the physical outputs the CPU applies the force value as the outputs are updated B The initialization of the outputs values is not affected by the Force function When reading the physical inputs ...

Page 650: ...ple change a parameter value You can debug a program more quickly with this feature for example invert the logic for a normally open or normally closed switch You can make the following program block and tag changes and download them in RUN mode Create overwrite and delete Functions FC Function Blocks FB and Tag tables Create and delete Data Blocks DB however DB structure changes cannot be overwri...

Page 651: ...u are running STEP 7 and the CPU The firmware of the target CPU must support the Download in RUN mode feature 14 11 2 Changing your program in RUN mode To change the program in RUN mode your must first ensure that the CPU supports Download in RUN mode and that the CPU is in RUN mode 1 To download your program in RUN mode select one of the following methods Download to device command from the Onlin...

Page 652: ...r one single block 1 If the user selects a single block for downloading from within the block editor then the only option in the Action column is Consistent download The user can expand the category line to be sure what blocks are to be loaded In this example a small change was made to the offline block and no other blocks need to be loaded 2 In this example more than one block is needed for downl...

Page 653: ... category line appears in the dialog 4 Click the Load button and the Load results dialog appears Click the Finish button to complete the download 14 11 4 Downloading a single selected block with a compile error in another block If the user attempts a consistent download with compile error in another block then the dialog will indicate an error and the load button will be disabled The user must cor...

Page 654: ...low 14 11 6 Downloading the program in RUN mode Before downloading the program in RUN mode consider the effect of a RUN mode modification on the operation of the CPU for the following situations If you deleted the control logic for an output the CPU maintains the last state of the output until the next power cycle or transition to STOP mode If you deleted a high speed counter or pulse output funct...

Page 655: ...ontrol or fragment in RUN mode Overwrite Organization Blocks OB however you cannot create or delete OBs A maximum number of ten blocks can be downloaded in RUN mode at one time If more than ten blocks are downloaded the CPU must be placed into STOP mode Once a download is initiated you cannot perform other tasks in STEP 7 until the download is complete Instructions that may fail due to Download in...

Page 656: ...controller 656 System Manual 11 2011 A5E02486680 05 In all cases the RLO output from the instruction will be false when the error occurs The error is temporary If it occurs the instruction should be retried later Note You must not retry the operation in the current execution of the OB ...

Page 657: ...le controllers listed in the Official Journals of the European Community EC Directive 2006 95 EC Low Voltage Directive Electrical Equipment Designed for Use within Certain Voltage Limits EN 61131 2 2007 Programmable controllers Equipment requirements and tests EC Directive 2004 108 EC EMC Directive Electromagnetic Compatibility Emission standard EN 61000 6 4 2007 Industrial Environment Immunity st...

Page 658: ...r CEC 18 150 Note The SM 1223 DI 8 x 120 230 VAC DQ 8 x Relay 6ES7 223 1QH30 0XB0 signal module is approved for use in Class 1 Division 2 Gas Group A B C D Temperature Class T4 Ta 40 C ATEX approval EN 60079 0 2006 Explosive Atmospheres General Requirements EN 60079 15 2005 Electrical Apparatus for potentially explosive atmospheres Type of protection n II 3 G Ex nA II T4 The following special cond...

Page 659: ...approvals related to specific markets and applications Consult your local Siemens representative if you need additional information related to the latest listing of exact approvals by part number Classification societies ABS American Bureau of Shipping BV Bureau Veritas DNV Det Norske Veritas GL Germanischer Lloyd LRS Lloyds Register of Shipping Class NK Nippon Kaiji Kyokai Note The CM 1242 5 PROF...

Page 660: ...stems 2 kV common mode 1kV differential mode For DC systems I O signals DC power systems external protection is required EN 61000 4 6 Conducted disturbances 150 kHz to 80 MHz 10 V RMS 80 AM at 1kHz EN 61000 4 11 Voltage dips AC systems 0 for 1 cycle 40 for 12 cycles and 70 for 30 cycles at 60 Hz Table A 3 Conducted and radiated emissions per EN 61000 6 4 Electromagnetic compatibility Conducted and...

Page 661: ... Panel Mount 7 0 mm from 5 9 Hz 2G from 9 to 150 Hz 10 sweeps each axis 1 octave per minute Table A 6 High potential isolation test High potential isolation test 24 V 5 V nominal circuits 115 230 V circuits to ground 115 230 V circuits to 115 230 V circuits 115 V 230V circuits to 24 V 5 V circuits 520 VDC type test of optical isolation boundaries 1 500 VAC routine test 1950 VDC type test 1 500 VAC...

Page 662: ...the 24 VDC power input ports in the S7 1200 system are interconnected with a common logic circuit connecting multiple M terminals For example the following circuits are interconnected when designated as not isolated in the data sheets the 24 VDC power supply of the CPU the power input for the relay coil of an SM or the power supply for a non isolated analog input All non isolated M terminals must ...

Page 663: ...0 4 30 VDC inductive load L R 7ms Rated Operating Current A A 2 CPU 1211C A 2 1 General specifications and features Table A 8 General specifications Technical data CPU 1211C AC DC Relay CPU 1211C DC DC Relay CPU 1211C DC DC DC Order number 6ES7 211 1BD30 0XB0 6ES7 211 1HD30 0XB0 6ES7 211 1AD30 0XB0 Dimensions W x H x D mm 90 x 100 x 75 90 x 100 x 75 90 x 100 x 75 Weight 420 grams 380 grams 370 gra...

Page 664: ... Single phase 3 at 100 kHz Quadrature phase 3 at 80 kHz Pulse outputs 2 2 Pulse catch inputs 6 Time delay cyclic interrupts 4 total with 1 ms resolution Edge interrupts 6 rising and 6 falling 10 and 10 with optional signal board Memory card SIMATIC Memory Card optional Real time clock accuracy 60 seconds month Real time clock retention time 10 days typ 6 days min at 40 C maintenance free Super Cap...

Page 665: ... interrupts 41 1 per event OB 200 to OB 65535 Hardware interrupts edges and HSC 50 1 per event OB 200 to OB 65535 Time error interrupts 1 OB 80 OBs Diagnostic error interrupts 1 OB 82 Type IEC Quantity Limited only by memory size Timers Storage Structure in DB 16 bytes per timer Type IEC Quantity Limited only by memory size Counters Storage Structure in DB size dependent upon count type SInt USInt...

Page 666: ...at max load 60 mA at 120 VAC 30 mA at 240 VAC 300 mA at 24 VDC 300 mA at 24 VDC Input current CPU with all expansion accessories at max load 180 mA at 120 VAC 90 mA at 240 VAC 900 mA at 24 VDC 900 mA at 24 VDC Inrush current max 20 A at 264 VAC 12 A at 28 8 VDC 12 A at 28 8 VDC Isolation input power to logic 1500 VAC Not isolated Not isolated Ground leakage AC line to functional earth 0 5 mA max H...

Page 667: ...inputs on simultaneously 6 Cable length meters 500 m shielded 300 m unshielded 50 m shielded for HSC inputs Table A 16 Digital outputs Technical data CPU 1211C AC DC Relay and DC DC Relay CPU 1211C DC DC DC Number of outputs 4 4 Type Relay dry contact Solid state MOSFET sourcing Voltage range 5 to 30 VDC or 5 to 250 VAC 20 4 to 28 8 VDC Logic 1 signal at max current 20 VDC min Logic 0 signal with ...

Page 668: ...hielded 1 For CPU models with relay outputs you must install a digital signal board SB to use the pulse outputs 2 Depending on your pulse receiver and cable an additional load resistor at least 10 of rated current may improve pulse signal quality and noise immunity A 2 3 Analog inputs Table A 17 Analog inputs Technical data Description Number of inputs 2 Type Voltage single ended Range 0 to 10 V F...

Page 669: ...uts of the CPU Rejection frequency Integration time selection Sample time 60 Hz 16 6 ms 4 17 ms 50 Hz 20 ms 5 ms 10 Hz 100 ms 25 ms A 2 3 3 Measurement ranges of the analog inputs for voltage Table A 20 Analog input representation for voltage System Voltage Measuring Range Decimal Hexadecimal 10 V 5 V 2 5 V 0 to 10 V 32767 7FFF 11 851 V 5 926 V 2 963 V 11 851 V 32512 7F00 Overflow Overflow 32511 7...

Page 670: ...ower Out For additional noise immunity connect M to chassis ground even if not using sensor supply For sinking inputs connect to M shown For sourcing inputs connect to M Table A 22 CPU 1211C DC DC Relay 6ES7 211 1HD30 0XB0 24 VDC Sensor Power Out For additional noise immunity connect M to chassis ground even if not using sensor supply For sinking inputs connect to M shown For sourcing inputs conne...

Page 671: ...or sourcing inputs connect to M Note Unused analog inputs should be shorted A 3 CPU 1212C A 3 1 General specifications and features Table A 24 General Technical data CPU 1212C AC DC Relay CPU 1212C DC DC Relay CPU 1212C DC DC DC Order number 6ES7 212 1BD30 0XB0 6ES7 212 1HD30 0XB0 6ES7 212 1AD30 0XB0 Dimensions W x H x D mm 90 x 100 x 75 90 x 100 x 75 90 x 100 x 75 Weight 425 grams 385 grams 370 g...

Page 672: ...rror interrupt events including FBs and FCs Signal modules expansion 2 SMs max Signal board expansion 1 SB max Communication module expansion 3 CMs max High speed counters 4 total Single phase 3 at 100 kHz and 1 at 30 kHz clock rate Quadrature phase 3 at 80 kHz and 1 at 20 kHz clock rate Pulse outputs 2 2 Pulse catch inputs 8 Time delay cyclic interrupts 4 total with 1 ms resolution Edge interrupt...

Page 673: ...upt or diagnostic error interrupt OB Blocks Monitoring Status of 2 code blocks can be monitored simultaneously Program cycle Multiple OB 1 OB 200 to OB 65535 Startup Multiple OB 100 OB 200 to OB 65535 Time delay interrupts and cyclic interrupts 41 1 per event OB 200 to OB 65535 Hardware interrupts edges and HSC 50 1 per event OB 200 to OB 65535 Time error interrupts 1 OB 80 OBs Diagnostic error in...

Page 674: ... with one additional Basic panel Table A 29 Power supply Technical data CPU 1212C AC DC Relay CPU 1212C DC DC Relay CPU 1212C DC DC DC Voltage range 85 to 264 VAC 20 4 to 28 8 VDC 20 4 to 28 8 VDC Line frequency 47 to 63 Hz CPU only 80 mA at 120 VAC 40 mA at 240 VAC 400 mA at 24 VDC 400 mA at 24 VDC Input current max load CPU with all expansion accessories 240 mA at 120 VAC 120 mA at 240 VAC 1200 ...

Page 675: ... VAC for 1 minute Isolation groups 1 Filter times 0 2 0 4 0 8 1 6 3 2 6 4 and 12 8 ms selectable in groups of 4 HSC clock input rates max Logic 1 Level 15 to 26 VDC Single phase 100 KHz Ia 0 to Ia 5 and 30 KHz Ia 6 to Ia 7 Quadrature phase 80 KHz Ia 0 to Ia 5 and 20 KHz Ia 6 to Ia 7 Number of inputs on simultaneously 8 Cable length meters 500 m shielded 300 m unshielded 50 m shielded for HSC input...

Page 676: ...oad 10 000 000 open close cycles Lifetime contacts at rated load 100 000 open close cycles Behavior on RUN to STOP Last value or substitute value default value 0 Last value or substitute value default value 0 Number of Outputs On simultaneously 6 6 Cable length meters 500 m shielded 150 m unshielded 500 m shielded 150 m unshielded 1 For CPU models with relay outputs you must install a digital sign...

Page 677: ...sponse of the built in analog inputs of the CPU Table A 34 Step Response ms 0V to 10V measured at 95 Rejection frequency Integration time Smoothing selection sample averaging 60 Hz 50 Hz 10 Hz None 1 cycle No averaging 63 ms 65 ms 130 ms Weak 4 cycles 4 samples 84 ms 93 ms 340 ms Medium 16 cycles 16 samples 221 ms 258 ms 1210 ms Strong 32 cycles 32 samples 424 ms 499 ms 2410 ms Sample time 4 17 ms...

Page 678: ...851 V 5 926 V 2 963 V 11 851 V 32512 7F00 Overflow Overflow 32511 7EFF 11 759 V 5 879 V 2 940 V 11 759 V 27649 6C01 Overshoot range Overshoot range 27648 6C00 10 V 5 V 2 5 V 10 V 20736 5100 7 5 V 3 75 V 1 875 V 7 5 V 1 1 361 7 μV 180 8 μV 90 4 μV 361 7 μV 0 0 0 V 0 V 0 V 0 V Rated range 1 FFFF 20736 AF00 7 5 V 3 75 V 1 875 V 27648 9400 10 V 5 V 2 5 V Rated range 27649 93FF 32512 8100 11 759 V 5 87...

Page 679: ...ower Out For additional noise immunity connect M to chassis ground even if not using sensor supply For sinking inputs connect to M shown For sourcing inputs connect to M Table A 38 CPU 1212C DC DC Relay 6ES7 212 1HD30 0XB0 24 VDC Sensor Power Out For additional noise immunity connect M to chassis ground even if not using sensor supply For sinking inputs connect to M shown For sourcing inputs conne...

Page 680: ...sourcing inputs connect to M Note Unused analog inputs should be shorted A 4 CPU 1214C A 4 1 General specifications and features Table A 40 General Technical data CPU 1214C AC DC Relay CPU 1214C DC DC Relay CPU 1214C DC DC DC Order number 6ES7 214 1BE30 0XB0 6ES7 214 1HE30 0XB0 6ES7 214 1AE30 0XB0 Dimensions W x H x D mm 110 x 100 x 75 110 x 100 x 75 110 x 100 x 75 Weight 475 grams 435 grams 415 g...

Page 681: ...ror interrupt events including FBs and FCs Signal modules expansion 8 SMs max Signal board expansion 1 SB max Communication module expansion 3 CMs max High speed counters 6 total Single phase 3 at 100 kHz and 3 at 30 kHz clock rate Quadrature phase 3 at 80 kHz and 3 at 20 kHz clock rate Pulse outputs 2 2 Pulse catch inputs 14 Time delay cyclic interrupts 4 total with 1 ms resolution Edge interrupt...

Page 682: ...upt or diagnostic error interrupt OB Blocks Monitoring Status of 2 code blocks can be monitored simultaneously Program cycle Multiple OB 1 OB 200 to OB 65535 Startup Multiple OB 100 OB 200 to OB 65535 Time delay interrupts and cyclic interrupts 41 1 per event OB 200 to OB 65535 Hardware interrupts edges and HSC 50 1 per event OB 200 to OB 65535 Time error interrupts 1 OB 80 OBs Diagnostic error in...

Page 683: ...ave up to three SIMATIC Basic panels connected to your CPU or you could have up to two SIMATIC Comfort panels with one additional Basic panel Table A 45 Power supply Technical data CPU 1214C AC DC Relay CPU 1214C DC DC Relay CPU 1214C DC DC DC Voltage range 85 to 264 VAC 20 4 to 28 8 VDC Line frequency 47 to 63 Hz CPU only 100 mA at 120 VAC 50 mA at 240 VAC 500 mA at 24 VDC Input current max load ...

Page 684: ...te Isolation groups 1 Filter times 0 2 0 4 0 8 1 6 3 2 6 4 and 12 8 ms selectable in groups of 4 HSC clock input rates max Logic 1 Level 15 to 26 VDC Single phase 100 KHz Ia 0 to Ia 5 and 30 KHz Ia 6 to Ib 5 Quadrature phase 80 KHz Ia 0 to Ia 5 and 20 KHz Ia 6 to Ib 5 Number of inputs on simultaneously 14 Cable length meters 500 m shielded 300 m unshielded 50 m shielded for HSC inputs Table A 48 D...

Page 685: ... max 2 Hz min 2 Lifetime mechanical no load 10 000 000 open close cycles Lifetime contacts at rated load 100 000 open close cycles Behavior on RUN to STOP Last value or substitute value default value 0 Number of Outputs On simultaneously 10 Cable length meters 500 m shielded 150 m unshielded 1 For CPU models with relay outputs you must install a digital signal board SB to use the pulse outputs 2 D...

Page 686: ...sponse of the built in analog inputs of the CPU Table A 50 Step Response ms 0V to 10V measured at 95 Rejection frequency Integration time Smoothing selection sample averaging 60 Hz 50 Hz 10 Hz None 1 cycle No averaging 63 ms 65 ms 130 ms Weak 4 cycles 4 samples 84 ms 93 ms 340 ms Medium 16 cycles 16 samples 221 ms 258 ms 1210 ms Strong 32 cycles 32 samples 424 ms 499 ms 2410 ms Sample time 4 17 ms...

Page 687: ...rshoot range 27648 6C00 10 V 5 V 2 5 V 10 V 20736 5100 7 5 V 3 75 V 1 875 V 7 5 V 1 1 361 7 μV 180 8 μV 90 4 μV 361 7 μV 0 0 0 V 0 V 0 V 0 V Rated range 1 FFFF 20736 AF00 7 5 V 3 75 V 1 875 V 27648 9400 10 V 5 V 2 5 V Rated range 27649 93FF 32512 8100 11 759 V 5 879 V 2 940 V Undershoot range 32513 80FF 32768 8000 11 851 V 5 926 V 2 963 V Underflow Negative values are not supported A 4 4 CPU 1214C...

Page 688: ...mmunity connect M to chassis ground even if not using sensor supply For sinking inputs connect to M shown For sourcing inputs connect to M Table A 55 CPU 1214C DC DC DC 6ES7 214 1AE30 0XB0 24 VDC Sensor Power Out For additional noise immunity connect M to chassis ground even if not using sensor supply For sinking inputs connect to M shown For sourcing inputs connect to M Note Unused analog inputs ...

Page 689: ...7 Digital inputs Model SM 1221 DI 8 x 24 VDC SM 1221 DI 16 x 24 VDC Number of inputs 8 16 Type Sink Source IEC Type 1 sink Sink Source IEC Type 1 sink Rated voltage 24 VDC at 4 mA nominal 24 VDC at 4 mA nominal Continuous permissible voltage 30 VDC max 30 VDC max Surge voltage 35 VDC for 0 5 sec 35 VDC for 0 5 sec Logic 1 signal min 15 VDC at 2 5 mA 15 VDC at 2 5 mA Logic 0 signal max 5 VDC at 1 m...

Page 690: ...s connect to M A 5 2 SM 1222 8 Point Digital Output Specifications Table A 59 General specifications Model SM 1222 DQ 8 x Relay SM 1222 DQ8 RLY Changeover SM 1222 DQ 8 x 24 VDC Order number 6ES7 222 1HF30 0XB0 6ES7 222 1XF30 0XB0 6ES7 222 1BF30 0XB0 Dimensions W x H x D mm 45 x 100 x 75 70 x 100 x 75 45 x 100 x 75 Weight 190 grams 310 grams 180 grams Power dissipation 4 5 W 5 W 1 5 W Current consu...

Page 691: ...o Isolation field side to logic 1500 VAC for 1 minute coil to contact None coil to logic 1500 VAC for 1 minute coil to contact 500 VAC for 1 minute Isolation resistance 100 MΩ min when new 100 MΩ min when new Isolation between open contacts 750 VAC for 1 minute 750 VAC for 1 minute Isolation groups 2 8 1 Current per common max 10 A 2 A 4 A Inductive clamp voltage L minus 48 V 1 W dissipation Switc...

Page 692: ...l at max current 20 VDC min Logic 0 signal with 10K Ω load 0 1 VDC max Current max 2 0 A 0 5 A Lamp load 30 W DC 200 W AC 5W ON state contact resistance 0 2 Ω max when new 0 6 Ω max Leakage current per point 10 μA max Surge current 7 A with contacts closed 8 A for 100 ms max Overload protection No No Isolation field side to logic 1500 VAC for 1 minute coil to contact None coil to logic 500 VAC for...

Page 693: ... 05 693 Model SM1222 DQ 16 x Relay SM1222 DQ 16 x 24 VDC Number of outputs on simultaneously 16 16 Cable length meters 500 m shielded 150 m unshielded 500 m shielded 150 m unshielded Table A 63 Wiring diagrams for the 8 point digital output SMs SM 1222 DQ 8 x Relay 6ES7 222 1HF30 0XB0 SM 1222 DQ 8 x 24 VDC 6ES7 222 1BF30 0XB0 ...

Page 694: ...anual 11 2011 A5E02486680 05 Table A 64 Wiring diagram for the 8 point digital output relay changeover SM SM 1222 DQ 8 x Relay Changeover 6ES7 222 1XF30 0XB0 Table A 65 Wiring diagrams for the 16 point digital output SMs SM 1222 DQ 16 x Relay 6ES7 222 1HH30 0XB0 SM 1222 DQ 16 x 24 VDC 6ES7 222 1BH30 0XB0 ...

Page 695: ...Model SM 1223 DI 8 x 24 VDC DQ 8 x Relay SM 1223 DI 16 x 24 VDC DQ 16 x Relay SM 1223 DI 8 x 24 VDC DQ 8 x 24 VDC SM 1223 DI 16 x 24 VDC DQ 16 x 24 VDC Number of inputs 8 16 8 16 Type Sink Source IEC Type 1 sink Rated voltage 24 VDC at 4 mA nominal Continuous permissible voltage 30 VDC max Surge voltage 35 VDC for 0 5 sec Logic 1 signal min 15 VDC at 2 5 mA Logic 0 signal max 5 VDC at 1 mA Isolati...

Page 696: ...max Overload protection No Isolation field side to logic 1500 VAC for 1 minute coil to contact None coil to logic 500 VAC for 1 minute Isolation resistance 100 MΩ min when new Isolation between open contacts 750 VAC for 1 minute Isolation groups 2 4 1 1 Current per common 10A 8 A 4 A 8 A Inductive clamp voltage L minus 48 V 1 W dissipation Switching delay 10 ms max 50 μs max off to on 200 μs max o...

Page 697: ...DC DQ 8 x Relay 6ES7 223 1PH30 0XB0 SM 1223 DI 16 x 24 VDC DQ 16 x Relay 6ES7 223 1PL30 0XB0 Notes For sinking inputs connect to M shown For sourcing inputs connect to M Table A 70 Wiring diagrams for the digital input VDC output SMs SM 1223 DI 8 x 24 VDC DQ 8 x 24 VDC 6ES7 223 1BH30 0XB0 SM 1223 DI 16 x 24 VDC DQ 16 x 24 VDC 6ES7 223 1BL30 0XB0 Notes For sinking inputs connect to M shown For sour...

Page 698: ...r output when on Table A 72 Digital inputs Model SM 1223 DI 8 x 120 230 VAC DQ 8 x Relay Number of inputs 8 Type IEC Type 1 Rated voltage 120 VAC at 6 mA 230 VAC at 9 mA Continuous permissible voltage 264 VAC Surge voltage Logic 1 signal min 79 VAC at 2 5 mA Logic 0 signal max 20 VAC at 1 mA Leakage current max 1 mA Isolation field side to logic 1500 VAC for 1 minute Isolation groups1 4 Input dela...

Page 699: ...side to logic 1500 VAC for 1 minute coil to contact None coil to logic Isolation resistance 100 MΩ min when new Isolation between open contacts 750 VAC for 1 minute Isolation groups 2 Current per common max 10 A Inductive clamp voltage Switching delay max 10 ms Maximum relay switching frequency 1 Hz Lifetime mechanical no load 10 000 000 open close cycles Lifetime contacts at rated load 1000 000 o...

Page 700: ... A 6 Analog signal modules SMs A 6 1 SM 1231 analog input module specifications Table A 75 General specifications Model SM 1231 AI 4 x 13 bit SM 1231 AI 8 x 13 bit Order number 6ES7 231 4HD30 0XB0 6ES7 231 4HF30 0XB0 Dimensions W x H x D mm 45 x 100 x 75 45 x 100 x 75 Weight 180 grams 180 grams Power dissipation 1 5 W 1 5 W Current consumption SM Bus 80 mA 90 mA Current consumption 24 VDC 45 mA 45...

Page 701: ...e 708 Resolution 12 bits sign bit Maximum withstand voltage current 35 V 40 mA Smoothing None weak medium or strong Refer to the section on step response times Page 707 Noise rejection 400 60 50 or 10 Hz Refer to the section on sample rates Page 707 Input impedance 9 MΩ voltage 280 Ω current Isolation field side to logic None Accuracy 25 C 0 to 55 C 0 1 0 2 of full scale Measuring principle Actual...

Page 702: ...inputs are configured for current mode no current will flow through the input unless you supply external power to the module A 6 2 SM 1232 analog output module specifications Table A 79 General specifications Technical data SM 1232 AQ 2 x 14 bit SM 1232 AQ 4 x 14 bit Order number 6ES7 232 4HB30 0XB0 6ES7 232 4HD30 0XB0 Dimensions W x H x D mm 45 x 100 x 75 45 x 100 x 75 Weight 180 grams 180 grams ...

Page 703: ...648 to 27 648 Current 0 to 27 648 Refer to the output ranges for voltage and current Page 708 Accuracy 25 C 0 to 55 C 0 3 0 6 of full scale Settling time 95 of new value Voltage 300 μS R 750 μS 1 uF Current 600 μS 1 mH 2 ms 10 mH Load impedance Voltage 1000 Ω Current 600 Ω Behavior on RUN to STOP Last value or substitute value default value 0 Isolation field side to logic none Cable length meters ...

Page 704: ... input output module specifications Table A 83 General specifications Technical data SM 1234 AI 4 x 13 bit AQ 2 x 14 bit Order number 6ES7 234 4HE30 0XB0 Dimensions W x H x D mm 45 x 100 x 75 Weight 220 grams Power dissipation 2 0 W Current consumption SM Bus 80 mA Current consumption 24 VDC 60 mA no load Table A 84 Analog inputs Model SM 1234 AI 4 x 13 bit AQ 2 x 14 bit Number of inputs 4 Type Vo...

Page 705: ... impedance 9 MΩ voltage 280 Ω current Isolation field side to logic None Accuracy 25 C 0 to 55 C 0 1 0 2 of full scale Analog to digital conversion time 625 μs 400 Hz rejection Common mode rejection 40 dB DC to 60 Hz Operational signal range Signal plus common mode voltage must be less than 12 V and greater than 12 V Cable length meters 100 m twisted and shielded Table A 85 Analog outputs Technica...

Page 706: ...s on outputs 24 VDC low voltage Yes 1 If a voltage greater than 30 VDC or less than 15 VDC is applied to the input the resulting value will be unknown and the corresponding overflow or underflow may not be active Table A 87 Wiring diagrams for the analog input output SM SM 1234 AI 4 x 13 Bit AQ 2 x 14 bit 6ES7 234 4HE30 0XB0 Note Unused analog inputs should be shorted When the inputs are configure...

Page 707: ...00 ms Weak 4 cycles 4 samples 9 ms 52 ms 63 ms 320 ms Medium 16 cycles 16 samples 32 ms 203 ms 241 ms 1200 ms Strong 32 cycles 32 samples 61 ms 400 ms 483 ms 2410 ms Sample time 4 channels 8 channels 0 625 ms 1 25 ms 4 17 ms 4 17 ms 5 ms 5 ms 25 ms 25 ms A 6 5 Sample time and update times for the analog inputs Table A 89 Sample time and update time Update time for all channels Rejection frequency ...

Page 708: ... FFFF 20736 AF00 7 5 V 3 75 V 1 875 V 27648 9400 10 V 5 V 2 5 V Rated range 27649 93FF 32512 8100 11 759 V 5 879 V 2 940 V Undershoot range 32513 80FF 32768 8000 11 851 V 5 926 V 2 963 V Underflow Negative values are not supported A 6 7 Output AQ measurement ranges for voltage and current SB and SM Table A 91 Analog output representation for current System Current Output Range Decimal Hexadecimal ...

Page 709: ...768 8000 See note 1 Underflow 1 In an overflow or underflow condition analog outputs will behave according to the device configuration properties set for the analog signal module In the Reaction to CPU STOP parameter select either Use substitute value or Keep last value A 7 Thermocouple and RTD signal modules SMs A 7 1 SM 1231 Thermocouple Table A 93 General specifications Model SM 1231 AI 4 x 16 ...

Page 710: ...to 24 VDC 500 VAC 500 VAC Isolation 24 VDC to logic 500 VAC 500 VAC Channel to channel 120 VAC 120 VAC Accuracy 25 C 0 to 55 C See Thermocouple selection table Page 712 See Thermocouple selection table Page 712 Repeatability 0 05 FS 0 05 FS Measuring principle Integrating Integrating Module update time See Noise reduction selection table Page 712 See Noise reduction selection table Page 712 Cold j...

Page 711: ...the thermocouple SMs SM 1231 AI 4 x TC 16 bit 6ES7 231 5QD30 0XB0 SM 1231 AI 8 x TC bit 6ES7 231 5QF30 0XB0 TC 2 3 4 and 5 not shown connected for clarity Note Unused analog inputs should be shorted The thermocouple unused channels can be deactivated No error will occur if an unused channel is deactivated A 7 1 1 Basic operation for a thermocouple Thermocouples are formed whenever two dissimilar m...

Page 712: ...ion The corrected sensor conversion is then linearized using the thermocouple tables For optimum operation of the cold junction compensation the thermocouple module must be located in a thermally stable environment Slow variation less than 0 1 C minute in ambient module temperature is correctly compensated within the module specifications Air movement across the module will also cause cold junctio...

Page 713: ...e Rejection frequency selection Integration time 4 Channel module update time seconds 8 Channel module update time seconds 400 Hz 2 5 ms 10 ms 1 0 143 0 285 60 Hz 16 6 ms 16 67 ms 0 223 0 445 50 Hz 20 ms 20 ms 0 263 0 525 10 Hz 100 ms 100 ms 1 225 2 450 1 To maintain module resolution and accuracy when 400 Hz rejection is selected the integration time is 10 ms This selection also rejects 100 Hz an...

Page 714: ...8000 238 0 32768 8000 Underflow1 1 Faulty wiring for example polarity reversal or open inputs or sensor error in the negative range for example wrong type of thermocouple may cause the thermocouple module to signal underflow A 7 2 SM 1231 RTD SM 1231 RTD specifications Table A 100 General specifications Technical data SM 1231 AI 4 x RTD x 16 bit SM 1231 AI 8 x RTD x 16 bit Order number 6ES7 231 5P...

Page 715: ... VAC Channel to channel isolation none none Accuracy See RTD Sensor selection table Page 717 See RTD Sensor selection table Page 717 Repeatability 0 05 FS 0 05 FS Maximum sensor dissipation 0 5m W 0 5m W Measuring principle Integrating Integrating Module update time See Noise reduction selection table Page 717 See Noise reduction selection table Page 717 Cable length meters 100 meters to sensor ma...

Page 716: ...be reported as decimal 253 The SM 1231 RTD module supports measurements with 2 wire 3 wire and 4 wire connections to the sensor resistor Table A 103 Wiring diagrams for the RTD SMs SM 1231 RTD 4 x 16 bit 6ES7 231 5PD30 0XB SM 1231 RTD 8 x 16 bit 6ES7 231 5PF30 0XB0 Loop back unused RTD inputs 2 wire RTD 3 wire RTD 4 wire RTD Note The RTD unused channels can be deactivated No error will occur if an...

Page 717: ... 200 Pt 500 Pt 0 003902 Pt 0 003916 Pt 0 003920 Pt 1000 243 0 C 200 0 C 850 0 C 1000 0 C 0 5 C 1 0 C Pt 10 273 2 C 240 0 C 1100 0 C 1295 C 1 0 C 2 0 C Pt 50 Pt 100 Pt 0 003910 Pt 500 273 2 C 240 0 C 1100 0 C 1295 C 0 8 C 1 6 C Ni 100 Ni 120 Ni 200 Ni 500 Ni 0 006720 Ni 0 006180 Ni 1000 105 0 C 60 0 C 250 0 C 295 0 C 0 5 C 1 0 C LG Ni 0 005000 LG Ni 1000 105 0 C 60 0 C 250 0 C 295 0 C 0 5 C 1 0 C N...

Page 718: ...0 Ω and 1000 Ω RTD ranges are used with other lower value resistors the error may increase to two times the specified error Best accuracy will be achieved for the 10 Ω RTD ranges if 4 wire connections are used The resistance of the connection wires in 2 wire mode will cause an error in the sensor reading and therefore accuracy is not guaranteed Table A 106 Noise reduction and update times for the ...

Page 719: ... your user program to accommodate the initialization time of the module Representation of Analog values for RTDs A representation of the digitized measured value for the RTD standard temperature range sensors are shown in the tables below Table A 107 Representation of analog values for resistance thermometers PT 100 200 500 1000 and PT 10 50 100 500 GOST 0 003850 standard Units Units Pt x00 standa...

Page 720: ...1 DI 4 x 24 VDC 200 kHz SB 1221 DI 4 x 5 VDC 200 kHz Number of inputs 4 4 Type Source Source Rated voltage 24 VDC at 7 mA nominal 5 VDC at 15 mA nominal Continuous permissible voltage 28 8 VDC 6 VDC Surge voltage 35 VDC for 0 5 sec 6 V Logic 1 signal min L minus 10 VDC at 2 9 mA L minus 2 0 VDC at 5 1 mA Logic 0 signal max L minus 5 VDC at 1 4 mA L minus 1 0 VDC at 2 2 mA HSC clock input rates max...

Page 721: ...wing options to improve the signal quality to the inputs Minimize the cable length Change a driver from a sink only driver to a sinking and sourcing driver Change to a higher quality cable Reduce the circuit components from 24 V to 5 V Add an external load at the input Table A 110 Wiring diagrams for the 200 kHz digital input SBs SB 1221 DI 4 x 24 VDC 200 kHz 6ES7 221 3BD30 0XB0 SB 1221 DI 4 x 5 V...

Page 722: ...1 Ω max 7 Ω max Off state resistance 6 Ω max 0 2 Ω max Leakage current per point Pulse Train Output rate 200 kHz max 2 Hz min 200 kHz max 2 Hz min Surge current 0 11 A 0 11 A Overload protection No No Isolation field side to logic 500 VAC for 1 minute 500 VAC for 1 minute Isolation groups 1 1 Currents per common 0 4 A 0 4 A Inductive clamp voltage None None Switching delay 1 5 μs 300 ns rise 1 5 μ...

Page 723: ...input Table A 113 Wiring diagrams for the 200 kHz digital output SBs SB 1222 DQ 4 x 24 VDC 200 kHz 6ES7 222 1BD30 0XB0 SB 1222 DQ 4 x 5 VDC 200 kHz 6ES7 222 1AD30 0XB0 For sourcing outputs connect Load to shown For sinking outputs connect Load to Because both sinking and sourcing configurations are supported by the same circuitry the active state of a sourcing load is opposite that of a sinking lo...

Page 724: ...C for 0 5 sec 6 V Logic 1 signal min L minus 10 VDC at 2 9 mA L minus 2 0 VDC at 5 1 mA Logic 0 signal max L minus 5 VDC at 1 4 mA L minus 1 0 VDC at 2 2 mA HSC clock input rates max Single phase 200 kHz Quadrature phase 160 kHz Single phase 200 kHz Quadrature phase 160 kHz Isolation field side to logic 500 VAC for 1 minute 500 VAC for 1 minute Isolation groups 1 no isolation to outputs 1 no isola...

Page 725: ...default value 0 Last value or substitute default value 0 Number of outputs on simultaneously 2 2 Cable length meters 50 shielded twisted pair 50 shielded twisted pair 1 Because both sinking and sourcing configurations are supported by the same circuitry the active state of a sourcing load is opposite that of a sinking load A source output exhibits positive logic Q bit and LED are ON when the load ...

Page 726: ...king load A source output exhibits positive logic Q bit and LED are ON when the load has current flow while a sink output exhibits negative logic Q bit and LED are OFF when the load has current flow If the module is plugged in with no user program the default for this module is 0 V which means that a sinking load will be turned ON A 8 4 SB 1223 2 X 24 VDC input 2 X 24 VDC output specifications Tab...

Page 727: ... VDC DQ 2 x 24 VDC Number of outputs 2 Output type Solid state MOSFET sourcing Voltage range 20 4 to 28 8 VDC Logic 1 signal at max current 20 VDC min Logic 0 signal with 10K Ω load 0 1 VDC max Current max 0 5 A Lamp load 5 W On state contact resistance 0 6 Ω max Leakage current per point 10 μA max Pulse Train Output PTO rate 20 KHz max 2 Hz min 1 Surge current 5 A for 100 ms max Overload protecti...

Page 728: ...S7 223 0BD30 0XB0 Supports sinking inputs only A 9 Analog signal boards SBs A 9 1 SB 1231 1 analog input specifications Note To use this SB your CPU firmware must be V2 0 or higher Table A 122 General specifications Technical data SB 1231 AI 1 x 12 bit Order number 6ES7 231 4HA30 0XB0 Dimensions W x H x D mm 38 x 62 x 21 mm Weight 35 grams Power dissipation 0 4 W Current consumption SM Bus 55 mA C...

Page 729: ...on for voltage and Analog input representation for current Page 733 Maximum withstand voltage current 35V 40 mA Smoothing None weak medium or strong refer to Analog input response times for step response time Page 733 Noise rejection 400 60 50 or 10 Hz refer to Analog input response times for sample rates Page 733 Accuracy 25 C 0 to 55 C 0 3 0 6 of full scale Input impedance Differential Common mo...

Page 730: ...1 analog output specifications Table A 126 General specifications Technical data SB 1232 AQ 1 x 12 bit Order number 6ES7 232 4HA30 0XB0 Dimensions W x H x D mm 38 x 62 x 21 mm Weight 40 grams Power dissipation 1 5 W Current consumption SM Bus 15 mA Current consumption 24 VDC 40 mA no load Table A 127 Analog outputs Technical data SB 1232 AQ 1 x 12 bit Number of outputs 1 Type Voltage or current Ra...

Page 731: ...cale Settling time 95 of new value Voltage 300 μS R 750 μS 1 uF Current 600 μS 1 mH 2 ms 10 mH Load impedance Voltage 1000 Ω Current 600 Ω Behavior on RUN to STOP Last value or substitute value default value 0 Isolation field side to logic None Cable length meters 100 m twisted and shielded Table A 128 Diagnostics Technical data SB 1232 AQ 1 x 12 bit Overflow underflow Yes Short to ground voltage ...

Page 732: ... 16 6 ms 50 Hz 20 ms 10 Hz 100 ms None 1 cycle No averaging 4 5 ms 18 7 ms 22 0 ms 102 ms Weak 4 cycles 4 samples 10 6 ms 59 3 ms 70 8 ms 346 ms Medium 16 cycles 16 samples 33 0 ms 208 ms 250 ms 1240 ms Strong 32 cycles 32 samples 63 0 ms 408 ms 490 ms 2440 ms Sample time 0 156 ms 1 042 ms 1 250 ms 6 250 ms A 9 3 2 Sample time and update times for the analog inputs Table A 131 Sample time and upda...

Page 733: ...FFFF 20736 AF00 7 5 V 3 75 V 1 875 V 27648 9400 10 V 5 V 2 5 V Rated range 27649 93FF 32512 8100 11 759 V 5 879 V 2 940 V Undershoot range 32513 80FF 32768 8000 11 851 V 5 926 V 2 963 V Underflow Negative values are not supported A 9 3 4 Output AQ measurement ranges for voltage and current SB and SM Table A 133 Analog output representation for current System Current Output Range Decimal Hexadecima...

Page 734: ... 32513 80FF See note 1 32768 8000 See note 1 Underflow 1 In an overflow or underflow condition analog outputs will behave according to the device configuration properties set for the analog signal module In the Reaction to CPU STOP parameter select either Use substitute value or Keep last value A 9 4 Thermocouple SBs A 9 4 1 SB 1231 1 analog thermocouple input specifications Note To use this SB yo...

Page 735: ...junction error 1 5 C Isolation field side to logic 500 VAC Cable length meters 100 m to sensor max Wire resistance 100 Ω max Table A 137 Diagnostics Technical data SB 1231 AI 1 x 16 bit Thermocouple Overflow underflow1 Yes Wire break2 Yes 1 The overflow and underflow diagnostic alarm information will be reported in the analog data values even if the alarms are disabled in the module configuration ...

Page 736: ...egrees Celsius The cold junction compensation restores the voltage added by the connector thermocouples The temperature of the module is measured internally then converted to a value to be added to the sensor conversion The corrected sensor conversion is then linearized using the thermocouple tables For optimum operation of the cold junction compensation the thermocouple module must be located in ...

Page 737: ...east 30 minutes of warmup time to meet this specification Table A 139 Filter selection table for the SB 1231 Thermocouple Rejection frequency Hz Integration time ms Signal board update time seconds 10 100 0 306 50 20 0 066 60 16 67 0 056 4001 10 0 036 1 To maintain module resolution and accuracy when 400 Hz rejection is selected the integration time is 10 ms This selection also rejects 100 Hz and ...

Page 738: ...bit thermocouple 6ES7 231 5QA30 0XB0 A 9 5 RTD SBs A 9 5 1 SB 1231 1 analog RTD input specifications Note To use this SB your CPU firmware must be V2 0 or higher Table A 141 General specifications Technical data SB 1231 AI 1 x 16 bit RTD Order number 6ES7 231 5PA30 0XB0 Dimensions W x H x D mm 38 x 62 x 21 mm Weight 35 grams Power dissipation 0 7 W Current consumption SM Bus 5 mA Current consumpti...

Page 739: ...0 m to sensor max Wire resistance 20 Ω 2 7 for 10 Ω RTD max Table A 143 Diagnostics Technical data SB 1231 AI 1 x 16 bit RTD Overflow underflow1 2 Yes Wire break 3 Yes 1 The overflow and underflow diagnostic alarm information will be reported in the analog data values even if the alarms are disabled in the module configuration 2 For resistance ranges underflow detection is never enabled 3 When wir...

Page 740: ... Table A 145 Ranges and accuracy for the different sensors supported by the RTD modules Temperature coefficient RTD type Under range minimum1 Nominal range low limit Nominal range high limit Over range maximum2 Normal range accuracy 25 C Normal range accuracy 0 C to 55 C Pt 10 243 0 C 200 0 C 850 0 C 1000 0 C 1 0 C 2 0 C Pt 50 Pt 100 Pt 200 Pt 500 Pt 0 003850 ITS90 DIN EN 60751 Pt 1000 243 0 C 200...

Page 741: ... 0 C 212 4 C 0 5 C 1 0 C Cu 0 004270 Cu 10 240 0 C 200 0 C 260 0 C 312 0 C 1 0 C 2 0 C Cu 10 60 0 C 50 0 C 200 0 C 240 0 C 1 0 C 2 0 C Cu 50 Cu 0 004260 Cu 100 60 0 C 50 0 C 200 0 C 240 0 C 0 6 C 1 2 C Cu 10 240 0 C 200 0 C 200 0 C 240 0 C 1 0 C 2 0 C Cu 50 Cu 0 004280 Cu 100 240 0 C 200 0 C 200 0 C 240 0 C 0 7 C 1 4 C 1 RTD values below the under range minimum value are reported as 32768 2 RTD va...

Page 742: ...tegration time 4 2 wire 1 channel module Update time seconds 3 wire 1 channel module Update time seconds 400 Hz 2 5 ms 10 ms 1 0 036 0 071 60 Hz 16 6 ms 16 67 ms 0 056 0 111 50 Hz 20 ms 20 ms 0 066 1 086 10 Hz 100 ms 100 ms 0 306 0 611 1 To maintain module resolution and accuracy when the 400 Hz filter is selected the integration time is 10 ms This selection also rejects 100 Hz and 200 Hz noise NO...

Page 743: ...s of the CM 1242 5 Technical specifications Order number 6GK7 242 5DX30 0XE0 Interfaces Connection to PROFIBUS 9 pin D sub female connector Maximum current consumption on the PROFIBUS interface when network components are connected for example optical network components 15 mA at 5 V only for bus termination Permitted ambient conditions Ambient temperature during storage during transportation durin...

Page 744: ...of 15 mA short circuit proof for bus termination PROFIBUS interface Table A 149 Pinout of the D sub socket Pin Description Pin Description 1 not used 6 P5V2 5V power supply 2 not used 7 not used 3 RxD TxD P Data line B 8 RxD TxD N Data line A 4 RTS 9 not used 5 M5V2 Data reference potential ground DGND Housing Ground connector A 10 1 2 CM 1243 5 Table A 150 Technical specifications of the CM 1243 ...

Page 745: ...wer supply external minimum maximum 24 V 19 2 V 28 8 V Current consumption typical from 24 V DC from the S7 1200 backplane bus 100 mA 0 mA Effective power loss typical from 24 V DC from the S7 1200 backplane bus 2 4 W 0 W Power supply 24 VDC external Min cable cross section Max cable cross section Tightening torque of the screw terminals min 0 14 mm2 AWG 25 max 1 5 mm2 AWG 15 0 45 Nm 4 lb in Dimen...

Page 746: ...TS 9 not used 5 DGND Ground for data signals and VP Housing Ground connector PROFIBUS cable NOTICE Contacting the shield of the PROFIBUS cable The shield of the PROFIBUS cable must be contacted To do this strip the insulation from the end of the PROFIBUS cable and connect the shield to functional earth A 10 2 GPRS Note S7 1200 PROFIBUS CMs and the GPRS CP are not approved for Maritime applications...

Page 747: ...B coding scheme 1 4 GMSK SMS Mode outgoing MO service point to point Permitted ambient conditions Ambient temperature during storage during transportation during operation with a vertical installation DIN rail horizontal during operation with a horizontal installation DIN rail vertical 40 C to 70 C 40 C to 70 C 0 C to 55 C 0 C to 45 C Relative humidity at 25 C during operation without condensation...

Page 748: ...enna ANT794 4MR Order number 6NH9860 1AA00 Mobile wireless networks GSM GPRS Frequency ranges 824 to 960 MHz GSM 850 900 1 710 to 1 880 MHz GSM 1 800 1 900 to 2 200 MHz GSM UMTS Characteristics omnidirectional Antenna gain 0 dB Impedance 50 ohms Standing wave ratio SWR 2 0 Max power 20 W Polarity linear vertical Connector SMA Length of antenna cable 5 m External material Hard PVC UV resistant Degr...

Page 749: ...tenna cable HF cable RG 174 fixed with SMA male connector Cable length 1 2 m Degree of protection IP64 Permitted temperature range 40 C to 75 C Flammability UL 94 V2 External material ABS Polylac PA 765 light gray RAL 7035 Dimensions W x L x H in mm 70 5 x 146 5 x 20 5 Weight 130 g A 10 3 CM 1243 2 AS i Master A 10 3 1 Technical data for the AS i master CM 1243 2 Table A 153 Technical data for the...

Page 750: ...hase no condensation maximum 95 Degree of protection IP20 Power supply current consumption power loss Type of power supply DC Current consumption typically From the S7 1200 backplane bus 200 mA Power loss typically From the S7 1200 backplane bus 2 4 W from AS i 0 5 W Dimensions and weights Width Height Depth 30 mm 100 mm 75 mm Weight Net weight Weight including packaging 122 g 159 g A 10 3 2 Elect...

Page 751: ...o 6ES7298 8FA30 8AH0 NOTICE Maximum current carrying capacity of the terminal contacts The current carrying capacity of the connection contacts is max 8 A If this value is exceeded on the AS i cable the AS i master CM 1243 2 must not be looped in to the AS i cable but must instead be connected via a spur line only one connection pair assigned on the AS i master CM 1243 2 You will find additional i...

Page 752: ...chnical data CB 1241 RS485 Type RS485 2 wire half duplex Common mode voltage range 7 V to 12 V 1 second 3 VRMS continuous Transmitter differential output voltage 2 V min at RL 100 Ω 1 5 V min at RL 54 Ω Termination and bias 10K to 5 V on B RS485 Pin 3 10K to GND on A RS485 Pin 4 Optional termination Short Pin TB to Pin T RB effective termination impedance is 127 Ω connects to RS485 Pin 3 Short Pin...

Page 753: ...Power supply Technical data CB 1241 RS485 Power loss dissipation 1 5 W Current consumption SM Bus max 50 mA Current consumption 24 VDC max 80 mA CB 1241 RS485 6ES7 241 1CH30 1XB0 Connect TA and TB as shown to terminate the network Terminate only the end devices on the RS485 network Use shielded twisted pair cable and connect the cable shield to ground You terminate only the two ends of the RS485 n...

Page 754: ... Ω Termination and bias 10K Ω to 5 V on B PROFIBUS Pin 3 10K Ω to GND on A PROFIBUS Pin 8 Receiver input impedance 5 4K Ω min including termination Receiver threshold sensitivity 0 2 V min 60 mV typical hysteresis Isolation RS485 signal to chassis ground RS485 signal to CPU logic common 500 VAC 1 minute Cable length shielded 1000 m max Baud rate 300 baud 600 baud 1 2 kbits 2 4 kbits 4 8 kbits 9 6 ...

Page 755: ...anually or cause it to be extended A 10 4 3 CM 1241 RS232 Specifications Table A 161 General specifications Technical data CM 1241 RS232 Order number 6ES7 241 1AH30 0XB0 Dimensions 30 x 100 x 75 mm Weight 150 grams Table A 162 Transmitter and receiver Technical data CM 1241 RS232 Type RS232 full duplex Transmitter output voltage 5 V min at RL 3K Ω Transmit output voltage 15 VDC max Receiver input ...

Page 756: ...hassis ground A 10 4 4 CM 1241 RS422 485 Specifications CM 1241 RS422 485 Specifications Table A 165 General specifications Technical data CM 1241 RS422 485 Order number 6ES7 241 1CH31 0XB0 Dimensions 30 x 100 x 75 mm Weight 155 grams Table A 166 Transmitter and receiver Technical data CM 1241 RS422 485 Type RS422 or RS485 9 pin sub D female connector Common mode voltage range 7 V to 12 V 1 second...

Page 757: ... XOFF supported for the RS422 mode Wait time 0 to 65535 ms Table A 167 Power supply Technical data CM 1241 RS422 485 Power loss dissipation 1 2 W From 5 VDC 240 mA Table A 168 RS485 or RS422 connector female Pin Description Connector female Pin Description 1 Logic or communication ground 6 PWR 5V with 100 ohm series resistor Output 2 TxD 1 Connected for RS422 Not used for RS485 Output 7 Not connec...

Page 758: ...TIC memory cards Order Number Capacity 6ES7 954 8LF01 0AA0 24 MB 6ES7 954 8LE01 0AA0 12 MB 6ES7 954 8LB01 0AA0 2 MB A 13 Input simulators Table A 169 General specifications Technical data 8 Position Simulator 14 Position Simulator Order number 6ES7 274 1XF30 0XA0 6ES7 274 1XH30 0XA0 Dimensions W x H x D mm 43 x 35 x 23 67 x 35 x 23 Weight 20 grams 30 grams Points 8 14 Used with CPU CPU 1211C CPU 1...

Page 759: ...mulator 6ES7 274 1XF30 0XA0 PP 24 VDC sensor power out 14 Position Simulator 6ES7 274 1XF30 0XA0 PP 24 VDC sensor power out A 14 I O expansion cable Technical Data Order number 6ES7 290 6AA30 0XA0 Cable length 2 m Weight 200 g Refer to the installation section Page 51 for information about installing and removing the S7 1200 expansion cable ...

Page 760: ...st A 15 2 CSM 1277 compact switch module The CSM1277 is an Industrial Ethernet compact switch module It can be used to multiply the Ethernet interface of the S7 1200 to allow simultaneous communication with operator panels programming devices or other controllers It provides the following features 4 x RJ45 sockets for connecting to Industrial Ethernet 3 pole plug in terminal strip for connection o...

Page 761: ...on Each CPU supplies both 5 VDC and 24 VDC power The CPU provides 5 VDC power for the expansion modules when an expansion module is connected If the 5 VDC power requirements for expansion modules exceed the power budget of the CPU you must remove expansion modules until the requirement is within the power budget Each CPU has a 24 VDC sensor supply that can supply 24 VDC for local input points or f...

Page 762: ...t the power budgets of the CPUs and the power requirements of the signal modules is provided in the technical specifications Page 657 Note Exceeding the power budget of the CPU may result in not being able to connect the maximum number of modules allowed for your CPU Sample power budget The following example shows a sample calculation of the power requirements for a configuration that includes one...

Page 763: ...mA 96 mA 3 SM 1223 8 relay coils each 3 8 11 mA 264 mA 1 SM 1221 8 inputs each 8 4 mA 32 mA Total requirements 810 mA 456 mA Equals Current balance 5 VDC 24 VDC Current balance total 790 mA 56 mA Form for calculating your power budget Use the following table to determine how much power or current the S7 1200 CPU can provide for your configuration Refer to the technical specifications Page 657 for ...

Page 764: ...554BCalculating a power budget S7 1200 Programmable controller 764 System Manual 11 2011 A5E02486680 05 ...

Page 765: ...le C 2 Signal boards SBs Signal boards Order Number SB 1221 200 KHz 4 x 24 VDC Input Source 6ES7 221 3BD30 0XB0 Digital input SB 1221 200 KHz 4 x 5 VDC Input Source 6ES7 221 3AD30 0XB0 SB 1222 200 KHz 4 x 24 VDC Output Sink Source 6ES7 222 1BD30 0XB0 Digital output SB 1222 200 KHz 4 x 5 VDC Output Sink Source 6ES7 222 1AD30 0XB0 SB 1223 2 x 24 VDC Input Sink 2 x 24 VDC Output Source 6ES7 223 0BD30...

Page 766: ...Input Sink Source 16 x Relay Output 6ES7 223 1PL30 0XB0 Digital input output SM 1223 8 x 120 230 VAC Input Sink Source 8 x Relay Outputs 6ES7 223 1QH30 0XB0 SM 1231 4 x Analog Input 6ES7 231 4HD30 0XB0 Analog input SM 1231 8 x Analog Input 6ES7 231 4HF30 0XB0 SM 1232 2 x Analog Output 6ES7 232 4HB30 0XB0 Analog output SM 1232 4 x Analog Output 6ES7 232 4HD30 0XB0 Analog input output SM 1234 4 x An...

Page 767: ...7 972 0MG00 0XA0 TS Module RS232 6ES7 792 0MS00 0XA0 TS Module Modem 6ES7 972 0MM00 0XA0 TS Module ISDN 6ES7 972 0MD00 0XA0 Table C 8 Accessories Accessory Order Number ANT794 4MR GSM GPRS antenna 6NH9 860 1AA00 Antenna ANT794 3M Flat antenna 6NH9 870 1AA00 Table C 9 Connectors Type of Connector Order Number 35 degree cable output screw terminal connection 6ES7 972 0BA42 0XA0 RS485 35 degree cable...

Page 768: ...AX0 C 7 Spare parts and other hardware Table C 13 Expansion cables simulators and connector blocks Item Order Number I O expansion cable I O Expansion cable 2 m 6ES7 290 6AA30 0XA0 Simulator 1214C 1211C 8 position 6ES7 274 1XF30 0XA0 I O simulator Simulator 1214C 14 position 6ES7 274 1XH30 0XA0 CPU 1211 1212 6ES7 291 1AA30 0XA0 CPU 1214 6ES7 291 1AB30 0XA0 Signal module 45 mm 6ES7 291 1BA30 0XA0 S...

Page 769: ...fort V11 6AV2101 0AA01 0AA5 WinCC Advanced V11 6AV2102 0AA01 0AA5 WinCC Professional 512 PowerTags V11 6AV2103 0DA01 0AA5 WinCC Professional 4096 PowerTags V11 6AV2103 0HA01 0AA5 Visualization software WinCC Professional max PowerTags V11 6AV2103 0XA01 0AA5 C 9 Documentation Table C 15 S7 1200 documentation Printed documentation Language Order Number German 6ES7 298 8FA30 8AH0 English 6ES7 298 8FA...

Page 770: ...555BOrder numbers C 9 Documentation S7 1200 Programmable controller 770 System Manual 11 2011 A5E02486680 05 ...

Page 771: ...epresentation voltage 709 734 status indicators 634 step response times CPU 669 677 686 step response times SB 732 step response times SM 707 Analog signal SM SM 1232 AQ 4 x 14bit 702 Analog signal board SB SB 1231 AI 1 x 12 bit 728 SB 1231 AI 1 x 16 bit RTD 738 SB 1231 AI 1 x 16 bit Thermocouple 734 SB 1232 AQ 1x12 bit 731 Analog signal module SM SM 1231 AI 4 x RTD x 16 bit 714 SM 1231 AI 8 x 13 ...

Page 772: ...monitoring 19 665 673 682 nesting depth 19 61 665 673 682 number of code blocks 19 665 673 682 number of OBs 19 68 665 673 682 organization blocks OBs 19 61 66 68 665 673 682 password protection 154 single instance or multi instance DB 140 size of the user program 19 61 665 673 682 start up OBs 68 timers quantity and memory requirements 19 665 673 682 types of code blocks 61 valid FC FB and DB num...

Page 773: ...er of connections PROFINET 394 parameters 120 483 polling architecture 561 PROFIBUS address 449 PROFINET and PROFIBUS 393 send and receive parameters 552 statistics 483 TCON_Param 120 time synchronization property PROFINET 132 Communication board CB add modules 112 CB 1241 RS485 753 comparison chart 20 configuration of parameters 115 device configuration 109 installation 46 LED indicators 529 633 ...

Page 774: ...ined Web pages 510 Web server 488 Contact information 3 Control DB for user defined Web pages global commands 526 parameter to WWW instruction 508 request commands and states 526 CONV convert 201 Conversion SCL instructions 202 Cookie restrictions standard Web pages 490 Cookie siemens_automation_language 523 Cooling 39 Copy protection binding to a CPU or memory card 156 Copying blocks from an onli...

Page 775: ...lost password 107 reset to factory settings 638 resetting the start values of a DB 644 restoring the status of a code block 34 RUN and STOP mode 639 run time meter 237 RUN STOP buttons 34 Security levels 153 signal board SB 22 startup parameters 102 startup processing 65 step response times 669 677 686 terminal block connector 50 thermal zone 39 42 time synchronization property 132 transfer card 9...

Page 776: ... difference 234 T_SUB subtract time 234 DB data block 61 141 capturing values 644 resetting the start values 644 valid DB numbers 61 DC grounding 58 inductive loads 59 isolation guidelines 57 wiring guidelines 56 58 Debugging downloading in RUN mode 650 654 DEC decrement 189 DECO decode 227 Defining enum types user defined Web pages 501 DELETE delete substring 256 Designing a PLC system 135 136 DE...

Page 777: ...common errors for extended instructions 313 RALRM 265 RDREC 265 WRREC 265 Errors diagnostic errors 71 time errors 70 Ethernet ad hoc mode 400 connection IDs 396 DPNRM_DG 271 DPRD_DAT 269 DPWR_DAT 269 GET 460 IP address 127 MAC address 127 network connection 117 number of communication connections 394 overview 399 PUT 460 RALRM 263 RDREC 260 T_CONFIG 421 TCON 408 TDISCON 408 TRCV 408 TRCV_C 401 TSE...

Page 778: ...e status of a code block 34 initial value 140 instance data block 140 know how protection 154 linear and structured programs 136 output parameters 140 overview 61 140 restoring the status of a code block 34 single FB with multiple instance DBs 141 valid FB numbers 61 G General technical specifications 657 Generating user defined Web page DBs 508 GET 460 configuring the connection 119 Get LED statu...

Page 779: ...tive loads 59 Information resources 4 Initial values capturing and resetting the start values of a DB 644 Input simulators 759 Inputs and outputs monitoring 642 INSERT insert substring 257 Inserting a device unspecific CPU 111 Inserting instructions drag and drop 29 drag and drop between editors 33 favorites 29 Inserting the memory card into CPU 100 Installation air flow 39 clearance 39 communicat...

Page 780: ...ponential 192 favorites 29 FieldRead 197 FieldWrite 197 FILL_BLK 199 FIND find substring 259 floating point math 192 FLOOR 205 FOR SCL 212 force 647 force operation 648 FRAC fraction 192 GET 460 GET_DIAG 285 GetError 223 GetErrorID 224 GO TO SCL 216 HSC high speed counter 315 317 HTA Hex to ASCII 252 IF THEN SCL 210 IN_RANGE within a range 184 INC increment 189 INSERT insert substring 257 insertin...

Page 781: ...43 STP stop PLC scan cycle 222 STRG_VAL string to value 241 SUB subtract 187 SWAP 200 SWITCH 218 T_ADD add time 234 T_COMBINE combine times 235 T_CONFIG 421 T_CONV convert time 233 T_DIFF time difference 234 T_SUB subtract time 234 TAN tangent 192 TCON 408 TDISCON 408 time 233 timer 170 timer operations 174 TOF off delay timer 170 TON on delay timer 170 TONR on delay retentive timer 170 TP pulse t...

Page 782: ... Load memory user defined Web pages 510 Local time RD_LOC_T read local time 235 Local Partner connection 394 Logging in out standard Web pages 477 Lost password 107 M MAC address 127 130 Manual fragment DB control 526 Manuals 4 Maritime approval 659 Master polling architecture 561 Math 30 186 187 MAX maximum 191 Maximum message length 558 MB_CLIENT 584 MB_COMM_LOAD 600 MB_MASTER 603 MB_SERVER 590 ...

Page 783: ...1222 DQ 4 200 kHz 200 kHz 722 SB 1223 DI 2 DQ 2 726 SB 1223 DI 2 DQ 2 200 kHz 724 SB 1231 AI 1 x 12 bit 728 SB 1231 AI 1 x 16 bit RTD 738 SB 1231 AI 1 x 16 bit Thermocouple signal board 734 SB 1232 AQ 1x12 bit 731 signal board SB 22 signal module SM 22 SM 1221 689 SM 1222 691 693 SM 1222 DQ8 RLY Changeover 691 SM 1223 696 SM 1231 AI 4 x 16 bit TC 709 SM 1231 AI 4 x RTD x 16 bit 714 SM 1231 AI 8 x ...

Page 784: ...5 Numbers binary 87 integer 88 real 88 O Off delay TOF 170 operation 174 OK instruction 185 On delay delay TON 170 operation 174 On delay retentive TONR 170 operation 174 Online assigning an IP address 125 capturing values of a DB 644 comparing and synchronizing 641 cycle time 640 diagnostics buffer 640 force 647 force operation 648 going online 635 IP address 638 memory usage 640 monitor 642 oper...

Page 785: ...3 binding to a CPU or memory card 156 code block 154 copy protection 156 CPU 153 empty transfer card 107 lost password 107 Peripheral access alarms 440 PID overview 324 PID_3STEP 331 PID_3Step algorithm 325 331 PID_Compact 328 PID_Compact algorithm 325 328 PLC add modules 112 assigning an IP address to an online CPU 125 communication load 74 comparing and synchronizing 641 copying blocks from an o...

Page 786: ...NET ad hoc mode 400 configuring communication between CPU and HMI device 431 configuring the IP address 114 connection IDs 396 CPU to CPU communication 433 device naming and addressing 133 diagnostics 441 Distributed I O instructions 441 DPRD_DAT 269 DPWR_DAT 269 Ethernet address properties 128 GET 460 IP address 127 IP address assignment 133 MAC address 127 network connection 117 432 434 438 numb...

Page 787: ...p between editors 33 expandable instructions 32 favorites 29 FBD function block diagram 145 function FC 140 function block FB 61 140 initial value of an FB 140 inserting instructions 29 instance data block DB 140 LAD ladder 144 linear program 136 operating modes of the CPU 63 organization block OB 138 PID overview 324 PID_3STEP 331 PID_3Step algorithm 325 331 PID_Compact 328 PID_Compact algorithm ...

Page 788: ...0 Reading HTTP variables 497 Receive configuration errors 541 Receive message configuration 553 PtP example program 564 Receive parameters configuration 437 Receive runtime return values 544 Referencing enum types user defined Web pages 501 Refreshing user defined Web pages 494 Relay electrical service life 663 REPLACE replace substring 258 Replacing modules 38 Requirements installation 27 Reset 1...

Page 789: ...nel 34 overview of the CPU 17 password protection 153 power budget 40 PROFIBUS 449 PROFIBUS address 449 PROFIBUS port 449 PROFINET 127 program card 105 pulse outputs 289 resetting the start values of a DB 644 restoring the status of a code block 34 RUN STOP buttons 34 signal board SB 22 signal module SM 22 startup parameters 102 startup processing 65 terminal block connector 50 thermal zone 39 42 ...

Page 790: ...SERT insert substring 257 INV invert 227 JMP_LIST 217 LED status 282 LEFT left substring 255 LEN length 253 LIMIT 192 LN natural logarithm 192 math 187 math floating point 192 MAX maximum 191 MC_ChangeDynamic 365 MC_CommandTable 362 MC_Halt 352 MC_Home 350 MC_MoveAbsolute 354 MC_MoveJog 360 MC_MoveRelative 356 MC_MoveVelocity 358 MC_Power 346 MC_Reset 349 MID middle substring 255 MIN minimum 191 M...

Page 791: ...iemens technical support 3 siemens_automation_language cookie 523 Signal board SB add modules 112 analog output representation current 708 733 analog output representation voltage 709 734 configuration of parameters 115 input representation voltage 669 678 687 708 733 installation 46 overview 22 power requirements 761 removal 46 SB 1221 DI 4 200 kHz 720 SB 1222 DQ 200 kHz 722 SB 1223 DI 2 DQ 2 726...

Page 792: ...ing diagram 697 698 SM 1231 AI 4 x 13 bit 700 SM 1231 AI 4 x 16 bit TC signal module 709 SM 1231 AI 4 x 16 bit TC wiring diagram 711 SM 1231 AI 4 x RTD x 16 bit signal module 714 SM 1231 AI 8 x 16 bit TC signal module 709 SM 1231 AI 8 x 16 bit TC wiring diagram 711 SM 1231 AI 8 x RTD x 16 bit signal module 714 SM 1231 RTD 4 x 16 bit wiring diagram 716 SM 1231 RTD 8 x 16 bit wiring diagram 716 SM 1...

Page 793: ...ct view 28 RD_LOC_T read local time 235 RD_SYS_T read system time 235 resetting the start values of a DB 644 restoring the status of a code block 34 run time meter 237 RUN STOP buttons 34 startup processing 65 time synchronization property PROFINET 132 transfer card 99 types of code blocks 61 unplugged modules 38 valid FC FB and DB numbers 61 WR_SYS_T write system time 235 STEP 7 programming PtP e...

Page 794: ... T_COMBINE combine times 235 T_CONV convert time 233 T_DIFF time difference 234 T_SUB subtract time 234 Time data type 89 TOD time of day data type 89 WR_SYS_T write system time 235 Time delay interrupt 279 Time of day configuring the online CPU 638 Time synchronization property 132 Time error interrupt OB 67 Timers operation 174 quantity 19 665 673 682 RT reset timer 170 size 19 665 673 682 TOF o...

Page 795: ...ganization block OB 138 password protection 154 program card 99 transfer card 99 User defined Web pages 473 492 accessing from PC 510 activating and deactivating from control DB 526 AWP commands for accessing S7 1200 data 494 configuring 507 creating fragments 503 creating with HTML editor 493 deleting program blocks 508 downloading corresponding DBs 509 enabling with WWW instruction 508 example 5...

Page 796: ...B 1223 DI 2 DQ 2 728 SB 1231 AI 1 x 16 bit RTD 740 SB 1231 AI 1 x 16 bit thermocouple 738 SB 1231 AI x 12 bit 730 SB 1232 AQ 1 x 12 bit 731 SM 1221 signal module 690 SM 1222 signal module 693 SM 1223 signal module 697 698 SM 1231 AI 4 x 16 bit TC 711 SM 1231 AI 8 x 16 bit TC 711 SM 1231 analog input 702 SM 1231 RTD 4 x 16 bit 716 SM 1231 RTD 8 x 16 bit 716 SM 1232 analog output 704 SM 1234 analog ...

Reviews: