Beruflich Dokumente
Kultur Dokumente
FAQs for
SIEMENS S7-1200
2009 to 2011
( jovanx.jovan@gmail.com , v1.0-01/2012 )
(folha em branco)
How do you establish MODBUS-RTU communication with STEP 7 Basic V10.5 for the
SIMATIC S7-1200 ?
How can you prevent data loss of runtime-generated parameters when updating your S7-1200
PLC program ?
How can you share runtime-generated between several S7-1200 PLCs with a KTP Basic
Panel ?
How do you synchronize the time and date of an HMI Basic Panel with an S7PLC using the "Job mailbox" area pointer ?
How can you manage block execution errors detected by the S7-1200 PLC ?
How can you deal with time errors detected by the S7-1200 CPU ?
How is numerical integration programmed in STEP 7 Basic V10.5 ?
How can you access an S7-1200 PLC by PC-Access and what is to be considered?
How can you establish a connection between an S7-1200 PLC and SIMATIC NET OPC ?
How can you erase the IP address and set your S7-1200 PLC back to factory settings , using
the SIMATIC MC memory card (2MB or 24MB) ?
How can you change the IP address of an S7-1200 PLC without STEP 7 Basic ?
How can you download to a network of several S7-1200 PLCs with the same IP address ?
How you reset the IP address of your S7-1200 PLC using STEP7 Basic software?
How can you manage peripheral device errors detected by the S7-1200 PLC ?
How can you use an analog current output with wire break diagnostics on your S7-1200 PLC
?
How can you use analog 0-20mA signal modules and signal boards with 4-20mA signals ?
How do you synchronize the time of the HMI Basic Panel with S7-1200 PLC ?
How do you access S7-1200 tags with a panel or RT configured with WinCC flexible 2008
SP2 ?
With which devices can the S7-1200 communicate via the PN connection ?
How do you compensate for the string mismatch caused by the RCV_PTP and SEND_PTP
blocks ?
How can you reduce memory usage with Multi instancing ?
How many high-speed counters (HSCs) are provided by SIMATIC S7-1200 PLC?
How do you connect a sensor to the analog signal modules of the SIMATIC S7-1200 ?
How can you back up parameters before loading a new control program ?
How can you determine the coordinates of your S7-1200 PLC with a standard GPS receiver ?
How can you establish a connection between an S7-1200 PLC and SIMATIC NET OPC ?
How do you implement a weekly timer for the SIMATIC S7-1200 in STEP 7 V11 ?
With which devices can the S7-1200 comminicate via the integrated PROFINET interface and
which protocols support the S7-1200 ?
How can you access tags of the S7-1200 with WinCC ?
How can you change the IP address of an S7-1200 without using STEP 7 Basic ?
What is the connection between subnet masks and IP addresses with regard to subnetting and
supernetting (classless inter domain routing CIDR) ?
How does startup work in an S7-1200 ?
(folha em branco)
How do you establish MODBUS-RTU communication with STEP 7 Basic V10.5 for the SIMATIC
S7-1200 ?
Description
The SIMATIC S7-1200 enables point-to-point communication using the communication modules CM
1241 RS485 and CM 1241 RS232.
You can add up to three communication modules to each S7-1200 controller.
Using the MODBUS library integrated in STEP 7 Basic V10.5 you can define each communication
module as a MODBUS master or slave.
If you define the CM 1241 RS232 as MODBUS master, then there is a physical limitation that permits
communication with one slave only.
If you define the CM 1241 RS485 as MODBUS master, then it is possible to communicate with up to
32 slaves one after the other.
We will take a sample project to describe the configuration procedure in STEP 7 Basic V10.5 for
communication with multiple slaves using the CM 1241 RS485.
Instructions
We have taken the example of MODBUS communication between a master and a slave.
There is alternate writing to the holding register of the slave (function code 16) and reading from the
holding register of the slave (function code 03).
Since the RS485 has a two-wire (half-duplex) interface, writing and reading must be conducted
consecutively.
By the same principle, the address of the slave to be addressed can be changed between two actions
(here writing and reading), thus making it possible to exchange data with multiple slaves.
Fig. 01
The CM 1241 RS485 communication modules are linked to each other using a PROFIBUS cable.
You can continue with the PROFIBUS cable to connect up to 31 additional MODBUS slaves to the
master.
The configuration is done in STEP 7 Basic V10.5 SP2. The program code is transferred to the
controllers with the switch CSM 1277.
MB_COMM_LOAD
The configuration block MB_COMM_LOAD is required on both sides (master and slave) for
MODBUS communication.
Fig. 02
The MB_COMM_LOAD block is used to select the communication module, set the communication
parameters and establish the connection with the master or slave parameters.
The MB_COMM_LOAD block must be called in the first program cycle (by activating the system
marker M1.0 in the hardware settings or by a call in Startup OB 100).
After inserting the communication module in the hardware configuration you can select the symbolic
name of the communication module at the PORT parameter.
The communication parameters BAUD (transmission rate) and PARITY (parity) must be identical for
all nodes. The port configuration of the RS485 interface in the STEP 7 V10.5 device view is irrelevant
here.
The instance data block of the master or slave block is transferred at the MB_DB parameter and thus
defines the communication module (PORT parameter) as MODBUS master or slave.
MB_MASTER
You use the MB_MASTER block to define the communication module selected with the
MB_COMM_LOAD configuration block as MODBUS master.
Fig. 03
The MB_MASTER block is used to select the MODBUS slave to be addressed, select the function code
(read/write, MODBUS start address and data length) and define the local data storage area.
The MODE parameter specifies the direction of transmission ("0" = read, "1" = write or additional
diagnostics functions).
The MB_MASTER block must be called in the first program cycle (by activating the system marker
M1.0 in the hardware settings or by a call in Startup OB 100).
The DATA_ADDR and DATA_LEN parameters are for setting the MODBUS start address and the
data length (bits or words depending on the MODBUS start address selected).
The DATA_PTR parameter defines the local receive and send data storage areas of the master.
DATA_PTR must refer to a global data block created with the "Symbolic access only" option disabled.
When multiple elements are to be transferred (bits or words), the symbolic name of an array or struct
that covers this data storage area (DATA_ADDR and DATA_PTR) must be transferred here.
MB_SLAVE
You use the MB_SLAVE block to define the communication module selected with the
MB_COMM_LOAD configuration block as MODBUS slave.
Fig. 04
The MB_SLAVE block is used to define the MODBUS-RTU station address and specify the local data
storage area for the holding register data transfer.
The local MODBUS-RTU station address is transferred at the MB_ADDR parameter. The MODBUS
master identifies the slave with this.
The MB_HOLD_REG parameter defines the local holding register data storage area of the slave.
MB_HOLD_REG must refer to a global data block created with the "Symbolic access only" option
disabled. When multiple registers (words) are to be transferred, the symbolic name of an array or struct
that covers the specified data volume of the master (DATA_ADDR and DATA_PTR) must be
transferred here. The first word of this array or struct corresponds to the MODBUS holding register
start address 40001.
The parameters can be switched with the inputs and outputs of the blocks or by accessing the instance
data block concerned.
Sample project
In the master project, the alternate writing to / reading from the holding register of the slave is done
using a sequencer.
Fig. 05
The MB_COMM_LOAD configuration block is called in the initialization step 0.
In Step 1 the MB_Master with the communication parameters for writing to the slave (MODE = 1) is
called and executed (REQ = 1).
The transition to Step 2 is made by the positive (DONE) or negative (ERROR) confirmation from the
MB_MASTER.
In Step 2 the communication parameters for reading from the slave (MODE = 0) are written using the
MB_MASTER in the same instance data block as from Step 1 (MB_DB parameter of the
MB_COMM_LOAD block).
Fig. 06
The MB_ADDR parameter (see Network 6) can therefore also be used to change the slave to be
addressed per step, which permits data to be exchanged with up to 32 slaves.
Download
The compressed file "MODBUS_RTU.zip" contains the sample project "MODBUS_RTU.ap10" for
10
Unpack the "MODBUS_RTU.zip" file and open the sample project "MODBUS_RTU.ap10" with STEP
7 Basic V10.5 (>= SP2).
The version of the firmware of the SIMATIC S7-1200 controllers used is V1.0.2.
Download the project folders ("Master" and "Slave") into the controllers.
Modbus_RTU.zip
( 969 KB )
Note
More information about Modbus Library Operations is available in the SIMATIC S7 S7-1200
Programmable Controller System Manual (Entry ID: 36932465).
11
(folha em branco)
12
How can you prevent data loss of runtime-generated parameters when updating your S7-1200
PLC program ?
Description
You need to apply changes to your user program running on a S7-1200 PLC, but you do not want to
loose your runtime-generated parameters. Buffer your runtime-generated parameters in the HMI
"Runtime" recipe function of STEP 7 Basic and download your program changes to your S7-1200 PLC.
To apply this feature, execute the following steps:
Prepare your STEP 7 Basic HMI project to buffer your parameters. No changes to your PLC
program are necessary.
Buffer your parameters in the HMI "Runtime" recipe function of STEP 7 Basic.
Download your changed program to your S7-1200 PLC.
Retrieve your parameters from the HMI "Runtime".
Each recipe allows you to buffer different sets of tags (total sum of tags: 5x20=100). Please find an
example project in the attached file.
Fig. 01
Configuring the buffering feature in your project
In the following description, the HMI project of the attached STEP 7 Basic project is used.
13
The panel type is not important as the HMI "Runtime" can simulate any configured type of KPT
Basic Panels.
2. Copy the HMI device into your project
Drag and Drop the "HMI_DataStore" HMI project from the attached "DataStore" STEP
7 Basic project into your own project.
Drag and Drop the "DataStore" global data block from the "DataStore" project to your
own project.
Drag and Drop the "RuntimeParameters" global data block from the "DataStore" project
to your own project.
Compile the data blocks of "PLC_1".
The "RuntimeParameters" data block holds the parameter tags for the example project. It is used
to demonstrate this feature. In your own project any data tag capable of holding numerals can be
used.
Fig. 02
Important
14
Select all "HMI_connection_x" entries, and click "Delete" in the context menu.
Fig. 03
Note
Do not delete the "s_ipAddress" internal tag.
4. Configure the HMI Connection
Follow these steps:
Browse for "Device&Networks" and click the "Connections" button. Select the
"Connections" tab and delete the HMI connection of the "HMI_DataStore" panel by
clicking "Delete" in the context menu. Acknowledge the following dialog window.
Fig. 04
Connect the Ethernet ports of the "HMI_DataStore" panel and the "PLC_1" S7-1200
PLC. A new HMI connection is established.
15
Fig. 05
5. Configure the HMI area pointer
Follow these steps:
In the context menu of the "HMI_connection_2" select the "Go to Connections editor.." item (see
Fig. 05).
In the "Area pointers" tab, check the Data record area pointer active, and assign the
"aw_dataRecord" tag from the "DataStore" data block.
Check the "Job mailbox" area pointer, and assign the "aw_jobMailbox" tag from the "DataStore"
data block.
Fig 06
6. Add the tags to recipe function
Follow these steps:
Browse the "Project tree" for the "Recipes" item of the "HMI_dataStore" HMI device.
In the recipe, view select "Recipe 1"
16
Change to the "Elements" tab, and assign the tags you want to share with your other S71200 PLCs to the elements of this recipe.
The default setting for decimal places is zero. Increase the number of decimal places up
to the resolution you need.
Configure up to 20 elements per recipe.
Note
Any invalid tag needs to be deleted or reassigned. Invalid tags are highlighted red.
Fig. 07
7. Configure the screen tags
Browse the "Project tree" for the "Screens" folder of the "HMI_DataStore" device, and
open the "root screen".
Assign the "aw_dataRecord[3]" word tag to the status output field.
Fig. 08
Assign the "HMI_connection_2" connection to the "Release" event of the Change IP
button.
17
Fig. 09
Table 01
Buffering and retrieving the parameters with HMI "Runtime"
No. Buffering and retrieving the parameters
1. Start the HMI "Runtime" of STEP 7 Basic
Follow these steps:
Fig. 10
18
On your HMI display select "Recipe_1" and click the "OPEN" button. The
"Recipe_data_record_1" opens.
Fig.11
Press the "PLC>>HMI" button to read the parameters from the S7-1200 PLC. The "Save
as" window opens.
Fig. 12
To save the data record number "1", enter the number "1" in the "Number" input field,
and click the "OK" button.
Fig. 13
Click the "Open" button to see the parameter values of this data record.
Fig. 14
Your parameters are now stored in Runtime.
Note
You can also archive / retrieve parameter element values.
3. Download your program
Click the "Download to device" button to download your program to your S7-1200 PLC.
19
Fig. 15
4. Restore the parameters to the PLC
Follow these steps:
On your HMI display select "Recipe_1" and click the "OPEN" button. The
"Recipe_data_record_1" opens. See Fig. 11/12 for details.
Press the "HMI>>PLC" button to write the parameters to your S7-1200 PLC.
Table 02
Adjusting the IP address
Change the IP address, that is configured in the HMI connection, if you want to access another S7-1200
PLC (for example, PLC_2). Each S7-1200 PLC has a unique IP address.
On your HMI "Runtime", enter the IP address of the S7-1200 PLC (for example,
"192.168.0.1") in the input field.
Click the "Change IP" button.
Fig. 16
Table 03
Doc. tcnico do blog Um PLC sem WatchDog (www.plcsemwatchdog.blogspot.com)
20
Requirements
S7-1200 PLC
Ethernet cable
PG / PC
STEP 7 Basic V10.5
S71200_DataStore.zi
p
( 3134 KB )
21
(folha em branco)
22
How can you share runtime-generated between several S7-1200 PLCs with a KTP Basic Panel ?
Description
Your application consists of one master project which you want to run simultaneously on several PLCs.
While commissioning the first PLC, miscellaneous specific parameters will be generated which shall be
used for all other PLCs. Archive these parameters in your KTP Basic Panel, and retrieve them on your
other PLCs, instead of commissioning every single PLC. The KTP Basic Panel allows for the archiving
and retrieving of these parameters, while being connected to an S7-1200 PLC, using its retentive recipe
function.
The recipe function of the KTP Basic Panel is used for this task. To use this "Parameter sharing"
feature, follow these steps:
1.
Integrate the recipe function into your HMI program, and link the parameter tags you want to
archive / retrieve.
2. Download your master project to all of your PLCs.
3. Assign unique IP addresses to each of your PLCs.Youcan use either STEP 7 Basic or the "IP
TOOL" which you will find in entry ID 41737436.
4. Download your HMI program to your KTP Basic Panel.
5. Connect your KTP Basic Panel to your first S7-1200 PLC.
6. In the configuration of the KTP Basic Panel, adjust the IP address (for example, 192.168.0.1)
for communications with your first S7-1200 PLC.
7. Commission your first PLC, and generate specific runtime parameters.
8. Archive the commissioned parameters in your KTP Basic Panel.
9. Connect your KTP Basic Panel to your next S7-1200 PLC.
10. In the configuration of the KTP Basic Panel, adjust the IP address (for example, 192.168.0.2)
for communications with your next S7-1200 PLC.
11. Retrieve your parameters from your KTP Basic Panel.
12. Repeat steps 9 through 11 until all your S7-1200 PLCs are updated.
To integrate this feature into your program, follow the steps described in the "Integrating the recipe
function" section of this article.
An overview on the use of this feature can be found in the "Applying the parameter sharing feature"
section of this article.
Fig. 01
Integrating the recipe function
23
2. Copy the HMI device and the data blocks into your project
Follow these steps:
Drag and Drop the "HMI_DataStore" HMI project from the "DataStore" project to your
own project.
Drag and Drop the "DataStore" global data block from the "DataStore" project to your
own project.
Drag and Drop the "RuntimeParameters" global data block from the "DataStore" project
to your own project.
Compile the data blocks of "PLC_1".
The "RuntimeParameters" data block holds the parameter tags for the example project. It is used
to demonstrate this feature. In your own project any data tag capable of holding numerals can be
used.
Fig. 02
Important
24
Fig. 03
Note
Do not delete the "s_ipAddress" internal tag.
4. Configure HMI Connection
Follow these steps:
Browse for "Device&Networks" and click the "Connections" button. Select the
"Connections" tab, and delete the HMI connection of the "HMI_DataStore" panel by
clicking "Delete" in the context menu. Acknowledge the following dialog w
Fig.
04
Connect the Ethernet ports of the "HMI_DataStore" panel and the "PLC_1" S7-1200
PLC. A new HMI connection is established
25
Fig. 05
5. Configure the HMI area pointer
Follow these steps:
In the context menu of the "HMI_connection_2" select the "Go to Connections editor.."
item (see Fig. 05).
In the "Area pointers" tab, check the Data record area pointer active, and assign the
"aw_dataRecord" tag from the "DataStore" data block.
Check the "Job mailbox" area pointer, and assign the "aw_jobMailbox" tag from the
"DataStore" data block.
Fig 06
26
Browse the "Project tree" for the "Recipes" item of the "HMI_dataStore" HMI device.
In the recipe view, select "Recipe 1"
Change to the "Elements" tab, and assign the tags you want to share with your other S71200 PLCs to the elements of this recipe.
Note
Any invalid tag needs to be deleted or to reassigned. Invalid tags are highlighted in red.
Fig. 07
Note
You can configure the tags stored in the HMI by adding new elements to the "Elements" view of
the "Recipe_data_record_1".
There are up to 5 recipes available for you to configure 5 different sets of tags.
One recipe holds up to 20 data records with 20 elements each. Therefore you can store
20 different setups in one recipe.
Browse the "Project tree" for the "Screens" folder of the "HMI_DataStore" device, and
open the "root screen".
Assign the "aw_dataRecord[3]" word tag to the status output field.
27
Fig. 08
Fig. 09
Table 01
Applying the "parameter sharing" feature
The following overview is based on the attached "DataStore" project.
28
Fig. 10
2. Assign unique IP addresses
Assign unique IP addresses to all of your S7-1200 PLCs. You can use either STEP 7 Basic or the
IP TOOL. Please find the IP TOOL in entry ID 41737436.
4. Change IP address
To address an S7-1200 PLC with your KTP Basic Panel, you need to use the IP address of the
S7-1200 PLC in your HMI device:
29
Fig. 11
5. Store parameters in HMI
On your HMI display, select "Recipe_1", and click the "OPEN" button. The
"Recipe_data_record_1" opens.
Press the "PLC>>HMI" button to read the parameters from the S7-1200 PLC. The "Save
as" window opens.
Fig. 12
To save the data record number "1", enter the number "1" in the "Number" input field,
and click the "OK" button.
Fig. 13
Click the "Open" button to see the parameter values of this data record.
30
Fig. 14
Your parameters are now stored in your panel.
Note
It is also possible to archive / retrieve parameter elements.
6. Restore data in PLC
On your HMI display, select "Recipe_1", and click the "OPEN" button. The
"Recipe_data_record_1" opens. See Fig. 11/12 for details.
Press the "HMI>>PLC" button to write the parameters to your S7-1200 PLC.
Table 02
Note
You can also use the "Runtime" feature of STEP 7 Basic instead of a KTP Basic Panel.
Requirements
S7-1200 PLC
Ethernet cable
PG / PC
STEP 7 Basic V10.5
KTP600PN basic panel
S71200_DataStore.zi
p
( 3137 KB )
31
(folha em branco)
32
How do you synchronize the time and date of an HMI Basic Panel with an S7-1200 PLC using
the "Job mailbox" area pointer ?
Description
To synchronize the time and date of your HMI Basic Panel to the local time of your S7-1200 PLC,
perform the following steps:
Set up a tag array for the area pointer to store the time and date information.
Enable and configure the "Job mailbox" area pointer.
Enter the time and date information into the tag array.
Evaluate the "Job mailbox".
2.
3.
4.
5.
Expand the view of the PLC in the "Project tree", and open the "Program blocks" folder.
Double-click on "Add new block", click on "Data block (DB)" with "Global DB" as the
type and click the "OK" button. The data block opens.
Fig. 01
Enter a tag name (for example "a_jobMailbox") in the "Name" column.
Select "Array [lo .. hi] of type" as the data type in the "Data type" column. Replace the
"lo" and "hi" entries in the brackets with the low ("0") and high ("3") values for the
dimensions of the array.
Replace the "type" designation with the "word" data type. The full data type for an array
of 4 tags appears as follows: "Array [0 .. 3] of word".
Fig. 02
Select the PLC in the "Project tree" and click the "Compile" button in the tool bar. The
data block is compiled. Following compilation, the tag array is available for further use in
the project.
33
Fig. 03
Note
The data block must be compiled before the tag array is available for further use.
2.
2.
3.
Expand the view of the HMI device in the "Project tree" and double-click the
"Connections" entry. The "Connections" editor opens.
Fig. 04
Open the "Area pointers" tab and enable the "Job mailbox" area pointer by checking the
box in the "Active" column.
Click the navigation button in the "PLC tag" field; the object list opens. Navigate to the
"Data_block_1"data block in the object list and select the "a_jobMailbox" tag in the right
window.
34
Fig. 05
3.
Fig. 06
Read the local time from the PLC
Fig. 07
Enter the parameters in the "Job mailbox" tag.
35
Fig. 08
Note
The parameters are BCD-coded.
4.
36
Fig. 09
The "Job mailbox" is evaluated and the time of the HMI Basic Panel is set to the local time of the
S7-1200 PLC.
5.
Fig. 10
Table 01
Requirements
S7-1200 PLC
Ethernet cable
PG / PC
STEP 7 Basic V10.5
37
(folha em branco)
38
How can you manage block execution errors detected by the S7-1200 PLC ?
Description
By default, the CPU responds to a block execution error by logging an error in the diagnostics buffer
and switching to STOP mode, as this is the predefined system response.
You can change this behavior by placing one or more "GetError" or "GetErrorID" instructions within
the program block you want to monitor. In this case the CPU does not switch to STOP mode and does
not log an error in the diagnostics buffer. Instead, this block is now set to manage errors within the
block. The error information is reported in the output of the "GetError" or "GetErrorID" instruction.
"GetError"
The "GetError" instruction indicates that a program block execution error has occurred and fills a
predefined error data structure of the data type: "ErrorStruct" with detailed error information.
The "GetError" instruction can also be used to forward an alarm about the error status to the calling
block. To do this, the instruction must be positioned in the last network of the called block.
"GetErrorID"
The "GetErrorID" instruction indicates that a program block execution error has occurred and reports
the ID (identifier code) of the error. Please find a list of the error codes in the online help of STEP 7
Basic, search for the keyword "GetErrorID".
Note
No "GetError" or "GetErrorID" instruction is present when you create a new project.
Evaluating a block execution error event with the "GetError" instruction
Information on the block execution event will be stored in a tag of the "ErrorStruct" system data type.
No. Evaluating a block execution error event with the "GetError" instruction
1 Add the "GetError" instruction
Browse the instructions pane for "Extended instructions > Program control > GetError".
Drag and Drop a "GetError" instruction into the last network of the OB you want to
monitor.
Click the "OK" button.
39
Fig. 01
3 Evaluating the "ERROR" output information of the "GetError" instruction
Only tags of the "ErrorStruct" system data type can be specified at the ERROR output. The
"ErrorStruct" system data type specifies the exact structure in which the information about the
error is stored. Using additional instructions, you can evaluate this structure and program an
appropriate response.
The "ErrorStruct" tag contains the following information:
Please find a detailed overview in the figure below. A detailed list of the contents of the
"ErrorStruct" data type can be found in the online help of STEP 7 Basic, search for the keyword
"GetError".
40
Fig. 02
Table 01
Error conditions indicated by the "ENO" enable output
The output "ENO" of the "GetError" or "GetErrorID" instruction is set only if the two following
preconditions are met:
If one of these conditions does not apply, then the remaining program execution is not affected by the
"GetError" instruction. If EN = TRUE and "GetError" or "GetErrorID" executes, then:
ENO = TRUE indicates a code block execution error occurred and error data is present
ENO = FALSE indicates no code block execution error occurred
You can connect error reaction program logic to the "ENO" output which activates after an error occurs.
If an error exists, then the output parameter stores the error data where your program has access to it.
"GetError" and "GetErrorID" can be used to send error information from the currently executing block
(called block) to a calling block. Place the instruction in the last network of the called block program to
report the final execution status of the called block.
Online diagnostics with STEP 7 Basic
When you do not use an "GetError" instruction, and you have online access to your S7-1200 PLC with
STEP 7 Basic, you can use the "Online & diagnostics" function:
41
Fig. 03
Note
An "Incoming event" shows the beginning of an event.
An "Outgoing event" shows the end of an event.
Use case
If a directly addressed contact (for example "IW120:P") is not available, you can use the "GetError"
instruction to achieve the following results:
Requirements
S7-1200 PLC
Ethernet cable
PG / PC
STEP 7 Basic V10.5
42
How can you deal with time errors detected by the S7-1200 CPU ?
Description
Time errors usually occur during commissioning of the S7-1200 PLC. Time errors can be triggered by
any of the following conditions:
All time error events trigger the execution of OB 80, if it exists. OB 80 includes startup information that
helps you determine which event and OB generated the time error.
If OB 80 does not exist, then the CPU ignores the error, for when the maximum cycle time is exceeded.
2.
When the cycle time exceeds the cycle monitoring time for the first time, there is an
attempt to start the "Time error interrupt" OB (OB 80).
If there is no "Time error interrupt" OB in the CPU, the CPU generates an error and
continues to execute the user program.
If the event "maximum cycle time exceeded" happens twice within the same program
cycle, without resetting the cycle timer, then the CPU turns to STOP, regardless of
whether OB 80 exists.
You can prevent the CPU from turning to STOP by restarting the CPU cycle monitoring
with the "RE_TRIGR" instruction.
The operating system monitors the execution time of the cyclic program for a configurable upper
limit known as the "Maximum cycle time".
You find the "Maximum cycle time" in the properties of your S7-1200 PLC.
43
Fig. 01
44
The "RE_TRIGR" instruction (Re-trigger cycle time monitoring) allows you to reset the timer that
measures the cycle time. However, this instruction must be executed in a program cycle OB. The
"RE_TRIGR" instruction is ignored if executed in other blocks (for example OB 80). If the maximum
scan cycle time is exceeded twice within the same program cycle with no "RE_TRIGR" instruction
executed, the CPU will switch to STOP immediately.
To insert a "RE_TRIGR" instruction:
Browse the instructions pane for "Extended instructions" > "Program control" > "RE_TRIGR".
Drag and Drop this instruction into a network of a program cycle OB.
Fig. 02
Note
Use the "RE_TRIGR" instruction with care. Repeated executions of the "RE_TRIGR" instruction can
create an endless loop or a very long scan. As a result of this endless loop, the cyclic program will never
end, and the output process image will never be written. Therefore you will never receive a save state at
the outputs.
Evaluating the time error event with the "Time error interrupt" OB
The operating system calls the "Time error interrupt" OB 80, if one of the previously mentioned events
occurs.
No. Evaluate the time error event with the "Time error interrupt" OB
1. Add the "Time error interrupt" OB
Browse the "Project tree" for the "Add new block" item.
In the "Add new block" window, click the "Organization block" button.
Select the "Time error interrupt" OB from the list.
Click the "OK" button.
Note
You can use only one "Time error interrupt" OB in your program.
45
Fig. 03
2. Monitoring the start information of the "Time error interrupt" OB
Double-click the "Time error interrupt" OB of your S7-1200 PLC in the "Project tree".
Browse the instructions pane for "Instructions" > "Move" >"Move".
Drag and Drop a move instruction into a network of your "Time error interrupt" OB.
Move the value of the "fault_id" tag into a global tag (for example
""Data_block".by_fault_ID").
Program the other tags you want to monitor in the same way. Please refer to the example
in Fig. 04.
46
Fig. 04
3. Evaluating the start information of the "Time error interrupt" OB
The "Time error interrupt" OB has the following start information:
"fault_id" (BYTE)
The "fault_id" identifies the type of error.
"csg_OBnr "(OB-ANY)
Number of the OB being executed at the time of the error.
"csg_prio" (UINT)
Priority of the OB being executed at the time of the error.
Table 02
Requirements
S7-1200 PLC
Ethernet cable
PG / PC
STEP 7 Basic V10.5
47
(folha em branco)
48
Fig. 01
Figure 01 illustrates the calculation of the integral of a trapezoidal area:
Fig. 02
49
Parameter
Data
type
Memory
area
Description
EN
BOOL
I, Q, M,
D, L
IN
REAL M, D, L
Enable
BOOL
I, Q, M,
D, L
Reset
BOOL
I, Q, M,
D, L
SMB
BYTE M
ENO
BOOL
OUT
REAL M, D, L
Error
Q, M, D,
BOOL
L
Q, M, D,
L
Value to be integrated
Downloads
The downloads below contain the library and a sample program for calculating integrals. Copy the ZIP
files into a separate folder, and unpack the files with the WinZip program.
Sample program: Integral calculation with STEP 7 Basic
The "Integral.zip" download contains the STEP 7 Basic program (FB602) program for calculating the
integral. There is one example programmed in the STEP 7 Basic project.
Integral_sample.zip
( 2350 KB )
In the example, an analog input value (IW64, "velocity_INT" variable) is converted to a floating-point
value in Network 1 (MD10, "velocity_REAL" variable). This floating-point value is the input "IN" for
the integrator FB602, which results in the output "OUT" (MD14, "distance"). The calculation of the
integral is started with the "DB_2".Enable bit (which is selected als retentive) on FB602's "Enable"
parameter. The "Error" output must be stored by a retentive counter or a RS-Flip-Flop (Network 3) to
see, that a power failure occurred while integration. M5.0 resets the output value and the error flag
M5.3 in Network 4.
Library "Integral"
The "Integral.zip" library contains the know-how protected, "Integration" function block (FB602). The
password to disable the know-how protection is "1234".
Integral.zip
( 434 KB )
50
Fig. 03
To open libraries in STEP 7 Basic, follow these steps:
1.
2.
3.
4.
The "Integral" library with the FB602 "Integration" appears in the "Global libraries".
Validity
This FAQ is valid for
51
(folha em branco)
52
How can you access an S7-1200 PLC by PC Access and what is to be considered ?
Description
You can establish a connection between PC Access and your S7-1200 PLC. Nevertheless, there are
some restrictions to keep in mind.
Note
Although establishing a connection between an S7-1200 PLC and SIMATIC NET OPC is not officially
supported by Siemens, this FAQ describes a solution. In the following chapters, you will find a
description of how to establish such a connection.
Restrictions
There are certain restrictions to be considered due to the fact that PC Access was originally intended to
access an S7-200 PLC:
Only tags in the data block DB1 of your S7-1200 PLC can be accessed because the S7-200
only had one data block.
DB1 in your S7-1200 PLC needs to be non-symbolic. Please uncheck the checkbox "Symbolic
access only" when creating your DB1 (Figure 01).
Requirements
The following items are the hardware and software requirements:
S7-1200 PLC
Ethernet cable
STEP 7 Basic V10.5
PC Access V1.0.4.10 (SP4)
No. Create tags in data block DB1 of your S7-1200 PLC project
1. Add the data block DB1 to your project
Browse the "project tree" and click on the item "Add new block". Click the button "Data block
(DB)". Uncheck the checkbox "Symbolic access only". Click the "OK" button.
53
Fig.01
2. Allocate the tags in STEP 7 Basic
Double-click DB1. Add the following three tags under "name" and "Data type" and give them an
"initial value".
Item_01: "Byte"
Item_02: "Int"
Item_03: "DWord"
Fig.02
Click the item "Save project" in the tool bar. Download the project by clicking the download
button in the tool bar.
54
Item_01: "DB1.DBB0"
Item_02: "DB1.DBW2"
Item_03: "DB1.DBD4"
Fig.03
Table 01
55
Fig.04
2. Add a new PLC
Highlight the entry "MicroWin(TCP/IP)" in the "project tree".
Browse the menu bar, and select "Edit > New > PLC". A "NewPLC" object will be added, and
the "PLC properties" dialog window of the new PLC opens. Enter the following parameters into
the input fields of this window:
Name: "S7-1200_PLC"
IP Address: "192.168.0.11" (IP adress of your S7-1200 PLC)
TSAP Local: "10.00." (TSAP of your S7-1200 PLC)
TSAP Remote: "03.01." (TSAP of PC Access)
Fig.05
56
Highlight your S7-1200 PLC in the "project tree". Browse the menu bar, and select "Edit > New
> Item". The dialog window "Item properties" opens.
To access data in your S7-1200 PLC, perform the following steps:
Additionally, you can restrict the memory address access to "read" only or "write" only.
Click the "OK" button.
Fig.06
Note
Please find a list of the accessible items at the end of this document in the table "accessible tags
and items".
57
Fig,07
Note
Anytime you open or edit a PC Access project, you must click the "Save" button to send tag
configurations to the server.
Fig.08
58
Fig.09
6. Start the Test Client
Click the "Start Test Client" button in the tool bar. The Test Client will go online and access the
designated data.
In the "Value" column, you can see the actual values of the listed items. If you are connected to
your S7-1200 PLC, the "Quality" of the item is listed as "Good".
Fig.10
Table 02
Doc. tcnico do blog Um PLC sem WatchDog (www.plcsemwatchdog.blogspot.com)
59
Accessible items
The following table shows all accessible items, including address examples.
Item
Address example
tags
markers
inputs
outputs
Table 03
Required version of PC Access
The required version of PC Access is V1.0.4.10 (SP4) or higher.
Please download PC access V1.0.4.10 (SP4) .
60
How can you establish a connection between an S7-1200 PLC and SIMATIC NET OPC ?
Description
Please find a detailed description on how to realize a connection between an S7-1200 PLC and
SIMATIC NET OPC V8.0 in the attached pdf-document.
Click the link "S7-1200_OPC_SIMATIC_NET_e.pdf" and save the document to your computer.
S7-1200_OPC_SIMA
TIC-NET_e.pdf
( 822 KB )
Keywords
client, scout
61
(folha em branco)
62
How can you erase the IP address and set your S7-1200 PLC back to factory settings , using the
SIMATIC MC memory card (2MB or 24MB) ?
Description
You can erase the IP address and set your S7-1200 PLC back to factory settings without using the STEP
7 Basic software and without knowing the exact IP address. To do so use any SIMATIC MC memory
card.
Disabling the write protection
Check that the memory card is not write-protected. Slide the protection switch away from the "Lock"
position.
Figure 01
Figure 02
Now the S7-1200 PLC reboots. After rebooting and evaluating the SIMATIC MC memory card, the
internal load memory, this means the device configuration including the IP address, the user program
and any force values, is copied to the memory card. The memory card turns into a program card,
containing the data and IP address stored in the internal load memory before. After the copy has been
completed, the internal load memory of the S7-1200 PLC is erased. The S7-1200 PLC then goes to the
configured startup mode (RUN or STOP).
When the operation is complete, the S7-1200 PLC flashes the maintenance LED to indicate that the
memory card can be removed.
3.
4.
The internal load memory including the IP address is erased and the S7-1200 PLC is set back to factory
settings.
63
(folha em branco)
64
How can you change the IP address of an S7-1200 PLC without STEP 7 Basic ?
Description
You can change the IP address of an S7-1200 PLC using the IP TOOL, which you can find attached to
this entry.
This tool is useful when you load a master project to multiple S7-1200 PLCs, connected to the same
network.
Requirements
2.
Restrictions
After an IP address is assigned by the IP TOOL, you cannot change it again with the IP TOOL,
until after you have downloaded the hardware configuration to your S7-1200 PLC using STEP
7 Basic.
You cannot communicate with a PLC to which no IP address has been assigned.
An IP address cannot be used more than once in a network; each PLC must have a unique IP
address.
Note
In the IP TOOLs "Update accessible devices" list, PLCs with duplicate IP addresses are shown in
red.Assigning an initial IP address to your S7-1200 PLC
No.
1. Update accessible devices
Double-click the item "Update accessible devices" to show all accessible devices.
65
Fig.01
2. Select an S7-1200 PLC
Double-click the S7-1200 PLC without an IP address. On the right side of the dialog, the
available data of the S7-1200 PLC is displayed.
Identify your S7-1200 PLC on site by clicking the "Flash LED Lights" button.
Fig.02
3. Assign a new IP address
66
Fig.03
Table 01
Changing the IP address of an S7-1200 PLC
No.
1. Update accessible devices
Double-click the item "Update accessible devices" to show all accessible devices.
Fig.04
2. Select an S7-1200 PLC
Double-click the S7-1200 PLC whose IP address you want to change. On the right side of hte
dialog, the available data of the S7-1200 PLC is displayed.
67
Identify your S7-1200 PLC on site by clicking the "Flash LED Lights" button.
Fig.05
3. Assign a new IP address
Fig.06
Table 02
IPToolInstall.zip
( 56907 KB )
68
How can you download to a network of several S7-1200 PLCs with the same IP address ?
Description
When you first download a PLC program of a STEP 7 Basic project to a network which contains several
S7-1200 PLCs, a situation may occur in which more than one PLC shares the same IP address.
This means you will miss one or more PLCs. In this case, delete the IP addresses of all PLCs to be able
to access them by their MAC addresses.
Figure 01
Deleting the IP address
Delete the IP address of an S7-1200 PLC using a SIMATIC MC memory card.
Identifying PLCs by their MAC address
To address a PLC by its MAC address, enable the checkbox "Show all accessible devices" in the
"Extended download to device" dialog box and select a MAC address from the list.
Downloading to the PLC
Select a MAC address from the list of accessible devices and click the "Load" button.
69
Figure
02
Note
A new, unconfigured PLC has no preset IP address.
70
How you reset the IP address of your S7-1200PLC using STEP 7 Basic software ?
Description
You can reset the IP address of your S7-1200 PLC using the function "Reset to factory settings" of the
STEP 7 Basic software. Therefore you need online access to your S7-1200 PLC. This means the IP
address of your S7-1200 PLC needs to be the same as the IP address in your STEP 7 Basic project.
Otherwise you cannot go online.
Adjustingthe IP address
1.
To figure out the IP address of your S7-1200 PLC, highlight your S7-1200 PLC in the project
tree. Browse the menu bar for "Online > Extended download to device..." and check the "Show
all accessible devices" check box. The IP address of your S7-1200 PLC is listed in the
"address" column.
Figure 01
2.
Change the IP address of the S7-1200 PLC in your project. Browse the project tree for the
"Device configuration" of your S7-1200 PLC and click the Ethernet port in the work area.
Open the "Ethernet addresses" properties and enter the IP address which you figured out in step
1.
71
Figure 02
Launch STEP 7 Basic, and open the project containing the S7-1200 PLC whose IP address you
want to reset.
In the project tree, browse for the S7-1200 PLC and highlight it.
Click the toolbar command "Go online". The title bar changes to orange. You have online
access to the S7-1200 PLC now.
Figure 03
4.
Double-click item "Online & Diagnostics" in the PLC folder in the project tree. The "Online
access" dialog window of your PLC opens.
72
In the Navigation area, browse for "Functions > Reset to factory settings".
Select the radio button "Reset IP address" in the work area, and click the "Reset" button.
Figure 04
7.
A "Reset to factory settings" dialog box opens. Click the "OK" button.
73
(folha em branco)
74
How can you manage peripheral device errors detected by S7-1200 PLC ?
Description
The S7-1200 PLC can detect and report peripheral device errors for diagnostics-capable devices.
These errors are called diagnostic errors. The following diagnostic errors are supported:
All diagnostic error events trigger the execution of the "Diagnostic error interrupt" organization block
(OB82).
The "Diagnostic error interrupt" OB82 includes startup information that helps you determine the
circumstances of the error occurrence:
You can program instructions inside OB82 to examine these startup values and to take appropriate
action.
Evaluating the diagnostic error events with the "Diagnostic error interrupt" organization block
(OB82)
The occurrence or removal of any of several different diagnostic error conditions results in a
diagnostic error event if the following preconditions are met:
The OB82 has been added to the program of your S7-1200 PLC.
The diagnostic error event has been enabled for the module.
If OB82 does not exist, then the CPU ignores the error.
The "Diagnostic error interrupt" OB82 interrupts the normal cyclic program execution if a diagnosticscapable module recognizes an error.
Note
No "Diagnostic error interrupt" OB82 is present when you create a new project.
No. Evaluating the diagnostic error events with the "Diagnostic error interrupt" organization
block OB82
1
Browse the project tree for the "Add new block" item.
In the "Add new block" window, click the "Organization block" button.
Select the "Diagnostic error interrupt" OB82 from the list.
Click the "OK" button.
Note
You can have only one "Diagnostic error interrupt" OB in your program.
75
Fig. 01
2
Reading out the start information of the "Diagnostic error interrupt" OB82
Double-click the "Diagnostic error interrupt" OB82 of your S7-1200 PLC in the
"Project tree".
Browse the instructions pane for "Instructions > Move > MOVE".
Drag and Drop a "MOVE" instruction into a network of your "Diagnostic error
interrupt" OB82.
Move the value of the "IOstate" tag into a global tag (for example "`DB1`.w_IOstate").
Program the other tags you want to monitor in the same way. Please find an example in
the figure below.
Fig. 02
76
Fig. 03
Table 01
77
Browse the "Project tree" for the "Device configuration" of your S7-1200 PLC.
Click your signal module in the "Device configuration" window.
Select the "Properties" tab and click the "AI4/AO2" item from the navigation area.
Click the "Enable power diagnostics" checkbox.
Fig 04
2
The high limit of an analog input / output has been exceeded (output value greater than
"+32511").
The following S7-1200 PLC LEDs will blink (color of blinking LEDs: red):
78
Browse the "Project tree" for the "Device configuration" of your S7-1200 PLC.
Click your signal module in the "Device configuration" window.
Select the "Properties" tab and click the "AI4/AO2" item from the navigation area.
Scroll down to the channel you want to monitor.
Click the "Enable overflow diagnostics" checkbox.
Fig 05
3
Browse the "Project tree" for the "Device configuration" of your S7-1200 PLC.
Click your signal module in the "Device configuration" window.
Select the "Properties" tab and click the "AI4/AO2" item from the navigation area.
Scroll down to the channel you want to monitor.
79
"Wire break"
The power circuit of an analog Current output is not closed.
The following S7-1200 PLC LEDs will blink (color of blinking LEDs: red):
Browse the "Project tree" for the "Device configuration" of your S7-1200 PLC.
Click your signal module in the "Device configuration" window.
Select the "Properties" tab and click the "AI4/AO2" item from the navigation area.
Scroll down to the channel you want to monitor.
Choose the "Current" analog output type.
Click the "Enable wire break diagnostics" checkbox.
Fig 06
5
"Short circuit"
The contacts of an analog Voltage output are short-circuited.
The following S7-1200 PLC LEDs will blink (color of blinking LEDs: red):
80
Browse the "Project tree" for the "Device configuration" of your S7-1200 PLC.
Click your signal module in the "Device configuration" window.
Select the "Properties" tab and click the "AI4/AO2" item from the navigation area.
Scroll down to the channel you want to monitor.
Choose the "Voltage" analog output type.
Click the "Enable short circuit diagnostics" checkbox.
Fig 07
Table 02
Online diagnostics with STEP 7 Basic
When you have online access to your S7-1200 PLC with STEP 7 Basic, you can use the "Online &
diagnostics" function:
Note
An "Incoming event" shows the beginning of an event.
An "Outgoing event" shows the end of an event.
Doc. tcnico do blog Um PLC sem WatchDog (www.plcsemwatchdog.blogspot.com)
81
Fig. 08
"IOstate" tag
The following table shows the possible I/O states of the "IOstate" tag.
IO_state Description
Bit 0
Configuration correct:
1, if the configuration is correct ; 0 , if the configuration is no longer correct
Bit 4
Error:
1, if an error is present (for example a wire break) ; 0, if the error is no longer present
Bit 5
Bit 6
Table 03
Requirements
S7-1200 PLC
Ethernet cable
PG / PC
STEP 7 Basic V10.5
Diagnostics-capable signal module / board
82
How can you use an analog current output with wire break diagnostics on your S7-1200 PLC ?
Description
You can detect a wire break event at an analog current output with the wire break function of STEP 7
Basic. You evaluate a wire break event using the "Diagnostic error interrupt" organization block
(OB82).
In this description, the signal module SM1234 is used. You can use other signal modules or signal
boards with an analog current output instead.
Adding a signal module with an analog current output to the S7-1200 PLC and enabling the wire
break diagnostics
No. Adding a signal module with an analog current output to the S7-1200 PLC and enabling the
wire break diagnostics
1. Add the signal module to the S7-1200 PLC
You will find a description on how to install a signal module or a signal board in Chapter 2,
"Installation", in the S7-1200 System Manual.
Fig. 01
Note
Please find the S7-1200 System Manual .
2. Add the signal module to the device configuration
Browse the hardware catalog for the signal module. Drag and drop it into the S7-1200 rack in the
device configuration.
Fig. 02
3. Configure the analog output channel and enable the wire break diagnostics
83
Fig.03
Note
The range of the substitute values is [0...32511]. For a current output of 20mA, the equivalent
substitute value is 27648.
Table 01
Evaluating the wire break event using the "Diagnostic error interrupt" OB
The "Diagnostic error interrupt" OB is called when a module detects an error.
The "Diagnostic error interrupt" OB will interrupt the cyclic program execution if a diagnostics-capable
module, for which the diagnostic error interrupt has been enabled, detects an error.
The signal module will blink the "DIAG" light and the light of the concerned channel.
No. Evaluating the wire break event using the "Diagnostic error interrupt" OB
1. Add "Diagnostic error interrupt" organization block OB82
Browse the project tree for the item "Add new block".
In the "Add new block" window, click the "Organization block (OB)" button.
Select the "Diagnostic error interrupt" OB.
Click the "OK" button.
Note
Doc. tcnico do blog Um PLC sem WatchDog (www.plcsemwatchdog.blogspot.com)
84
You can use only one diagnostic error interrupt OB in your program.
Fig. 04
2. Read-out the start information of the "Diagnostics error interrupt" OB
Fig. 05
Doc. tcnico do blog Um PLC sem WatchDog (www.plcsemwatchdog.blogspot.com)
85
Fig. 06
Table 02
Online diagnostics with STEP 7 Basic
When you have online access to your S7-1200 PLC with STEP 7 Basic, you can use the diagnostics
function.
Go online to your S7-1200 PLC. The wrench symbol beside your PLC indicates a diagnostic
error (Fig. 07, blue circle).
Browse the "Project tree" for the entry "Online & diagnostics".
Browse the navigation area of the "Online Access" window for the entry "Diagnostics buffer".
Select the wire break event from the "Events" table.
Beneath the "Events" table, details on the selected event are displayed. Here, you will find the HW-ID,
the channel number, and the type event.
Note
Doc. tcnico do blog Um PLC sem WatchDog (www.plcsemwatchdog.blogspot.com)
86
An "incoming event" shows the beginning of an event, in this case a wire break.
An "Outgoing event" shows the end of an event. The signal module will blink the "DIAG" light and the
light of the concerned channel.
Fig. 07
"IOstate" tag
The following table shows the possible I/O states of the "IOstate" tag.
IO_state Description
Configuration correct:
Bit 0
Error:
Bit 4
Table 03
87
Requirements
S7-1200 PLC
Ethernet cable
PG / PC
STEP 7 Basic V10.5
Signal module / board with analog current output
88
How can you use analog 0-20mA signal modules and signal boards with 4-20mA signals ?
Description
You can use analog 4-20 mA input and output signals with the analog 0-20 mA signal modules and
signal boards. You can scale the signal range of the analog inputs and outputs using the
"Scale_current_input" and "Scale_current_output" predefined functions (FCs), which you can find
attached to this FAQ.
Adding the "Scale_current" Global library
1.
2.
3.
Download the attached library, and unzip it. Open the "Libraries" task card.
Click the "Open global library" button. The "Open global library" dialog window opens.
Browse for the "Scale_current" library folder, and open the "Scale_current.al10" file. Now,
the library is displayed in the "Global libraries" pane in the "Libraries" task card.
Fig. 01
Scaling of the analog input
The range of 0-20 mA without the "Scale_current_input" instruction corresponds to the PLCs internal
signal range of 0-27648. The "Scale_current_input" instruction adapts this internal range to 4-20 mA
linearly, starting with "0" for 4 mA and ending up with "27648" for 20 mA. A limit for wire break
monitoring can be chosen by hand.
Fig. 02
89
Fig. 03
2. Scaling the analog input signal
Connect the contact "w_input_0-20mA" (2) to your analog hardware input (for example, IW96).
You receive the scaled value at the contact "r_input_4-20mA" (4).
Note
For any input value lower than 4 mA the signal at "r_input_4-20mA" (4) will be set to "0".
Accordingly, any input values higher than 20 mA will not exceed the maximum of "27648".
Fig. 04
Doc. tcnico do blog Um PLC sem WatchDog (www.plcsemwatchdog.blogspot.com)
90
Table 01
Scaling of the analog output
The range of 0-20 mA without the "Scale_current_input" instruction corresponds to the PLC1 internal
signal range of 0-27648.
The Scale_current_output" instruction adapts this internal range to 4-20 mA linearly, starting with 4
mA for "0" and ending up with 20 mA for "27648".
Fig. 05
Fig. 06
Doc. tcnico do blog Um PLC sem WatchDog (www.plcsemwatchdog.blogspot.com)
91
Fig. 07
Table 02
Requirements
S7-1200 PLC
Ethernet cable
signal board / signal module for analog output / input
STEP 7 Basic V10.5
S7-1200_Scale_curre
nt.zip
( 348 KB )
92
How do you synchronize the time of the HMI Basic Panel with an S7-1200 PLC ?
Description
Synchronize the system time of your HMI Basic Panel with the system time of your S7-1200 PLC by
configuring tags and blocks and incorporating the configuration in your HMI Basic Panel.
Synchronize the time
Detailed instructions for synchronizing the time are available in PDF format in the section "Instructions
for Synchronizing Time" in the file "S7-1200_HMI_time_sync_HowTo.pdf".
The sample project created in the instructions for STEP 7 Basic V10.5 can be downloaded in the section
"Download" in the file "S7-1200_HMI_time_sync_example.zip".
Instructions for synchronizing the time
Contents:
1.
2.
3.
Double-click the link "S7-1200_HMI_time_sync.pdf" to open the instructions. You need the
Acrobat Reader program for this.
S7-1200_HMI_time_s
ync_HowTo_e.pdf
( 748 KB )
Download
Right-click the link. In the pop-up menu that opens, select the item "Save target as..." and save
the file on your computer. Unpack the file with WinZip program.
S7-1200_HMI_time_s
ync_example.zip
( 1816 KB )
Validity
This FAQ is valid for
Keywords
CPU, Alignment
93
(folha em branco)
94
How do you access S7-1200 tags with a panel or RT configured with WinCC flexible 2008 SP2 ?
Core statement
With WinCC flexible 2008 Service Pack 2 all panels with an Ethernet interface that can be configured with
WinCC flexible 2008 and the WinCC flexible 2008 Runtime can access S7-1200 data blocks using absolute
addresses (no symbolic DBs) via the "SIMATIC S7 300/400" driver.
Compatibility
The following items are supported:
Data type: Bool, Byte, Char, DInt, DWord, Int, Real, Time, Word, String, Array
New S7-1200 data type:
o SInt can be connected in WinCC flexible 2008 SP2 as Char
(range: -128 to 127)
o USInt can be connected in WinCC flexible 2008 SP2 as Byte
(range: 0 to 255)
o UInt can be connected in WinCC flexible 2008 SP2 as Word
(range: 0 to 65535)
o UDInt can be connected in WinCC flexible 2008 SP2 as DWord
(range: 0 to 4294967295)
Structures (Struct, IEC_Counter, IEC_Timer, DTL, IEC_SCounter, IEC_DCounter, IEC_UCounter,
IEC_USCounter, IEC_UDCounter, ErrorStruct) are not supported, but elements of structures can be
connected in WinCC flexible 2008 SP2 separately.
Read and write access to peripheral inputs and outputs
Tag multiplexing
Recipes
Discrete alarms
Analog alarms
Screen number
Project ID
Data records
Coordination
Controller jobs
Procedure
The procedure for the communication with WinCC flexible 2008 Runtime is described below.
No. Remarks
1
Create a data block using an absolute address in STEP 7 Basic V10.5 via "Add new block" and
"Global DB".
95
Fig. 01
Remove the check mark for the option "Symbolic access only".
2
In the data block, you create the tags that WinCC flexible 2008 will access.
Fig. 02
96
In WinCC flexible 2008, you create a connection via "Communication > Connections".
Fig. 03
Open the PG/PC interface under "Start > Control panel > Set PG/PC interface".
In the PG/PC interface, you must set the access point "S7ONLINE" to "TCP/IP -> [Used
network card]".
Fig. 04
97
Create the S7-1200 tags using absolute addresses under "Communication > Tags" (compare
with Fig. 02).
Fig. 05
Table 01
Notice
Service Pack 2 for WinCC flexible 2008 is available.
98
With which devices can the S7-1200 communicate via the PN connection ?
Communication partners of S7-1200
The S7-1200 PLC communicates with the following devices via the PN connection:
Figure 01
Validity
This FAQ is valid from
99
Figure 02
Supported protocols
The S7-1200 PLC supports the following protocols via the PN connection:
Firmware version
ISOonTCP
(RFC 1006)
PROFINET IO
(PNIO)
V1.0.0
--
Table 01
Additional information
More information on this topic is available in chapter 7 in the system manual of the S7-1200 PLC.
100
How do you compensate for the string mismatch caused by the RCV_PTP and SEND_PTP blocks ?
Description
When dealing with string tags, the PTP (point-to-point) communication blocks ignore the specific properties of
maximum string length and actual string length (Fig.01).
When writing data to a string tag, the RCV_PTP block will overwrite the string header data (Fig.02).
When reading data from a string tag, the SEND_PTP block will read the string header information as part of the
virtual string data and send them as well (Fig.03).
Structure of a string tag
A string tag in STEP 7 Basic consists of three parts:
Fig. 01
From the point of view of PTP communication, a string tag consists of the virtual string data only.
Characteristics of the RCV_PTP block
The RCV_PTP block writes the received virtual string data to the prepared string tag in the S7-1200 PLC,
without the necessary length data in the first two bytes. As a result, the processing of this data cannot be
continued, due to the nonexistent string tag header.
Fig. 02
Characteristics of the SEND_PTP block
The SEND_PTP block reads the requested string data including the string header data, which are sent as the first
two bytes of the requested data string.
101
Fig. 03
Preconditions
The data block (DB), in which the string tag is created, needs to be "non-symbolic".
Absolute addressing of the buffer is required.
Fig. 04
Doc. tcnico do blog Um PLC sem WatchDog (www.plcsemwatchdog.blogspot.com)
102
Browse the "Project tree", and double-click the data-block "Data_block_2 (DB2)". In the "Static" column of the
table, enter a tag with a "String[8]" data type.
Fig.05
Compensation of string mismatch using the RCV_PTP block
For compensation, the string length information has to be handled separately.
In this example, a string tag with a length of eight bytes is used.
Pointer "P#".
Absolute address of the 1st bit of the 3rd byte, (for example DB2.DBX12.0).
Number of bytes you want to write into the string tag, separated by a blank. This should be the
maximum length of the string tag (for example BYTE 8).
Fig. 06
103
2.
Copy the maximum and actual string length into the string header
Fig. 07
Note
Before you copy the "actual length" value, you need to convert its data type from UINT to BYTE.
Table 01
Compensation of string mismatch using the SEND_PTP block
For compensation, the string length information has to be handled separately.
In this example, a string tag with a length of eight bytes is used.
No. Compensation of string mismatch using the SEND_PTP block
1. Replace the actual string length in the SEND_PTP block
Fig. 08
Note
Before you replace the "#length" value, you need to convert its data type from BYTE to UINT.
2.
To prevent the string header data from being sent, the SEND_PTP block needs to start reading at the 3rd
byte of the string tag. Absolute addressing of the buffer makes this possible.
In this example, the string tag has a length of eight bytes. It begins at offset 10.0 (DB2.DBBX10.0), so the
virtual string data begins at offset 12.0 (DB2.DBBX12.0). The address expression is similar to the
expression used in table 01, Figure 06.
104
Fig. 09
Table 02
Requirements
S7-1200 PLC
Ethernet cable
PC / PG with Ethernet interface
STEP 7 Basic V10.5
105
(folha em branco)
106
Figure 01
If you call the counter or timer in a function block (FB), you can choose either a "Single Instance" DB or the
"Multi Instance" DB of the FB.
Otherwise, you can only choose a "Single Instance" DB.
Thus, in this case, you generate a single instance DB for every counter or timer, which makes your project
confusing and increases the load memory.
To avoid this situation, you can create a global DB with multi instance properties as follows (example for
counters)
No. Remarks
1
Fig. 02
107
Choose the property "Symbolic access only" property if you want to select several
counters as retentive.
2
Open the new generated DB, and add a static tag using data type "IEC_Counter" (or,
depending on the counter range, one of the other data types: "IEC_SCounter",
"IEC_DCounter", "IEC_UCounter", "IEC_USCounter" or "IEC_UDCounter").
Fig. 03
In the "Retain" column, you can select the counter as retentive:
For DBs with disabled "Symbolic access only", you can select the whole DB
as retentive.
For DBs with enabled "Symbolic access only", you can select several items of
the DB as retentive.
Fig. 04
108
Double click on the three question marks ("<???>") above the counter block, click on
the "eye" icon (which lists available parameters) and select the newly generated
"Multi_instance_DB".
Fig. 05
By inserting a dot (".") after the symbolic name of the DB, you can choose the required
tag element.
Choose the symbolic name of the added counter structure ("IEC_Counter_0").
5
Note
Please find further information about, how the property "Symbolic access only" affects the design of
data blocks .
Please find further information about the SIMATIC S7-1200 in the System Manual or in the help
files of STEP 7 Basic V10.5.
109
(folha em branco)
110
PLC ?
Description
With the SIMATIC S7-1200 PLC you can use up to 6 high-speed counters.
Depending on the CPU, the signal board and the high-speed counting specification you can use some or
all of them.
The attached document provides detailed information about this, as well as an overview in the summary
to find the solution for your high-speed counting task quickly.
Double-click the link "S7-1200_HSCs.pdf" to open the instructions. You need the Acrobat Reader
program for this.
S7-1200_HSCs_e.pd
f
( 659 KB )
Note
Please find further information about the SIMATIC S7-1200 HSCs in the SIMATIC S7-1200
System Manual or in the help files of STEP 7 Basic V10.5.
If you don't find your selected signal board in STEP 7 Basic V10.5 please update the Hardware
Catalog with the STEP 7 Basic V10.5 Hardware Support Packages .
111
(folha em branco)
112
How do you connect a sensor to the analog signal modules of the SIMATIC
Description
A field sensor with the following attributes:
S7-1200 ?
SM 1231 AI 4 x 13 Bit
SM 1231 AI 8 x 13 Bit
SM 1234 AI 4 x 13 Bit / AQ 2 x 14 Bit
113
When using a 4mA to 20mA sensor, you must convert the measured value accordingly.
Please find further information about the SIMATIC S7-1200 in the SIMATIC S7-1200 System
Manual .
114
How can you back up parameters before loading a new control program ?
Description
When you load a new control program into your S7-1200 with STEP 7 Basic V10.5, all the data is
overwritten. Thus, when you change programs, the plant-specific or optimized parameters are lost.
The current version does not permit uploading of the data block content to an offline project.
Therefore, you must use STEP 7 Basic V10.5 to read out such parameters manually from the relevant
data blocks and configure them as Start values in the new control program.
Backing up and configuring the parameters
No. Procedure:
1
Navigate to your monitoring table (watch table) in the project structure via
"<Project_name>" -> "<CPU_designation>" -> "Watch tables".
In the "Address" column you specify the appropriate absolute addresses of the
parameters required or you specify the corresponding symbolic name in the "Name"
column.
Click on the button for monitoring the parameters. The current values are displayed in
the "Monitor value" column.
Save the values with a screenshot, for example.
Fig. 01
Note
To add a monitoring (watch) table, under "Watch tables" you double-click on the item "Add
new Watch table".
2
115
Fig. 02
Note
The initial values are transferred when you load into your S7-1200.
Table 01
Validity
This FAQ is valid for
Keywords:
Variable, Constant, Remanent, Retentivity
116
How can you determine the coordinates of your S7-1200 PLC with a standard GPS receiver?
Description
Receive a standard GPS frame of the RMC data type according to the NMEA 0183 standard with your
S7-1200 PLC. The GPS frames are read using a GPS receiver at the RS 232 interface of the S7-1200
CM1241 RS232 communication module.
The "gps_rcv" function block provided by the attached library will provide you with the Latitude and
Longitude value of your actual position.
The "gps_rcv" function block will preset the hardware configuration with the parameters shown in table
01. No additional port configuration of the S7-1200 CM1241 RS232 communication module is
neccessary.
The "gps_rcv" function block is processed in one CPU cycle. The actual position values are only
available in this evaluation cycle.
Please find further information on the tags in table 05.
Communication parameters
This "gps_rcv" function block is designed to work with a standard GPS receiver according to the NMEA
0183 standard. The specifications are:
Parameter
Setting
Baud rate
38400 bit Not tested with other rates, the GPS receiver used only has one rate available.
Parity
No
Data bits
8 bits
Stop bits
Flow control No
Comment
Table 01
Hardware setup
In this example, a NAVILOCK NL-403P has been used together with a navilock connection cable
(MD6 to RS232).
Fig. 01
117
Note
This standard GPS receiver requires a 5V DC power supply. The communication module does not
provide any power supply for the GPS receiver. Therefore you need an additional 5V DC power
supply (for example a LOGO! POWER 5V DC/3A unit).
2. Add the communication module to the "Device configuration"
Follow these steps:
Browse the "Project tree for the "Device configuration". Select the "Device view" tab.
Drag and drop "Communication module" > "RS232" form the "Hardware catalog" pane
into the device view. Note, that you might need to expand the left side of the S7-1200
rack in the "Device view".
Fig. 02
Table 02
Evaluating the position values of your S7-1200 PLC
Please find an example project in the attached "gps_rcv_proj.zip" zip archive.
No. Synchronizing the system time and date of your S7-1200 PLC
1. Download and open the attached "gps_rcv" S7-1200 global library
Follow these steps:
Download, unzip and open the attached "gps_rcv.zip" S7-1200 global library.
Click the "Open global library" button, browse for the library, and open it.
118
Fig. 03
2. Connect the "gps_rcv" function block
Follow these steps:
Drag and Drop the "gps_rcv" function block into a cyclic called network.
Connect the inputs and outputs of the "gps_rcv" function block according to table 04.
Fig. 04
119
3. Note:
The DTL tag does not include a valid "Day of week" value.
The UTC time provided by the RMC GPS telegram does not support nanoseconds but
only milliseconds.
Table 03
Connectors of the "gps_rcv" function block
Connector
cmd_get_
time_n_date
Data
type
Comment
Fig.05
120
cmd_hw_id
Fig. 06
return_done
BOOL optional; tag is true for the cycle in which the GPS frame was successfully
received.
return_aborted BOOL optional; tag is true for the cycle in which the receive of the GPS frame failed.
Table 04
Tags holding Latitude and Longitude
These tags are accessible via the instance data block of the "gps_rcv" function block (for example,
"gps_rcv_DB.gps_latitude_LReal").
Tag
"gps_rcv_DB.gps_latitude_LReal"
LReal
"gps_rcv_DB.gps_longitude_LReal"
LReal
Table 05
Creation environment
S7-1200 PLC
Communication module CM1241 RS232
Ethernet cable
PG / PC
STEP 7 Basic V10.5 / STEP 7 Basic V11.0
GPS receiver NAVILOCK NL-403P
Connector cable for NAVILOCK GPS receiver (MD6 to RS 232)
Downloads
121
Software
STEP 7
Basic V10.5
Library
gps_rcv.zip
( 797 KB )
STEP 7
Basic V11.0
gps_rcv_V11.zip
( 638 KB )
Project sample
Comment
gps_rcv_proj.zip
( 2682 KB )
gps_rcv_proj_V11.zi
p
( 2642 KB )
Table 06
122
How can you establish a connection between an S7-1200 PLC and SIMATIC NET OPC?
Description
Please find a detailed description on how to realize a connection between an S7-1200 PLC and
SIMATIC NET OPC V8.0 in the attached pdf-document.
Click the link "S7-1200_OPC_SIMATIC_NET_e.pdf" and save the document to your computer.
39960679_S7-1200_
OPC_SIMATIC-NET_e.pdf
( 820 KB )
Keywords
client, scout
123
(folha em branco)
124
How do you implement a weekly timer for the SIMATIC S7-1200 in STEP 7 V11?
Description
You can use the global library "S7-1200_WeeklyTimer" below to implement the function of a weekly
timer in STEP 7 V11.
Instructions
The global library "S7-1200_WeeklyTimer" consists of the three master copies below:
Master
copies
Program
blocks
Parts
Description
Cams_data
WeeklyTimer
Cam
PLC data type for transferring a weekly switch-on and switch-off time
(cam) that can be parameterized.
Time
Watch
table_1
PLC data
types
Watch table
The "WeeklyTimer" function block is called cyclically in the STEP 7 V11 project.
Fig. 01
The "WeeklyTimer" function block consists of the interfaces below:
Data
type
Description
Cam
"Cam"
DTL
DTL
Interface Name
Input
125
Output
OUT Boolean
Data type
Description
On Time
"Time"
Off Time
"Time"
Weekday
Hour
USInt
Minute
USInt
Cam
Time
Function description
The "S7-1200_WeeklyTimer" weekly timer is implemented as a function block.
It has a setting cam ("Cam") which you can use to parameterize a time window.
Via the cam you specify the switch-on time ("On Time") and switch-off time ("Off Time") in the form
of the required weekday (1=Sunday...7=Saturday), hour (0...23) and minute (0...59).
You transfer the cam settings via the "Cam" input. Specify "Cam" as data type from a global data block
with parameterization via the start values.
At the "DTL" input you transfer the current time with which the cam setting is to be compared. To read
this out you select the extended date and time statements "RD_SYS_T" and "RD_LOC_T".
At a switch-on time the weekly timer switches on the "OUT" output if it is not already switched on. The
weekly timer resets the output to the switch-off time.
Special features when parameterizing
It is possible to select multiple weekdays.
The shortest switching period is thus one minute.
If no weekday is selected for the switch-on or switch-off time, the parameterized time is irrelevant in
each case.
If the switch-on time and switch-off time (weekday and time) are identical, resetting of the output has
priority.
If multiple cams are required, call the "S7-1200_WeeklyTimer" function block again and connect the
outputs via an OR operation.
Sample project
The download "S7-1200_WeeklyTimer_project.zip" includes a sample project with the cam
specifications below:
Cam 1:
Cam 2:
126
Version
Code
S7-1200_WeeklyTim
er.zip
S7-1200_WeeklyTim
er_project.zip
( 602 KB )
( 1652 KB )
Note
Service Pack 1 for STEP 7 V11 is available under Entry-ID 51696778.
Requirements
S7-1200
Ethernet cable
STEP 7 (Professional or Basic) V11 SP1
127
(folha em branco)
128
With which devices can the S7-1200 communicate via the integrated PROFINET interface and
which protocols support the S7-1200?
Communication partners of S7-1200
The S7-1200 CPU communicates with the following devices via the integrated PROFINET interface:
connection type
Open User
Communications
S7 communication
HMI connections
PG connections
Webserver (HHTP)
connections
129
Figure 01
PROFINET
For PROFINET the S7-1200 CPU supports maximum 8 PROFINET IO devices and 128 submodules,
whichever is reached first.
Validity
This FAQ is valid from:
Figure 02
130
Supported protocols
The S7-1200 CPU supports the following protocols via the integrated PROFINET interface:
Protocol
TCP
V1.0
V1.0
UDP
V2.0
V2.0
V1.0
V2.0
Webserver
V2.0
Modbus TCP
V2.1
V2.0
V2.0
V2.0
V2.0
V2.0
V2.0
V2.0
V2.0
Additional information
Additional information on communication wih S7-1200 CPU is available in the manual of the S7-1200,
in Entry ID: 36932465.
131
(folha em branco)
132
Description
It is possible to access tags of the S7-1200 from WinCC via the OPC.
For this, you create a PC station with an OPC server. You can access the OPC server with WinCC.
A detailed description of the required procedure is available in chapters 1 to 5 of the PDF in Entry ID
39960679.
Validity
This FAQ is valid for
Keywords
HMI
133
(folha em branco)
134
How can you change the IP address of an S7-1200 without using STEP 7 Basic?
Description
The S7-1200 tool enables you to specify the IP address of one or several S7-1200 CPUs without using
the STEP 7 Basic software.
This tool is particularly useful for mass filling; if, for example, you download a project by means of a
memory card to multiple CPUs in a network and then have to change the IP address for each CPU.
Setting the PG/PC interface
No.
1. Click the "PG/PC Interface" button.
Fig. 01
2.
1.
2.
3.
Fig. 02
Table 01
135
No.
1. Double-click the "Update accessible devices" button to update the list of accessible nodes.
Fig. 03
2. The S7-1200 tool displays the MAC address of CPUs without an assigned IP address.
Fig. 04
3.
1.
2.
Fig. 05
4. Click the "Stop CPU" button to put the CPU into STOP mode.
Fig. 06
136
1.
2.
5.
3.
Specify the IP address, subnet mask and gateway address for the CPU selected.
Then click the "Set" button.
If you enable the "Set as Default" option, the current settings are saved as "Default"
settings when you click the "Set" button.
Click the "Use Defaults" button to load the saved "Default" settings.
Fig. 07
6. Click the "Start CPU" button to put the CPU into RUN mode.
Fig. 08
Table 02
Network Mapping
No.
1. Mark the network card folder in the tree view.
A table is displayed listing all the connected S7-1200 CPUs.
137
Fig. 09
2. Click the "Export..." button to generate a CSV file with the current network settings of all the
connected S7-1200 CPUs.
Save this file on your computer.
Fig. 10
3. Open the exported CSV file with Notepad.
Each line in the CSV file contains a MAC address, IP address, subnet mask and gateway address
for each separate S7-1200 CPU.
You can change the network settings of each CPU as required. You must not change the MAC
address.
You can use the "#" character to insert comments in the CSV file.
Fig. 11
138
4. Click the "Import..." button and select the modified CSV file from Step 3.
Fig. 12
5. Your changes are shown in the Network Mapping table .
Click the "Update" button to apply the new network settings of all the CPUs.
Fig. 13
6.
A green circle next to the S7-1200 CPU indicates that the update has been successful.
A red circle indicates that the update has failed.
A yellow circle indicates that the S7-1200 CPU is in the process of being updated.
Fig. 14
Table 03
139
Additional Functions
No.
1. Click the "Fault Capture" button to read out system information from the selected S7-1200 CPU.
This information can be forwarded to Siemens for analysis.
Fig. 15
2. Click the "Reset To Factory Defaults" button to reset the selected S7-1200 CPU back to its
original factory settings. All the data including the IP address will be deleted.
Fig. 16
Table 04
Requirements
Operating system: Windows XP, Windows Vista or Windows 7 (32-bit versions are supported)
S7-1200
Ethernet cable
PC/PG with Ethernet interface
S7-1200 Tool V2.0.0.5
S7-1200Tool.zip
( 55566 KB )
Keywords
IPTool, IP TOOL, IP-Tool
140
What is the connection between subnet masks and IP addresses with regard to subnetting and
supernetting (classless inter domain routing CIDR)?
Configuration Notes
With CIDR, there is no fixed assignment of an IP address to a network class and possible subnetting in
other networks or supernetting of several networks in a class. There is only one network mask that splits
the IP address into a network part and a host part.
The CIDR function (classless inter domain routing) thus includes subnetting and supernetting.
The following Industrial Ethernet CPs support the "Subnetting" function and "Supernetting" function:
The following CPUs with integrated PROFINET interface support the "Subnetting" function and
"Supernetting" function:
The following Industrial Ethernet PC modules support the "Subnetting" function and "Supernetting"
function:
It is only possible to configure the "Subnetting"function for the remaining Industrial Ethernet PC
modules like IE general, CP1613 (A2), CP1623, CP1612 and CP1512. It is not possible to configure the
"Supernetting" function in STEP 7 / NCM PC for these modules. This is prevented in STEP 7 / NCM
PC by an error message (see Fig. 05).
In these modules that support the TCP/IP protocol it is possible to set both the IP address and the
associated subnet mask in the hardware configuration of STEP 7. The IP address and associated subnet
mask are entered in the Properties window of the CP's or CPU's Ethernet interface. After inserting the
Industrial Ethernet CP or CPU with integrated PN interface in the hardware configuration, you are
offered the following default settings (see Fig. 01) in the Properties window of the CP's or CPU's
Ethernet interface.
141
IP address: 192.168.0.1
Subnet mask: 255.255.255.0
Subnet mask
255.0.0.0
1 byte
3 bytes
255.255.0.0
2 bytes
2 bytes
255.255.255.0 3 bytes
---
1 byte
Multicasting addresses
Class A network
IP addresses from Class A begin with the bit sequence 0-..., e.g. the IP address range lies between
0.x.x.x and 127.x.x.x.
Doc. tcnico do blog Um PLC sem WatchDog (www.plcsemwatchdog.blogspot.com)
142
The subnet mask identifies the range that includes the address information for identifying the subnet. In
Class A networks the first byte, that is to say the first 8 bits correspond to the IP address of the subnet
address. Thus Class A networks are defined by the following subnet mask: 255.0.0.0 = 1111 1111 0000
0000 0000 0000 0000 0000. The last three bytes (24 bits) of the IP address identify a node in this
subnet.
The total number of Class A networks can be calculated as follows:
28-1-2 = 27-2 = 126 networks (since the IP address always begins with the bit sequence 0-...,
0.0.0.0 and 127.0.0.0 are not permitted)
224-2 = 16 777 214 computers (x.0.0.0 -> network address and x.255.255.255 -> broadcast
address are not permitted)
216-2 = 214 = 16384 networks (since the IP address always begins with the bit sequence 1-0...)
216-2 = 65534 computers (x.x.0.0 -> network address and x.x.255.255 -> broadcast address are
not permitted)
143
Class C network
IP addresses from Class C begin with the bit sequence 1-1-0... and the address range lies between
192.0.0.x and 223.255.255.x. In Class C networks the first three bytes, that is to say the first 24 bits
correspond to the IP address of the subnet address. Thus Class C networks are defined by the following
subnet mask: 255.255.255.0 = 1111 1111 1111 1111 1111 1111 0000 0000. The last byte (8 bits)
identifies a node in this subnet.
The total number of Class C networks can be calculated as follows:
224-3 = 221 = 2 097 152 networks (since the IP address always begins with the bit sequence 1-10...)
28-2 = 254 computers (x.x.x.0 -> network address and x.x.x.255 -> broadcast address are not
permitted)
A Class A network is larger than a Class C network, because there is a much greater address
area available for addressing the computers.
There are much less Class A networks than Class C networks because the address area of the
subnets is much smaller.
Reserved addresses
The Class A network address 127.x.x.x is reserved for the Loopback function of all
computers, i.e.:
all IP addresses that have the value 127 in the first byte may only be used for internal tests of
computers.
The 255 values are reserved as broadcast addresses. Thus, for example, the address
140.80.255.255 is a broadcast address to all computers in the Class B network 140.80.0.0.
The following ranges are reserved for private networks. All IP addresses in these ranges are not
routed in the Internet.
10.0.0.0 - 10.255.255.255
172.16.0.0 - 172.31.255.255
192.168.0.0 - 192.168.255.255
Until now, the connection between the class of the IP address and subnet mask has been explained.
Furthermore, it is possible to extend the subnet mask with the so-called "Subnetting" procedure.
144
Subnetting
Subnetting can be implemented in a Class A network, for example. It is possible to divide the computers
of this Class A network into further logical units (subnets). We will observe the Class A network
86.x.x.x as an example. The subnet mask of this Class A network is 255.0.0.0 (1111 1111 0000 0000
0000 0000 0000 0000). The address area can be divided further into logical subnets by extending the
subnet mask by 1 bit. The subnet mask is then 255.128.0.0 (1111 1111 1000 0000 0000 0000 0000
0000).
This means the following for addressing:
Only the addresses 86.0.0.1 to 86.127.255.254 can communicate directly with each other, i.e.
without router, because these computers have the same value (in this case "0") in the first bit
after the subnet mask.
Only the addresses 86.128.0.1 to 86.255.255.254 can communicate directly with each other, i.e.
without router, because these computers have the same value (in this case "1") in the first bit
after the subnet mask.
The address area of the computers in this Class A network has been divided into two subnets.
Conclusion
By extending the subnet mask you can divide the address area of the computers into more logical units
(subnets). The address area has been divided into two subnets in the example. By adding more bits you
can quickly multiply the number of subnets. You can extend a subnet as you wish.
Supernetting
Supernetting is the grouping together of multiple networks with partially the same network share in one
single route. The underlying technology is the opposite to subnetting and in principle means a procedure
for addressing a large number of hosts within one IP network. With supernetting the host share of a
network class is increased. Thus the network share of this network class is decreased.
We will observe the Class C network 192.168.178.0 as an example. The subnet mask of this Class C
network is 255.255.255.0 (1111 1111 1111 1111 1111 1111 0000 0000). Now 2 bits are added to the
host share. The subnet mask is then 255.255.252.0 (1111 1111 1111 1111 1111 1100 0000 0000).
Requirement
The use of the "Supernetting" function requires that the modules in the network support the function
"classless inter domain routing" (CIDR).
Note:
If the module configured in STEP 7 does not support the "Subnetting" unction or the "Supernetting"
function, then use of these functions is prevented by an error message in STEP 7 (see Fig. 05 "STEP 7
error message").
The input of subnet masks in the form 255.5.0.0 = 1111 1111 0000 0101 0000 0000 0000 0000 is
prevented by STEP 7. Here, it is not the next two consecutive bits that are used for subnet addressing,
but any two other bits. Since this method is very difficult to handle and provokes very many user errors,
we strongly recommend not to use it. STEP 7 prevents configuration of such a subnet mask in the
Properties window of the CP's Ethernet interface by output of the following error message.
145
146
Inserting an SD card
Failure of an expansion module
Other reasons
If STOP mode occurs, you need software for changing to RUN mode.
Remedy
We recommend setting the startup mode "Warm restart RUN". Then, the CPU changes automatically
back into RUN mode when power returns. In this way, neither you nor your customers need customer
supports assistance to set the CPU back into RUN mode.
The table below shows the startup modes of the S7-1200 CPU.
Startup mode
CPU behavior
No startup
Warm restart - operating mode before POWER OFF CPU goes into the same mode as before loss of
power.
Note
As from STEP 7 V11 and firmware version V2.0 you have the option of changing operating modes
using the web server if activated.
Proceed as follows.
1.
2.
3.
4.
147
(folha em branco)
148