Beruflich Dokumente
Kultur Dokumente
NOTAS DE APLICAO N 01
SIEMENS S7-1200
www.bresimar.pt
SIEMENS S7-1200
NOTAS DE APLICAO N 01
(folha em branco)
www.bresimar.pt
SIEMENS S7-1200
NOTAS DE APLICAO N 01
www.bresimar.pt
SIEMENS S7-1200
NOTAS DE APLICAO N 01
(folha em branco)
www.bresimar.pt
SIEMENS S7-1200
NOTAS DE APLICAO N 01
FAQ - 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".
1. Expand the view of the PLC in the "Project tree", and open the "Program blocks" folder. Doubleclick 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
2. Enter a tag name (for example "a_jobMailbox") in the "Name" column.
3. 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.
4. 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
5. Select the PLC in the "Project tree" and click the "Compile" button in the tool bar. The data block is
www.bresimar.pt
SIEMENS S7-1200
NOTAS DE APLICAO N 01
compiled. Following compilation, the tag array is available for further use in the project.
Fig. 03
Note
The data block must be compiled before the tag array is available for further use.
1. Expand the view of the HMI device in the "Project tree" and double-click the "Connections" entry.
The "Connections" editor opens.
Fig. 04
2. Open the "Area pointers" tab and enable the "Job mailbox" area pointer by checking the box in the
"Active" column.
www.bresimar.pt
SIEMENS S7-1200
NOTAS DE APLICAO N 01
3. 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.
Fig. 05
Fig. 06
Read the local time from the PLC
Fig. 07
Enter the parameters in the "Job mailbox" tag.
www.bresimar.pt
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Fig. 08
Note
The parameters are BCD-coded.
www.bresimar.pt
SIEMENS S7-1200
NOTAS DE APLICAO N 01
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.
Fig. 10
Table 01
Requirements
S7-1200 PLC
Ethernet cable
PG / PC
STEP 7 Basic V10.5
www.bresimar.pt
SIEMENS S7-1200
NOTAS DE APLICAO N 01
(folha em branco)
www.bresimar.pt
10
SIEMENS S7-1200
NOTAS DE APLICAO N 01
FAQ - 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.
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.
www.bresimar.pt
11
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Fig. 01
The type of block, in which the error occurred (for example "data_block".gl_error.block_type)
The number of the block in which the error occurred (for example:
"data_block".gl_error.code_block_number)
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".
www.bresimar.pt
12
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Fig. 02
Table 01
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
www.bresimar.pt
13
SIEMENS S7-1200
NOTAS DE APLICAO N 01
called block.
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
www.bresimar.pt
14
SIEMENS S7-1200
NOTAS DE APLICAO N 01
FAQ - 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.
www.bresimar.pt
15
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Fig. 01
3. "Queue overflow"
An overflow has occurred in an interrupt OB queue. There is a queue for each interrupt priority group. If an
interrupt event occurs when the corresponding queue is full, a time error event is generated.
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
www.bresimar.pt
16
SIEMENS S7-1200
NOTAS DE APLICAO N 01
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.
www.bresimar.pt
17
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Fig. 03
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.
Fig. 04
www.bresimar.pt
18
SIEMENS S7-1200
NOTAS DE APLICAO N 01
"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
www.bresimar.pt
19
SIEMENS S7-1200
NOTAS DE APLICAO N 01
(folha em branco)
www.bresimar.pt
20
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Fig. 01
Figure 01 illustrates the calculation of the integral of a trapezoidal area:
Fig. 02
www.bresimar.pt
21
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Parameter
Data
type
Memory
area
Description
EN
BOOL
I, Q, M, D,
L
IN
REAL
M, D, L
Value to be integrated
Enable
BOOL
I, Q, M, D,
L
Reset
BOOL
I, Q, M, D,
L
SMB
BYTE
ENO
BOOL
Q, M, D, L
Enable output
OUT
REAL
M, D, L
Error
BOOL
Q, M, D, L
Error output (it is steady TRUE, if the system memory byte is disabled or
not connected and it is TRUE for one cycle, if a power up occurs while the
integration is enabled = sign for a power break down while integration)
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.
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 )
www.bresimar.pt
22
SIEMENS S7-1200
NOTAS DE APLICAO N 01
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
www.bresimar.pt
23
SIEMENS S7-1200
NOTAS DE APLICAO N 01
(folha em branco)
www.bresimar.pt
24
SIEMENS S7-1200
NOTAS DE APLICAO N 01
FAQ 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.
www.bresimar.pt
25
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Fig.01
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.
www.bresimar.pt
26
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Item_01: "DB1.DBB0"
Item_02: "DB1.DBW2"
Item_03: "DB1.DBD4"
Fig.03
Table 01
www.bresimar.pt
27
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Fig.04
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
www.bresimar.pt
28
SIEMENS S7-1200
NOTAS DE APLICAO N 01
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".
www.bresimar.pt
29
SIEMENS S7-1200
NOTAS DE APLICAO N 01
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
www.bresimar.pt
30
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Fig.09
Fig.10
www.bresimar.pt
31
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Table 02
Accessible items
The following table shows all accessible items, including address examples.
Item
Address example
tags
markers
inputs
outputs
Table 03
www.bresimar.pt
32
SIEMENS S7-1200
NOTAS DE APLICAO N 01
FAQ 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.
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.
www.bresimar.pt
33
SIEMENS S7-1200
NOTAS DE APLICAO N 01
(folha em branco)
www.bresimar.pt
34
SIEMENS S7-1200
NOTAS DE APLICAO N 01
FAQ 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
S7-1200 PLC
Ethernet cable
PC / PG with Ethernet interface
IP TOOL V1.1.0.1
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.
www.bresimar.pt
35
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Fig.01
2.
Fig.02
3.
36
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Fig.03
Table 01
Fig.04
2.
www.bresimar.pt
37
SIEMENS S7-1200
NOTAS DE APLICAO N 01
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.
Identify your S7-1200 PLC on site by clicking the "Flash LED Lights" button.
Fig.05
3.
Fig.06
Table 02
IPToolInstall.zip ( 56907 KB )
www.bresimar.pt
38
SIEMENS S7-1200
NOTAS DE APLICAO N 01
FAQ 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
www.bresimar.pt
39
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Figure 02
Note
A new, unconfigured PLC has no preset IP address.
www.bresimar.pt
40
SIEMENS S7-1200
NOTAS DE APLICAO N 01
FAQ 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.
www.bresimar.pt
41
SIEMENS S7-1200
NOTAS DE APLICAO N 01
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 S71200 PLC now.
www.bresimar.pt
42
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Figure 03
4.
5.
6.
Double-click item "Online & Diagnostics" in the PLC folder in the project tree. The "Online access" dialog
window of your PLC opens.
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.
Note
Make sure that no SIMATIC MC memory card is inserted in your S7-1200 PLC while deleting the IP address.
www.bresimar.pt
43
SIEMENS S7-1200
NOTAS DE APLICAO N 01
(folha em branco)
www.bresimar.pt
44
SIEMENS S7-1200
NOTAS DE APLICAO N 01
FAQ 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
Fig. 01
Note
Please find the S7-1200 System Manual .
Fig. 02
www.bresimar.pt
45
SIEMENS S7-1200
NOTAS DE APLICAO N 01
3. Configure the analog output channel and enable the wire break diagnostics
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.
www.bresimar.pt
46
SIEMENS S7-1200
NOTAS DE APLICAO N 01
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
You can use only one diagnostic error interrupt OB in your program.
Fig. 04
www.bresimar.pt
47
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Fig. 05
"IOstate" (WORD)
The "IOstate" contains the I/O status of the diagnostics-capable module.
Please find details on the "IOstate" tag in Table no. 3.
"laddr"(HW-ANY)
This is the hardware-identifier.
The Hardware identifier (HW-ID) identifies modules or functional units of modules (for example outputs and
high speed counter). The hardware identifier consists of a whole number and is reported by the system along
with diagnostics alarms to allow the faulty module or functional unit to be localized (see Fig. 07 for details).
To identify the functional unit belonging to the HW-ID, browse the "Project tree" for the "PLC tags" item.
Select the "Constants" tab from the "PLC tags" window. The "Value" column holds a list of the used HW-IDs
(Fig. 06).
"Channel" (UINT)
The "Channel" contains the number of the output channel being used on the signal module.
"multierror" (BOOL)
The "multierror" bit indicates that more than one error has occurred.
www.bresimar.pt
48
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Fig. 06
Table 02
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
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
www.bresimar.pt
49
SIEMENS S7-1200
NOTAS DE APLICAO N 01
"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
Bit 5
Bit 6
Table 03
Requirements
S7-1200 PLC
Ethernet cable
PG / PC
STEP 7 Basic V10.5
Signal module / board with analog current output
www.bresimar.pt
50
SIEMENS S7-1200
NOTAS DE APLICAO N 01
FAQ 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.
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
www.bresimar.pt
51
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Fig. 02
Fig. 03
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".
www.bresimar.pt
52
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Fig. 04
Table 01
Fig. 05
www.bresimar.pt
53
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Fig. 06
Note
For any input value lower than "0", the signal at "w_output_0-20mA" will be set to 4mA.
Accordingly, any input values higher than "27648"will not exceed the maximum of 20mA.
Fig. 07
Table 02
www.bresimar.pt
54
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Requirements
S7-1200 PLC
Ethernet cable
signal board / signal module for analog output / input
STEP 7 Basic V10.5
S7-1200_Scale_current.zip ( 348 KB )
www.bresimar.pt
55
SIEMENS S7-1200
NOTAS DE APLICAO N 01
(folha em branco)
www.bresimar.pt
56
SIEMENS S7-1200
NOTAS DE APLICAO N 01
FAQ - 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.
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_sync_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_sync_example.zip( 1816 KB )
Validity
This FAQ is valid for
Keywords
CPU, Alignment
www.bresimar.pt
57
SIEMENS S7-1200
NOTAS DE APLICAO N 01
(folha em branco)
www.bresimar.pt
58
SIEMENS S7-1200
NOTAS DE APLICAO N 01
FAQ 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".
www.bresimar.pt
59
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Fig. 01
Remove the check mark for the option "Symbolic access only".
In the data block, you create the tags that WinCC flexible 2008 will access.
Fig. 02
www.bresimar.pt
60
SIEMENS S7-1200
NOTAS DE APLICAO N 01
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
www.bresimar.pt
61
SIEMENS S7-1200
NOTAS DE APLICAO N 01
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.
www.bresimar.pt
62
SIEMENS S7-1200
NOTAS DE APLICAO N 01
FAQ 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
www.bresimar.pt
63
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Validity
This FAQ is valid from
S7-1200 CPUs with firmware version V1.0.0.
Software version STEP 7 Basic V10.5 without Service Pack.
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.
www.bresimar.pt
64
SIEMENS S7-1200
NOTAS DE APLICAO N 01
FAQ 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).
Fig. 01
From the point of view of PTP communication, a string tag consists of the virtual string data only.
Fig. 02
www.bresimar.pt
65
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Fig. 03
Preconditions
The data block (DB), in which the string tag is created, needs to be "non-symbolic".
www.bresimar.pt
66
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Fig. 04
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
www.bresimar.pt
67
SIEMENS S7-1200
NOTAS DE APLICAO N 01
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
2.
Copy the maximum and actual string length into the string header
Fig. 07
www.bresimar.pt
68
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Note
Before you copy the "actual length" value, you need to convert its data type from UINT to BYTE.
Table 01
Fig. 08
Note
Before you replace the "#length" value, you need to convert its data type from BYTE to UINT.
2.
Fig. 09
www.bresimar.pt
69
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Table 02
Requirements
S7-1200 PLC
Ethernet cable
www.bresimar.pt
70
SIEMENS S7-1200
NOTAS DE APLICAO N 01
FAQ How can you reduce memory usage with Multi instancing ?
Description
When you call counters or timers in STEP 7 Basic V10.5, the "Call options" dialog appears to assign the
instance data block for this function.
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
www.bresimar.pt
71
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Figure 02
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").
Figure 03
www.bresimar.pt
72
SIEMENS S7-1200
NOTAS DE APLICAO N 01
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.
Figure 04
www.bresimar.pt
73
SIEMENS S7-1200
NOTAS DE APLICAO N 01
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".
Figure 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.
www.bresimar.pt
74
SIEMENS S7-1200
NOTAS DE APLICAO N 01
FAQ How many high-speed counters (HSCs) are provided by SIMATIC S7-1200
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.pdf ( 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 .
www.bresimar.pt
75
SIEMENS S7-1200
NOTAS DE APLICAO N 01
(folha em branco)
www.bresimar.pt
76
SIEMENS S7-1200
NOTAS DE APLICAO N 01
FAQ How do you connect a sensor to the analog signal modules of the SIMATIC
S7-1200 ?
Description
A field sensor with the following attributes:
SM 1231 AI 4 x 13 Bit
SM 1231 AI 8 x 13 Bit
www.bresimar.pt
77
SIEMENS S7-1200
NOTAS DE APLICAO N 01
78
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Note
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 .
www.bresimar.pt
79
SIEMENS S7-1200
NOTAS DE APLICAO N 01
(folha em branco)
www.bresimar.pt
80
SIEMENS S7-1200
NOTAS DE APLICAO N 01
FAQ 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.
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.
Fig. 01
Note
To add a monitoring (watch) table, under "Watch tables" you double-click on the item "Add new Watch
table".
www.bresimar.pt
81
SIEMENS S7-1200
NOTAS DE APLICAO N 01
Navigate to your data block in the project structure via "<Project_name>" ->
"<CPU_designation>" -> "Program blocks".
In the "Initial value" column you configure the values read out previously for your
parameters.
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
www.bresimar.pt
82