Page 1
P R O D A V E V 5 . 5 Toolbox for WINDOWS 95/98/NT/ME/2000 Applications for a Data Link of PGs/PCs to SIMATIC S7 via MPI Interface and PC/MPI Cable Operating Instructions PRODAVE S7 Win95/98/NT/ME/2000 mini Order No.: 6ES7 807 - 3BA00 - 0YA0 PRODAVE S7 Win95/98/NT/ME/2000 Order No.: 6ES7 807 - 4BA00 - 0YA0...
PRODAVE under Visual Basic (32-Bit) Example.................15 4. DESCRIPTION OF PRODAVE FUNCTIONS............16 Functions Overview ............................17 Basic Functions.............................19 load_tool ..............................19 new_ss..............................21 unload_tool ............................21 4.1.1 Basic Functions for Data Transfer S7-300/400 ................22 a_field_read ............................22 a_field_write ............................23 ag_info ..............................24 Toolbox for Data Link PGs/PCs to SIMATIC S7...
Page 3
...............................56 testbit..............................56 error_message ............................57 TeleService Funcions ...........................59 4.3.1 General Commments on the Modem Connection................62 4.3.2 Active Telephone Dialling from the PLC..................62 ts_dial..............................63 ts_hang_up_dial .............................66 ts_set_ringindicator..........................67 ts_read_info ............................69 ts_hang_up_ring.............................69 5. DEMONSTRATION PROGRAMS ...............70 Toolbox for Data Link PGs/PCs to SIMATIC S7...
Page 4
SIEMENS AG PRODAVE S7 Demonstration Programs for the PC....................70 6. APPENDIX ......................72 Error Texts ............................72 Used Abbreviations ..........................76 Literature and Ordering Data ......................77 6.3.1 Modules ............................77 6.3.2 PRODAVE Overview ........................78 Toolbox for Data Link PGs/PCs to SIMATIC S7...
(see Para. 5. Demonstration Programs). PRODAVE S7 runs under Windows 95/98/NT/ME/2000 on PG 7xx and on Pcs which are compatible to Industrial Standard in conjunction with MPI interfaces (CP5411, CP5511, CP5611) or PC/MPI cables. Toolbox for Data Link PGs/PCs to SIMATIC S7...
- set and reset flag (mb_setbit, mb_resetbit). - read timer words from PLC (t_field_read). - read counter words from PLC (z_field_read). - overwrite counter words in PLC (z_field_write). - read mixed data (mix_read). - write mixed data (mix_write). Toolbox for Data Link PGs/PCs to SIMATIC S7...
- error text output relating to error number (error_message). - format conversion of S7 data (gp_to_float, float_to_gp). - format conversion of S5 data (kg_to_float, float_to_kg). - byte conversion of a byte to eight logical values and vice versa (boolean_byte, byte_boolean). Toolbox for Data Link PGs/PCs to SIMATIC S7...
Pre-requisite is the installation of the SIMATIC TeleService = SW-Option package to STEP 7 for the linking of SIMATIC S7 controllers (PLCs) via the public telephone network. - Dial a station and / or a TS adaptor (ts_dial).
Operating System Windows 95/98/ME or Windows NT V4.x/2000. Hardware-Prerequisites: PRODAVE S7 PRODAVE S7 mini PG 7xx or AT compatible Industrial-PC with 64MB main memory and MPI-ISA- interface, CP5411, CP5511, CP5611 or PC-Adaptor. Toolbox for Data Link PGs/PCs to SIMATIC S7...
S7-200 PPI-interface S7-300/400/M7/C7 COM1/2 PC-Adaptor MPI-interface Installation and set-up of the required hardware is carried out via the STEP7- Tool PG/PC interface parameterisation, which is available in the system after successful installation. Toolbox for Data Link PGs/PCs to SIMATIC S7...
The drivers to be used can be loaded, parameterised and linked into the system by means of the STEP7 tool PG/PC-interface parameterisation (S7EPATSX.EXE). After correct installation the drivers are automatically activated every time Windows 95/98/NT/ME/2000 is started. Toolbox for Data Link PGs/PCs to SIMATIC S7...
DBW0 - DBW5. I.e. three 16bit words are available for processing in the PG/PC, which the PLC addresses via DBW0, DBW2 and DBW4, by the PG/PC, however, they are addressed via DW0, DW1 and DW2. Toolbox for Data Link PGs/PCs to SIMATIC S7...
Page 16
Type Declaration in Symbol List: Block: DB10 DB_10 Address Variable Data Type Start Value Comments STRUCT ARRAY[0 .. 255] WORD END STRUCT Example of access to the varilable in PLC: “DB_10“.DW[2] MW10 MW10 “DB_10“.DW[2] Toolbox for Data Link PGs/PCs to SIMATIC S7...
Dim dbno As Long, dwno As Long, amount As Long Dim buffer(50) As Integer Dim plc_adr_table As String res = load_tool 1, “S7ONLINE“, plc_adr_table, res = db_read dbno, dwno, amount, buffer(0) res = unload_tool Toolbox for Data Link PGs/PCs to SIMATIC S7...
Dim plcadr (5) As plcadrtype plcadr(0).adr = 2 plcadr(0).SEGMENTID = 0 plcadr(0).SLOTNO = 2 plcadr(0).RACKNO = 0 plcadr(1).adr = 0 res = load_tool (1, ”S7ONLINE”, plcadr) res = db_read (dbno, dwno, amount, buffer(0)) res = unload_tool() Toolbox for Data Link PGs/PCs to SIMATIC S7...
Functions included in the software package PRODAVE S7 mini have the suffix mini in the headline. 32-Bit-DLL for Windows 95/98/NT/ME/2000 WINAPI a_field_read (int nr, int amount, void* buffer); Toolbox for Data Link PGs/PCs to SIMATIC S7...
PRODAVE S7 mini load_tool unload_tool new_ss Basic Functions S7-300/400 PRODAVE S7 PRODAVE S7 mini ag_info ag_zustand a_field_read a_field_write db_buch db_read db_write d_field_read d_field_write e_field_read m_field_read m_field_write mb_bittest mb_setbit mb_resetbit t_field_read z_field_read z_field_write mix_read mix_write Toolbox for Data Link PGs/PCs to SIMATIC S7...
Page 22
TeleService Functions PRODAVE S7 PRODAVE S7 mini ts_dial ts_hang_up_dial ts_set_ringindicator ts_read_info ts_hang_up_ring For the TeleService functions the prerequisite is the correct installation of software package SIMATIC TeleService V5.x. Toolbox for Data Link PGs/PCs to SIMATIC S7...
ID of party = 0 (reserved for later expansions) slotno slot number of party rackno rack number of party = 0 A connected party is selected by means of the “no“ parameter of function load_tool and via the new_ss function: Toolbox for Data Link PGs/PCs to SIMATIC S7...
Page 24
/* PLC No 1 address = 2 */ res = new_ss(2); /* PLC No 2 address = 4 */ res = new_ss(3); /* PLC No 3 address = 9 */ error = unload_tool(); Toolbox for Data Link PGs/PCs to SIMATIC S7...
If there were no errors, the function supplies 0 as the return value otherwise an error message which can be evaluated in accordance with the error table (see error_message). See also load_tool C-Adapter (mini) unload_tool(void); Toolbox for Data Link PGs/PCs to SIMATIC S7...
Output byte 10 is read. The read value is stored in "buffer". C-Adapter #include <w95_s7.h> char buffer; error; adr_table_type plc_adr_table[2] = { {2,0,2,0},{0,0,2,0} }; error = load_tool(1,”S7ONLINE”,plc_adr_table); error = a_field_read(10,1,&buffer); error = unload_tool(); Toolbox for Data Link PGs/PCs to SIMATIC S7...
If there were no errors, the function supplies 0 as the return value, otherwise an error message which can be evaluated in accordance with the error table (see error_message). See also m_field_write C-Adapter a_field_write (int no,int amount,void* buffer); Toolbox for Data Link PGs/PCs to SIMATIC S7...
If there were no errors, the function supplies 0 as the return value otherwise an error message which can be evaluated in accordance with the error table (see error_message). See also ag_info C-Adapter ag_zustand (void * buffer); Toolbox for Data Link PGs/PCs to SIMATIC S7...
The program checks if DB 123 exists in the PLC. C-Adapter #include <w95_s7.h> unsigned short buffer[512]; error; error = db_buch(buffer); if (buffer[123] != 0) /* DB 123 ist im AG vorhanden */ error = unload_tool(); Toolbox for Data Link PGs/PCs to SIMATIC S7...
If there were no errors, the function supplies 0 as the return value otherwise an error message which can be evaluated in accordance with the error table (see error_message). See also db_write C-Adapter (mini) db_read (int dbno, int dwno, int* amount, void* buffer); Toolbox for Data Link PGs/PCs to SIMATIC S7...
Page 32
The read values are stored in the data buffer “buffer” and are available for processing. C-Adapter #include <w95_s7.h> buffer[100]; error; dbno,dwno,amount; dbno = 10; dwno = 5; amount = 45; error = db_read(dbno,dwno,&amount,buffer); error = unload_tool(); Toolbox for Data Link PGs/PCs to SIMATIC S7...
If there were no errors, the function supplies 0 as the return value otherwise an error message which can be evaluated in accordance with the error table (see error_message). See also d_field_read C-Adapter (mini) d_field_write (int bstno, int no,int amount,void* buffer); Toolbox for Data Link PGs/PCs to SIMATIC S7...
If there were no errors, the function supplies 0 as the return value otherwise an error message which can be evaluated in accordance with the error table (see error_message). See also a_field_read, m_field_read C-Adapter e_field_read (int no,int amount,void * buffer); Toolbox for Data Link PGs/PCs to SIMATIC S7...
If there were no errors, the function supplies 0 as the return value otherwise an error message which can be evaluated in accordance with the error table (see error_message). See also mb_setbit, mb_bittest C-Adapter mb_resetbit (int mbno,int bitno); Toolbox for Data Link PGs/PCs to SIMATIC S7...
If there were no errors, the function supplies 0 as the return value otherwise an error message which can be evaluated in accordance with the error table (see error_message). See also mb_setbit, mb_bittest C-Adapter mb_setbit (int mbno,int bitno); Toolbox for Data Link PGs/PCs to SIMATIC S7...
If there were no errors, the function supplies 0 as the return value otherwise an error message which can be evaluated in accordance with the error table (see error_message). See also a_field_write C-Adapter m_field_write (int no,int amount,void* buffer); Toolbox for Data Link PGs/PCs to SIMATIC S7...
If there were no errors, the function supplies 0 as the return value otherwise an error message which can be evaluated in accordance with the error table (see error_message). C-Adapter z_field_write (int no,int amount,void* buffer); Toolbox for Data Link PGs/PCs to SIMATIC S7...
The read values are saved in sequence. I.e. the user himself must carry out structured processing of the field occupied with the read values. "data" must have the following structure: Toolbox for Data Link PGs/PCs to SIMATIC S7...
Page 41
0..255 (for type=M,T,Z) 0..4090 (for type=D) type E,A,M,T,Z,D W / B (for type=E,A,M) size 1..255 dbno 0..255 (for type=M,T,Z) 0..4090 (for type=D) List end identifier C-Adapter mix_read (char* data, void* buffer); Toolbox for Data Link PGs/PCs to SIMATIC S7...
Page 42
= 'd'; data[2].size= 'w'; data[2].dbno= 10; data[2].no = 5; data[3].typ = 0; /* endekennung der liste */ error = mix_read((char*)data,buffer); e = buffer[0]; a = buffer[1]; d = ((int)buffer[2] << 8) | (int)buffer[3]; Toolbox for Data Link PGs/PCs to SIMATIC S7...
= ”b” read byte and save The values to be written must be entered in sequence. For the structure of "data" see function mix_read. C-Adapter mix_write (char* data, void* buffer); Toolbox for Data Link PGs/PCs to SIMATIC S7...
0 - 255 Counters 0 - 63 0 -127 0 - 255 0 -255 For further information on data types and ranges please refer to the Manual STEP 7 - Micro / Programming S7-200. Toolbox for Data Link PGs/PCs to SIMATIC S7...
= { {2,0,2,0},{0,0,2,0} }; char state; error = load_tool(1,”S7ONLINE”,plc_adr_table); error = as200_ag_zustand(&state); if (state == 0); //plc in run if (state != 0); //plc in stop error = unload_tool(); Toolbox for Data Link PGs/PCs to SIMATIC S7...
(see error_message). C-Adapter int as200_e_field_read (int no,int amount,void*buffer); int as200_a_field_read (int no,int amount,void*buffer); int as200_m_field_read (int no,int amount,void*buffer); int as200_sm_field_read (int no,int amount,void*buffer); C-Adapter (mini) int as200_vs_field_read (int no,int amount,void*buffer); Toolbox for Data Link PGs/PCs to SIMATIC S7...
Page 48
Output byte 0..9 is read and saved in ”buffer”. C-Adapter #include <w95_s7.h> error; adr_table_type plc_adr_table[2] = { {2,0,2,0},{0,0,2,0} }; #pragma pack(1) unsigned char buffer[10]; #pragma pack() error = load_tool(1,”S7ONLINE”,plc_adr_table); error = as200_a_field_read(0,10,buffer); error = unload_tool(); Toolbox for Data Link PGs/PCs to SIMATIC S7...
(see error_message). C-Adapter int as200_a_field_write (int no,int amount,void* buffer); int as200_m_field_write (int no,int amount,void* buffer); int as200_sm_field_write (int no,int amount,void* buffer); C-Adapter (mini) int as200_vs_field_write (int no,int amount,void* buffer); Toolbox for Data Link PGs/PCs to SIMATIC S7...
If there were no errors, the function supplies a 0 as the return value, otherwise an error number which can be evaluated in accordance with the error table (see error_message). C-Adapter int as200_z_field_write (int no,int amount,void* buffer); Toolbox for Data Link PGs/PCs to SIMATIC S7...
If there were no errors, the function supplies a 0 as the return value, otherwise an error message which can be evaluated in accordance with the error table (see error_message). C-Adapter int as200_mb_setbit (int mbno,int bitno); Toolbox for Data Link PGs/PCs to SIMATIC S7...
The read values are saved in sequence. I.e. the user himself must carry out structured processing of the field occupied with the read values. "data" must have the following structure: type data E,A,M,S,V size type E,A,M,S,V size List end identifier = 0 Toolbox for Data Link PGs/PCs to SIMATIC S7...
Page 55
/* variablen speicher byte 6 */ data[3].size= 'b'; data[3].no = 6; data[4].typ = 0; /* endekennung der liste */ error = mix_read(data,buffer); e = buffer[0]; a = buffer[1]; v5= buffer[2]; v6= buffer[3]; Toolbox for Data Link PGs/PCs to SIMATIC S7...
= A,E,M,S,V size may be set = “b“. The values to be written must be entered in sequence. For the structure of "data" see function as200_mix_read. C-Adapter as200_mix_write (void* data, void* buffer); Toolbox for Data Link PGs/PCs to SIMATIC S7...
Value bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 C-Adapter void byte_boolean(char wert, char * buff); Toolbox for Data Link PGs/PCs to SIMATIC S7...
IEEE format and makes the value available for processing in the variable "ieee". C-Adapter #include <komfort.h> #include <w95_s7.h> error; buffer[100] dbno,dwno,amount; float ieee; dbno = 10; dwno = 0; amount = 2; error = db_read(dbno,dwno,&amount,buffer); gp_to_float(buffer,&ieee); error = unload_tool(); Toolbox for Data Link PGs/PCs to SIMATIC S7...
The function float_to_kg converts a value of the float type (IEEE-Format) to an S5 floating point value. If there were no conversion errors, the function supplies 0 as the return value, otherwise 1. See also kg_to_float C-Adapter floag_to_kg (void * ieee, void * kg); Toolbox for Data Link PGs/PCs to SIMATIC S7...
Return value = TRUE or 1 Bit is set Return-value = FALSE or 0 Bit is not set C-Adapter char testbit (char value, char bitno); Toolbox for Data Link PGs/PCs to SIMATIC S7...
Return-Value = 3: Incorrect call of the ERROR.DAT error text file. Return-Value = 4: No error text exists for this error number. Return-Value = 5: Too many error texts in ERROR.DAT C-Adapter error_message (int no,char * buffer); Example: Toolbox for Data Link PGs/PCs to SIMATIC S7...
Page 62
"Baustein nicht vorhanden" would be entered in the “message” variable. C-Adapter #include <komfort.h> #include <w95_s7.h> buffer[100]; error; amount; char message[100]; error = error_message(0,"error.eng"); amount = 45; error = db_read(10,5,&amount,buffer); if (error != 0) error = error_message(error,message); error = unload_tool(); Toolbox for Data Link PGs/PCs to SIMATIC S7...
Parameterisation of the TS-Adaptor is carried out using the SIMATIC Software TeleService. When the TeleService functions are in use it is important to note that the PG/PC interface in system control the module parameter assignment is set to TS-Adaptor Toolbox for Data Link PGs/PCs to SIMATIC S7...
Page 64
TS_CONNECTED (connection established) or TS_DISCONNECTED (connection not established) is sent to the specified window only after the connection is established or if the TeleService Adaptor replies with error (e.g. password not correct). Toolbox for Data Link PGs/PCs to SIMATIC S7...
Page 65
TeleService connection by means of ts_hang_up_dial or ts_hang_up_ring. Note: After establishing a remote connection this remains active until the user program calls the ts_hang_up_dial and / or ts_hang_up_ring functions! Toolbox for Data Link PGs/PCs to SIMATIC S7...
The PLC has the facility to establish a TeleService connection via the TS Adaptor. This is carried out by calling the function block 46 PG_DIAL. For further information please refer to the Product Description TS Adaptor and SIMATIC TeleService. Toolbox for Data Link PGs/PCs to SIMATIC S7...
• Message Message which is sent to the window when the connection has been established or the timeout has elapsed. • wParam Parameters for the message. Toolbox for Data Link PGs/PCs to SIMATIC S7...
Page 68
(see error_message). C-Adapter ts_dial ( char * ModemName, char * Standort, char * TelNo, char * UserName, char * Password, HANDLE WindowHandle, UINT Message, WPARAM wParam, char * res1); Toolbox for Data Link PGs/PCs to SIMATIC S7...
Page 69
* TelNo = "+49 00911 8957101"; char * UserName = "ADMIN"; char * Password = "admin"; error; error = ts_dial(ModemName,Standort,TelNo, UserName,Password,NULL,0,0,NULL); if (error == 0) error = load_tool(...); error = unload_tool(); error = ts_hang_up_dial(); Toolbox for Data Link PGs/PCs to SIMATIC S7...
If there were no errors, the function supplies 0 as the return value otherwise an error message which can be evaluated in accordance with the error table (see error_message). C-Adapter ts_hang_up_dial (void); Toolbox for Data Link PGs/PCs to SIMATIC S7...
In order to end the ring indication call the function with ModemName=NULL (ZERO). If there were no errors, the function supplies 0 as the return value otherwise an error message which can be evaluated in accordance with the error table (see error_message). Toolbox for Data Link PGs/PCs to SIMATIC S7...
Page 72
SIEMENS AG PRODAVE S7 C-Adapter ts_set_ringindicator ( char * ModemName, NumberOfRings HANDLE WindowHandle, UINT Message, WPARAM wParam, char * res1); Toolbox for Data Link PGs/PCs to SIMATIC S7...
If there were no errors, the function supplies 0 as the return value otherwise an error message which can be evaluated in accordance with the error table (see error_message). C-Adapter ts_hang_up_ring (void); Toolbox for Data Link PGs/PCs to SIMATIC S7...
The demonstration programs operate on the principle that process data traffic to a PLC is based on Address = 2 and Slot no = 2! When connecting an S7-400 with double wide power supply module set Slot no = 3. Toolbox for Data Link PGs/PCs to SIMATIC S7...
Page 75
- Start Windows 95 again in to ensure the configuration is accepted. - Start the demonstration program in the PRODAVE program group. Select the load_tool menu and specify the parameters (address, slot number, segment ID and rack number) of the destination system. Toolbox for Data Link PGs/PCs to SIMATIC S7...
00F4 : device does not exist 00F5 : incorrect sub system 00F6 : unknown code 00F7 : buffer too small 00F8 : buffer too small 00F9 : incorrect protocol 00FB : reception error 00FC : licence error Toolbox for Data Link PGs/PCs to SIMATIC S7...
Page 77
0335 : serial drv in use 0336 : no connection 0337 : job rejected 0380 : internal error 0381 : hardware fault 0382 : no driver or device found 0384 : no driver or device found Toolbox for Data Link PGs/PCs to SIMATIC S7...
Page 78
D241 : protection level of function not sufficient D406 : information not available EF01 : incorrect ID2 FFFB : TeleService Library not found FFFE : unknown error FFFE hex FFFF : timeout error. Check interface Toolbox for Data Link PGs/PCs to SIMATIC S7...
Page 79
4541 : alarm not used 4580 : login error user name 4581 : login error password A206 : busy A207 : partner not responding A212 : connection not available A213 : no dial tone Toolbox for Data Link PGs/PCs to SIMATIC S7...
SIEMENS AG PRODAVE S7 6.2 Used Abbreviations Programmable Logic Controller Communications Processor Central-Processing-Unit Data Block Dynamic Link Library Multi Point Interface Personal Computer Programming Unit PRODAVE Process Data Traffic Toolbox for Data Link PGs/PCs to SIMATIC S7...
6.3 Literature and Ordering Data 6.3.1 Modules TS-Adaptor Part No.: 6ES7-972-0CA30-0XA0 PC-Adaptor Part No.: 6ES7-972-0CA20-0XA0 PC/PPI Cable Part No.: 6ES7-901-3BF00-0XA0 CP5511 PROFIBUS PCMCIA-Interface Part No.: 6GK1-551-1AA00 CP5611 PROFIBUS PCI-Interface Part No.: 6GK1-561-1AA00 Toolbox for Data Link PGs/PCs to SIMATIC S7...
PRODAVE WIN/DOS 64R including manual Part No.: 6ES5897-2VD11 PRODAVE DDE including manual Part No.: 6ES5886-2WS01 PRODAVE S7 mini Win95/98/NT/ME/2000 including manual Part No.: 6ES7-807-3BA00-0YA0 PRODAVE S7 Win95/98/NT/ME/2000 including manual Part No.: 6ES7-807-4BA00-0YA0 Toolbox for Data Link PGs/PCs to SIMATIC S7...