Professional Documents
Culture Documents
A PLC INSIDE A PC
Information in this document is subject to change without notice and does not represent a commitment on the part of IBH softec GmbH. The software and/or databases, described in this document, are furnished under a license agreement or non-disclosure agreement. The software and/or databases may be used or copied only in accordance with the terms of the agreement. It is against the law to copy the software on any medium except as specifically allowed in the license or non-disclosure agreement. The purchaser may make one copy of the software for backup purposes. No part of this manual and/or databases may be reproduced or transmitted in any form or by any means, (electronic or mechanical, including photocopying, recording, or information storage and retrieval systems), for any purpose other than the purchaser's personal use, without the express written permission of IBH softec GmbH.
Gesellschaft fr Automatisierungstechnik mbH Turmstrae 77 D - 64743 Beerfelden / Odw. Germany Telefon 0 60 68 / 30 01 Telefax 0 60 68 / 30 74 Internet: www.IBHsoftec.de E-Mail: info@IBHsoftec.de
Windows, Windows NT, Visual C, Visual Basic, Excel, and Access, are registered trademarks of the Microsoft Corporation. Simatic S5, Step 5, Simatic S7, Step 7, S7-200, S7-300, S7-400, and GRAPH 5 are registered trademarks of Siemens AG, Mnchen and Berlin. S7 for Windows SoftPLC
Contents
Page I
Contents
SoftPLC Fundamentals................................................................. 3
3.1 3.2 Response Time ..................................................................................... 3 Retentivity ............................................................................................. 3
Load at Start.................................................................................................... 3 Save at Termination ........................................................................................ 3 Save M, T, C at Termination ........................................................................... 4
3.3 3.4
4.1.8
4.1.9 4.1.10
Page II
SoftPLC
4.1.11
Exit PLC......................................................................................................... 10
5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 5.10 5.11 5.12 5.13 5.14 5.15 5.16 5.17 5.18 5.19
Load and Transfer Instructions ......................................................... 13 Peripheral Access Instructions ......................................................... 14 Accumulator Instructions................................................................... 14 Shift and Rotation Instructions.......................................................... 14 Timer Instructions............................................................................... 15 Counter Instructions........................................................................... 15 Word Instructions ............................................................................... 16 Arithmetic Instructions....................................................................... 16 Data Type Conversion Instructions................................................... 17 Jump Instructions............................................................................... 18 Block Call Instructions ....................................................................... 19 Indirect Addressing Instructions....................................................... 19 Program Display and Null Operation Instructions ........................... 20 PLC Memory Allocation...................................................................... 20 System Data Area Allocation ............................................................. 20 Organization Blocks (OBxx) integrated ............................................ 21 Integrated System Functions............................................................. 21 Integrated System Function Blocks .................................................. 22
6.2
Example ............................................................................................... 28
6.2.1 6.2.2 6.2.3
Contents
Page III
8 9
10.3
11 Appendix ..................................................................................... 49
Null Modem Cable......................................................................................... 49
S7 for Windows SoftPLC
Page IV
SoftPLC
12 Index.............................................................................................51
Chapter 1
Introduction
Page 1
1 Introduction
This manual will explain how to install and how to use the Software PLC SoftPLC PLC416 and the Simulation PLC SimPLC. Both Software PLC's are compatible with the Siemens PLC S7-416 hardware. Also available is a Software PLC SoftPLC PLC315 which is compatible with the Siemens PLC S7-315 hardware. The Simulation PLC is not a "Real Time" application. Rather the SimPLC is used as a development tool to test PLC programs. As the SimPLC does not have real time capability the Simulation PLC may not be used to control a process. Therefore user DLL's (e.g. CIFDriver) can't be read in. The use of the Simulation PLC cannot be prohibited with a password. The corresponding switch in the dialog box has no function. The Simulation PLC does not support access to I/O ports. The dialog box where you would enter an I/O port address is disabled. The Software PLC requires the Microsoft operating systems Windows NT Version 4.x or Windows 2000. The Simulation PLC ,which does not have real time capability, may also be executed under the Microsoft operating systems Windows 95 or Windows 98. All other functions of the Software PLC SoftPLC and the Simulation PLC SimSPS are identical. In the following chapters all explanations refer to the Software PLC and the Simulation PLC even if only the Software PLC is mentioned. Differences between the Software PLC and the Simulation PLC are mentioned only if they are not mentioned above or are the consequences of the above limitations. Some differences apply to the SoftPLC PLC315. Both Software PLCs use the same instruction set and have the same integrated functions. The limitations of the PLC315 Software PLC versus the PLC416 Software PLC are as follows: SoftPLC PLC416 Load Memory limited by the PC Memory, adjustable SoftPLC PLC315 80kByte, fixed value M0.0 up to M255.7 T0 up to T127 C0 up to C63
Differences between the PC416 and PC315 Software PLCs are only mentioned if they are not mentioned above or are the consequences of the above limitations.
Page 2
SoftPLC
Chapter 2
2 SoftPLC Installation
The Software PLC requires either Windows NT Version 4.x or Windows 2000 Microsoft operating systems. The Simulation PLC may be executed using Windows NT Version 4.x, Windows 2000, Windows 95, or Windows 98 Microsoft operating systems. In General a CD Drive is required to install the software, however the CD provides the software to generate 3.5" installation disks.
2.1
2.2
Online Functions
The Software PLC can be accessed directly from S7 for Windows or via a serial port. The programming device must be connected with the PC running the Software PLC via a Null Modem Cable.
Chapter 3
SoftPLC Fundamentals
Page 3
3 SoftPLC Fundamentals
The Software PLC is designed to reproduce a Hardware PLC with Real-Time capability. After downloading the PLC program to the Software PLC, it is executed in the same manner as a Hardware PLC. This ensures the ability to directly monitor the status of the operands without recompiling the executed PLC program. It is therefore possible to determine which PLC instruction is being executed at any time.
3.2 Retentivity
If a retentivity of the Software PLC is required (as in a Hardware PLC) some settings in the Software PLC dialog field are necessary. With the explanation of the use of these check boxes and an Uninterruptible Power Supply (UPS), it is possible to configure the Software PLC to act the same as a Hardware PLC in case of a power failure (retentive behavior). With an installed UPS and the support of Windows NT, the PLC program resident in the Software PLC and the Memory Bits (M), Timers (T), and Counters (C), with their current conditions, are saved in a binary file (PLC.BIN) on the hard disk. A signal from the UPS (via a COM port) starts the power down procedure in the case of a power failure. The battery of the UPS will ensure that the PC has power until the power down process is completed. When the power returns, the Software PLC program can start-up with the Memory Bits (M), Timers (T), and Counters (C) with same conditions that were saved at power down. To enable the retentivity of the Software PLC the following check boxes must be marked: Load at Start The PLC program stored on the hard disk in the binary file PLC.BIN will be transferred into the SoftPLC during the SoftPLC start up procedure (PC boot up). Save at Termination The PLC program resident in the Software PLC is saved in the PLC.BIN file on the hard disk when the Software PLC application is terminated. In addition, the PLC program is saved in
S7 for Windows SoftPLC
Page 4
SoftPLC
Chapter 3
the PLC.BIN file when Windows NT / 2000 is terminated in a normal manner while the Software PLC is running. Save M, T, C at Termination The current state of the Memory Bits (M), Timers (T), and Counters (C) are saved in the PLC.BIN file along with the PLC program currently resident in the Software PLC, when the program is terminated. In addition, the PLC program is saved in the PLC.BIN file when Windows NT / 2000 is terminated with its normal procedure while the SoftPLC is running.
A polling frequency of 2ms and the task interval setting of 1ms will result in a 50% processing power sharing between the Software PLC and the Windows operating system and any other windows applications.
Chapter 4
Page 5
Figure 4-1
SoftPLC Dialog Box The Software PLC timing is displayed and is constantly updated.
Page 6
SoftPLC
Chapter 4
The PLC program is executed in the Software PLC CPU (RUN mode) The Software PLC CPU is in its STOP mode. The PLC program is not executed.
Complete Restart (OB 100) Marking the Compl. Rst. (OB 100) button will put the Software PLC CPU is in its RUN mode. First, the Organization Block OB 100 is executed and then the PLC program will start to execute OB 1 and cycle. This program start is the same as the start sequence of a Hardware PLC, when power is restored.
Restart (OB 101) Marking the Restart (OB 101) button will put the Software PLC CPU is in its RUN mode. First, the Organization Block OB 101 is executed and then the PLC program will start to execute OB 1 and cycle. This program start is the same as the start sequence of a Hardware PLC when restarting the CPU with the RUN / STOP switch.
Stop Marking the Stop button will put the Software PLC CPU is in its STOP mode. The execution of the PLC program is terminated. The state of the Process Images, Memory Bits, Timer, and Counters are saved with their actual current status. The watchdog of the interface board must put the output signals into their OFF stage.
4.1.2 Cycle
The number of the cycles the PLC program executes is counted and displayed. The cycle counter is halted with the Stop button. Marking one of the Start (OB10x) buttons resets the cycle counter.
The execution time of the program is constantly measured and displayed. The minimum, maximum, and current cycle times are displayed. Depending of the PLC program structure, the cycle time of a PLC program may vary greatly. At the end of a cycle, the Software PLC saves the results of the time measurement. The time measured is the time from the call of OB 1 until the next OB 1 call. The cycle times (OB 1 cycle time) can be read by the PLC program.
S7 for Windows SoftPLC
Chapter 4
Page 7
Currently actual cycle time in ms Maximum cycle time in ms Minimum cycle time in ms
The port address and the number of ports must be entered in the text field. The Software PLC must be restarted to activate the I/O ports.
4.1.5 Jitter
Jitter is the variation in the cycle time of the Software PLC caused by the system itself. If an output pulse from a timer OB (e.g. OB 10, every 10 ms) and measured, differences may be found. Jitter is the variation in time between the current measurement, relative to the previously measured time. You will see jitter with hardware and software PLCs. With software PLC's the jitter may be caused by program interruption within the PLC program and also could occur due to hard disk access, network access, etc (system activities). The Jitter of the Software PLC is constantly measured. The maximum jitter and the actual jitter is displayed.
The jitter value must be added to the reaction time of the Software PLC.
Page 8
SoftPLC
Chapter 4
4.1.7 Options
The Software PLC options to be set with the SoftPLC dialog box may be interlocked with a password. The settings in the PLC Program and Data Blocks and the I/O port settings (can only be altered when the options are unlocked with the correct password.
The locking and unlocking of the options is done with the buttons Lock and Unlock. These buttons open a text box to enter the password. Locked The marked field Locked indicates that none of the settings in the Software PLC dialog box may be altered prior to unlocking the options with a password. If Locked is marked, none of the dialog boxes settings can be altered. The operation of the buttons Start, Stop, and Exit PLC are also disabled. The locking option gives you the ability to inhibit any operator invention after setup. To change the dialog box settings a valid password must be entered prior to the intervention. The information in the dialog box is always valid. Unlocked The marked field Unlocked indicates that the option may be altered any time without a password. Modify Password You may also change the password by pressing the Modify Password button. Prior to activating the Software PLC lock protection, you have to define a password to turn the protection on and off. The password may have up to 27 characters. The password may be changed any time as long as you know the old password. As a default no password is assigned. If one of above mentioned buttons is activated, the Enter Password dialog box is opened. Please enter the valid password and confirm with OK button. In the text field Old Password enter the password you defined the last time. If no password has yet to be assigned (default setting) do not enter a password. In the text field New Password enter the password you want to use to turn the Software PLC lock protection on. The same password is needed to turn the PLC lock protection off. To avoid entering a wrong password due to typing errors you have to type the new password again in the text field Reenter Password. The password you entered is not displayed in the text fields. Each star represents one (1) typed character. ! To confirm the password entry, activate the OK button. The Software PLC lock protection may now be turned on and of with the defined password.
If the re-entered password and the new password do not match a warning will be displayed and the new password is ignored. If you have lost the password you have to reinstall the Software PLC.
S7 for Windows SoftPLC
Chapter 4
Page 9
Save Activating the Save button will save the PLC program currently stored in the Software PLC to the hard disk in the binary file PLC.BIN. Save M, T, C at Termination If the check box Save M, T, C at Termination is activated the Memory Bits (M), Timers (T), and Counters (C) are also saved in the PLC.BIN file. The Software PLC will display the following warning prior to saving the data on disk:
If you encounter problems during the next Software PLC start delete the binary file PLC.BIN. Problems may occur if a corrupted PLC program was saved or the saving process was interrupted. In such cases you must reload the PLC program from the programming system environment. The Memory Bits (M), Timers (T), and Counters (C) will then be in their initial conditions. Load If the Load button is activated, the PLC program, stored on the hard disk in the binary file PLC.BIN, will be transferred into the Software PLC. If the check box Save M, T, C also was activated prior to the last save action, the Memory Bits (M), Timers (T), Counters (C) are reset to the condition they had at that time. The Jitter display is also reset. Load at PLC Start If the Load at PLC Start check box is activated, the PLC program stored on the hard disk in the binary file PLC.BIN will be transferred into the Software PLC during the start up procedure (PC boot up). The start of the Software PLC is exactly the same as if starting a hardware PLC after a power failure (the power to the hardware PLC was switched off). First, the Organization Block OB101 will be executed then the cyclical execution of the Organization Block OB1 will start. If the Memory Bits (M), Timers (T), and Counters (C) have been saved in the PLC.BIN file, the saved data will be transferred into the Software PLC. Save at PLC Termination If the Save at PLC Termination check box is activated, the PLC program resident in the Software PLC is saved in the PLC.BIN file on the hard disk. In addition the PLC program will be saved in the PLC.BIN file when Windows NT / 2000 is terminated in a normal manner while the Software PLC is running.
S7 for Windows SoftPLC
Page 10
SoftPLC
Chapter 4
Save M, T, C at Termination If the Save M, T, C at Termination check box is activated, the current status of the Memory Bits (M), Timers (T), and Counters (C) as well as the PLC program resident in the Software PLC, are saved in the PLC.BIN when the Software PLC is terminated. In addition, the PLC program is saved in the PLC.BIN file when Windows NT / 2000 is terminated in a normal manner while the Software PLC is running.
Only S7 for Windows may communicate directly (Internal) with the Software PLC without using a serial port. The port parameters (Baud rate etc.) are defined in the PLC.INI file.
Also the Load Memory available and the Load Memory used by the PLC program are displayed. The Load Memory size may be adjusted (not in the PLC315 Software PLC) in the field "Bytes Total".
Chapter 5
Page 11
Page 12
SoftPLC
Chapter 5
Chapter 5
Page 13
Page 14
SoftPLC
Chapter 5
Chapter 5
Page 15
Shift and Rotation Instructions Instruction RLD RLDA RRDA RRD constant Address ID
(continued)
Description Rotate the contents of ACCU1 to the left (Double Word) Rotate the contents of ACCU1 one bit to the left through CC1 Rotate the contents of ACCU1 one bit to the right through CC1 Rotate the contents of ACCU1 to the right (Double Word) Number of places to Shift / Rotate Number of places to Shift / Rotate located in ACCU2
Page 16
SoftPLC
Chapter 5
Address ID
Description Compare two Integer Values for Equal Compare two Integer Values for NOT Equal Compare two Integer Values for Greater Compare two Integer Values for Greater or Equal Compare two Integer Values for Less Compare two Integer Values for Less or Equal Compare two Double Integer Values for Equal Compare two Double Integer Values for NOT Equal Compare two Double Integer Values for Greater Compare two Double Integer Values for Greater or Equal Compare two Double Integer Values for Less Compare two Double Integer Values for Less or Equal Compare two Real Numbers for Equal Compare two Real Numbers for NOT Equal Compare two Real Numbers for Greater Compare two Real Numbers for Greater or Equal Compare two Real Numbers for Less Compare two Real Numbers for Less or Equal Calculate the Sine of a Real Number Calculate the Cosine of a Real Number Calculate the Tangent of a Real Number
Chapter 5
Page 17
Arithmetic Instructions Instruction ASIN ACOS ATAN SQR SQRT EXP LN +I -I *I /I +D -D *D /D +R -R *R /R MOD + +P# DEC INC constant constant Address ID
(continued) Description Calculate the Arcsine of a Real Number Calculate the Arccosine of a Real Number Calculate the Arctangent of a Real Number Calculate the Square of a Real Number Calculate the Square Root of a Real Number Calculate the Exponential Value of a Real Number (Base "e") Calculate the Natural Logarithm of a Real Number Add two Integer Values Subtract one Integer Value from another Multiply one Integer Value with another Divide one Integer Value by another Add two Double Integer Values Subtract one Double Integer Value from another Multiply one Double Integer Value with another Divide one Double Integer Value by another Add two Real Numbers Subtract one Real Number from another Multiply one Real Number with another Divide one Real Number by another Divide one Double Integer Value by another (with Remainder) Add a Constant Add a Pointer Decrement ACCU1-LL (one Byte) Increment ACCU1-LL (one Byte)
Page 18
SoftPLC
Chapter 5
Data Type Conversion Instructions Instruction RND+ RNDTRUNC INVI INVD NEGI NEGD NEOR ABS Address ID Description
(continued)
Convert a Real Number to a Double Integer Value (rounded UP to the next whole number) Convert a Real Number to a Double Integer Value (rounded DOWN to the next whole number) Convert a Real Number to a Double Integer Value (the places after the decimal point are truncated) Form the Ones Complement of ACCU1-L (Integer) Form the Ones Complement of ACCU1-L (Double Integer) Form the Twos Complement of ACCU1-L (Integer) Form the Twos Complement of ACCU1-L (Double Integer) Negate the Real Number in ACCU1 Form the Absolute Value of the Real Number in ACCU1
Chapter 5
Page 19
Page 20
SoftPLC
Chapter 5
Indirect Addressing Instructions Instruction TAR1 TAR2 MD LD DBD DID TAR1 TAR2 TAR1 TAR +AR1 +AR2 +AR1 +AR2 P# P# AR2 P# Address ID
(continued)
Description Transfer Contents of Address Register 1 (AR1) in Transfer Contents of Address Register 2 (AR2) in Bit Memory Double Word Local Data Double Word Data Block Double Word Instance Data Block Double Word Transfer Contents from Address Register 1 (AR1) in ACCU1 Transfer Contents from Address Register 2 (AR2) in ACCU1 Transfer Contents from Address Register 1 (AR1) in Address Register 2 (AR2) Swap Contents of Address Register 1 (AR1) with Contents of Address Register 2 (AR2) Add Contents from ACCU1 to Address Register 1 (AR1) Add Contents from ACCU1 to Address Register 2 (AR2) Add Pointer to Address Register 1 (AR1) Add Pointer to Address Register 2 (AR2)
Chapter 5
Page 21
The following Table lists the integrated System Functions (SFC) SFC No. SFC0 SFC1 SFC20 SFC Name SET_CLK READ_CLK BLKMOV Function Set clock Read clock Copy variable (n = number of bytes to be copied)
Page 22
SoftPLC
Chapter 5
Integrated System Functions (SFC) SFC No. SFC21 SFC22 SFC23 SFC24 SFC25 SFC28 SFC29 SFC30 SFC31 SFC32 SFC33 SFC34 SFC39 SFC40 SFC41 SFC42 SFC43 SFC51 SFC64 SFC Name FILL CREAT_DB DEL_DB TEST_DB COMPRESS SET_TINT CAN_TINT ACT_TINT QRY_TINT SRT_DINT CAN_DINT QRY_DINT DIS_IRT EN_IRT DIS_AIRT EN_AIRT RE_TRIGR RDSYST TIME_TCK Function
(continued)
Set array default variables Create Data Block Delete Data Block Test Data Block Compress Memory (user memory) Set Time-of-Day interrupt Cancel Time-of-Day interrupt Activate Time-of-Day interrupt Query Time-of-Day interrupt Start Time-Delay interrupt Cancel Time-Delay interrupt Query Time-Delay interrupt Discard new events Stop discarding events Delay interrupt events Stop delaying interrupt events Retrigger watchdog monitoring "Module ID" partial list Display millisecond timer
Function Count up Count down Count up and down Generate pulse Generate On-Delay Generate Off-Delay Implement sequencer
Chapter 6
Page 23
(unsigned char far* typ, unsigned long nr, int DBNr, unsigned size, int far* ok);
Comment
Parameter typ 'E' 'A' 'M' 'Z' 'T' 'D' nr DBNr size
Description PLC Operand Input Output Memory Bit (Flag) Counter Value Timer Value Data Word or Data Double Word Address Data Block Number Number of Bits 0..7 8 16 32 = Bit No. 0 7 = 1 Byte = 1 Word = 1 Double Word 'I' 'Q' 'M' 'C' 'T' 'D'
16 Bit access only 16 Bit access only (Number of Bits depends on Parameter size ) Byte address of the Operand to transfer 1 - 4095 only 'E', 'A', 'M'
ok
0: Error
Error message
Page 24
SoftPLC
Chapter 6
char far* typ, long nr, int DBNr, size, unsigned long val, ok);
Parameter typ 'E' 'A' 'M' 'Z' 'T' 'D' nr DBNr size
Description PLC Operand Input Output Memory Bit (Flag) Counter Value Timer Value Data Word or Data Double Word Address Data Block Number Number of Bits 0..7 8 16 32 = Bit No. 0 7 = 1 Byte = 1 Word = 1 Double Word 'I' 'Q' 'M' 'C' 'T' 'D'
Comment
16 Bit access only 16 Bit access only (Number of Bits depends on Parameter size ) Byte address of the Operand to transfer 1 - 4095 only 'E', 'A', 'M'
ok
0: Error
Error message
char far* typ, long nr, int DBNr, size, unsigned char far* vals, ok);
Comment
Description PLC Operand Input Output Memory Bit (Flag) Data Word 'I' 'Q' 'M' 'D'
Parameter "size" determines the number of Bytes Parameter "size" determines the number of Bytes Parameter "size" determines the number of Bytes Parameter "size" determines the number of Words
Chapter 6
Page 25
(continued) Comment
Description Address Data Block Number Number of Bytes or Words Byte Values 0: Error
1 - 4095
Error message
char far* typ, long nr, int DBNr, size, unsigned char far* vals, ok);
Comment
Parameter typ 'E' 'A' 'M' 'D' nr DBNr size 'E' 'A' 'M' 'D' Vals ok
Description PLC Operand Input Output Memory Bit (Flag) Data Word Address Data Block Number Number of Bytes or Words Input Output Memory Bit (Flag) Data Word Byte Values 0: Error PLC Operand 'I' 'Q' 'M' 'D' 'I' 'Q' 'M' 'D'
1 - 4095
Parameter "size" determines the number of Bytes Parameter "size" determines the number of Bytes Parameter "size" determines the number of Bytes Parameter "size" determines the number of Words Attention! Field size must be set to hold all requested bytes. Error message
Page 26
SoftPLC
Chapter 6
short int nr, short int* Baustein, int* Anzahl, char Synchron, int far* ok);
Description Data Block Number Pointer to the Data Block contents Number of words to be read from the Data Block No Function 0: Error
Comment 1 - 4095 Baustein " "Block" Anzahl " "Number" If the Data Block has less words than requested, the "Number (Anzahl)" is automatically adjusted. Synchron " "synchronous" The parameter is inserted for compatibility reasons. Error message
Synchron ok
Attention! The information from the Data Block is read in a word orientated format. The Low-Byte and the High-Byte are interchanged.
short int nr, short int* Baustein, int* Anzahl, char Synchron, int far* ok);
Comment 1 - 4095 Baustein " "Block" The Buffer from which the DB will be copied from. Anzahl " "Number" If the Data Block has less words than requested, the "Number (Anzahl)" is automatically adjusted.
Description Data Block Number Pointer to the new Data Block Number of words to be written into the Data Block
Chapter 6
Page 27
(continued) Comment Synchron " "synchronous" The parameter is inserted for compatibility reasons. Error message
Description No Function
ok
0: Error
Attention! The information is written into the Data Block in a word-orientated format. The Low-Byte and the High-Byte are interchanged.
6.1.7 FloatToMC5
The "FloatToMC5" function converts a floating-point value (REAL) from the format used in the IBM PC to the format used in the S7 PLC (Double Word - REAL).
Description Floating-point value in the IEEE format or INTEL format respectively Floating-point value in the Siemens S7 format
6.1.8 MC5ToFloat
The "MC5ToFloat" function converts a floating-point value (REAL) from the format used in the S7 PLC (Double Word - REAL) to the format used in the IBM PC.
Description Floating-point value in the Siemens S7 format Floating-point value in the IEEE format or INTEL format respectively
Page 28
SoftPLC
Chapter 6
6.2 Example
The example shows a data transfer between the Software PLC and a Borland C++ Builder application. More examples can be found on the Software PLC CD.
6.2.2 Visualization
The example shows a simple visualization of Software PLC Operands using the Borland C++ compiler.
The example uses the following assignments: Position of the Valve (Speed): Tank Level = Pump Rotation Angle: Pump Rotation Text: MB10 Value QW12 Value DB4095 String
Chapter 6
Page 29
void __fastcall TForm1::TrackBar1Change(TObject *Sender) { int ok; unsigned char typ = 'M'; GlobalPosition = TrackBar1->Position; wrVal (&typ,10,0,8,GlobalPosition,&ok); } void __fastcall TForm1::Timer1Timer(TObject *Sender) { int ok; unsigned char typ; int val; unsigned short int Baustein[64]; unsigned int Anzahl; char Stringtext[128]; unsigned int i; typ = 'A'; val = rdVal (&typ,12,0,16,&ok); AW12->Text = val; Pie1->Angles->StartAngle = val; Pie1->Angles->EndAngle = val + 10; ProgressBar->Position = val; typ = 'M'; val = rdVal (&typ,10,0,8,&ok); MB10->Text = val; if (rdVal (&typ,6,0,0,&ok)) m6pkt0->Text = "true"; else m6pkt0->Text = "false"; typ = 'T'; val = rdVal (&typ,99,0,16,&ok); val &= 0x07ff; T99->Text = val; // Modify Memory (Byte) // Read MB10 // Display Value // Read Memory Bit M6.0 // Display Value in dialog box // Display Value in dialog box // // // // Modify Timer Read Value of Timer T99 Mask Control Bits Display Value in dialog box // Modify Output Value // Read QW12
// Write to Memory(Byte)
Anzahl = 20; // Number of characters to read RdDB (4095,&Baustein[0],&Anzahl,0,&ok); // Transfer String // High- und Lowbyte tauschen for (i = 1; i <= Anzahl; i++) Baustein[i] = ((Baustein[i] & 0xff00)>>8)|((Baustein[i] &
0xff)<<8);
Page 30
SoftPLC
Chapter 7
7 DDE Manager
The Software PLC supports Dynamic Data Exchange (DDE) for the exchange of data between the Software PLC and other Windows applications. The procedure to exchange data between the Software PLC and your Windows application, via the DDE, depends on your application. Please refer to the user manual for information on how to setup the data exchange with another Windows application (the Software PLC). The DDE Manager is a DDE Server with the following functions: Request () Poke () Advise () Unadvise () Coldlink and Hotlink With the Request function a value may be read from the Software PLC. With the Poke function a value may be written into the Software PLC. To establish a "Hotlink" connection between the Software PLC and your Windows application, the Advice function is used. Unadvise cancels this link. The Server Name of the DDE Manager is 'PLC416'. The Topic Name is 'PLCS7'. Name format of the data to be exchanged with the Software PLC (DDE Item) : Operand Input Bit (In.m) Input Byte (IBn) Input Word (IWn) Output Bit (Qn.m) Output Byte (QBn) Output Word (QWn) Memory Bit (Mn.m) Memory Byte (MBn) Memory Word (MWn) Data Byte (DBn,dbm) Name Format En.m Ebn Ewn An.m Abn Awn Mn.m Mbn Mwn DBn,dbm Range n: 0..511, m: 0..7 n: 0..511 n: 0..510 n: 0..511, m: 0..7 n: 0..511 n: 0..510 n: 0..4095, m: 0..7 n: 0..4095 n: 0..4094 n: 0..1023, dbm: 0..4095 Example E10.1 EB10 EW10 A12.1 AB12 AW12 M14.1 MB14 MW14 DB9,16 (DB9 of DB16) DBn Data Byte number dbm Data Block number DW3,16 (DW3 of DB16) DWn Data Word number dbm Data Block number T20 Z3
DWn,dbm
Tn Zn
n: 0..511 n: 0..511
Chapter 7
DDE Manager
Page 31
7.1 Example
Reading a Memory Byte With the Microsoft EXCEL Windows application, the Memory Byte 10 (MB10), from the Software PLC, should be read and displayed. In one of the Cells write the following Instruction: =PLC416|PLCS7!MB10 PLC416 PLCS7 MB10 DDE Manager Server Name DDE Manager Topic Name DDE-Manager Item Name
This instruction is a Remote Reference Formula. This formula automatically establishes a "Hotlink" to the Software PLC. Whenever the value of the Memory Byte MB10 changes, the new value is transmitted and displayed in EXCEL. Because of different versions of Microsoft EXEL it is possible that the Remote Reference Formula (each part must be in ' ' ) must be entered as followed: ='PLC416'|'PLCS7'!'MB10'
Writing into a Memory Byte The Value one ("1") is transferred from Microsoft EXCEL into the Input Byte (IB0) of the Software PLC (Microsoft Excel Visual Basic Macros). The following Visual Basic Macro inserts a "1" into IB0 of the Software PLC: Sub SendeS5W0() Range("B9").Value = 1 The following command opens the DDE Channel to the Software PLC. Only one (1) DDE Channel can be open any time! S5WChannel = DDEInitiate("PLC416"; "PLCS7") The following command fetches the contents of cell C5 and writes the contents into IB0 of the Software PLC: Application.DDEPoke S5WChannel, "EB0", Cells(5, 3) The following command closes the DDE Channel: DDETerminate (S5WChannel) EndSub
Page 32
SoftPLC
Chapter 8
Timer OB's are not interrupted by Windows, therefore these Timer OB's may not have a long execution time (<1ms). The following System Function and System Function Blocks are not integrated in the Software PLC: SFC44 SFC46 SFB33 SFB37 Transfer substitute value to ACCU1 Force CPU into STOP mode Generate block-related messages
Chapter 9
SoftPLC Configuration
Page 33
9 SoftPLC Configuration
The parameters required to adjust the operation of the Software PLC are located in the initialization file PLC43.INI. Section [PLC] In this section the basic settings of the Software PLC may be adjusted. Key Name S7_STORE REM Area Default Value Description Size of "Load Memory" (SoftPLC 416) The "Load Memory" of the SoftPLC 315 is fixed If set to "1" the memory for the M, T, and C is retentive. (Byte 0 up to the max setting from the Hardware Configuration).
Section [COM] In the section [COM] the parameter of the serial port COM1 are set. Key Name BAUD INT PORT Area 2400 .. 115000 PC depending PC depending Default Value Description 38400 3/4 2F8 / 3F8 Baud rate of the serial port Interrupt number of the serial port Port address of the serial port
Section [COM2] In the section [COM2] the parameter of the serial port COM2 are set. Key Name BAUD INT PORT Area 2400 .. 115000 PC depending PC depending Default Value Description 38400 3/4 2F8 / 3F8 Baud rate of the serial port Interrupt number of the serial port Port address of the serial port
Section [OEM] In the section [OEM] the DLL's used by the application are listed. These DLL's are hardware depending. Up to ten (10) DLL's can be incorporated (DLL0 up to DLL9). Key Name DLLn Area File_Name.DLL Default Value Description --User DLL (e.g. CIF driver CIF30X.DLL
Page 34
SoftPLC
Chapter 10
10 CIF30X - Driver
The driver, CIF30X (CIF30 eXtended), as a part of the Software PLC package, can be used in conjunction with the Profi-Bus board CIF30/5060 , the InterBus board CIF30/5060 , the CAN-Open board CIF30/5060 , or the DeviceNet board CIF30/5060 . These boards are manufactured by the Hilscher company and may be used to connect the Software PLC with a corresponding bus system.
10.1 Installation
Prior to inserting the CIF30/5060 board into an empty PC slot, make sure that the jumpers are set as follows: Dual Port Address: No IRQ: (Jumper Field J7) (Jumper at J5) Default = CA00:0000 The Software PLC doesnt use an interrupt
Make sure that any other device in the PC does not use the Dual Port Addresses. Usually the addresses D000 up to D400 are a better choice than the default address CA00. Please check the settings in the [CIF30X] section of the PLC43.INI initialization file. [OEM] DLL0=CIF30X.DLL [CIF30X] CIF30DP=CA00 StatusFB=252 ControlOB=210 DP_Size=1 ;Dual port address of the CIF30 board ;Number of the Status SFB ;Number of the Control SFB ;CIF board with additional dual port memory (1=8KB, 2=16KB)
If a Dual Port address other than the default address is used, the address parameter CIF30_DP= xxxx must be set accordingly. After the driver installation, the System Function Blocks SFB210 and SFB252 are listed in the PLC Block List (S7 for Windows). If you want to use a Dual Port address that is above the 1 Megabyte limit (PCI boards only) the following parameter must be inserted in the PLC43.INI file ([CIF30X] section) instead of the CIF30_DP= xxxx . ( CONFUSING) BoardNumber = n (n=0 up to n=3)
When this parameter is set, access to the Dual Port is controlled by an additional DLL which will be supplied by the Hilscher company on request. [CIF30X] BoardNumber = n StatusFB=252 ControlOB=210 DP_Size=1
S7 for Windows SoftPLC
;CIF30 board number (n=0 up to n=3) ;Number of the Status SFB ;Number of the Control SFB ;CIF board with additional dual port memory (1=8KB, 2=16KB)
Chapter 10
CIF30X - Driver
Page 35
The CIF Status request System Function Block SFB252 must be called with its assigned Instance Data Block: CALL SFB252, DB252 OUT0: = M10.0 OUT1: = M10.1 //RDY //RUN
The control SFB252 does not require an Instance Data Block. The parameter transfer is done via ACCU1 and ACCU2. The SFB must be called with the commands UC SFB252 (CC) because no Instance Data Block is required.
S7 for Windows SoftPLC
Page 36
SoftPLC
Chapter 10
10.3.1 FCT 102 Setting the Number of the Digital Inputs and Outputs
This function defines the number of Inputs and Outputs to be used. The default setting of the Software PLC is 512 Byte digital Inputs / Outputs. You may use this function to reduce the number of digital Inputs / Outputs. A reduced number of digital I / O bytes will decrease the execution time of the Software PLC. Example: L L UC 50 102 SFB 210 // 50 I/O Bytes are required // Load Function Number into ACCU1 // Calling the function (FCT 102)
Returned Values ACCU1 ACCU2 RLO Irrelevant = 0 = no error = 1 = no error Error Code: 1 = to many digital I / O bytes = 0 = error (error code in ACCU2)
Chapter 10
CIF30X - Driver
Page 37
Returned Values ACCU1 ACCU2 RLO = 0 = no error = 0 = no error = 1 = no error (ACCU2 must also be "0") Error Code 1 = Data Block non existing 2 = Data Block size not equal Peripheral Input area
Returned Values ACCU1 ACCU2 RLO = 0 = no error = 0 = no error = 1 = no error (ACCU2 must also be "0") Error Code 1 = Data Block non existing 2 = Data Block size not equal Peripheral Output area
Page 38
SoftPLC
Chapter 10
Global Diagnostic Bits of the CIF30/5060 InterBus board: Bit 0 1 2 3 4 5 6 7 InterBus Error Message Invalid Parameter System failure occurred At least one Slave indicates Module failure At least one W1 Interface failure At least one W2 Interface failure reserved reserved reserved
Example: L UC T 130 SFB 210 MB 0 // Load Function Number into ACCU1 // Calling the function (FCT 130) // Transferring the Global Diagnostic Bits into Memory Byte MB0
Chapter 10
CIF30X - Driver
Page 39
Example: L UC T 131 SFB 210 MB 2 // Load Function Number into ACCU1 // Calling the function (FCT 131) // Transferring the Bus Status Bits into Memory Byte MB2
InterBus Error Numbers Error No.: 0 50 51 53 54 55 Description no mistakes appear IBS task not found no global data-field PLC task not found Non-existing master parameters error in reading the master parameters device device device device project planning technical support technical support technical support execute download of data base again execute download of data base again Error Source Possible Cure
Page 40
SoftPLC
Chapter 10
(continued) Description Error Source project planning project planning project planning Possible Cure execute download of data base again execute download of data base again check projected addresses
Non-existing project parameters network data base includes no parameters The projected send process data offset address of a participant, is outside the allowable border of 0- 255
60
The projected receive process data offset project planning address of a participant, is outside the allowable border of 0- 255 Data-area of slaves are overlapping in the project planning send process data no segment in the init phase no program code for the external processor device device
61 63 64 65 66 67 69 213 101
hardware or software error in the external external field bus technical support processor processor no project information database execute download of data base again check installation depths of the configured slaves check configuration in special slave length codes contact Hilscher company compare the ID and length codes of the slaves with the master configuration reduce the connected modules check the bus segments and voltage break-ins start the diagnostic function check the bus segments and start the diagnostic function run the bus segments separately with the system configurator check the cable connection between DEVICE and first slave module increment the supervision time or check the user program if running
illegal installation depth of a slave module project planning illegal length code structure surrender to operating system faulty the network configuration differs from configured configuration the configuration exceeds the maximum allowed configuration the configuration has changed during running state multiple data cycle error time out network error could not be localized project planning device bus
108
no connection to a network
bus
220
the user program stops to handle the dual-port watchdog location in time user program does not acknowledge the process data indication in time (mode 0)
user program
221
user program
Chapter 10
CIF30X - Driver
Page 41
(continued) Description Error Source bus and data base bus device Possible Cure compare bus configuration list with ID and length codes of the slaves technical support technical support
the configured network is different than the connected network different count of modules was detected during identification cycles error in external processor communication
223 224
Profi Bus Error Numbers Error No.: 0 50 51 52 53 54 55 56 57 58 59 Description no mistakes appear USR_INTF-Task not found no global data-field FDL-Task not found PLC-Task not found non existing master parameters faulty parameter-value in the master parameters non existing slave parameters faulty parameter-value in a slave parameters data file double slave address projected send process data offset address of a participant outside the allowable border of 0- 255 projected receive process data offset address, of a participant, is outside the allowable border of 0- 255 Data-areas of slaves are overlapping in the send process data Data-areas of slaves are overlapping in the receive process data unknown process data handshake free RAM exceeded faulty slave parameter data sets no segment for the treatment free faulty reading of a data base structure-surrender to operating system faulty station reports overflow device device device device device project planning project planning project planning project planning project planning contact technical support contact technical support contact technical support contact technical support execute download of data base again contact technical support execute download of data base again contact technical support check projected addresses check projected addresses Error Source Possible Cure
60
project planning
project planning project planning warm start device project planning device device device master telegram
check projected addresses check projected addresses check warm start parameters contact technical support contact technical support contact technical support execute download of data base again contact technical support check length of configured slave configuration or parameter data.
S7 for Windows SoftPLC
Page 42
SoftPLC
Chapter 10
(continued) Description Error Source Possible Cure check slave if PROFIBUSDP norm compatible check configuration data of the station and compare it with the physical I/O data length check bus cable, check bus address of slave check FDL-Address of master or highest-stationAddress of other master systems. examine bus cabling to bus short circuits.
request function of master is not activated master telegram in the station no answer-data, although the slave must respond with data slave
17 18
no response of the station master not into the logical token ring
slave device
Returned Values ACCU1 Lower Byte / Single bit = 0 = Slave inactive = 1 = Slave active
Chapter 10
CIF30X - Driver
Page 43
UC T
SFB 210 MB 7
// Calling the function (FCT 135) // Transferring the Status bits into Memory Byte MB7
Returned Values ACCU1 Lower Byte / Single bit = 0 = No status change = 1 = Slave changed status
Returned Values ACCU1 ACCU2 = 0 = no error = 0 = no error (ACCU2 must also be "0") Error Code 1= 2= 3= RLO = 1 = no error Data Block non existing Number of requested Bytes exceeds the Dual Port Memory limit Number of requested Bytes exceeds the Data Block limit (not enough bytes in DB)
Page 44
SoftPLC
Chapter 10
Example: OPN DB60 L L UC W#16#0100 000A 137 SFB 210 // The DB60 will receive the contents of the Dual Port Memory // 10 Bytes starting at the relative address 100hex // Load Function Number into ACCU1 // Calling the function (FCT 137)
Returned Values ACCU1 ACCU2 = 0 = no error = 0 = no error (ACCU2 must also be "0") Error Code 1= 2= Data Block non existing Number of requested Bytes exceeds the Dual Port Memory limit
RLO
= 1 = no error
Chapter 10
CIF30X - Driver
Page 45
10.3.14
FCT 141
With this function the HostFlags (8 Bits) can be read (messages from the host). HostFlag Bits: Bit 0 1 2 3 4 5 6 7 HostFlag Messages HostCom: DevAck: PdAck: reserved reserved Com: Run: Ready: User data transfer phase from at least one module active Parameter data valid, CIF ready for communication Module ready, no basic initialization error present HostMailBox command bit DevMailBox acknowledge bit Host I/O data synchronization acknowledge bit
Example: L UC T 141 SFB 210 MB 8 // Load Function Number into ACCU1 // Calling the function (FCT 141) // Transferring the HostFlags into Memory Byte MB8
10.3.15
FCT 142
With this function the DevFlags (8 Bits) can be read (messages from the device). DevFlags Bits: Bit 0 1 2 3 4 5 6 7 DevFlag Messages HostAck: DevCom: PdCom: reserved reserved NotReady: Init: Reset: Terminate bus transfer or deactivate module. At least one module is in the reset mode Reset the CIF and transfer the parameters from the DPM Reset the CIF HostMailBox acknowledge bit DevMailBox command bit Dev I/O data synchronization command bit
Example: L UC 142 SFB 210 // Load Function Number into ACCU1 // Calling the function (FCT 141)
S7 for Windows SoftPLC
Page 46
SoftPLC
Chapter 10
MB 9
Example: L L UC W#16#40 143 SFB 210 // DevFlag 7 (Reset the CIF and transfer the parameters from the DPM) // Load Function Number into ACCU1 // Calling the function (FCT 143)
Chapter 10
CIF30X - Driver
Page 47
Page 48
SoftPLC
Chapter 10
Data Blocks Data Block Size SFC: SFB: Retentivity Cycle Time DDE Access Network Connections OEM Drivers Task Dual Processor Board Key Board Access
SoftPLC PLC315 Load Memory Size Serial Ports Baud Rate Operands Area 80kByte, fixed value COM1.. COM4, adjustable with the initialization file PLC43.INI 9600 115000 Baud Inputs (I) Outputs (Q) Memory (M) Timer (T) Counter (C) 0 ... 4095 65.534 Bytes Integrated, see chapter 5.18 of this manual Integrated, see chapter 5.19 of this manual Adjustable M, T, C via the initialization file PLC43.INI 1ms 150ms (up to 2000ms adjustable) to all operands via PLC32.DLL TCP/IP via INAT driver 10, (DLL0 DLL9, initialization file PLC43.INI) 20 80%, initialization file PLC43.INI Yes Yes 0.0 511.7 0.0 511.7 0.0 255.7 0 ... 127 0 ... 63
Data Blocks Data Block Size SFC: SFB: Retentivity Cycle Time DDE Access Network Connections OEM Drivers Task Dual Processor Board Key Board Access
Chapter 11
Appendix
Page 49
11 Appendix
Null Modem Cable Sub.-D Connector Female 9 Pin 1 2 3 4 5 6 7 8 9 Shell 25 Pin -----3 2 20 7 6 4 5 -----Shell Not Connected ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Not Connected ------------- Shield -------1 3 2 6 5 4 8 7 9 Shell Sub.-D Connector Female 9 Pin 25 Pin -----2 3 6 7 20 5 4 -----Shell
Page 50
SoftPLC
Chapter 11
Chapter 12
Index
Page 51
12 Index
Direct Access Data Interface ........................... 23 Dual Port Memory............................................ 43 Dual Processor Board ..................................... 48 Dynamic Data Exchange (DDE) ...................... 30
A
Access Data Interface...................................... 23 Accumulator Instructions.................................. 14 Addressing Instructions.................................... 19 Advise .............................................................. 30 AND.................................................................. 11 Arithmetic Instructions...................................... 16
E
Edge Triggered Instructions ............................ 12 Error Number ................................................... 39 Example..................................................... 28, 31 Exclusive OR ................................................... 11 Exit PLC........................................................... 10
B
Baud rate ......................................................... 10 Binary Result.................................................... 11 Bit Logic Instructions........................................ 11 Bit Memory....................................................... 11 Block Call Instructions...................................... 19 Boolean Logic Instructions............................... 12 Borland C++ Builder ...................................... 28 Bus Status........................................................ 38 Bytes Total ....................................................... 10
F
FCT 102 Setting the Number of the Digital Inputs and Outputs ........................... 36 FCT 125 Reading the Process Inputs (Peripheral Inputs)....................................... 37 FCT 126 Writing to the Process Outputs (Peripheral Outputs) .................................... 37 FCT 130 Reading the Global Diagnostic Bits.. 38 FCT 131 Reading the Bus Status.................... 38 FCT 132 Reading an Illegal Bus Address ....... 39 FCT 133 Reading the Error Number ............... 39 FCT 134 Reading the Status Bits .................... 42 FCT 135 Reading the Diagnostic Bits ............. 42 FCT 136 Reading the Dual Port Memory ........ 43 FCT 137 Writing to the Dual Port Memory ...... 43 FCT 139 Suppressing the Watchdog .............. 44 FCT 140 Restarting the Watchdog .................. 44 FCT 141 Reading the ...................................... 45 FCT 142 Reading the ...................................... 45 FCT 143 Writing to the .................................... 46 FloatToMC5 ..................................................... 27 FN .................................................................... 12 FP .................................................................... 12 Fundamentals .................................................... 3
C
Call Instructions ............................................... 19 CAN-Open ....................................................... 34 CIF Control System Function Block................. 35 CIF Status Request.......................................... 35 CIF System Configuration................................ 47 CIF30 ............................................................... 34 CIF30X ............................................................. 34 CIF30X - Driver ................................................ 34 Coldlink ............................................................ 30 Complete Restart (OB 100) ............................... 6 Configuration.............................................. 33, 47 Control System Function Block........................ 35 Conversion Functions ...................................... 23 Conversion Instructions ................................... 17 Counter ............................................................ 11 Counter Instructions......................................... 15 CPU.................................................................... 5 Current actual cycle time ................................... 7 Cycle .................................................................. 6 Cycle Time ................................................... 6, 48
G
Global Diagnostic Bits ..................................... 38
H
HostFlag .......................................................... 45 Hotlink .............................................................. 30
D
Data Area Allocation ........................................ 20 Data Bit ............................................................ 11 Data Blocks........................................................ 9 Data Transfer and Conversion Functions ........ 23 Data Type Conversion Instructions.................. 17 DDE Manager .................................................. 30 DevFlag............................................................ 45 DeviceNet ........................................................ 34 Diagnostic Bit ................................................... 42 Direct access ..................................................... 2
I
I/O Ports............................................................. 7 Illegal Bus Address .......................................... 39 Indirect Addressing Instructions ...................... 19 Input ................................................................. 11 Installation.................................................... 2, 34 Instance Data Bit ............................................. 11
S7 for Windows SoftPLC
Page 52
SoftPLC
Chapter 12
Instruction Set ..................................................11 Integrated System Function Blocks .................22 Integrated System Functions ...........................21 InterBus ............................................................34
J
Jitter ...................................................................7 Jump Instructions .............................................18
PLC.BIN ............................................................. 3 PLC416 ............................................................ 48 Poke................................................................. 30 Product ID Card ................................................. 2 Profi-Bus .......................................................... 34 Program Display and Null Operation Instructions .................................................. 20
R
Read Data Block .............................................. 26 Read Several Values ....................................... 24 Read Value ...................................................... 23 Reading an Illegal Bus Address....................... 39 Reading the...................................................... 45 Reading the Bus Status ................................... 38 Reading the Diagnostic Bits............................. 42 Reading the Dual Port Memory ....................... 43 Reading the Error Number............................... 39 Reading the Global Diagnostic Bits ................. 38 Reading the Process Inputs (Peripheral Inputs) ....................................... 37 Reading the Status Bits ................................... 42 Request............................................................ 30 Reset................................................................ 12 Response Time.................................................. 3 Restart (OB 101)................................................ 6 Restarting the Watchdog ................................. 44 Retentivity .................................................... 3, 48 Rotation Instructions ........................................ 14 RUN mode ......................................................... 6
L
Load ...................................................................9 Load and Transfer Instructions ........................13 Load at PLC Start...............................................9 Load at Start.......................................................3 Load Memory ...................................................10 Local Data Bit...................................................11 Locked................................................................8 Locking the Software PLC Settings ...................4
M
Master Control Relay (MCR) Instructions ........12 Maximum cycle time...........................................7 MC5ToFloat .....................................................27 Memory Allocation............................................20 Minimum cycle time............................................7 Modify Password................................................8
N
Null Modem Cable............................................49 Null Operation Instructions...............................20
S
S7 Block Call.................................................... 21 S7 for Windows.................................................. 2 Save................................................................... 9 Save at PLC Termination................................... 9 Save at Termination........................................... 3 Save M, T, C at Termination.................... 4, 9, 10 Section [COM].................................................. 33 Section [OEM].................................................. 33 Section [PLC] ................................................... 33 Serial Communication...................................... 10 Serial Number .................................................... 2 Serial Number and Version................................ 7 Set / Reset ....................................................... 12 Setting the Number of the Digital Inputs and Outputs ................................................. 36 SFB .................................................................. 22 SFB210 ............................................................ 35 SFB252 ............................................................ 35 SFB252 Functions ........................................... 36 SFB33 SFB37 ............................................... 32 SFC.................................................................. 21 SFC44.............................................................. 32 SFC46.............................................................. 32 Shift and Rotation Instructions......................... 14 SimPLC.............................................................. 1 Simulation PLC .................................................. 1 SoftPLC.............................................................. 1
O
OB 100 ...............................................................6 OB 101 ...............................................................6 OB40 OB47...................................................32 OB60 ................................................................32 OEM .................................................................34 Online Functions ................................................2 Options ...............................................................8 OR ....................................................................11 Organization Blocks (OBxx) integrated in the Software PLC.....................................21 Output ..............................................................11 Overflow ...........................................................11
P
Password ...........................................................8 Peripheral Access Instructions.........................14 PIN Code............................................................2 PLC Memory ....................................................10 PLC Memory Allocation ...................................20 PLC Program ...............................................5, 28 PLC Program and Data Blocks ..........................9 PLC S7-315........................................................1 PLC S7-416........................................................1 PLC Termination ................................................9
S7 for Windows SoftPLC
Chapter 12
Index
Page 53
SoftPLC Dialog Box ........................................... 5 SoftPLC PLC315................................................ 1 SoftPLC PLC416................................................ 1 Software PLC..................................................... 1 Source Code .................................................... 29 Special Settings ............................................... 47 Status ................................................................. 3 Status Bit.......................................................... 42 Status Request ................................................ 35 StatusFB .......................................................... 34 Stop.................................................................... 6 STOP mode ....................................................... 6 Stored Overflow ............................................... 11 Suppressing the Watchdog.............................. 44 System Configuration....................................... 47 System Data Area Allocation ........................... 20 System Function Blocks............................. 22, 35 System Functions ............................................ 21
U
Unadvise.......................................................... 30 Uninterruptible Power Supply ............................ 3 Unlocked............................................................ 8
V
Version number ................................................. 7 Visualization..................................................... 28
W
Watchdog......................................................... 44 Word Instructions............................................. 16 Work Memory .................................................. 10 Write Data Block .............................................. 26 Write Several Values ....................................... 25 Write Value ...................................................... 24 Writing to the.................................................... 46 Writing to the Dual Port Memory ..................... 43 Writing to the Process Outputs (Peripheral Outputs) .................................... 37
T
Task Interval ...................................................... 4 Technical Data ................................................. 48 Termination .................................................. 4, 10 Timer ................................................................ 11 Timer Instructions ............................................ 15
Page 54
SoftPLC
Chapter 12
SoftPLC
The SoftPLC has two different Software PLC configurations.
Compatible with Step 5 programming Compatible with Step 7 programming
a Software PLC
The instruction execution time and the PLC cycle time of course depends on the clock speed of the processor and on the components and features integrated in the PC. The table below is an example of the execution times.
Windows 3.1x / 95 /98 Compatible with Step 5 PLC S5-945
The differences between the versions are listed in the table below
Windows NT 4.x
PLC S5-943 PLC S5-945 PLC S7-315 PLC S7-416 PLC S5-943
Load Memory Working Memory Memory (Flags) S- Flags Timer Counter Digital I/O Analog I(O Processing time *) Pentium II 300 **) 2 x Pentium II 300 MHz Double Processor Board
-----
100 kByte adjustable 720 KByte 2 048 32 768 256 256 1024 256
720 kByte 100 kByte adjustable 48 KByte 2 048 32 768 256 256 1024 256 2 048 ----128 64 1024 64 16 348 ----512 512 32 768 2048 2 048 32 768 256 256 1024 256
560 s
560 s
300 s
300 s
560 s
560 s
180 s
180 s
90 s
90 s
560 s
560 s
*) for one (1) instruction **) Time setting: 50% PLC time, 50% Windows time.1 024 mixed instructions (50% Binary, 50% Digital)
Windows, Windows NT, Visual C, Visual Basic, Excel, and Access, are registered trademarks of the Microsoft Corporation. Simatic S5, Step 5, Simatic S7, Step 7, S7-200, S7-300, S7-400, and GRAPH 5 are registered trademarks of Siemens AG, Mnchen and Berlin.