### Example Interface Declaration Values Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/LibNoDaveConnectionLibrary/Documentation/MC7 Block Format.txt Illustrates example values for interface declarations, showing data types and child counts. ```text [7] 17 byte Struct [8] 4 byte Stat [9] 37 byte 37 children [10] 17 byte Struct [11] 4 byte Stat [12] 29 byte 29 Children [13] 1 byte Bool [14] 4 byte Stat [15] 1 byte Bool [16] 4 byte Stat ..... ``` -------------------------------- ### Connection Resources 0x10 to 0xDF Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/LibNoDaveConnectionLibrary/Documentation/S7 TSAP.txt These connection resources are used for static or dynamic connection setup with an unspecified connection partner. Each resource can operate one connection. ```plaintext 0x10..0xDF Connections with static or dynamic connection setup Configured unspecified connection One of these connection resources can operate one (and only one) connection. Use: Connection configured at both ends with unspecified connection partner! ``` -------------------------------- ### S7-1500 CPU to S7-300/400 CPU TSAP Example Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/LibNoDaveConnectionLibrary/Documentation/S7 TSAP.txt Example TSAP configurations for a connection between an S7-1500 CPU and an S7-300/400 CPU, using the respective TSAP structures. ```plaintext S7-1500 CPU (rack 0, slot 1, connection resource 10): TSAP: 10.01 S7-300/400 CPU (rack 0, slot 2, connection resource 11): TSAP: 11.02 ``` -------------------------------- ### S7-1500 CPU to S7-1500 CPU TSAP Example Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/LibNoDaveConnectionLibrary/Documentation/S7 TSAP.txt Example TSAP configuration for a connection between two S7-1500 CPUs, showing the 'SIMATIC-ACC' prefix with local IDs. ```plaintext S7-1500 CPU "A" with local ID 200: TSAP: SIMATIC-ACC20001 S7-1500 CPU "B" with local ID 3B2: TSAP: SIMATIC-ACC3B201 ``` -------------------------------- ### Build libnodave DLL and Test Programs Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/externalDlls/libnodave/makefile.vc.txt The 'all' target builds the libnodave.dll library. Use 'make' to build the DLL and statically linked test programs. ```makefile all: $(LIBRARIES) ``` -------------------------------- ### Link Test Programs (Static) Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/externalDlls/libnodave/makefile.vc.txt These rules define how to link various test programs as static executables. They specify the object files and libraries required for each program, including the Windows Sockets library. ```makefile testISO_TCP.exe: nodave.obj openSocketw.obj testISO_TCP.obj $(LL) $(LFLAGS) testISO_TCP.obj openSocketw.obj nodave.obj "$(SDKPATH)"\lib\ws2_32.lib /OUT:testISO_TCP.exe ``` ```makefile testMPI.exe: setportw.obj nodave.obj testMPI.obj $(LL) $(LFLAGS) setportw.obj nodave.obj testMPI.obj "$(SDKPATH)"\lib\ws2_32.lib /OUT:testMPI.exe ``` ```makefile testIBH.exe: openSocketw.obj nodave.obj testIBH.obj $(LL) $(LFLAGS) openSocketw.obj nodave.obj testIBH.obj "$(SDKPATH)"\lib\ws2_32.lib /OUT:testIBH.exe ``` ```makefile testPPI_IBH.exe: openSocketw.obj nodave.obj testPPI_IBH.obj $(LL) $(LFLAGS) openSocketw.obj nodave.obj testPPI_IBH.obj "$(SDKPATH)"\lib\ws2_32.lib /OUT:testPPI_IBH.exe ``` ```makefile testPPI.exe: testPPI.obj nodave.obj setportw.obj $(LL) $(LFLAGS) setportw.obj nodave.obj testPPI.obj "$(SDKPATH)"\lib\ws2_32.lib /OUT:testPPI.exe ``` ```makefile testPPIload.exe: nodave.obj setportw.obj testPPIload.obj $(LL) $(LFLAGS) setportw.obj nodave.obj testPPIload.obj "$(SDKPATH)"\lib\ws2_32.lib /OUT:testPPIload.exe ``` ```makefile testMPIload.exe: nodave.obj setportw.obj testMPIload.obj $(LL) $(LFLAGS) setportw.obj nodave.obj testMPIload.obj "$(SDKPATH)"\lib\ws2_32.lib /OUT:testMPIload.exe ``` ```makefile testISO_TCPload.exe: nodave.obj openSocketw.obj testISO_TCPload.obj $(LL) $(LFLAGS) openSocketw.obj nodave.obj testISO_TCPload.obj "$(SDKPATH)"\lib\ws2_32.lib /OUT:testISO_TCPload.exe ``` ```makefile testMPI_IBHload.exe: nodave.obj openSocketw.obj testMPI_IBHload.obj $(LL) $(LFLAGS) openSocketw.obj nodave.obj testMPI_IBHload.obj "$(SDKPATH)"\lib\ws2_32.lib /OUT:testMPI_IBHload.exe ``` ```makefile testPPI_IBHload.exe: nodave.obj openSocketw.obj testPPI_IBHload.obj $(LL) $(LFLAGS) openSocketw.obj nodave.obj testPPI_IBHload.obj "$(SDKPATH)"\lib\ws2_32.lib /OUT:testPPI_IBHload.exe ``` ```makefile testAS511.exe: testAS511.obj nodave.obj setportw.obj $(LL) $(LFLAGS) setportw.obj nodave.obj testAS511.obj "$(SDKPATH)"\lib\ws2_32.lib /out:$@ ``` ```makefile testNLpro.exe: testNLpro.obj nodave.obj openSocketw.obj $(LL) $(LFLAGS) openSocketw.obj nodave.obj testNLpro.obj "$(SDKPATH)"\lib\ws2_32.lib /out:$@ ``` ```makefile testS7online.exe: testS7online.obj nodave.obj openS7online.obj $(LL) $(LFLAGS) nodave.obj testS7online.obj openS7online.obj "$(SDKPATH)"\lib\ws2_32.lib "$(SDKPATH)"\lib\user32.lib /out:$@ ``` -------------------------------- ### Compile Source Files Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/externalDlls/libnodave/makefile.vc.txt These rules define how to compile individual C source files into object files. They specify the compiler, include paths, and preprocessor definitions. ```makefile nodave.obj: nodave.c nodave.h $(CC) $(CFLAGS) -DDOEXPORT nodave.c ``` ```makefile setportw.obj: setportw.c $(CC) $(CFLAGS) -DDOEXPORT setportw.c ``` ```makefile openSocketw.obj: openSocketw.c $(CC) $(CFLAGS) -DDOEXPORT openSocketw.c ``` ```makefile openS7online.obj: openS7online.c openS7online.h $(CC) $(CFLAGS) -DDOEXPORT openS7online.c ``` ```makefile s7fake.obj: s7fake.c $(CC) $(CFLAGS) -DDOEXPORT s7fake.c ``` -------------------------------- ### Link Test Programs (Dynamic) Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/externalDlls/libnodave/makefile.vc.txt These rules define how to link test programs as dynamically linked executables, using the libnodave.dll library. ```makefile testIBHd.exe: libnodave.dll testIBH.obj $(LL) $(LFLAGS) testIBH.obj libnodave.lib /OUT:testIBHd.exe ``` ```makefile testPPI_IBHd.exe: libnodave.dll testPPI_IBH.obj $(LL) $(LFLAGS) testPPI_IBH.obj libnodave.lib /OUT:testPPI_IBHd.exe ``` ```makefile testMPId.exe: libnodave.dll testMPI.obj $(LL) $(LFLAGS) testMPI.obj libnodave.lib /OUT:testMPId.exe ``` ```makefile testPPId.exe: libnodave.dll testPPI.obj $(LL) $(LFLAGS) testPPI.obj libnodave.lib /OUT:testPPId.exe ``` ```makefile testISO_TCPd.exe: libnodave.dll testISO_TCP.obj $(LL) $(LFLAGS) testISO_TCP.obj libnodave.lib /OUT:testISO_TCPd.exe ``` -------------------------------- ### Connection Resource 0x03 (Other) Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/LibNoDaveConnectionLibrary/Documentation/S7 TSAP.txt Represents a free connection that is configured but unspecified. This resource can handle multiple connections and does not require the partner to be configured. ```plaintext 0x03 Other Free connection (configured, unspecified connection) This connection resource can operate multiple connections. Use: Connection configured at one end with unspecified connection partner! The connection partner does not have to be configured if the connection resource 0x03 is addressed. ``` -------------------------------- ### Build libnodave DLL Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/externalDlls/libnodave/makefile.vc.txt This rule defines the build process for the libnodave.dll dynamic link library. It links together several object files and the Windows Sockets library. ```makefile libnodave.dll: nodave.obj setportw.obj openSocketw.obj openS7online.obj $(LL) $(LLFLAGS) /DLL nodave.obj setportw.obj openSocketw.obj openS7online.obj "$(SDKPATH)"\lib\ws2_32.lib /OUT:libnodave.dll ``` -------------------------------- ### Connection Resource 0x01 (PG) Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/LibNoDaveConnectionLibrary/Documentation/S7 TSAP.txt Represents a Programming device connection, which is a free connection not requiring explicit configuration. At least one resource is reserved per CPU. ```plaintext 0x01 ("PG") Programming device connection Free connection (not configured) ``` -------------------------------- ### Build Dynamically Linked Test Programs Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/externalDlls/libnodave/makefile.vc.txt The 'dynamic' target builds dynamically linked test programs. Use 'make dynamic' to build the DLL and dynamically linked test programs. ```makefile dynamic: $(DYNAMIC_PROGRAMS) ``` -------------------------------- ### Connection Resource 0x02 (OP) Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/LibNoDaveConnectionLibrary/Documentation/S7 TSAP.txt Represents an OP (Operator Panel) connection, which is a free connection not requiring explicit configuration. At least one resource is reserved per CPU. ```plaintext 0x02 ("OP") OP connection Free connection (not configured) ``` -------------------------------- ### Calculating Initial Values Offset Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/LibNoDaveConnectionLibrary/Documentation/MC7 Block Format.txt Provides the formula for calculating the offset of initial values within an MC7 block, considering header and interface lengths. ```text IntfInitValueStart = Header-length (36 bytes) + MC7-Length (given in Byte 34 + 35) + Interface Length (given in Byte 28 + 29) ``` -------------------------------- ### Enable Libnodave Debugging in Application Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/externalDlls/libnodave/faq.txt Enable comprehensive debugging for libnodave within your application by calling daveSetDebug. Redirect your application's output to a file to capture all debug information. ```c daveSetDebug(daveDebugAll) ``` ```bash yourappliation >debugout.txt ``` -------------------------------- ### S7 Basic Communication Resource 0xFD Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/LibNoDaveConnectionLibrary/Documentation/S7 TSAP.txt Represents connections typically set up from a CPU to another module within a subnet, initiated by the application program without prior configuration. Allows process data exchange. ```plaintext S7 basic communication (0xFD) Connections that are typically set up from a CPU to another module (CPU, FM, etc.) within a subnet. The connection setup is initiated by the application program, in which a connection configuration does not exist. This type of connection allows process data to be exchanged between the modules. For certain S7-300 CPUs, it is possible to reserve resources for S7 basic communication. ``` -------------------------------- ### Clean All Artifacts Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/externalDlls/libnodave/makefile.vc.txt The 'distclean' target provides a more thorough cleanup, removing additional temporary files. ```makefile distclean: del /f /q *.tds *.il? *.obj *.map ``` -------------------------------- ### Recompile Libnodave with Debug Calls Enabled Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/externalDlls/libnodave/faq.txt Recompile libnodave with the DEBUG_CALLS macro uncommented in nodave.c to aid in debugging parameter passing issues. ```c #define DEBUG_CALLS ``` -------------------------------- ### Run Debug Output to File Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/externalDlls/libnodave/faq.txt Redirect the debug output of test programs to a file for analysis. This is useful for diagnosing issues when precompiled test programs do not work. ```bash testMPI -d COM1 >debugout.txt ``` -------------------------------- ### Multi-Instance Block Parameters Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/LibNoDaveConnectionLibrary/Documentation/MC7 Block Format.txt Describes the fixed 3-byte descriptor item used for MultiInstance FB or SFB references, including data type and block number. ```text IntfStrt + IntfHeader + x + 0 Data Type: see S7DataRowType enumeration IntfStrt + IntfHeader + x + 1 Block Number LSB IntfStrt + IntfHeader + x + 2 Block Number MSB ``` -------------------------------- ### OS-Specific Defines for Libnodave Compilation Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/externalDlls/libnodave/faq.txt Define BCCWIN for Windows or LINUX for Linux/Unix-like systems when compiling code that includes nodave.h to specify the target operating system. This is crucial for correct serial port or TCP/IP stream handling. ```c #define BCCWIN // if you work on windows #include nodave.h // or nodavesimple.h, but NEVER both #include setport.h // if your code works with serial connections #include openSocket.h // if your code works with TCP/IP ``` -------------------------------- ### Clean Build Artifacts Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/externalDlls/libnodave/makefile.vc.txt The 'clean' target removes all generated files except source files, including object files, libraries, and executables. ```makefile clean: del /f /q *.tds *.il? *.obj *.map *.lib *.dll *.exe *.exp *.o *.a ``` -------------------------------- ### Enable Libnodave Debugging via Excel VBA Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/externalDlls/libnodave/faq.txt Enable libnodave debugging for applications launched via Excel VBA. Uncomment the daveSetDebug call in the VBA module and redirect Excel's output to a file. ```vba call daveSetDebug(daveDebugAll) ``` ```bash excel testsheet >debugout.txt ``` -------------------------------- ### String Descriptor Item Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/LibNoDaveConnectionLibrary/Documentation/MC7 Block Format.txt Details the fixed 3-byte descriptor item for strings, specifying data type, parameter type, and maximum string length. ```text IntfStrt + IntfHeader + x + 0 Data Type: see S7DataRowType enumeration: Structures always have 0x11 IntfStrt + IntfHeader + x + 1 Parameter Type: see ParameterType enumeration IntfStrt + IntfHeader + x + 2 Max String length. This tells you the maximum String length. Be aware that this is not necesarily the same as the current String length. The Current length must be taken from the Current Values or Start Values ``` -------------------------------- ### MC7 Block Footer Structure Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/LibNoDaveConnectionLibrary/Documentation/MC7 Block Format.txt Details the fixed 36-byte block footer, including fields for author, family, name, version, and checksum. ```text 0 -7 Autor 8 -15 Family 16-23 Name 24 Version. Encoded as two digits where each one is 4 bits. 0.0 up to 15.15 25 ?? 26,27 Checksum 28-35 ?? ``` -------------------------------- ### MC7 Block Interface Structure Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/LibNoDaveConnectionLibrary/Documentation/MC7 Block Format.txt Defines the structure of interface declarations within an MC7 block, specifying data types, parameter types, array dimensions, and bounds. ```text IntfStrt + IntfHeader + x + 0 Data Type: see S7DataRowType enumeration: Arrays always have 0x10 IntfStrt + IntfHeader + x + 1 Parameter Type: see ParameterType enumeration IntfStrt + IntfHeader + x + 2 Array Dimension Count: This defines the amount of dimension that are defined on this array. This also tells you how many following Bytes must be parsed from the interface IntfStrt + IntfHeader + x + 3-4 Lower Bound of 1st Dimension IntfStrt + IntfHeader + x + 5-6 Upper Bound of 1st Dimension IntfStrt + IntfHeader + x + 7-8 Lower Bound of 2nd Dimension if any IntfStrt + IntfHeader + x + 9-10 Upper Bound of 2nd Dimensino if any ... ``` -------------------------------- ### S7-300/400 CPU TSAP Structure Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/LibNoDaveConnectionLibrary/Documentation/S7 TSAP.txt For S7-300/400 CPUs, the TSAP is structured as ., representing the connection resource, rack number, and slot number. ```plaintext . xx = Number of the connection resource y = Rack number z = Slot number ``` -------------------------------- ### 0x01 Telegram Structure for PLC Block Status Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/LibNoDaveConnectionLibrary/Documentation/StatusOfPLCBlock.txt Details the byte-level structure of the old 0x01 telegram format used for requesting PLC block status. This format is simpler and primarily focuses on register requests for lines. ```plaintext ---------This now is only for the 0x01 Telegramm--------- 0x80 - fixed? 0x.. - first ask for registers (this are all the selected registers, so every one has a value, because in a line, there is only asked for the registers wich the command changes) --- and now follw the lines wich are asked for 0x80 0x.. - Asked registers if the command is more than 2 bytes long, the length of the command -2 0x00 is added to the ask! --- If for a command no register is asked, there are added as many 0x80s to the aks as long the telegramm is! The ask for Variables is the same as in the 0x13 command, in a asked line, the 0x80 in the beginning is replaced with the number of asked variables! And the the varaibles are added to the telegramm! ``` -------------------------------- ### 0x13 Telegram Structure for PLC Block Status Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/LibNoDaveConnectionLibrary/Documentation/StatusOfPLCBlock.txt Details the byte-level structure of the new 0x13 telegram format used for requesting PLC block status. This includes fixed fields, lengths, register requests, and the handling of called variables. ```plaintext 0xFF - fix 0x09 - fix 0x.. 0x.. - 2 Bytes length 0x.. 0x.. - Length of header 0x.. 0x.. - Length of the Register ask part 0x00 0x00 0x00 0x01 0x00 0x00 - Fix 6 Lines? 0x.. 0x.. 0x00 0x01 0x00 0x01 0x00 0x01 0x00 0x01 0x00 0x01 - Fix 10 Bytes? 0x06 - Fix 0x.. - Count of the calling Paths (0x00 = none, 0x01 = db or path, 0x02 = both) 0x.. 0x.. - 2 Bytes Block type 0x.. 0x.. - 2 Bytes Block Number 0x.. 0x.. - 2 bytes Starting Row (Byteadress of the starting Command) 0x.. 0x.. - Adress of the last asked command plus the length of this command. --- Callingpath follows, but only if the count of the calling path is not zero, and the length of this depends on the count --- End of Calling Paths ---------This now is only for the 0x13 Telegramm--------- 0x80 - fixed? 0x.. - count of asked lines. 0x00 - fixed 0x.. - first ask for registers (this are all the selected registers, so every one has a value, because in a line, there is only asked for the registers wich the command changes) --- and now follw the lines wich are asked for 0x.. 0x.. 0x.. 0x.. - Byte Adress of the Line 0x.. 0x.. - Asked registers --- The Asked Registers can be: Bit 0 = STW, Bit 1 = Akku 1, Bit 2 = Akku 2, Bit 3 = AR1, Bit 4 = AR2, Bit 5 = DB/DI There is one speciality left. On a call line, there is also asked for Variables, these variables are appended to the end of the asked line list. The asked line list then looks like this: --- and now follw the lines wich are asked for 0x.. 0x.. 0x.. 0x.. - Byte Adress of the Line 0x.. - count asked Variables. 0x.. - Asked registers --- and a Asked Variable at the end then looks like this: 0x.. - High Niblle Contains the Source Type (0 = M, 1 = E, 2 = A, 0xC = L,7 = DB.DBWxx, 0xB = DB, can also be DI the in the 4th Byte is 01 (because db adress can only be 2 bytes)) Low Nibble conatins the size (1 = Byte/Bit, 2 = Word, 3 = Dword) 0x01 - Every time 01? 0x.. 0x.. 0x.. 0x.. - 4 Bytes Address ``` -------------------------------- ### Endianness Definition for Libnodave Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/externalDlls/libnodave/faq.txt Define DAVE_LITTLE_ENDIAN if your target system uses little-endian byte order (like Intel processors) to enable necessary multibyte value conversions within libnodave. Otherwise, big-endian is assumed. ```c #define DAVE_LITTLE_ENDIAN ``` -------------------------------- ### S7-1500 CPU TSAP Structure Source: https://github.com/dotnetprojects/dotnetsiemensplctoolboxlibrary/blob/master/LibNoDaveConnectionLibrary/Documentation/S7 TSAP.txt For S7-1500 CPUs, the TSAP includes 'SIMATIC-ACC' followed by a local ID and any value. ```plaintext "SIMATIC-ACC" nn = Local ID mm = any value ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.