diff --git a/example/As6Project/AsProject.apj b/example/As6Project/AsProject.apj
new file mode 100644
index 0000000..9a3b3b7
--- /dev/null
+++ b/example/As6Project/AsProject.apj
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Logical/Global.typ b/example/As6Project/Logical/Global.typ
new file mode 100644
index 0000000..5dc40af
--- /dev/null
+++ b/example/As6Project/Logical/Global.typ
@@ -0,0 +1,4 @@
+
+TYPE
+
+END_TYPE
diff --git a/example/As6Project/Logical/Global.var b/example/As6Project/Logical/Global.var
new file mode 100644
index 0000000..3e8a206
--- /dev/null
+++ b/example/As6Project/Logical/Global.var
@@ -0,0 +1,8 @@
+
+VAR
+
+END_VAR
+
+VAR CONSTANT
+
+END_VAR
diff --git a/example/As6Project/Logical/Libraries/Loupe/Package.pkg b/example/As6Project/Logical/Libraries/Loupe/Package.pkg
new file mode 100644
index 0000000..b10a609
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/Package.pkg
@@ -0,0 +1,9 @@
+
+
+
+
+ ..\..\src\Ar\stringext\ANSIC.lby
+ tlsf
+ rtk_lib
+
+
\ No newline at end of file
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/Binary.lby b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/Binary.lby
new file mode 100644
index 0000000..93a1423
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/Binary.lby
@@ -0,0 +1,34 @@
+
+
+
+
+ arErrno.h
+ arexport.h
+ arInternetTypes.h
+ arNetworkConvert.h
+ arSelect.h
+ arSocket.h
+ arState.h
+ bootModeApi.h
+ cosyApi.h
+ cosyReadApi.h
+ cosyWriteApi.h
+ hostApi.h
+ iecType.h
+ pvElementIteratorApi.h
+ rtk.h
+ rtkBase.h
+ rtkCriticalSection.h
+ rtkFifo.h
+ rtkMemory.h
+ rtkMisc.h
+ rtkObject.h
+ rtkPlainFifo.h
+ rtkRtc.h
+ rtkSemaphore.h
+ rtkTask.h
+ rtkTimer.h
+ rtkTypes.h
+ SiosClock.h
+
+
\ No newline at end of file
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/SG4/ARM/librtk_lib.a b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/SG4/ARM/librtk_lib.a
new file mode 100644
index 0000000..effc2b9
Binary files /dev/null and b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/SG4/ARM/librtk_lib.a differ
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/SG4/librtk_lib.a b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/SG4/librtk_lib.a
new file mode 100644
index 0000000..11fd129
Binary files /dev/null and b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/SG4/librtk_lib.a differ
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/SiosClock.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/SiosClock.h
new file mode 100644
index 0000000..df01a2f
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/SiosClock.h
@@ -0,0 +1,36 @@
+
+/* sequential io scheduler clock */
+
+#ifndef _SIOS_CLOCK_H_
+#define _SIOS_CLOCK_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* SIOS Aufloesung auslesen.
+ Der Rueckgabeparameter liefert die die tatsaechliche SIOS-Zykluszeit in Nanosekunden. Dieser Wert entspricht
+ auch gleichzeitig der Aufloesung der SIOS-Clock. Die Aufloesung der SIOS-Clock wird staendig korrigiert und
+ angepasst. Bei Verwendung des Wertes genuegt es also nicht ihn nur einmal zu Beginn auszulesen, er muss
+ von Zeit zu Zeit aktualisiert werden.
+*/
+void siosClockGetRes(unsigned long* resolution);
+
+/* SIOS Zeit auslesen.
+ Die beiden Rueckgabeparameter, aufgeteilt in einen Sekunden- und einen Nanosekunden- Anteil, liefern die
+ Uhrzeit zum Beginn des laufenden SIOS-Zyklus. Beide Werte beziehen sich auf den festgelegten Zeitpunkt:
+ 01.01.1970, 00:00:000000000.
+*/
+void siosClockGetTime(unsigned long* seconds, unsigned long* nanoscs);
+
+
+#if AR_CORE
+#include
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/arErrno.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/arErrno.h
new file mode 100644
index 0000000..176df94
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/arErrno.h
@@ -0,0 +1,131 @@
+
+/* global error status value definitions and a function to read the global error status value */
+
+
+#ifndef _AR_ERRNO_H_
+#define _AR_ERRNO_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* AR error codes corresponding to POSIX Error codes */
+#define AR_EPERM 1 /* Not owner */
+#define AR_ENOENT 2 /* No such file or directory */
+#define AR_ESRCH 3 /* No such process */
+#define AR_EINTR 4 /* Interrupted system call */
+#define AR_EIO 5 /* I/O error */
+#define AR_ENXIO 6 /* No such device or address */
+#define AR_E2BIG 7 /* Arg list too long */
+#define AR_ENOEXEC 8 /* Exec format error */
+#define AR_EBADF 9 /* Bad file number */
+#define AR_ECHILD 10 /* No children */
+#define AR_EAGAIN 11 /* No more processes */
+#define AR_ENOMEM 12 /* Not enough core */
+#define AR_EACCESS 13 /* Permission denied */
+#define AR_EFAULT 14 /* Bad address */
+#define AR_ENOTEMPTY 15 /* Directory not empty */
+#define AR_EBUSY 16 /* Mount device busy */
+#define AR_EEXIST 17 /* File exists */
+#define AR_EXDEV 18 /* Cross-device link */
+#define AR_ENODEV 19 /* No such device */
+#define AR_ENOTDIR 20 /* Not a directory*/
+#define AR_EISDIR 21 /* Is a directory */
+#define AR_EINVAL 22 /* Invalid argument */
+#define AR_ENFILE 23 /* File table overflow */
+#define AR_EMFILE 24 /* Too many open files */
+#define AR_ENOTTY 25 /* Not a typewriter */
+#define AR_ENAMETOOLONG 26 /* File name too long */
+#define AR_EFBIG 27 /* File too large */
+#define AR_ENOSPC 28 /* No space left on device */
+#define AR_ESPIPE 29 /* Illegal seek */
+#define AR_EROFS 30 /* Read-only file system */
+#define AR_EMLINK 31 /* Too many links */
+#define AR_EPIPE 32 /* Broken pipe */
+#define AR_EDEADLK 33 /* Resource deadlock avoided */
+#define AR_ENOLCK 34 /* No locks available */
+#define AR_ENOTSUP 35 /* Unsupported value */
+#define AR_EMSGSIZE 36 /* Message size */
+
+/* ANSI math software */
+#define AR_EDOM 37 /* Argument too large */
+#define AR_ERANGE 38 /* Result too large */
+
+/* ipc/network software */
+
+/* argument errors */
+#define AR_EDESTADDRREQ 40 /* Destination address required */
+#define AR_EPROTOTYPE 41 /* Protocol wrong type for socket */
+#define AR_ENOPROTOOPT 42 /* Protocol not available */
+#define AR_EPROTONOSUPPORT 43 /* Protocol not supported */
+#define AR_ESOCKTNOSUPPORT 44 /* Socket type not supported */
+#define AR_EOPNOTSUPP 45 /* Operation not supported on socket */
+#define AR_EPFNOSUPPORT 46 /* Protocol family not supported */
+#define AR_EAFNOSUPPORT 47 /* Addr family not supported */
+#define AR_EADDRINUSE 48 /* Address already in use */
+#define AR_EADDRNOTAVAIL 49 /* Can't assign requested address */
+#define AR_ENOTSOCK 50 /* Socket operation on non-socket */
+
+/* operational errors */
+#define AR_ENETUNREACH 51 /* Network is unreachable */
+#define AR_ENETRESET 52 /* Network dropped connection on reset*/
+#define AR_ECONNABORTED 53 /* Software caused connection abort */
+#define AR_ECONNRESET 54 /* Connection reset by peer */
+#define AR_ENOBUFS 55 /* No buffer space available */
+#define AR_EISCONN 56 /* Socket is already connected */
+#define AR_ENOTCONN 57 /* Socket is not connected */
+#define AR_ESHUTDOWN 58 /* Can't send after socket shutdown */
+#define AR_ETOOMANYREFS 59 /* Too many references: can't splice */
+#define AR_ETIMEDOUT 60 /* Connection timed out */
+#define AR_ECONNREFUSED 61 /* Connection refused */
+#define AR_ENETDOWN 62 /* Network is down */
+#define AR_ETXTBSY 63 /* Text file busy */
+#define AR_ELOOP 64 /* Too many levels of symbolic links */
+#define AR_EHOSTUNREACH 65 /* No route to host */
+#define AR_ENOTBLK 66 /* Block device required */
+#define AR_EHOSTDOWN 67 /* Host is down */
+
+/* non-blocking and interrupt i/o */
+#define AR_EINPROGRESS 68 /* Operation now in progress */
+#define AR_EALREADY 69 /* Operation already in progress */
+#define AR_EWOULDBLOCK 70 /* Operation would block */
+
+#define AR_ENOSYS 71 /* Function not implemented */
+
+/* aio errors (should be under posix) */
+#define AR_ECANCELED 72 /* Operation canceled */
+
+/* specific STREAMS errno values */
+#define AR_ENOSR 74 /* Insufficient memory */
+#define AR_ENOSTR 75 /* STREAMS device required */
+#define AR_EPROTO 76 /* Generic STREAMS error */
+#define AR_EBADMSG 77 /* Invalid STREAMS message */
+#define AR_ENODATA 78 /* Missing expected message data */
+#define AR_ETIME 79 /* STREAMS timeout occurred */
+#define AR_ENOMSG 80 /* Unexpected message type */
+
+#define AR_EFPOS 81 /* File positioning error */
+#define AR_EILSEQ 82 /* Illegal byte sequence. */
+
+/* error codes used by network stack */
+#define AR_EDQUOT 83 /* routing error */
+
+#define AR_EIDRM 84 /* Identifier removed */
+#define AR_EOVERFLOW 85 /* Value too large for data type */
+#define AR_EMULTIHOP 86 /* Reserved */
+#define AR_ENOLINK 87 /* Reserved */
+#define AR_ESTALE 88 /* Reserved */
+
+#define AR_EFIREWALL 1006 /* the communication was blocked by the AR firewall. This is not a POSIX error code */
+
+#define AR_EUNKNOWN 0xFFFFFF
+
+/* Get the global error status value of the calling task.
+ * For ARsim only socket errors are currently handled properly. */
+int arerrnoGet(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/arInternetTypes.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/arInternetTypes.h
new file mode 100644
index 0000000..17d5048
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/arInternetTypes.h
@@ -0,0 +1,42 @@
+
+/* Base definition for AR socket and conversion functions */
+
+
+#ifndef _AR_INTERNET_TYPES_H_
+#define _AR_INTERNET_TYPES_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+
+/* Protocols - used for arsocket, getsockopt, setsockopt */
+#define AR_IPPROTO_IP 0 /* Internet Protocol version 4. */
+#define AR_IPPROTO_ICMP 1 /* control message protocol */
+#define AR_IPPROTO_TCP 6 /* tcp */
+#define AR_IPPROTO_UDP 17 /* user datagram protocol */
+#define AR_IPPROTO_RAW 255 /* raw IP packet */
+
+/* values for AR_IN_ADDR struct */
+#define AR_INADDR_ANY 0x00000000UL
+#define AR_INADDR_BROADCAST 0xffffffffUL /* must be masked */
+#define AR_INADDR_NONE 0xffffffffUL /* -1 return */
+#define AR_INADDR_LOOPBACK 0x7f000001UL
+
+/* Address families - used for arsocket, arinet_ntop, arinet_pton */
+#define AR_AF_UNSPEC 0 /* unspecified */
+#define AR_AF_INET 2 /* internetwork: UDP, TCP, etc. */
+
+/* Internet address (contains AR_INADDR_xxx values) */
+typedef struct AR_IN_ADDR
+{
+ uint32_t addr;
+} AR_IN_ADDR;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/arNetworkConvert.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/arNetworkConvert.h
new file mode 100644
index 0000000..c3f8020
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/arNetworkConvert.h
@@ -0,0 +1,48 @@
+
+/* AR network conversion functions
+ The syntax and behavior of these functions is equal to the corresponding POSIX IPv4 functions */
+
+
+#ifndef _AR_NETWORK_CONVERT_H_
+#define _AR_NETWORK_CONVERT_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+
+
+/* Convert a string representation of an internet address "src" (given in decimal values only - e.g. 192.168.0.1)
+ * to its binary form "dst" (being a pointer to AR_IN_ADDR for family = AR_AF_INET respectively).
+ * Returns 1 on success, 0 if the string was not a valid address, or <0 on error */
+int arinet_pton(int family, const char* src, void* dst);
+
+/* Convert the network address "src" (being a pointer to AR_IN_ADDR for family = AR_AF_INET respectively) into a
+ * character string (dst, size). "dst" is a pointer to the buffer with length "size". After the function call the buffer
+ * contains the string representation of the address in decimal values (e.g. 192.168.0.1).
+ * Return dst on success, or NULL on error */
+const char* arinet_ntop(int family, const void* src, char* dst, int size);
+
+/* Convert a short value (2 bytes) from host byte-order to net byte-order */
+uint16_t arhtons(uint16_t val);
+
+/* Convert a long value (4 bytes) from host byte-order to net byte-order */
+uint32_t arhtonl(uint32_t val);
+
+/* Convert a short value (2 bytes) from net byte-order to host byte-order */
+uint16_t arntohs(uint16_t val);
+
+/* Convert a long value (4 bytes) from net byte-order to host byte-order */
+uint32_t arntohl(uint32_t val);
+
+
+#if AR_CORE
+#include
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/arSelect.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/arSelect.h
new file mode 100644
index 0000000..dc37e6b
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/arSelect.h
@@ -0,0 +1,72 @@
+
+/* AR select functions
+ The syntax and behavior of these functions is equal to the POSIX IPv4 select function */
+
+
+#ifndef _AR_SELECT_H_
+#define _AR_SELECT_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+
+typedef struct AR_FD_SET* AR_FD_SET_H;
+
+/* Allocate internal resources for a set of file descriptors */
+AR_FD_SET_H arFD_ALLOC(void);
+
+/* Cleanup internal resources allocated with arFD_ALLOC */
+void arFD_FREE(AR_FD_SET_H set);
+
+/* Test if file descriptor "fd" is marked in the provided "set" of file descriptors.
+ * Returns a non zero value if the file descriptor is marked in the set of file descriptors, otherwise 0 */
+long arFD_ISSET(int fd, AR_FD_SET_H set);
+
+/* Mark file descriptor "fd" in the "set" to be observed */
+void arFD_SET(int fd, AR_FD_SET_H set);
+
+/* Unmark file descriptor "fd" in the "set" */
+void arFD_CLR(int fd, AR_FD_SET_H set);
+
+/* Unmark an enire "set" of file descriptors */
+void arFD_ZERO(AR_FD_SET_H set);
+
+/* Get the maximum width to be set for arselect */
+int arFD_SIZE(void);
+
+typedef struct AR_TIMEVAL
+{
+ int32_t tv_sec;
+ int32_t tv_usec;
+} AR_TIMEVAL;
+
+/* Pends until one of the observed file descriptors becomes active (ready to read, ready to write, or exception occurred).
+ * The function pends until "pTimeOut" (NULL = pend forever).
+ *
+ * pReadFds, pWriteFds, pExceptFds contain the list of observed file descriptors. They have to be provided with an object allocated
+ * with arFD_ALLOC or they can be NULL. All in the object marked file descriptors (marked with arFD_SET) will be observed.
+ * After the function returns, these objects contain the information about the active file descriptors. This information can
+ * be querried with arFD_ISSET.
+ *
+ * The "width" parameter can be used to limit the observed file descriptors to only observe file descriptors 0 to width-1
+ * (to not observe them eventhough they are in pReadFds, pWriteFds, or pExceptFds). Usually the "width" parameter is not used
+ * to limit the set of file descriptors and is thus simply set to the value of the observed file descriptor plus one or to arFD_SIZE.
+ *
+ * Returns the number of active file descriptors, 0 if timed out, -1 on error
+ *
+ * Usage example:
+ * ARFD_SET_H fdSet = arFD_ALLOC();
+ * arFD_SET(fdToCheck, fdSet);
+ * arselect(arFD_SIZE(), fdSet, NULL, NULL, 0);
+ * isActive = arFD_ISSET(fdToCheck, fdSet);
+ * arFD_FREE(fdSet);
+ */
+int arselect(int width, AR_FD_SET_H pReadFds, AR_FD_SET_H pWriteFds, AR_FD_SET_H pExceptFds, AR_TIMEVAL* pTimeOut);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/arSocket.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/arSocket.h
new file mode 100644
index 0000000..4974329
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/arSocket.h
@@ -0,0 +1,186 @@
+
+/* AR socket functions
+ The syntax and behavior of these functions is equal to POSIX IPv4 sockets */
+
+
+#ifndef _AR_SOCKET_H_
+#define _AR_SOCKET_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include
+
+/* IOCTL used for arioctl */
+#define AR_FIONREAD 1 /* get num chars available to read */
+#define AR_FIONBIO 16 /* set/unset socket non-blocking */
+
+/* Types used for arsocket */
+#define AR_SOCK_STREAM 1 /* stream socket */
+#define AR_SOCK_DGRAM 2 /* datagram socket */
+#define AR_SOCK_RAW 3 /* raw-protocol interface */
+
+/* Options for getsockopt/setsockopt - TCP level. */
+#define AR_TCP_NODELAY 1 /* don't delay send to coalesce packets */
+#define AR_TCP_KEEPIDLE 4 /* int; Send first keepalive probe when the connections been isdl this time (in seconds) */
+#define AR_TCP_KEEPINTVL 5 /* int; Interval (in seconds) between keepalives */
+#define AR_TCP_KEEPCNT 6 /* int; Maximum number of keepalives before dropping the connection */
+
+/* Options for getsockopt/setsockopt - flags per-socket. */
+#define AR_SO_REUSEADDR 0x0004 /* allow local address reuse */
+#define AR_SO_KEEPALIVE 0x0008 /* keep connections alive */
+#define AR_SO_BROADCAST 0x0020 /* permit sending of broadcast msgs */
+#define AR_SO_LINGER 0x0080 /* linger on close if data present */
+#define AR_SO_OOBINLINE 0x0100 /* leave received OOB data in line */
+#define AR_SO_REUSEPORT 0x0200 /* allow local address & port reuse */
+
+/* Options for getsockopt/setsockopt - additional options */
+#define AR_SO_SNDBUF 0x1001 /* send buffer size */
+#define AR_SO_RCVBUF 0x1002 /* receive buffer size */
+#define AR_SO_ERROR 0x1007 /* get error status and clear */
+#define AR_SO_BINDTODEVICE 0x1010 /* bind to device */
+
+/* shutodwn options used for arshutdown */
+#define AR_SHUT_RD 0 /* shutdown incoming network connection on socket */
+#define AR_SHUT_WR 1 /* shutdown outgoing network connection on socket */
+#define AR_SHUT_RDWR 2 /* shutdown incoming and outgoing network connection on socket */
+
+/* Level number for getsockopt/setsockopt to apply to socket itself. */
+#define AR_SOL_SOCKET 0xffff /* options for socket level */
+
+/* used for the "flags" parameter of the following functions:
+ * arsendto arrecvfrom, arsend, arrecv */
+#define AR_MSG_OOB 0x1 /* process out-of-band data */
+#define AR_MSG_PEEK 0x2 /* peek at incoming message */
+#define AR_MSG_DONTROUTE 0x4 /* send without using routing tables */
+
+/* Options for getsockopt() and setsockopt() at the IP level.
+ * First word of the comment is the data type; bool is stored in int */
+#define AR_IP_TOS 3 /* int; IP type of service and preced. */
+#define AR_IP_TTL 4 /* int; IP time to live */
+
+#define AR_IP_MULTICAST_IF 9 /* u_char; set/get IP multicast i/f */
+#define AR_IP_MULTICAST_TTL 10 /* u_char; set/get IP multicast ttl */
+#define AR_IP_MULTICAST_LOOP 11 /* u_char; set/get IP multicast loopback */
+#define AR_IP_ADD_MEMBERSHIP 12 /* AR_IP_MREQ; add an IP group membership */
+#define AR_IP_DROP_MEMBERSHIP 13 /* AR_IP_MREQ; drop an IP group membership */
+
+/* Argument structure for AR_IP_ADD_MEMBERSHIP and AR_IP_DROP_MEMBERSHIP. */
+typedef struct AR_IP_MREQ
+{
+ AR_IN_ADDR imr_multiaddr; /* IP multicast address of group */
+ AR_IN_ADDR imr_interface; /* local IP address of interface */
+}AR_IP_MREQ;
+
+/* Structure used for AR_SO_LINGER. */
+typedef struct AR_LINGER
+{
+ int32_t l_onoff; /* option on/off */
+ int32_t l_linger; /* linger time */
+} AR_LINGER;
+
+/* IPv4 address struct.
+ * Required for the "addr" parameter of the following functions:
+ * arsentto, arrecvfrom, arbind, arconnect, araccept, argetsockname */
+typedef struct AR_SOCKADDR_IN
+{
+ int16_t sin_family;
+ uint16_t sin_port;
+ AR_IN_ADDR sin_addr;
+ char sin_zero[8];
+} AR_SOCKADDR_IN;
+
+/* Open a new socket. Sockets are usually created using the domain AR_AF_INET and the protocol AR_IPPROTO_IP.
+ * The type parameter specifies whether the socket is raw (AR_SOCK_RAW), streaming (AR_SOCK_STREAM) or
+ * datagram (AR_SOCK_DGRAM).
+ * Returns the socket descriptor on success, -1 on error */
+int arsocket(int domain, int type, int protocol);
+
+/* Send a datagram message (with content "buf" and length "bufLen") via socket "s" to a peer.
+ * The peer is identified by "addrTo" which takes a pointer to a AR_SOCKADDR_IN structure. "addrLen"
+ * is the size of the provided structure. "flags" is the bitwise OR of AR_MSG_xxx parameters.
+ * Returns the number of byte sent, or -1 on error */
+int arsendto(int s, const char* buf, int bufLen, int flags, void* addrTo, int addrLen);
+
+/* Receive a datagram message via socket "s" from a peer. Information about the peer is available
+ * after the function call via the "addrFrom" (pointer to a AR_SOCKADDR_IN) and the "addrLen"
+ * (size of addrFrom type) parameters. "flags" is the bitwise OR of AR_MSG_xxx parameters.
+ * Returns the number of byte received, or -1 on error */
+int arrecvfrom(int s, char* buf, int bufLen, int flags, void* addrFrom, int* addrLen);
+
+/* Performs an I/O control function for socket "s"
+ * Possible commands "cmd" are AR_FIOxxx
+ * Returns 0 on success, else error */
+int arioctl(int s, int cmd, int arg);
+
+/* Close the socket "s"
+ * Returns 0 on success, else error */
+int arclose(int s);
+
+/* Send data (with content "buf" and length "bufLen") to a previously established connection-based
+ * socket "s" (streaming, sequential packets). "flags" is the bitwise OR of AR_MSG_xxx parameters.
+ * Returns the number of byte sent, or -1 on error */
+int arsend(int s, const char* buf, int bufLen, int flags);
+
+/* Receive data from a connection-based (stream) socket "s".
+ * The function has to be provided a buffer "buf" and the buffer length "bufLen". The received
+ * data is copied to this buffer.
+ * "flags" is the bitwise OR of AR_MSG_xxx parameters.
+ * Returns the number of byte received, or -1 on error */
+int arrecv(int s, char* buf, int bufLen, int flags);
+
+/* Binds socket "s" to an address ("addrName" as pointer to AR_SOCKADDR_IN and "addrLen" as its length).
+ * When a socket is bound to an address, then then only messages sent/received on this
+ * address (network interface, port, ...) are handled by this socket.
+ * Returns 0 on success, or -1 on error */
+int arbind(int s, void* addrName, int addrLen);
+
+/* Initiate a connection via socket "s" to a peer ("addrName" as pointer to AR_SOCKADDR_IN and "addrLen" as its length).
+ * Returns 0 on success, or -1 on error */
+int arconnect(int s, void* addrName, int addrLen);
+
+/* Accept an incoming connection (which was initiated by the peer with arconnect).
+ * "s" is a socket listening for incoming connections (arlisten).
+ * "addr" has to contain a pointer to AR_SOCKADDR_IN and addrLen has to contain its length.
+ * After the function call "addr" contains information about the peer which initiated the connection.
+ * Returns a new socket descriptor created for the new connection, or -1 on error */
+int araccept(int s, void* addr, int* addrLen);
+
+/* Listen for incoming connections on socket "s". The maximum number of pending incoming connections
+ * (connections not yet handled by araccept) is set by "backlog".
+ * Returns 0 on success, or -1 on error */
+int arlisten(int s, int backlog);
+
+/* Shutdown a network connection on socket "s". "how" specifies which kind of traffic is shut down:
+ * incoming (AR_SHUT_RD), outgoing (AR_SHUT_WR) or both (AR_SHUT_BOTH).
+ * Returns 0 on success, or -1 on error */
+int arshutdown(int s, int how);
+
+/* Get the address to which the socket "s" is bound.
+ * "addr" has to contain a pointer to AR_SOCKADDR_IN and addrLen has to contain its length.
+ * After the function call "addr" contains information about the address.
+ * Returns 0 on success, or -1 on error
+ */
+int argetsockname(int s, void* addrName, int* addrLen);
+
+/* Set an option for socket "s".
+ * "optName" specifies the kind of option to be set (AR_IP_xxx)
+ * "optVal" contains the data with length "optLen" required for that kind of option
+ * "level" contains AR_SOL_SOCKET or AR_IPPROTO_xxx
+ * Returns 0 on success, or -1 on error */
+int arsetsockopt(int s, int level, int optName, const void* optVal, int optLen);
+
+/* Get an option value associated with socket "s".
+ * "optName" specifies the kind of option to be read (AR_IP_xxx)
+ * "level" contains AR_SOL_SOCKET or AR_IPPROTO_xxx
+ * After the call, "optVal" contains the the data for the read option (with length "optLen").
+ * Returns 0 on success, or -1 on error */
+int argetsockopt(int s, int level, int optName, void* optVal, int* optLen);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/arState.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/arState.h
new file mode 100644
index 0000000..fb1d759
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/arState.h
@@ -0,0 +1,36 @@
+#ifndef _AR_STATE_H_
+#define _AR_STATE_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define AR_OK (0)
+
+typedef int AR_STATE; /* AR_OK or any error, test for != AR_OK */
+
+
+#if defined(UT_BUILD)
+/**
+ * For UTs for std-libs both runtime.h and arState.h can be
+ * included and we cant set the _AR_I386_AUTOMATION_STUDIO_ define
+ * globally.
+ */
+#if !defined(ERR_OK)
+#define ERR_OK AR_OK
+#endif
+
+
+#elif !defined(__cplusplus) && !defined(_AR_I386_AUTOMATION_STUDIO_)
+/* For C++ ERR_OK is defined in Rtk.h as member of the RTK_ERROR enum.
+ * For stdlibs ERR_OK is not defined here, but in runtime.h
+ * ARTIG-Guidelines: Use AR_OK instead of ERR_OK */
+#undef ERR_OK
+#define ERR_OK AR_OK
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/arexport.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/arexport.h
new file mode 100644
index 0000000..8ed76e7
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/arexport.h
@@ -0,0 +1,25 @@
+/* This headerfile contains makros used to mark exported functions as deprecated or as not recommended */
+
+#ifndef _AR_EXPORT_H_
+#define _AR_EXPORT_H_
+
+/* Functions marked with AR_DEPRECATED should not be used in AR-external code at all.
+ * AR still supports these functions, but cannot provide guarantees for the compatibility
+ * of these functions.
+ * Any AR-external code using AR_DEPRECATED functions should replace these functions with
+ * the equivalent exported function which is not marked as AR_DEPRECATED. If you cannot
+ * find such a function in the exported AR headerfiles, then talk to the AR team. */
+#if !defined(AR_CORE) && defined(__GNUC__)
+#define AR_DEPRECATED __attribute__((deprecated))
+#else
+#define AR_DEPRECATED
+#endif
+
+/* Functions marked with AR_NOT_RECOMMENDED should not be used when writing new AR-external code.
+ * However, for these functions there is no functionally equivalent alternative available and thus
+ * they cannot be replaced easily in existing code (that is why they are not AR_DEPRECATED).
+ * If you think that you need an AR_NOT_RECOMMENDED function when writing new code, then talk
+ * to the AR team - they'll try to help you finding a better solution to your problem. */
+#define AR_NOT_RECOMMENDED
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/bootModeApi.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/bootModeApi.h
new file mode 100644
index 0000000..d1e526c
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/bootModeApi.h
@@ -0,0 +1,25 @@
+/*
+ * This API provides information about the current AR boot mode.
+ */
+
+#ifndef _BOOT_MODE_API_H_
+#define _BOOT_MODE_API_H_
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Returns true if the target is in RUN mode (if it finished booting successfully and user programs are running)
+ * or if the target is currently booting towards RUN mode (which means that up until now no errors occured during boot).
+ * Returns false, if the target is not in RUN mode and does not boot towards RUN mode (e.g. if it reboots or finished
+ * rebooting after an error or after the user stopped the target via AS). */
+bool bootModeIsRun();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/cosyApi.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/cosyApi.h
new file mode 100644
index 0000000..bd4aba4
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/cosyApi.h
@@ -0,0 +1,61 @@
+/*
+
+Configuration System (COSY) API.
+
+The configuration system handles configuration elements. An element is uniquely
+specified by its location and id (also called fqn - fully qualified name). The
+separation takes place by '/'.
+An element consists of groups, and properties. Groups consist of sub-groups
+and properties.
+
+For more information see:
+Y:\TuM\BuAsw\BUInfo\Projekte\AT-50-000825_GlobaleSystemArchitektur\Technik\ConfigurationSystemArRegistry\AT-50-000825_TS_ConfigurationSystemAR.docx
+Y:\TuM\BuAsw\BUInfo\Projekte\AT-50-000825_GlobaleSystemArchitektur\Technik\ConfigurationSystem\AT-50-000825_TS_ConfigurationSystem.docx
+
+The API is separated in the following parts:
+ -> cosyAdminApi.h - element administration (creation, add members, deletion)
+ -> cosyReadApi.h - read attributes and properties
+
+*/
+
+#ifndef _COSY_API_H_
+#define _COSY_API_H_
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* COSY handle */
+typedef struct COSY* COSY_H;
+
+/*
+ * Returns the handle of an existing COSY element specified by its location and id.
+ *
+ * return COSY handle for the element, NULL on failure (e.g. non existing).
+ */
+COSY_H cosyOpenElement(const char* location, const char* id);
+
+/*
+ * Returns the handle of an existing COSY element specified by its fqn ("/").
+ *
+ * return COSY handle for the element, NULL on failure (e.g. non existing).
+ */
+COSY_H cosyOpenElementByFqn(const char* fqn);
+
+/*
+ * Closes a COSY element.
+ *
+ * Cosy elements can be opend with cosyOpenElement or with cosyCreateElement (cosyWriteApi.h).
+ * If the element is non volatile and changes were made, the changes are flushed to the non volatile copy.
+ *
+ * return true on success, false on failure.
+ */
+bool cosyCloseElement(COSY_H hCosy);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/cosyReadApi.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/cosyReadApi.h
new file mode 100644
index 0000000..ced06e4
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/cosyReadApi.h
@@ -0,0 +1,191 @@
+/*
+
+Configuration System (COSY) read API.
+
+Detailed description see cosyApi.h!
+
+*/
+
+#ifndef _COSY_READ_API_H_
+#define _COSY_READ_API_H_
+
+#include
+#include
+#include
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* COSY iterate flags */
+enum COSY_ITERATE_FLAGS
+{
+ COSY_ITERATE_DEFAULT = 0, /* Iterate only members of the first level. */
+ COSY_ITERATE_SUB_MEMBER = 1 /* Iterate all members of an element. Also sub members. */
+};
+
+/*
+ * COSY iteration callback.
+ *
+ * Invoked for each existing configuration element. Elements must not be added
+ * or removed during iteration.
+ * context ........ user context.
+ * hCosy ........... COSY element handle.
+ *
+ * Return true - continue iteration, false - stop iteration.
+ */
+typedef bool (*COSY_ITERATE_FP)(uintptr_t context, COSY_H hCosy);
+
+/*
+ * COSY element member iteration callback.
+ *
+ * Invoked for each existing member of an element. Members of the same level
+ * must not be added or removed during iteration.
+ * context ........ user context.
+ * hCosy ........... COSY element handle.
+ * id ............. member id.
+ * elementType .... member type ("Group", "Property").
+ *
+ * Return true - continue iteration, false - stop iteration.
+ */
+typedef bool (*COSY_ITERATE_MEMBERS_FP)(uintptr_t context, COSY_H hCosy, const char* id, const char* memberType);
+
+/*
+ * Gets the location of a COSY element.
+ *
+ * Returns a pointer to the location string, NULL on failure.
+ */
+const char* cosyGetElementLocation(COSY_H hCosy);
+
+/*
+ * Gets the id of a COSY element.
+ *
+ * Returns a pointer to the id string, NULL on failure.
+ */
+const char* cosyGetElementId(COSY_H hCosy);
+
+/*
+ * Gets the type of a COSY element.
+ *
+ * Returns a pointer to the type string, NULL on failure.
+ */
+const char* cosyGetElementType(COSY_H hCosy);
+
+/*
+ * Gets the technology package of a COSY element.
+ *
+ * Returns a pointer to the technology package string, NULL on failure.
+ */
+const char* cosyGetElementTechnologyPackage(COSY_H hCosy);
+
+
+/*
+ * Tests if the COSY element has a non volatile copy.
+ *
+ * Return true if non volatile, false if volatile.
+ */
+bool cosyIsElementNonVolatile(COSY_H hCosy);
+
+/*
+ * Gets the value of a group.
+ *
+ * Returns a pointer to the value string of a group, NULL on failure or if no value is set.
+ */
+const char* cosyGetGroupValue(COSY_H hCosy, const char* id);
+
+/*
+ * Gets the IEC type of a property.
+ *
+ * Returns a pointer to the type string (IEC), NULL on failure or if no type is set.
+ */
+const char* cosyGetPropertyType(COSY_H hCosy, const char* id);
+
+/*
+ * Gets a property value.
+ *
+ * Also suceeeds if the specified bytes to read are less than the real size,
+ * therefore also the size value should be checked.
+ *
+ * Type mapping (IEC -> type of the given value pointer):
+ * BOOL -> int
+ * SINT -> int
+ * INT -> int
+ * DINT -> int
+ * USINT -> int
+ * UINT -> int
+ * UDINT -> int
+ * BYTE -> int
+ * WORD -> int
+ * DWORD -> int
+ * REAL -> String
+ * LREAL -> String
+ * STRING -> String
+ * TIME -> String
+ * DATE -> String
+ * DATE_AND_TIME -> String
+ * TIME_OF_DAY -> String
+ * ULINT -> not supported
+ * LWORD -> not supported
+ * WSTRING -> not supported
+ * OCTET -> not supported
+ * LINT -> not supported
+ *
+ * Return true if succeeds, false on failure.
+ */
+bool cosyGetPropertyValue(COSY_H hCosy, const char* id, const char* iecType, size_t bytesToRead, void* pValue,
+ size_t* pValueSize);
+
+/*
+ * Gets the size of a property.
+ *
+ * Return true if succeeds, false on failure.
+ */
+bool cosyGetPropertySize(COSY_H hCosy, const char* id, size_t* pValueSize);
+
+/*
+ * Iterates existing COSY elements.
+ *
+ * If a type is specified only elements of this type are iterated. Otherwise
+ * all elements are iterated.
+ *
+ * Return true on success, false on failure.
+ */
+bool cosyIterateElements(COSY_ITERATE_FP fpIterate, uintptr_t context, const char* elementTypeFilter);
+
+/*
+ * Iterates COSY element members.
+ *
+ * If a start id is given (parameter startId), the iteration is done for the childs of
+ * this member.
+ *
+ * Return true on success, false on failure.
+ */
+bool cosyIterateMembers(COSY_H hCosy, const char* startId, enum COSY_ITERATE_FLAGS flags,
+ COSY_ITERATE_MEMBERS_FP fpIterate, uintptr_t context);
+
+/*
+ * Tests if the COSY element has a non volatile copy which is different to the current
+ * element configuration.
+ *
+ * Return true if dirty, false if not.
+ */
+bool cosyIsElementDirty(COSY_H hCosy);
+
+/*
+ * Gets the version of a COSY element.
+ *
+ * Returns a pointer to the version string, NULL on failure.
+ */
+const char* cosyGetElementVersion(COSY_H hCosy);
+
+
+#if AR_CORE
+#include
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/cosyWriteApi.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/cosyWriteApi.h
new file mode 100644
index 0000000..631aa21
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/cosyWriteApi.h
@@ -0,0 +1,148 @@
+/*
+
+Configuration System (COSY) write API.
+
+This API provides functions:
+ - to create and delete COSY members (elements, groups),
+ - to set properties,
+ - to set the attributes of an element.
+
+Detailed description see cosyApi.h!
+
+*/
+
+#ifndef _COSY_WRITE_API_H_
+#define _COSY_WRITE_API_H_
+#include
+#include
+#include
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define COSY_TIMEOUT_NO_WAIT 0
+#define COSY_TIMEOUT_WAIT_FOREVER 0xFFFFFFFF
+
+
+
+/*
+ * Creates a new COSY element.
+ *
+ * An element is uniquely specified by its location and id. The result of
+ * the combination of location and id is called fqn (fully qualified name).
+ * E.g. "System/GMC/Axis" where "System/GMC" is the location and "Axis" is
+ * the id of the element. The separation takes place by '/', so an id must not
+ * contain a slash.
+ *
+ * return COSY handle for the element, NULL on failure.
+ */
+COSY_H cosyCreateElement(const char* location, const char* id, const char* type, const char* technologyPackage);
+
+/*
+ * Destroys an existing COSY element.
+ *
+ * Also, an existing non volatile copy is deleted.
+ *
+ * return true if deletion succeeds, false on failure.
+ */
+bool cosyDestroyElement(const char* location, const char* id);
+
+/*
+ * Makes a non volatile copy of a COSY element.
+ *
+ * Must be called again, if changes in an element should be stored non volatile.
+ *
+ * return true on success, false on failure.
+ */
+bool cosySaveElement(COSY_H hCosy);
+
+/*
+ * Adds a group.
+ *
+ * It is possible to add subgroups at once. So id can be given as path to a
+ * subgroup. Example: if id equals "g1/g2/g3" and none of the groups exists,
+ * all groups will be created.
+ *
+ * return true if add group succeeds, false on failure.
+ */
+bool cosyAddGroup(COSY_H hCosy, const char* id, const char* value);
+
+/*
+ * Sets the value of a group.
+ *
+ * It is only possible to change values of a group. Set the value to NULL is also not possible.
+ *
+ * return pointer to the new value string of a group, NULL on failure.
+ */
+const char* cosySetGroupValue(COSY_H hCosy, const char* id, const char* value);
+
+/*
+ * Sets a property value.
+ *
+ * If the property does not exist it will be created. If the property exists
+ * the value will be changed. It is not possible to change the type of an
+ * existing property.
+ * It is possible to add properties of currently not existing subgroups. So id
+ * can be given as path to a property of a subgroup. Example: if id equals "g1/g2/g3/property"
+ * and none of the groups exists, all groups will be created.
+ *
+ * Type mapping (IEC -> type of the given value pointer):
+ * BOOL -> int
+ * SINT -> int
+ * INT -> int
+ * DINT -> int
+ * USINT -> int
+ * UINT -> int
+ * UDINT -> int
+ * BYTE -> int
+ * WORD -> int
+ * DWORD -> int
+ * REAL -> String
+ * LREAL -> String
+ * STRING -> String
+ * TIME -> String
+ * DATE -> String
+ * DATE_AND_TIME -> String
+ * TIME_OF_DAY -> String
+ * ULINT -> not supported
+ * LWORD -> not supported
+ * WSTRING -> not supported
+ * OCTET -> not supported
+ * LINT -> not supported
+ *
+ * return true if set property succeeds, false on failure.
+ */
+bool cosySetProperty(COSY_H hCosy, const char* id, const char* iecType, const void* pValue, size_t valueSize);
+
+/*
+ * Deletes a group or property.
+ *
+ * Removes a member of an element (group or property) and all its sub-
+ * members. A timeout [usec] can be specified, to wait for an
+ * opened member:
+ * -> COSY_TIMEOUT_NO_WAIT (0) - don't wait,
+ * -> COSY_TIMEOUT_WAIT_FOREVER (0xFFFFFFFF) - wait forever.
+ *
+ * return true if deletion succeeds, false on failure.
+ */
+bool cosyDeleteMember(COSY_H hCosy, const char* id, uint32_t timeoutUsec);
+
+/*
+ * Sets the version of a COSY element.
+ *
+ * return true on success, false on failure.
+ */
+bool cosySetElementVersion(COSY_H hCosy, const char* version);
+
+
+#if AR_CORE
+#include
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/hostApi.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/hostApi.h
new file mode 100644
index 0000000..e8fd6bb
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/hostApi.h
@@ -0,0 +1,36 @@
+
+#ifndef _HOST_API_H_
+#define _HOST_API_H_
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum HOST_ERROR
+{
+ HOST_ERR_PARAMETER = 29703, /* invalid parameter*/
+ HOST_ERR_DOMAIN = 29705, /* name can't be resolved */
+ HOST_ERR_ADDRESS = 29706, /* address can't be reloved */
+ HOST_ERR_STRLEN = 29708, /* buffersize */
+};
+
+/* Looks up the IP address (lpAddr) of the provided hostname (szName).
+ * Returns ERR_OK on success, HOST_ERROR on failure */
+WORD ARHostGetByName(const char* szName, ULONG* lpAddr);
+
+/* Get the symbolic name of this machine.
+ * "dst" is a pointer to the buffer that will receive the name, and "size" is the size of the buffer
+ * Returns 0 on success, -1 on error */
+int argethostname(char* dst, int size);
+
+#if AR_CORE
+#include
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/iecType.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/iecType.h
new file mode 100644
index 0000000..b5fad98
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/iecType.h
@@ -0,0 +1,47 @@
+
+/* IEC type definitions */
+
+#ifndef _IEC_TYPE_H_
+#define _IEC_TYPE_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum
+{
+ IEC_TYPE_INVALID = 0, /* No IEC Type */
+ IEC_TYPE_BOOL = 1, /* 8 Bit containing a boolean value FALSE=0 or TRUE=1 */
+ IEC_TYPE_SINT = 2, /* 8 Bit signed integer */
+ IEC_TYPE_INT = 3, /* 16 Bit signed integer */
+ IEC_TYPE_DINT = 4, /* 32 Bit signed integer */
+ IEC_TYPE_USINT = 5, /* 8 Bit unsigned integer */
+ IEC_TYPE_UINT = 6, /* 16 Bit unsigned integer */
+ IEC_TYPE_UDINT = 7, /* 32 Bit unsigned integer */
+ IEC_TYPE_REAL = 8, /* 32 Bit floating point number */
+ IEC_TYPE_STRING = 9, /* Variable-length single-byte character string */
+ IEC_TYPE_ULINT = 10, /* 64 Bit unsigned integer */
+ IEC_TYPE_DATE_AND_TIME = 11, /* 32 Bit of Date in Seconds since 01.01.1970 00:00:00 */
+ IEC_TYPE_TIME = 12, /* 32 Bit of Time in ms */
+ IEC_TYPE_DATE = 13, /* 32 Bit of Date (only) */
+ IEC_TYPE_LREAL = 14, /* 64 Bit floating point number */
+ IEC_TYPE_obsoletDT15 = 15, /* not used any more (historisch "struct array") */
+ IEC_TYPE_TIME_OF_DAY = 16, /* 32 Bit Time of day (only)*/
+ IEC_TYPE_BYTE = 17, /* Bit string of length 8 */
+ IEC_TYPE_WORD = 18, /* Bit string of length 16 */
+ IEC_TYPE_DWORD = 19, /* Bit string of length 32 */
+ IEC_TYPE_LWORD = 20, /* Bit string of length 64 */
+ IEC_TYPE_WSTRING = 21, /* Variable-length double-byte character string */
+ BUR_TYPE_OCTET = 22, /* OCTET fuer Felder */
+ IEC_TYPE_LINT = 23 /* 64 Bit signed integer */
+} IEC_TYPE;
+
+#if AR_CORE
+#include
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/pvElementIteratorApi.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/pvElementIteratorApi.h
new file mode 100644
index 0000000..afe6e9c
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/pvElementIteratorApi.h
@@ -0,0 +1,202 @@
+/* pvElementIteratorApi
+ * This API provides functions to get all elements that a pv is composed of
+ * for each leaf-element one callback will occur e.g.:
+ *
+ * TYPE
+ * TestStruct : STRUCT
+ * Struct_Bool : BOOL := 1;
+ * Struct_Dint : DINT := -2000000000;
+ * Struct_DT : DATE_AND_TIME := DT#1992-09-23-20:15:00;
+ * Struct_Int : INT := -3000;
+ * Struct_LReal : LREAL := -1234567.12345;
+ * END_STRUCT;
+ * FARBEN :
+ * (
+ * GRUEN,
+ * TUERKIS,
+ * LILA
+ * );
+ * adt_basic_bool : BOOL;
+ * END_TYPE
+ *
+ * VAR
+ * var_Struct : TestStruct;
+ * var_Sint : SINT;
+ * pvArray_adt_basic_bool : ARRAY[-32001..-32000] OF adt_basic_bool;
+ * rb1 : REFERENCE TO BOOL;
+ * var_colour : FARBEN;
+ * END_VAR
+ *
+ * pveiIterateElements("TestStruct",...)
+ * name address size type
+ * .Struct_Bool 0x5bf3c24 1 BOOL
+ * .Struct_Dint 0x5bf3c28 4 DINT
+ * .Struct_DT 0x5bf3c2c 4 DATE_AND_TIME
+ * .Struct_Int 0x5bf3c30 2 INT
+ * .Struct_LReal 0x5bf3c34 8 LREAL
+ *
+ * pveiIterateElements("var_Sint",...)
+ * name address size type
+ * (emty) 0x56e3fcd 1 SINT
+ *
+ * pveiIterateElements("pvArray_adt_basic_bool",...)
+ * name address size type baseType
+ * [-32001] 0x56e3f68 1 INVALID BOOL
+ * [-32000] 0x56e3f69 1 INVALID BOOL
+ *
+ * pveiIterateElements("rb1",...)
+ * name address size type baseType isRefernce BaseAddr Offset
+ * (emty) NULL 1 INVALID BOOL true 0x5aca396 0
+ *
+ * pveiIterateElements("var_colour",...)
+ * name address size type baseType isEnum
+ * (emty) 0x56e3f6c 4 INVALID INVALID true
+ */
+
+#ifndef _PVEI_API_H_
+#define _PVEI_API_H_
+
+#include
+#include
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct PVELEM* PVELEM_H;
+typedef struct ENUMVAL* ENUMVAL_H;
+
+/* Callback for each element within a PV.
+ * The parameter 'pvElem' is a handle to the current element that can be used to get further
+ * information. It is only valid for the duration of the callback.
+ * The Parameter 'pArg' is the pointer 'pCallbackArg' that was provided to pveiIterateElements().
+ * Return true to continue the iteration, false to stop.
+ */
+typedef bool (*PVEI_CALLBACK_FP)(PVELEM_H pvElem, void* pArg);
+
+/*
+ * Find a PV by name and call a function for each leaf element of the PV and
+ * for each leaf element of substructures to any depth.
+ * One callback occurs for every member of an array.
+ * Basic PVs are considered to have one nameless member.
+ * Syntax for 'pvName': (see 'Names of process variables' in AS help):
+ * ["::"][":"]["[""]"]["."]
+ * Name of the application module (optional).
+ * Name of the cyclic object (optional).
+ * Name of the process variable.
+ * Index of the array element (optional).
+ * Name of the structure element (optional).
+ * 'pvName' must not be NULL.
+ * 'fpCallback' can be NULL.
+ * 'pCallbackArg' can be NULL.
+ * True is returned when the PV was found, false otherwise.
+ */
+bool pveiIterateElements(const char pvName[], PVEI_CALLBACK_FP fpCallback, void* pCallbackArg);
+
+/*
+ * Returns true if the 'nameBuffer' holds the name and the path to the element,
+ * false if the supplied buffer was too small.
+ * The name of the PV that is being iterated is not part of the returned name.
+ * If the PV has no subelements (it is an IEC base type or a direct derived type) nameBuffer will be empty.
+ * 'pvElem' must not be NULL.
+ * 'nameBuffer' must not be NULL.
+ * 'nameBufferSize' must hold the size of 'nameBuffer'.
+ */
+bool pveiGetName(PVELEM_H pvElem, char nameBuffer[], unsigned int nameBufferSize);
+
+/*
+ * Returns the IEC type of an element.
+ * If IEC_TYPE_INVALID is returned the element is a user defined type.
+ * E.g. an enum or a direct derived type or an element that is accessed via a reference.
+ * 'pvElem' must not be NULL.
+ */
+IEC_TYPE pveiGetType(PVELEM_H pvElem);
+
+/*
+ * Returns the base IEC type of a direct derived type or an element that is accessed via a reference.
+ * Returns IEC_TYPE_INVALID for base types and enum.
+ * 'pvElem' must not be NULL.
+ */
+IEC_TYPE pveiGetBaseType(PVELEM_H pvElem);
+
+/*
+ * Returns the size in bytes of the element or 0 in case of an error.
+ * For IEC base types this function is identical to iecTypeSize() for
+ * other types the size is depending on the implementation.
+ * 'pvElem' must not be NULL.
+ */
+unsigned int pveiGetSize(PVELEM_H pvElem);
+
+/*
+ * Returns the address of the element.
+ * NULL is returned when the element is accessed via a reference.
+ * The value of the element can be read with *(address).
+ * 'pvElem' must not be NULL.
+ */
+void* pveiGetAddr(PVELEM_H pvElem);
+
+/*
+ * Returns the base address of an element that is accessed via a reference.
+ * Returns in 'offset' the number of bytes that need to be added
+ * to the content of the base address to get the value of the element.
+ * The value of the element can be read with *(*(baseAddress) + 'offset')
+ * 'pvElem' must not be NULL.
+ * 'offset' can be NULL.
+ */
+void* pveiGetBaseAddrAndOffset(PVELEM_H pvElem, unsigned int* offset);
+
+/*
+ * Returns true if the element is accessed via a reference.
+ * 'pvElem' must not be NULL.
+ */
+bool pveiIsReferenceTo(PVELEM_H pvElem);
+
+/*
+ * Returns true if the element is an enum.
+ * 'pvElem' must not be NULL.
+ */
+bool pveiIsEnum(PVELEM_H pvElem);
+
+/*
+ * Callback for each valid value of an enum.
+ * The parameter 'enumVal' is a handle that can be used to retrive the properties of the enum entry.
+ * It is only valid for the duration of the callback.
+ * The Parameter 'pArg' is the pointer 'pCallbackArg' that was provided to pveiIterateEnumValues().
+ * Return true to continue the iteration, false to stop.
+ */
+typedef bool (*PVEI_ENUM_CALLBACK_FP)(ENUMVAL_H enumVal, void* pArg);
+
+/*
+ * Call a function for each valid value of an enum.
+ * 'pvElem' must not be NULL.
+ * 'fpCallback' must not be NULL.
+ * 'pCallbackArg' can be NULL.
+ */
+void pveiIterateEnumValues(PVELEM_H pvElem, PVEI_ENUM_CALLBACK_FP fpCallback, void* pCallbackArg);
+
+/*
+ * Returns the numeric representation of the enum value.
+ * 'enumVal' must not be NULL.
+ */
+int pveiEnumGetNumericValue(ENUMVAL_H enumVal);
+
+/*
+ * Returns true if a subrange was set.
+ * 'pvElem' must not be NULL.
+ */
+bool pveiHasSubrange(PVELEM_H pvElem);
+
+/*
+ * Returns the upper and lower limit of a data type with subrange.
+ * 'pvElem' must not be NULL.
+ * 'lowerLimit' can be NULL.
+ * 'upperLimit' can be NULL.
+ */
+void pveiGetSubrangeLimits(PVELEM_H pvElem, int* lowerLimit, int* upperLimit);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtk.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtk.h
new file mode 100644
index 0000000..54c2b75
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtk.h
@@ -0,0 +1,25 @@
+
+/* This API provides abstractions for OS-functionalities (semaphores, tasks, timers, ...).
+ * Instead of using native Windows or VxWorks functions, you should use this API.
+ * All functions returning RTK_ERROR return ERR_OK on success and other error codes on failure */
+
+#ifndef _RTK_H_
+#define _RTK_H_
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#if AR_CORE
+#include
+#endif
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkBase.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkBase.h
new file mode 100644
index 0000000..c1fd59b
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkBase.h
@@ -0,0 +1,134 @@
+
+/* RTK basis data types and error codes */
+
+
+#ifndef _RTK_BASE_H_
+#define _RTK_BASE_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include
+
+#ifndef __cplusplus
+#include
+#endif
+
+/* For using this file in Automation Studio tasks, it has to be included AFTER AsDefault.h */
+#if defined (_DEFAULT_INCLUDES) && !defined(_RUNTIME_) && !defined(_REPLACE_CONST)
+#error Rtk-headers have to be be included after AsDefault.h
+#endif
+
+
+/* Can be used to decorate RTK functions with additional attributes.
+ * E.g. #define EXIMPORT __declspec(nothrow) simplifies the function calls for C++,
+ * because no exception-related code has to be generated by the compiler */
+#ifndef EXIMPORT
+ #define EXIMPORT
+#endif
+
+/* General definitions for RT kernel */
+#define MAX_RTK_NAME_LENGTH 32
+#define MAX_RTK_NAME_TERMINATED_LENGTH (MAX_RTK_NAME_LENGTH + 1)
+
+/* Timeout for task events, semaphore, fifo, debugmessage, ... */
+#define RTK_TIMEOUT_NOWAIT 0
+#define RTK_TIMEOUT_WAITFOREVER 0xFFFFFFFF
+
+typedef void (*LPRTK_CREATE_TASK_FKT)(void* param);
+
+/* Errorcodes */
+typedef enum
+{
+#if !defined(__cplusplus) && !defined(_AR_I386_AUTOMATION_STUDIO_)
+ ERR_RTK_OK = ERR_OK,
+#else
+#ifndef ERR_OK /* could be defined by runtime.h */
+// ERR_OK = 0, /* No error */
+#endif
+#endif
+
+ ERR_RTK_OBJID = 25000, /* Invalid object ident */
+ ERR_RTK_OBJNOTFOUND, /* Object with specified name not found */
+ ERR_RTK_OBJTYPE, /* Invalid object type */
+ ERR_RTK_OBJ_OVERFLOW, /* Object table full */
+ ERR_RTK_OBJ_EXIST, /* Object already exists */
+ ERR_RTK_OBJNAME, /* Wrong object name */
+
+ ERR_RTK_PRIORITY = 25010, /* Invalid priority */
+ ERR_RTK_NO_STACK, /* Not enough free stack */
+ ERR_RTK_NOT_SUSPENDED, /* Task is not suspended */
+ ERR_RTK_SUSPENDED, /* Task is already suspended */
+ ERR_RTK_TASKVALUE, /* Invalid valueindex */
+ ERR_RTK_NOTASKTIMERS, /* No more task timers available */
+ ERR_RTK_TASKCREATE, /* OS task not created */
+ ERR_RTK_TASKDELETE, /* OS Task not deleted */
+
+ ERR_RTK_FIFO_CREATE = 25030, /* FIFO not created (memory alloc, ...) */
+ ERR_RTK_FIFO_DELETE, /* FIFO not deleted (memory free, ...) */
+ ERR_RTK_FIFO_WRITE, /* FIFO not written (fifo full, ...) */
+ ERR_RTK_FIFO_READ, /* FIFO not read (fifo empty, ...) */
+ ERR_RTK_FIFO_RELEASE, /* FIFO not released */
+ ERR_RTK_FIFO_ATTACHED_TIMEOUT, /* FIFO read/write with timeout invalid (attached) */
+ ERR_RTK_FIFO_NOT_ATTACHED, /* FIFO not attached when read/write */
+ ERR_RTK_FIFO_ATTACHED, /* FIFO already attached (other task) */
+ ERR_RTK_FIFO_ATTACH, /* FIFO not created for attach */
+
+ ERR_RTK_SEMACREATE = 25040, /* OS semaphore not created */
+ ERR_RTK_SEMA_DELETE, /* OS semaphore not deleted */
+ ERR_RTK_SEMA_RELEASE, /* OS semaphore not released */
+
+ ERR_WRONG_MEMTYPE = 25060, /* Invalid memory type */
+ ERR_RTK_NOMEM_HEAP, /* Not enough memory free in heap */
+ ERR_RTK_FREE_HEAP, /* Memory not in heap */
+
+ ERR_RTK_CREATE_SHAREDMEM, /* SharedMemory not created */
+ ERR_RTK_DELETE_SHAREDMEM, /* SharedMemory not deleted */
+ ERR_RTK_MAP_SHAREDMEM, /* SharedMemory not mapped */
+ ERR_RTK_UNMAP_SHAREDMEM, /* SharedMemory not unmapped */
+
+ ERR_RTK_IRQNUMBER = 25080, /* Invalid interruptnumber */
+ ERR_RTK_CONNECT_IRQ, /* Interrupt not connected */
+ ERR_RTK_DISCONNECT_IRQ, /* Interrupt not disconnected */
+
+ ERR_RTK_TIMERCYCLE = 25090, /* Invalid cycletime */
+ ERR_RTK_WRONGTIME, /* Invalid time/date */
+ ERR_RTK_SET_RTC, /* RealTimeClock not set */
+ ERR_RTK_TIMER_CREATE, /* Timer not created */
+ ERR_RTK_TIMER_DELETE, /* Timer not deleted */
+ ERR_RTK_TIMER_START, /* Timer not started */
+ ERR_RTK_TIMER_STOP, /* Timer not stopped */
+
+ /* 25100 - 25199 obsolete (Debugger error codes) */
+
+ ERR_RTK_SOFTPLC_CREATE = 25200, /* RtkCreateSoftPlc not possible */
+ ERR_RTK_INIT, /* RTK not initialized */
+ ERR_RTK_DEINIT, /* RTK not deinitialized */
+ ERR_RTK_FATAL, /* Fatal internal RTK error */
+ ERR_RTK_TIMEOUT, /* Timeout in RTK functions with wait */
+ ERR_RTK_NOTSUPPORTED, /* Function not supported in this RTK version */
+ ERR_RTK_UNHANDLED_CPP_EXC, /* Unhandled CPP Exception */
+
+ ERR_RTK_CRITSECCREATE = 25250, /* CriticalSection not created */
+ ERR_RTK_CRITSECDELETE, /* CriticalSection not deleted */
+ ERR_RTK_CRITSECENTER, /* CriticalSection not enterd */
+ ERR_RTK_CRITSECLEAVE, /* CriticalSection not left */
+
+ ERR_RTK_EXC_BASE = 25300, /* Base for RTK exceptions -> + RTK_EXCTYP_xx */
+
+ ERR_RTK_LOG_CREATE = 25400, /* Log not created */
+ ERR_RTK_LOG_DELETE, /* Log not deleted */
+ ERR_RTK_LOG_NOBUFSET, /* no Log-Buffer set */
+ ERR_RTK_LOG_LOGACTIVE, /* Log active */
+} RTK_ERROR;
+
+/* General datatypes for RT kernel */
+typedef ULONG RTK_H;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkCriticalSection.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkCriticalSection.h
new file mode 100644
index 0000000..6cac18a
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkCriticalSection.h
@@ -0,0 +1,44 @@
+
+/* RTK critical section functions */
+
+#ifndef _RTK_CRITICAL_SECTION_H_
+#define _RTK_CRITICAL_SECTION_H_
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef RTK_H RTK_CRIT_SEC_H;
+
+/**********************************************************************************************/
+/* Critical Section */
+/* A critical sections can be used to mutually exclude access to critical code sections which */
+/* process shared data that might be simultaniously modified by other tasks as well. */
+/* RTK critical sections support priority inheritance to avoid priority inversion. */
+/**********************************************************************************************/
+
+/* Creates a critical section object with the provided name (lpszCriticalSectionName must be unique or NULL).
+ * The output-parameter hCriticalSection (must not be NULL) returns a handle to the critical section */
+EXIMPORT RTK_ERROR RtkCreateCriticalSection(LPSTRING lpszCriticalSectionName, RTK_CRIT_SEC_H* hCriticalSection);
+
+/* Deletes a critical section object */
+EXIMPORT RTK_ERROR RtkDeleteCriticalSection(RTK_CRIT_SEC_H hCriticalSection);
+
+/* Enter a critical section.
+ * This function has to be called before accessing the data which needs mutual exclusion.
+ * If no other task is in the critical section (entered and did not yet leave), then this function returns immediately.
+ * If another task is in the critical section, then the current task yields until no other
+ * task is in the critical section. */
+EXIMPORT RTK_ERROR RtkEnterCriticalSection(RTK_CRIT_SEC_H hCriticalSection);
+
+/* Leave a critical section.
+ * This function has to be called after accessing the data which needs mutual exclusion. */
+EXIMPORT RTK_ERROR RtkLeaveCriticalSection(RTK_CRIT_SEC_H hCriticalSection);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkFifo.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkFifo.h
new file mode 100644
index 0000000..eaf286f
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkFifo.h
@@ -0,0 +1,65 @@
+
+/* RTK FIFO functions */
+
+#ifndef _RTK_FIFO_H_
+#define _RTK_FIFO_H_
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef RTK_H RTK_FIFO_H;
+
+/* Fifo flags (create) */
+typedef unsigned long RTK_FIFOFLAG;
+#define RTK_FIFO_WRITE_UNTIL_FULL 0x00000000 /* no overwrite */
+#define RTK_FIFO_WRITE_ALWAYS 0x00000001 /* overwrite */
+#define RTK_FIFO_ATTACH 0x00000002 /* FIFO access only attach/release */
+
+/* Creates a FIFO with the provided name (lpszFifoName must be unique or NULL) and the provided size (ulFifoByteSize).
+ * The FifoFlags determine whether RtkWriteFifo calls will overwrite data in the FIFO (RTK_FIFO_WRITE_ALWAYS) or whether
+ * RtkWriteFifo calls only succeed if there is enough free space available in the FIFO (RTK_FIFO_WRITE_UNTIL_FULL).
+ * A handle to the FIFO is returned as output-parameter (hFifo - must not be NULL) */
+EXIMPORT RTK_ERROR
+RtkCreateFifo(LPSTRING lpszFifoName, ULONG ulFifoByteSize, RTK_FIFOFLAG FifoFlags, RTK_FIFO_H* hFifo);
+
+/* Deletes a FIFO*/
+EXIMPORT RTK_ERROR RtkDeleteFifo(RTK_FIFO_H hFifo);
+
+/* Writes data (lpDataSource) with size ulDataByteSize to the FIFO.
+ * If the FIFO was created with the flag RTK_FIFO_WRITE_ALWAYS, then unread data will be overwritten.
+ * If the FIFO was created with the flag RTK_FIFO_WRITE_UNTIL_FULL, then unread data not be overwritten and this
+ * function waits for ulTimeoutUsec (RTK_TIMEOUT_WAITFOREVER to wait forever) to put the data into the FIFO and
+ * returns ERR_RTK_TIMEOUT if the timeout expires */
+EXIMPORT RTK_ERROR RtkWriteFifo(RTK_FIFO_H hFifo, LPVOID lpDataSource, ULONG ulDataByteSize, ULONG ulTimeoutUsec);
+
+/* Copies data of size lpDataByteSize from the FIFO to lpDataDest (must not be NULL).
+ * Waits for ulTimeoutUsec (RTK_TIMEOUT_WAITFOREVER to wait forever) if not enough data is available in the FIFO */
+EXIMPORT RTK_ERROR RtkReadFifo(RTK_FIFO_H hFifo, LPVOID lpDataDest, ULONG lpDataByteSize, ULONG ulTimeoutUsec);
+
+/* Deletes all data in the FIFO */
+EXIMPORT RTK_ERROR RtkClearFifo(RTK_FIFO_H hFifo);
+
+/* Locks access (read/write) to the FIFO for other tasks.
+ * It is possible to have one task reading and one task writing to the FIFO without requiring locking with this
+ * function. However, if multiple tasks read or if multiple tasks write to the FIFO, then locking with this function is
+ * required */
+EXIMPORT RTK_ERROR RtkAttachFifo(RTK_FIFO_H hFifo);
+
+/* Unlocks access (read/write) to the FIFO for other tasks */
+EXIMPORT RTK_ERROR RtkReleaseFifo(RTK_FIFO_H hFifo);
+
+/* Obtains information about the FIFO
+ *
+ * hFifo.............. Handle to the FIFO for which the information shall be retrieved
+ * lpulFifoFree....... Output-parameter - can be NULL. Returns the number of free bytes
+ * lpulFifoUsed....... Output-parameter - can be NULL. Returns the number of occupied bytes */
+EXIMPORT RTK_ERROR RtkGetFifoInfo(RTK_FIFO_H hFifo, LPULONG lpulFifoFree, LPULONG lpulFifoUsed);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkMemory.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkMemory.h
new file mode 100644
index 0000000..39a0683
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkMemory.h
@@ -0,0 +1,48 @@
+
+/* RTK memory functions */
+
+#ifndef _RTK_MEMORY_H_
+#define _RTK_MEMORY_H_
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Memory access flags */
+typedef unsigned long RTK_MEMORY_ACCESS;
+#define RTK_MEM_NO_READ 0x00000000 /* ignored */
+#define RTK_MEM_NO_WRITE 0x00000000 /* ignored */
+#define RTK_MEM_NOT_EXECUTE 0x00000000 /* ignored */
+#define RTK_MEM_READ_ALL 0x00000001 /* ignored */
+#define RTK_MEM_WRITE_ALL 0x00000002 /* ignored */
+#define RTK_MEM_EXECUTE_ALL 0x00000004 /* ignored */
+#define RTK_MEM_READ_LOCAL 0x00000008 /* ignored */
+#define RTK_MEM_WRITE_LOCAL 0x00000010 /* ignored */
+#define RTK_MEM_EXECUTE_LOCAL 0x00000020 /* ignored */
+#define RTK_MEM_NO_INIT 0x00000000 /* no memory initialization */
+#define RTK_MEM_INITZERO 0x00008000 /* memory initialization with 0 */
+
+/* Allocates heap memory.
+ * Depending on the AccessFlags, the memory will be initialized with 0 (RTK_MEM_INITZERO) or it will be not initialized
+ * (RTK_MEM_NO_INIT). After the function call lpMemoryAddress (which must not be NULL) contains the pointer to the
+ * allocated memory */
+EXIMPORT RTK_ERROR RtkAllocateMemory(ULONG ulByteLength, RTK_MEMORY_ACCESS AccessFlags, LPVOID* lpMemoryAddress);
+
+/* Frees memory allocated with RtkAllocateMemory.
+ * lpMemoryaddress is the pointer to the memory to be freed */
+EXIMPORT RTK_ERROR RtkFreeMemory(LPVOID lpMemoryAddress, ULONG ulUnused);
+
+/* Retrieves information about the DRAM
+ * lpulMemSize................. Output-parameter - can be NULL. Returns the overall RAM size in byte.
+ * lpulFreeMemSize............. Output-parameter - can be NULL. Returns the available/free RAM size in byte.
+ * lpulBiggestFreeBlockSize.... Output-parameter - can be NULL. Returns the biggest available/free consecutive
+ * RAM block in byte. */
+EXIMPORT RTK_ERROR RtkGetMemoryInfo(LPULONG lpulMemSize, LPULONG lpulFreeMemSize, LPULONG lpulBiggestFreeBlockSize);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkMisc.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkMisc.h
new file mode 100644
index 0000000..69878f5
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkMisc.h
@@ -0,0 +1,25 @@
+
+/* Miscellaneous RTK functions */
+
+#ifndef _RTK_MISC_H_
+#define _RTK_MISC_H_
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Reads the current value of a microsecond counter.
+ * Can be used for time measurements.
+ * Overflow from 0xFFFFFFFF to 0x00000000 */
+EXIMPORT ULONG RtkReadUsecCounter(void);
+
+/* Returns the configured system tick */
+EXIMPORT ULONG RtkGetSystemTick();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkObject.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkObject.h
new file mode 100644
index 0000000..def91ed
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkObject.h
@@ -0,0 +1,53 @@
+
+/* Functions to read general information about RTK objects */
+
+#ifndef _RTK_OBJECT_H_
+#define _RTK_OBJECT_H_
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Objecttypes */
+typedef enum
+{
+ RTK_OBJ_INVALID = 0,
+ RTK_OBJ_TASK,
+ RTK_OBJ_SEMAPHORE,
+ RTK_OBJ_CRITICAL_SECTION,
+ RTK_OBJ_TIMER,
+ RTK_OBJ_INTERRUPT,
+ RTK_OBJ_EXCEPTION,
+ RTK_OBJ_PLAINFIFO,
+ RTK_OBJ_FIFO,
+ RTK_OBJ_MEMORY,
+ RTK_OBJ_SHARED_MEMORY,
+ RTK_OBJ_DEBUGGER,
+ RTK_OBJ_LOG,
+ RTK_OBJ_RTC,
+ RTK_OBJ_MISC,
+ RTK_OBJ_TASKTIMER /* internal */
+} RTK_OBJ_TYPE;
+
+typedef RTK_OBJ_TYPE* LPRTK_OBJ_TYPE;
+
+/* Searches an RTK object with the provided name (lpszObjectName).
+ * Returns the object (hObject - must not be NULL) and the type of the object (lpObjectType - can be NULL) */
+EXIMPORT RTK_ERROR RtkGetIdent(LPSTRING lpszObjectName, RTK_H* hObject, LPRTK_OBJ_TYPE lpObjectType);
+
+/* Returns information about the RTK-Object.
+ *
+ * hObject............. Handle of the RTK Object
+ * ulMaxNameLength..... Length of the provided lpszObjectName buffer
+ * lpObjectType........ Output-parameter - can be NULL. Returns the type of the RTK-object.
+ * lpszObjectName...... Output-parameter - can be NULL. The function call writes the RTK-object name to this buffer */
+EXIMPORT RTK_ERROR
+RtkGetObjectInfo(RTK_H hObject, ULONG ulMaxNameLength, LPRTK_OBJ_TYPE lpObjectType, LPSTRING lpszObjectName);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkPlainFifo.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkPlainFifo.h
new file mode 100644
index 0000000..ef1d70f
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkPlainFifo.h
@@ -0,0 +1,55 @@
+
+/* RTK Plain FIFO
+ * Rtk plain FIFO is a simple ringbuffer which does not use any locking.
+ * It is possible to have one task reading and one task writing to the FIFO without requiring any further locking.
+ * If multiple tasks read or if multiple tasks write to the FIFO, then external locking is required.
+ */
+
+#ifndef _RTK_PLAIN_FIFO_H_
+#define _RTK_PLAIN_FIFO_H_
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef RTK_H RTK_PLAIN_FIFO_H;
+
+/* Creates a FIFO with the provided name (lpszFifoName must be unique or NULL) */
+/* the FIFO provides space for ulFifoMaxEntries with ulFifoEntrySize.
+ * A handle to the FIFO is returned as output-parameter (hFifo - must not be NULL) */
+EXIMPORT RTK_ERROR
+RtkCreatePlainFifo(LPSTRING lpszFifoName, ULONG ulFifoEntrySize, ULONG ulFifoMaxEntries, RTK_PLAIN_FIFO_H* hFifo);
+
+/* Deletes a plain FIFO*/
+EXIMPORT RTK_ERROR RtkDeletePlainFifo(RTK_PLAIN_FIFO_H hFifo);
+
+/* Writes data to the FIFO.
+ * The size of the data is the size provided with ulFifoEntrySize when creating the FIFO. If the FIFO is full (it only
+ * contains entries which were not yet read), then this function returns ERR_RTK_FIFO_WRITE */
+EXIMPORT RTK_ERROR RtkWritePlainFifo(RTK_PLAIN_FIFO_H hFifo, LPVOID lpDataSource);
+
+/* Copies data from the FIFO to lpDataDestination (must not be NULL).
+ * The size of the copied data is the size provided with ulFifoEntrySize when creating the FIFO.
+ * Returns ERR_RTK_FIFO_READ if the FIFO is empty */
+EXIMPORT RTK_ERROR RtkReadPlainFifo(RTK_PLAIN_FIFO_H hFifo, LPVOID lpDataDestination);
+
+/* Deletes all data contained in the FIFO
+ * This function requires external locking if another task calls RtkReadPlainFifo */
+EXIMPORT RTK_ERROR RtkClearPlainFifo(RTK_PLAIN_FIFO_H hFifo);
+
+/* Obtains information about the FIFO
+ *
+ * hFifo.............. Handle to the FIFO for which the information shall be retrieved
+ * lpulFifoFree....... Output-parameter - can be NULL. Returns the amount of free FIFO entries
+ * lpulFifoUsed....... Output-parameter - can be NULL. Returns the amount of occupied FIFO entries
+ * lpulFifoEntrySize.. Output-parameter - can be NULL. Returns the size of one FIFO entry in byte */
+EXIMPORT RTK_ERROR
+RtkGetPlainFifoInfo(RTK_PLAIN_FIFO_H hFifo, LPULONG lpulFifoFree, LPULONG lpulFifoUsed, LPULONG lpulFifoEntrySize);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkRtc.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkRtc.h
new file mode 100644
index 0000000..601e678
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkRtc.h
@@ -0,0 +1,28 @@
+
+/* Functions to set and read the real-time-clock */
+
+#ifndef _RTK_RTC_H_
+#define _RTK_RTC_H_
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Set the real-time-clock to 'newDateTime'.
+ * 'newDateTime' has to contain the localtime (not the UTC time).
+ */
+EXIMPORT RTK_ERROR RtkSetRealTimeClock(LPRTK_RTC newDateTime);
+
+/*
+ * Retrieves the current date and localtime.
+ */
+EXIMPORT void RtkGetRealTimeClock(LPRTK_RTC dateTime);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkSemaphore.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkSemaphore.h
new file mode 100644
index 0000000..f82ac67
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkSemaphore.h
@@ -0,0 +1,53 @@
+
+/* RTK semaphore functions
+ * Semaphores can be used to control access to critical code setions or to synchronize tasks
+ */
+
+#ifndef _RTK_SEMAPHORE_H_
+#define _RTK_SEMAPHORE_H_
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef RTK_H RTK_SEM_H;
+
+/* Creates a semaphore with the provided name (lpszSemaphoreName must be unique or NULL)
+ * ulInitCount defines the initial value of the semaphore (RtkAcquireSemaphore decreases this value until 0,
+ * RtkReleaseSemaphore increases this value until ulMaxCount).
+ * The output-parameter hSemaphore (must not be NULL) returns a handle to the semaphore */
+EXIMPORT RTK_ERROR
+RtkCreateSemaphoreEx(LPSTRING lpszSemaphoreName, ULONG ulInitCount, ULONG ulMaxCount, RTK_SEM_H* hSemaphore);
+
+/* Creates a semaphore with the provided name (lpszSemaphoreName must be unique or NULL)
+ * The initial value of the semaphore is ulMaxCount (RtkAcquireSemaphore decreases this value until 0,
+ * RtkReleaseSemaphore increases this value until ulMaxCount).
+ * The output-parameter hSemaphore (must not be NULL) returns a handle to the semaphore */
+EXIMPORT RTK_ERROR
+RtkCreateSemaphore(LPSTRING lpszSemaphoreName, ULONG ulMaxCount, RTK_SEM_H* hSemaphore);
+
+/* Deletes a sempahore*/
+EXIMPORT RTK_ERROR RtkDeleteSemaphore(RTK_SEM_H hSemaphore);
+
+/* Blocks until the semaphore has a value higher than 0 or until the timeout expires. When the semaphore has a value
+ * higher than 0, then this function decrements this value and returns */
+EXIMPORT RTK_ERROR RtkAcquireSemaphore(RTK_SEM_H hSemaphore, ULONG ulTimeoutUsec);
+
+/* Increment the value of the semaphore (only if the value was lower than the ulMaxCount defined when
+ * creating the semaphore) */
+EXIMPORT RTK_ERROR RtkReleaseSemaphore(RTK_SEM_H hSemaphore);
+
+/* Obtains information about the semaphore.
+ * lpulMaxCount ........... Output-parameter - can be NULL. Returns ulMaxCount defined when creating the semaphore
+ * lpulActCount ........... Output-parameter - can be NULL. Returns the current value of the semaphore
+ * lpulTaskWaitingCount ... Output-parameter - can be NULL. Returns the number of tasks waiting for this semaphore */
+EXIMPORT RTK_ERROR
+RtkGetSemaphoreInfo(RTK_SEM_H hSemaphore, LPULONG lpulMaxCount, LPULONG lpulActCount, LPULONG lpulTaskWaitingCount);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkTask.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkTask.h
new file mode 100644
index 0000000..980fded
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkTask.h
@@ -0,0 +1,157 @@
+
+/* RTK task functions */
+
+#ifndef _RTK_TASK_H_
+#define _RTK_TASK_H_
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef RTK_H RTK_TASK_H;
+typedef RTK_H RTK_TASK_TIMER_H;
+
+#define RTK_TASKIDENT_ITSELF 0x00000000
+#define RTK_MAX_TASK_PRIORITY 255
+#define RTK_MIN_TASK_PRIORITY 1
+#define RTK_IDLE_TASK_PRIORITY 0x1000
+#define RTK_MAX_TASK_VALUES 16
+
+/* Task flags (create/start) */
+typedef unsigned long RTK_TASKFLAG;
+#define RTK_TASK_RESUMED 0x00000000 /* task starts immediately*/
+#define RTK_TASK_SUSPENDED 0x00000001 /* task does not start immediately (to be started with RtkTaskResume) */
+#define RTK_TASK_SYSTEM 0x00000000 /* ignored */
+#define RTK_TASK_DRIVER 0x00000002 /* ignored */
+#define RTK_TASK_APPLICATION 0x00000004 /* ignored */
+
+/* Task event flags */
+typedef unsigned long RTK_EVENTFLAG;
+#define RTK_EVENT_ANY 0x00000000 /* wait until any of the wanted events are set */
+#define RTK_EVENT_ALL 0x00000001 /* wait until all wanted events are set */
+#define RTK_EVENT_NO_DELETE 0x00000002 /* ignored */
+
+/* Task state flags (taskInfo) */
+typedef unsigned long RTK_TASKSTATEFLAG;
+#define RTK_TASKSTATE_READY 0x00000000 /* Task is not waiting for any resource other than the CPU. */
+#define RTK_TASKSTATE_SUSPENDED 0x00000001 /* Task is unavailable for execution. */
+#define RTK_TASKSTATE_PENDED 0x00000002 /* Task is blocked due to the unavailability of some resource. */
+#define RTK_TASKSTATE_DELAYED 0x00000004 /* Task is asleep for some duration. */
+/* RTK_TASKSTATE_DELAYED + RTK_TASKSTATE_SUSPENDED Task is both delayed and suspended */
+/* RTK_TASKSTATE_PENDED + RTK_TASKSTATE_SUSPENDED Task is both pended and suspended */
+
+/* Creates a task running function taskFunction(taskFunctionParameter).
+ * The task has the name lpszTaskName (must be unique or NULL), the priority wTaskPriority (1.. lowest, 255.. highest),
+ * and the stack size ulTaskUserStackSize+ulTaskSupervisorStackSize in bytes. This combined stack size has to be
+ * greater or equal to 0x1000 and less than or equal to 0x100000, otherwise the error ERR_RTK_NO_STACK will be returned.
+ * The TaskFlags can be used to determine the initial task state (resumed/suspended).
+ * The function returns a handle to the created task (hTask) */
+EXIMPORT RTK_ERROR RtkCreateTask(LPSTRING lpszTaskName, WORD wTaskPriority, ULONG ulTaskSupervisorStackSize,
+ ULONG ulTaskUserStackSize, RTK_TASKFLAG TaskFlags, LPRTK_CREATE_TASK_FKT taskFunction,
+ void* taskFunctionParameter, RTK_TASK_H* hTask);
+
+/* Deletes the task.
+ * Stops execution and frees stack of the task. */
+EXIMPORT RTK_ERROR RtkDeleteTask(RTK_TASK_H hTask);
+
+/* Suspends the task.
+ * A suspended task stops its execution until it is resumed (RtkResumeTask) */
+EXIMPORT RTK_ERROR RtkSuspendTask(RTK_TASK_H hTask);
+
+/* Resumes the task. */
+EXIMPORT RTK_ERROR RtkResumeTask(RTK_TASK_H hTask);
+
+/* Delays the calling task for the specified time in µs. */
+EXIMPORT void RtkSleepTaskUsec(ULONG ulSleepUsec);
+
+/* Sends an event to a task (hTask).
+ * Each bit of wTaskEvent is one event of the task - sending multiple events is possible (logical OR of event-bits).
+ * Sending one event-bit multiple times (e.g. by calling this function twice) has no effect if the event was not yet
+ * read with RtkReceiveTaskEvent. */
+EXIMPORT RTK_ERROR RtkSendTaskEvent(RTK_TASK_H hTask, WORD wTaskEvents);
+
+/* Waits for one (EventFlags=RTK_EVENT_ANY) or all (EventFlag=RTK_EVENT_ALL) of the requested
+ * Events and returns these events. Resets all returned events of the task.
+ *
+ * hTask............. Handle of the task for which the events shall be returned
+ * wWantedEvents..... Bit-mask of the events which shall be returned
+ * EventFlags........ With EventFlags=RTK_EVENT_ANY this function returns if any of the events specified with
+ * wWantedEvents is received. With EventFlags=RTK_EVENT_ALL this function only returns if all of the
+ * events specified with wWantedEvents is received
+ * ulTimeoutUsec..... If the specified timeout is over before the events are received, the function returns with an
+ * error and lpwReceivedEvent is not valid. If some of the requested events were already received by
+ * the task, then these events are not reset.
+ * lpwReceivedEvent.. This output-parameter contains the received events after the function call.
+ * Parameter must not be NULL. */
+EXIMPORT RTK_ERROR RtkReceiveTaskEvent(RTK_TASK_H hTask, WORD wWantedEvents, RTK_EVENTFLAG EventFlags,
+ ULONG ulTimeoutUsec, LPWORD lpwReceivedEvents);
+
+/* Cyclically sends events to a task (hTask). The events will be sent every ulDelayUsec µs.
+ * Each bit of wTaskEvent is one event of the task - sending multiple events is possible (logical OR of event-bits)
+ * Sending one event-bit multiple times has no effect (e.g. if the timer expires and the event is re-sent before the
+ * event was read with RtkReceiveTaskEvent).
+ * Returns a timer handle (hTaskTimer - must not be NULL) which can be used to stop sending the events
+ * (RtkCancelTaskTimer) */
+EXIMPORT RTK_ERROR
+RtkSendTaskEventCyclic(RTK_TASK_H hTask, WORD wTaskEvents, ULONG ulDelayUsec, RTK_TASK_TIMER_H* hTaskTimer);
+
+/* Sends events once to a task (hTask). The events will be sent after ulDelayUsec µs.
+ * Each bit of wTaskEvent is one event of the task - sending multiple events is possible (logical OR of event-bits).
+ * Sending one event-bit multiple times (e.g. by calling this function twice) has no effect if the event was not yet
+ * read with RtkReceiveTaskEvent.
+ * Returns a timer handle (hTaskTimer - must not be NULL) which can be used to stop sending the event
+ * (RtkCancelTaskTimer) */
+EXIMPORT RTK_ERROR
+RtkSendTaskEventAfter(RTK_TASK_H hTask, WORD wTaskEvents, ULONG ulDelayUsec, RTK_TASK_TIMER_H* hTaskTimer);
+
+/* Cancels the provided timer (hTaskTimer).
+ * This results in canceling sending the events initiated with RtkSendtaskEventCyclic() or RtkSendTaskEventAfter() */
+EXIMPORT RTK_ERROR RtkCancelTaskTimer(RTK_TASK_TIMER_H hTaskTimer);
+
+/* Writes to one of the 16 available local variables of the task (hTask).
+ * byValueIndex (0-15) addresses the variables, ulValue is the values to be written */
+EXIMPORT RTK_ERROR RtkSetTaskValue(RTK_TASK_H hTask, BYTE byValueIndex, ULONG ulValue);
+
+/* Reads to one of the 16 available local variables of the task (hTask).
+ * byValueIndex (0-15) addresses the variables, lpulValue contains the value of the variable after the function call */
+EXIMPORT RTK_ERROR RtkGetTaskValue(RTK_TASK_H hTask, BYTE byValueIndex, LPULONG lpulValue);
+
+/* Sets the task priority to wTaskPriority (1.. lowest, 255.. highest) */
+EXIMPORT RTK_ERROR RtkSetTaskPriority(RTK_TASK_H hTask, WORD wTaskPriority);
+
+/* Retrieves the task priority.
+ * lpwTaskPriority contains the priority of the task after the function call */
+EXIMPORT RTK_ERROR RtkGetTaskPriority(RTK_TASK_H hTask, LPWORD lpwTaskPriority);
+
+/* Returns task information
+ *
+* hTask................ Handle of the task for which the information shall be returned
+* lpTaskStateFlags..... Output-parameter - can be NULL. Returns the task state (RTK_TASKSTATE_READY,
+* RTK_TASKSTATE_SUSPENDED, RTK_TASKSTATE_PENDED, RTK_TASKSTATE_DELAYED)
+* lpwTaskPriority....... Output-parameter - can be NULL. Returns the task priority
+* lpulUnused1........... unused - can be NULL
+* lpulUnused2........... unused - can be NULL
+* lpulFreeStack......... Output-parameter - can be NULL. Returns the free stack size
+* lpulInternalTaskIdent. Output-parameter - can be NULL. Returns an OS-specific task ident */
+EXIMPORT RTK_ERROR RtkGetTaskInfo(RTK_TASK_H hTask, RTK_TASKSTATEFLAG* lpTaskStateFlags, LPWORD lpwTaskPriority,
+ LPULONG lpulUnused1, LPULONG lpulUnused2, LPULONG lpulFreeStack,
+ LPULONG lpulInternalTaskIdent);
+
+/* Get the handle for the currently running task */
+EXIMPORT RTK_TASK_H RtkGetCurrentTaskIdent();
+
+/* Returns TRUE if the task is ready.
+ * Returns FALSE if the task is not ready or if 'hTask' is invalid. */
+EXIMPORT BOOLEAN RtkIsTaskReady(RTK_TASK_H hTask);
+
+/* Returns TRUE if the task is suspended.
+ * Returns FALSE if the task is not suspended or if 'hTask' is invalid. */
+EXIMPORT BOOLEAN RtkIsTaskSuspended(RTK_TASK_H hTask);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkTimer.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkTimer.h
new file mode 100644
index 0000000..a60c69a
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkTimer.h
@@ -0,0 +1,43 @@
+
+/* RTK timer functions
+ * Timers can be used for cyclic actions and for single timeouts
+ */
+
+#ifndef _RTK_TIMER_H_
+#define _RTK_TIMER_H_
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef RTK_H RTK_TIMER_H;
+
+/* Flags for RtkStartTimer */
+typedef unsigned long RTK_TIMERFLAG;
+#define RTK_TIMER_CYCLIC 0x00000000
+#define RTK_TIMER_ONESHOT 0x00000001
+
+/* Create a timer object with the provided name (lpszTimerName must be unique or NULL).
+ * When the timer expires (to be started with RtkStartTimer), then timerFunction(timerContext) is called with task
+ * priority wTimerPriorityand with stack size ulTimerSupervidorStackSize
+ * The output-parameter hTimer (must not be NULL) returns a handle to the timer */
+EXIMPORT RTK_ERROR RtkCreateTimer(LPSTRING lpszTimerName, WORD wTimerPriority, ULONG ulTimerSupervisorStackSize,
+ LPRTK_CREATE_TASK_FKT timerFunction, void* timerContext, RTK_TIMER_H* hTimer);
+
+/* Deletes a timer object */
+EXIMPORT RTK_ERROR RtkDeleteTimer(RTK_TIMER_H hTimer);
+
+/* Starts a cyclical timer (TimerFlage=RTK_TIMER_CYCLIC) with the provided cycle time (ulTimerCycleUsec)
+ * or a single-shot timer (TimerFlags=RTK_TIMER_ONESHOT) with the provided delay (ulTimerCycleUsec) */
+EXIMPORT RTK_ERROR RtkStartTimer(RTK_TIMER_H hTimer, ULONG ulTimerCycleUsec, RTK_TIMERFLAG TimerFlags);
+
+/* Stops a timer started with RtkStartTimer */
+EXIMPORT RTK_ERROR RtkStopTimer(RTK_TIMER_H hTimer);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkTypes.h b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkTypes.h
new file mode 100644
index 0000000..5901cea
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkTypes.h
@@ -0,0 +1,58 @@
+/* contains legacy type definitions. These types should only be used
+ * for calling functions which require these types. */
+
+#ifndef _RTK_TYPES_H_
+#define _RTK_TYPES_H_
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#ifndef _ULONG_DEFINED_ /* ULONG might also be defined by vxTypesOld.h */
+#define _ULONG_DEFINED_
+typedef uint32_t ULONG;
+#endif
+
+#ifndef _BYTE_DEFINED_ /* BYTE might already be defined from plctypes.h */
+#define _BYTE_DEFINED_
+typedef uint8_t BYTE;
+#endif
+
+#ifndef _WORD_DEFINED_ /* WORD might already be defined from plctypes.h */
+#define _WORD_DEFINED_
+typedef uint16_t WORD;
+#endif
+
+#ifndef TRUE
+#define TRUE 1
+#define FALSE 0
+#endif
+
+typedef unsigned char BOOLEAN;
+typedef char* LPSTRING;
+typedef void* LPVOID;
+typedef BYTE* LPBYTE;
+typedef WORD* LPWORD;
+typedef ULONG* LPULONG;
+
+typedef struct
+{
+ WORD Year; /* 0 up (for example 1999) */
+ BYTE Month; /* 1-12 */
+ BYTE Day; /* 1-31 */
+ BYTE DayOfWeek; /* 1=monday, ..., 7=sunday */
+ BYTE Hour; /* 0-23 */
+ BYTE Minute; /* 0-59 */
+ BYTE Second; /* 0-59 */
+ WORD Millisecond; /* 0-999 */
+ WORD Microsecond; /* 0-999 */
+} RTK_RTC, *LPRTK_RTC;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/example/As6Project/Logical/Libraries/Loupe/tlsf/Binary.lby b/example/As6Project/Logical/Libraries/Loupe/tlsf/Binary.lby
new file mode 100644
index 0000000..501a84f
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/tlsf/Binary.lby
@@ -0,0 +1,8 @@
+
+
+
+
+ heap_redirect.c
+ tlsf.h
+
+
\ No newline at end of file
diff --git a/example/As6Project/Logical/Libraries/Loupe/tlsf/SG4/ARM/libtlsf_s.a b/example/As6Project/Logical/Libraries/Loupe/tlsf/SG4/ARM/libtlsf_s.a
new file mode 100644
index 0000000..03bd47c
Binary files /dev/null and b/example/As6Project/Logical/Libraries/Loupe/tlsf/SG4/ARM/libtlsf_s.a differ
diff --git a/example/As6Project/Logical/Libraries/Loupe/tlsf/SG4/libtlsf_s.a b/example/As6Project/Logical/Libraries/Loupe/tlsf/SG4/libtlsf_s.a
new file mode 100644
index 0000000..4ef3661
Binary files /dev/null and b/example/As6Project/Logical/Libraries/Loupe/tlsf/SG4/libtlsf_s.a differ
diff --git a/example/As6Project/Logical/Libraries/Loupe/tlsf/heap_redirect.c b/example/As6Project/Logical/Libraries/Loupe/tlsf/heap_redirect.c
new file mode 100644
index 0000000..853f147
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/tlsf/heap_redirect.c
@@ -0,0 +1,22 @@
+#include
+#include "tlsf.h"
+
+//Redirect memory allocation calls:
+struct _reent;
+#define REENT struct _reent * _r __attribute__((__unused__))
+
+void * malloc(size_t size) { return tlsf_malloc(size); }
+void free(void* ptr) { tlsf_free(ptr); }
+void * realloc(void* ptr, size_t size) { return tlsf_realloc(ptr, size); }
+void * calloc(size_t items, size_t size) { return tlsf_calloc(items, size); }
+
+#ifndef __CYGWIN__
+void * _malloc_r(REENT, size_t size) { return tlsf_malloc(size); }
+void _free_r(REENT, void* ptr) { tlsf_free(ptr); }
+void * _realloc_r(REENT, void* ptr, size_t size) { return tlsf_realloc(ptr, size); }
+void * _calloc_r(REENT, size_t items, size_t size) { return tlsf_calloc(items, size); }
+#endif
+
+int const _force_tlfs_malloc = (int) malloc;
+
+__attribute__((weak,visibility("hidden"))) size_t bur_heap_size = 0; /* variable 'bur_heap_size' as dummy */
diff --git a/example/As6Project/Logical/Libraries/Loupe/tlsf/tlsf.h b/example/As6Project/Logical/Libraries/Loupe/tlsf/tlsf.h
new file mode 100644
index 0000000..4cb81f0
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Loupe/tlsf/tlsf.h
@@ -0,0 +1,105 @@
+/** @file
+ *******************************************************************************
+ **
+ ** @brief
+ ** Two Levels Segregate Fit memory allocator (TLSF)
+ ** Written by Miguel Masmano Tello
+ **
+ ** This code is released using a dual license strategy: GPL/LGPL
+ **
+ *******************************************************************************
+ ** $Header: https://brateggevsvn1.br-automation.co.at/svn/motion_gmc/trunk/GMC/Core/sys/tlsf.h 2314 2013-11-26 09:33:41Z eisenmannm $
+ *******************************************************************************
+ **
+ ** @remark
+ ** This file is part of the common AR C++ System environment.
+ **
+ ** @copyright
+ **
+ ** Bernecker + Rainer Industrie-Elektronik Ges.m.b.H.
+ **
+ ** @date 2012-06-21 File has been adopted by Markus Eisenmann
+ **
+ ******************************************************************************/
+
+#ifndef _ARSYS_TLSF_H_INCLUDED_
+#define _ARSYS_TLSF_H_INCLUDED_
+
+#ifndef _SIZE_T_DEFINED
+#include
+#endif
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/** @cond COMPILER_SPECIFICS */
+#ifndef DECLSPEC_NOTHROW
+#if defined(__GNUC__) && ((__GNUC__ > 3) || \
+ ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)))
+#define DECLSPEC_NOTHROW __attribute__((__nothrow__))
+#elif (_MSC_VER >= 1200) && defined(__cplusplus)
+#define DECLSPEC_NOTHROW __declspec(nothrow)
+#else
+#define DECLSPEC_NOTHROW
+#endif
+#endif
+
+#if defined(__ELF__) && (__GNUC__ >= 4)
+#pragma GCC visibility push(hidden)
+#define BURTLSF_DLLAPI __attribute__((visibility("default"), __nothrow__))
+#else
+#if defined(_WIN32) || defined(__WINDOWS__) || defined(__MINGW32__) || defined(__CYGWIN__)
+#if defined(_ARSVCREG_EXPORT) || defined(BURTLSF_EXPORTS)
+#define BURTLSF_DLLAPI __declspec(dllexport) DECLSPEC_NOTHROW
+#else
+#define BURTLSF_DLLAPI __declspec(dllimport) DECLSPEC_NOTHROW
+#endif
+#else /* not Windows */
+#define BURTLSF_DLLAPI extern DECLSPEC_NOTHROW
+#endif /* end Windows */
+#endif
+ /** @endcond */
+
+ DECLSPEC_NOTHROW size_t _tlsf_init_memory_pool(size_t mem_pool_size, void *mem_pool);
+ DECLSPEC_NOTHROW size_t _tlsf_add_new_area(void *area, size_t area_size, void *mem_pool);
+#if !defined(NDEBUG) && (defined(DEBUG) || defined(_DEBUG))
+ DECLSPEC_NOTHROW size_t _tlsf_get_used_size(void *mem_pool);
+ DECLSPEC_NOTHROW size_t _tlsf_get_max_size(void *mem_pool);
+#endif
+ DECLSPEC_NOTHROW void _tlsf_destroy_memory_pool(void *mem_pool);
+ DECLSPEC_NOTHROW void *_tlsf_malloc_ex(size_t size, void *mem_pool);
+ DECLSPEC_NOTHROW void *_tlsf_free_ex(void *ptr, void *mem_pool);
+ DECLSPEC_NOTHROW void *_tlsf_realloc_ex(void *ptr, size_t new_size, void *mem_pool);
+ DECLSPEC_NOTHROW void *_tlsf_calloc_ex(size_t nelem, size_t elem_size, void *mem_pool);
+
+#if defined(__ELF__) && (__GNUC__ >= 4)
+#pragma GCC visibility pop
+#endif
+
+ /*lint -esym(526, tlsf_*) prevent warning about undefined functions*/
+ /*exos BURTLSF_DLLAPI*/ void *tlsf_malloc(size_t size);
+ /*exos BURTLSF_DLLAPI*/ void tlsf_free(void *ptr);
+ /*exos BURTLSF_DLLAPI*/ void *tlsf_realloc(void *ptr, size_t size);
+ /*exos BURTLSF_DLLAPI*/ void *tlsf_calloc(size_t nelem, size_t elem_size);
+
+ /** @cond HIDDEN_INTERNALS */
+ extern int const _force_tlfs_malloc; /*link symbol to force use of TLSF*/
+
+#if defined(_ENFORCE_TLFS_REDIRECT) && !(defined(_CODECHECK_PASS) || defined(_CODEPARSE_PASS) || defined(__CDT_PARSER__) || defined(_lint) || defined(__DOXYGEN) || defined(_doxygen))
+#if (__GNUC__ >= 3) && !defined(WIN32)
+ __extension__ void *malloc(size_t) __asm__("tlsf_malloc");
+ __extension__ void free(void *) __asm__("tlsf_free");
+ __extension__ void *realloc(void *, size_t) __asm__("tlsf_realloc");
+ __extension__ void *calloc(size_t, size_t) __asm__("tlsf_calloc");
+#else
+#error "Forcing TSLF-redirection of DSA not supported!"
+#endif
+#endif
+ /** @endcond */
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+#endif /*_ARSYS_TLSF_H_INCLUDED_*/
diff --git a/example/As6Project/Logical/Libraries/Package.pkg b/example/As6Project/Logical/Libraries/Package.pkg
new file mode 100644
index 0000000..1668338
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/Package.pkg
@@ -0,0 +1,8 @@
+
+
+
+
+ _AS
+ Loupe
+
+
\ No newline at end of file
diff --git a/example/As6Project/Logical/Libraries/_AS/AsBrStr/AsBrStr.fun b/example/As6Project/Logical/Libraries/_AS/AsBrStr/AsBrStr.fun
new file mode 100644
index 0000000..87ba979
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/AsBrStr/AsBrStr.fun
@@ -0,0 +1,80 @@
+
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsftoa : UINT (*converts a REAL value into a character string*)
+ VAR_INPUT
+ value :REAL; (*REAL (FLOAT) value to be converted into a character string*)
+ pString :UDINT; (*pointer to the destination character string*)
+ END_VAR
+END_FUNCTION
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsatof : REAL (*converts a character string into a REAL (FLOAT) value*)
+ VAR_INPUT
+ pString :UDINT; (*pointer to the character string to be converted*)
+ END_VAR
+END_FUNCTION
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsatod : LREAL (*converts a character string into a LREAL (DOUBLE) value*)
+ VAR_INPUT
+ pString :UDINT; (*pointer to the character string to be converted*)
+ END_VAR
+END_FUNCTION
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsitoa : UINT (*converts a DINT value into a character string*)
+ VAR_INPUT
+ value :DINT; (*numerical value to be converted into a string*)
+ pString :UDINT; (*pointer to the destination character string*)
+ END_VAR
+END_FUNCTION
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsatoi : DINT (*converts a character string into a DINT value*)
+ VAR_INPUT
+ pString :UDINT; (*pointer to the character string to be converted*)
+ END_VAR
+END_FUNCTION
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsmemset : UDINT (*fills the memory area with specific values*)
+ VAR_INPUT
+ pDest :UDINT; (*pointer to the destination memory*)
+ value :USINT; (*initialization value*)
+ length :UDINT; (*number of bytes to be initialized*)
+ END_VAR
+END_FUNCTION
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsmemcpy : UDINT (*copies the memory area*)
+ VAR_INPUT
+ pDest :UDINT; (*pointer to the destination memory*)
+ pSrc :UDINT; (*pointer to the data to be copied*)
+ length :UDINT; (*size of bytes to be copied*)
+ END_VAR
+END_FUNCTION
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsmemmove : UDINT (*copies the memory area (even if the memory areas overlap)*)
+ VAR_INPUT
+ pDest :UDINT; (*pointer to the destination memory*)
+ pSrc :UDINT; (*pointer to the data to be copied*)
+ length :UDINT; (*size of bytes to be copied*)
+ END_VAR
+END_FUNCTION
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsmemcmp : DINT (*compares memory areas*)
+ VAR_INPUT
+ pMem1 :UDINT; (*pointer to the memory area 1*)
+ pMem2 :UDINT; (*pointer to the memory area 2*)
+ length :UDINT; (*size of bytes to be checked*)
+ END_VAR
+END_FUNCTION
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsstrcat : UDINT (*attaches character strings to one another*)
+ VAR_INPUT
+ pDest :UDINT; (*pointer to the destination character string*)
+ pSrc :UDINT; (*pointer to the source character string*)
+ END_VAR
+END_FUNCTION
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsstrlen : UDINT (*provides the length of a character string*)
+ VAR_INPUT
+ pString :UDINT; (*pointer to the source character string*)
+ END_VAR
+END_FUNCTION
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsstrcpy : UDINT (*copies one character string into another*)
+ VAR_INPUT
+ pDest :UDINT; (*pointer to the destination character string*)
+ pSrc :UDINT; (*pointer to the source character string*)
+ END_VAR
+END_FUNCTION
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION brsstrcmp : DINT (*compares two character strings*)
+ VAR_INPUT
+ pString1 :UDINT; (*pointer to the first character string*)
+ pString2 :UDINT; (*pointer to the second character string*)
+ END_VAR
+END_FUNCTION
+
diff --git a/example/As6Project/Logical/Libraries/_AS/AsBrStr/AsBrStr.typ b/example/As6Project/Logical/Libraries/_AS/AsBrStr/AsBrStr.typ
new file mode 100644
index 0000000..1657f43
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/AsBrStr/AsBrStr.typ
@@ -0,0 +1,4 @@
+
+TYPE
+
+END_TYPE
diff --git a/example/As6Project/Logical/Libraries/_AS/AsBrStr/AsBrStr.var b/example/As6Project/Logical/Libraries/_AS/AsBrStr/AsBrStr.var
new file mode 100644
index 0000000..30b816c
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/AsBrStr/AsBrStr.var
@@ -0,0 +1,4 @@
+
+VAR CONSTANT
+
+END_VAR
diff --git a/example/As6Project/Logical/Libraries/_AS/AsBrStr/SG3/AsBrStr.h b/example/As6Project/Logical/Libraries/_AS/AsBrStr/SG3/AsBrStr.h
new file mode 100644
index 0000000..3f4c4bc
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/AsBrStr/SG3/AsBrStr.h
@@ -0,0 +1,39 @@
+/* Automation Studio generated header file */
+/* Do not edit ! */
+
+#ifndef _ASBRSTR_
+#define _ASBRSTR_
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include
+
+#ifndef _IEC_CONST
+#define _IEC_CONST _WEAK const
+#endif
+
+
+
+
+/* Prototyping of functions and function blocks */
+unsigned short brsftoa(float value, unsigned long pString);
+float brsatof(unsigned long pString);
+unsigned short brsitoa(signed long value, unsigned long pString);
+signed long brsatoi(unsigned long pString);
+unsigned long brsmemset(unsigned long pDest, unsigned char value, unsigned long length);
+unsigned long brsmemcpy(unsigned long pDest, unsigned long pSrc, unsigned long length);
+unsigned long brsmemmove(unsigned long pDest, unsigned long pSrc, unsigned long length);
+signed long brsmemcmp(unsigned long pMem1, unsigned long pMem2, unsigned long length);
+unsigned long brsstrcat(unsigned long pDest, unsigned long pSrc);
+unsigned long brsstrlen(unsigned long pString);
+unsigned long brsstrcpy(unsigned long pDest, unsigned long pSrc);
+signed long brsstrcmp(unsigned long pString1, unsigned long pString2);
+
+
+#ifdef __cplusplus
+};
+#endif
+#endif /* _ASBRSTR_ */
+
diff --git a/example/As6Project/Logical/Libraries/_AS/AsBrStr/SG4/AsBrStr.h b/example/As6Project/Logical/Libraries/_AS/AsBrStr/SG4/AsBrStr.h
new file mode 100644
index 0000000..daa7324
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/AsBrStr/SG4/AsBrStr.h
@@ -0,0 +1,39 @@
+/* Automation Studio generated header file */
+/* Do not edit ! */
+
+#ifndef _ASBRSTR_
+#define _ASBRSTR_
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include
+
+#ifndef _BUR_PUBLIC
+#define _BUR_PUBLIC
+#endif
+
+
+
+/* Prototyping of functions and function blocks */
+_BUR_PUBLIC unsigned short brsftoa(float value, unsigned long pString);
+_BUR_PUBLIC float brsatof(unsigned long pString);
+_BUR_PUBLIC double brsatod(unsigned long pString);
+_BUR_PUBLIC unsigned short brsitoa(signed long value, unsigned long pString);
+_BUR_PUBLIC signed long brsatoi(unsigned long pString);
+_BUR_PUBLIC unsigned long brsmemset(unsigned long pDest, unsigned char value, unsigned long length);
+_BUR_PUBLIC unsigned long brsmemcpy(unsigned long pDest, unsigned long pSrc, unsigned long length);
+_BUR_PUBLIC unsigned long brsmemmove(unsigned long pDest, unsigned long pSrc, unsigned long length);
+_BUR_PUBLIC signed long brsmemcmp(unsigned long pMem1, unsigned long pMem2, unsigned long length);
+_BUR_PUBLIC unsigned long brsstrcat(unsigned long pDest, unsigned long pSrc);
+_BUR_PUBLIC unsigned long brsstrlen(unsigned long pString);
+_BUR_PUBLIC unsigned long brsstrcpy(unsigned long pDest, unsigned long pSrc);
+_BUR_PUBLIC signed long brsstrcmp(unsigned long pString1, unsigned long pString2);
+
+
+#ifdef __cplusplus
+};
+#endif
+#endif /* _ASBRSTR_ */
+
diff --git a/example/As6Project/Logical/Libraries/_AS/AsBrStr/SGC/AsBrStr.h b/example/As6Project/Logical/Libraries/_AS/AsBrStr/SGC/AsBrStr.h
new file mode 100644
index 0000000..3f4c4bc
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/AsBrStr/SGC/AsBrStr.h
@@ -0,0 +1,39 @@
+/* Automation Studio generated header file */
+/* Do not edit ! */
+
+#ifndef _ASBRSTR_
+#define _ASBRSTR_
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include
+
+#ifndef _IEC_CONST
+#define _IEC_CONST _WEAK const
+#endif
+
+
+
+
+/* Prototyping of functions and function blocks */
+unsigned short brsftoa(float value, unsigned long pString);
+float brsatof(unsigned long pString);
+unsigned short brsitoa(signed long value, unsigned long pString);
+signed long brsatoi(unsigned long pString);
+unsigned long brsmemset(unsigned long pDest, unsigned char value, unsigned long length);
+unsigned long brsmemcpy(unsigned long pDest, unsigned long pSrc, unsigned long length);
+unsigned long brsmemmove(unsigned long pDest, unsigned long pSrc, unsigned long length);
+signed long brsmemcmp(unsigned long pMem1, unsigned long pMem2, unsigned long length);
+unsigned long brsstrcat(unsigned long pDest, unsigned long pSrc);
+unsigned long brsstrlen(unsigned long pString);
+unsigned long brsstrcpy(unsigned long pDest, unsigned long pSrc);
+signed long brsstrcmp(unsigned long pString1, unsigned long pString2);
+
+
+#ifdef __cplusplus
+};
+#endif
+#endif /* _ASBRSTR_ */
+
diff --git a/example/As6Project/Logical/Libraries/_AS/AsBrStr/binary.lby b/example/As6Project/Logical/Libraries/_AS/AsBrStr/binary.lby
new file mode 100644
index 0000000..2090ed1
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/AsBrStr/binary.lby
@@ -0,0 +1,9 @@
+
+
+
+
+ AsBrStr.fun
+ AsBrStr.typ
+ AsBrStr.var
+
+
diff --git a/example/As6Project/Logical/Libraries/_AS/AsBrWStr/AsBrWStr.fun b/example/As6Project/Logical/Libraries/_AS/AsBrWStr/AsBrWStr.fun
new file mode 100644
index 0000000..8de4cc5
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/AsBrWStr/AsBrWStr.fun
@@ -0,0 +1,71 @@
+
+{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION brwcsconv : UDINT (*converts one string to a different format*)
+ VAR_INPUT
+ pDestination :REFERENCE TO USINT; (*string to be appended to, given as a pointer*)
+ pSource :REFERENCE TO USINT; (*string to be appended, given as a pointer*)
+ level :USINT; (*brwU8toUC (= 0) if converting from U8 to UC; brwUCtoU8 (= 1) if converting from UC to U8*)
+ END_VAR
+END_FUNCTION
+{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION brwcsncpy : UDINT (*copies a maximum of n characters from the pSource WC string to the pDestination address*)
+ VAR_INPUT
+ pDestination :REFERENCE TO UINT; (*pointer to the target memory for the string*)
+ pSource :REFERENCE TO UINT; (*string to be copied, given as a pointer*)
+ n :UDINT; (*max. number of characters to be copied*)
+ END_VAR
+END_FUNCTION
+{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION brwcsncat : UDINT (*appends a maximum of n characters from the pSource string to the pDestination string*)
+ VAR_INPUT
+ pDestination :REFERENCE TO UINT; (*string to be appended to, given as a pointer*)
+ pSource :REFERENCE TO UINT; (*string to be appended, given as a pointer*)
+ n :UDINT; (*maximum number of characters to be added from pSource to pDestination*)
+ END_VAR
+END_FUNCTION
+{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION brwcscat : UDINT (*connects two WC strings to each other (concatenation)*)
+ VAR_INPUT
+ pDestination :REFERENCE TO UINT; (*string to be appended to, given as a pointer*)
+ pSource :REFERENCE TO UINT; (*string to be appended, given as a pointer*)
+ END_VAR
+END_FUNCTION
+{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION brwcscmp : DINT (*compares two 16-bit character strings*)
+ VAR_INPUT
+ pUcstr1 :REFERENCE TO UINT; (*first string, given as a pointer*)
+ pUcstr2 :REFERENCE TO UINT; (*second string, given as a pointer*)
+ END_VAR
+END_FUNCTION
+{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION brwcslen : UDINT (*determines the length of a WC string*)
+ VAR_INPUT
+ pwcString :REFERENCE TO UINT; (*string whose length should be determined, given as a pointer*)
+ END_VAR
+END_FUNCTION
+{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION brwcsset : UDINT (*appends the pSource string to the pDestination string*)
+ VAR_INPUT
+ pDestination :REFERENCE TO UINT; (*string being written, given as a pointer*)
+ len :UDINT; (*number of characters to be written*)
+ symbol :UINT; (*character used to overwrite*)
+ END_VAR
+END_FUNCTION
+{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION brwcsncmp : DINT (*compares two 16-bit strings*)
+ VAR_INPUT
+ pwcString1 :REFERENCE TO UINT; (*first string given as a pointer*)
+ pwcString2 :REFERENCE TO UINT; (*second string given as a pointer*)
+ n :UDINT; (*max. number of characters from pUcstr1 to be compared with pUcstr2*)
+ END_VAR
+END_FUNCTION
+{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION brwcscpy : UDINT (*copies a WC string*)
+ VAR_INPUT
+ pDestination :REFERENCE TO UINT; (*pointer to the target memory for the string*)
+ pSource :REFERENCE TO UINT; (*string to be copied, given as a pointer*)
+ END_VAR
+END_FUNCTION
+{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION brwcsrchr : UDINT (*searches for the last occurrence of a certain character in a WC string*)
+ VAR_INPUT
+ pDestination :REFERENCE TO UINT; (*character string being searched, given as a pointer*)
+ symbol :UINT; (*character being looked for*)
+ END_VAR
+END_FUNCTION
+{REDUND_OK} {REDUND_UNREPLICABLE} FUNCTION brwcschr : UDINT (*searches for the first occurrence of a certain character*)
+ VAR_INPUT
+ pDestination :REFERENCE TO UINT; (*string given as a pointer*)
+ symbol :UINT; (*character being looked for*)
+ END_VAR
+END_FUNCTION
diff --git a/example/As6Project/Logical/Libraries/_AS/AsBrWStr/AsBrWStr.typ b/example/As6Project/Logical/Libraries/_AS/AsBrWStr/AsBrWStr.typ
new file mode 100644
index 0000000..1657f43
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/AsBrWStr/AsBrWStr.typ
@@ -0,0 +1,4 @@
+
+TYPE
+
+END_TYPE
diff --git a/example/As6Project/Logical/Libraries/_AS/AsBrWStr/AsBrWStr.var b/example/As6Project/Logical/Libraries/_AS/AsBrWStr/AsBrWStr.var
new file mode 100644
index 0000000..7af0668
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/AsBrWStr/AsBrWStr.var
@@ -0,0 +1,5 @@
+
+VAR CONSTANT
+ brwUCtoU8 : USINT := 1; (*instructs the wcsconv function to convert a WC character string into an ANSI string*)
+ brwU8toUC : USINT := 0; (*instructs the wcsconv function to convert an ANSI character string into a WC string*)
+END_VAR
diff --git a/example/As6Project/Logical/Libraries/_AS/AsBrWStr/SG3/AsBrWStr.h b/example/As6Project/Logical/Libraries/_AS/AsBrWStr/SG3/AsBrWStr.h
new file mode 100644
index 0000000..456b6dd
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/AsBrWStr/SG3/AsBrWStr.h
@@ -0,0 +1,50 @@
+/* Automation Studio generated header file */
+/* Do not edit ! */
+
+#ifndef _ASBRWSTR_
+#define _ASBRWSTR_
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include
+
+#ifndef _IEC_CONST
+#define _IEC_CONST _WEAK const
+#endif
+
+/* Constants */
+#ifdef _REPLACE_CONST
+ #define brwUCtoU8 1U
+ #define brwU8toUC 0U
+#else
+ _IEC_CONST unsigned char brwUCtoU8 = 1U;
+ _IEC_CONST unsigned char brwU8toUC = 0U;
+#endif
+
+
+
+
+
+
+
+/* Prototyping of functions and function blocks */
+unsigned long brwcsconv(unsigned char* pDestination, unsigned char* pSource, unsigned char level);
+unsigned long brwcsncpy(unsigned short* pDestination, unsigned short* pSource, unsigned long n);
+unsigned long brwcsncat(unsigned short* pDestination, unsigned short* pSource, unsigned long n);
+unsigned long brwcscat(unsigned short* pDestination, unsigned short* pSource);
+signed long brwcscmp(unsigned short* pUcstr1, unsigned short* pUcstr2);
+unsigned long brwcslen(unsigned short* pwcString);
+unsigned long brwcsset(unsigned short* pDestination, unsigned long len, unsigned short symbol);
+signed long brwcsncmp(unsigned short* pwcString1, unsigned short* pwcString2, unsigned long n);
+unsigned long brwcscpy(unsigned short* pDestination, unsigned short* pSource);
+unsigned long brwcsrchr(unsigned short* pDestination, unsigned short symbol);
+unsigned long brwcschr(unsigned short* pDestination, unsigned short symbol);
+
+
+#ifdef __cplusplus
+};
+#endif
+#endif /* _ASBRWSTR_ */
+
diff --git a/example/As6Project/Logical/Libraries/_AS/AsBrWStr/SG4/AsBrWStr.h b/example/As6Project/Logical/Libraries/_AS/AsBrWStr/SG4/AsBrWStr.h
new file mode 100644
index 0000000..c05a10d
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/AsBrWStr/SG4/AsBrWStr.h
@@ -0,0 +1,49 @@
+/* Automation Studio generated header file */
+/* Do not edit ! */
+
+#ifndef _ASBRWSTR_
+#define _ASBRWSTR_
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include
+
+#ifndef _BUR_PUBLIC
+#define _BUR_PUBLIC
+#endif
+
+
+
+/* Prototyping of functions and function blocks */
+_BUR_PUBLIC unsigned long brwcsconv(unsigned char* pDestination, unsigned char* pSource, unsigned char level);
+_BUR_PUBLIC unsigned long brwcsncpy(unsigned short* pDestination, unsigned short* pSource, unsigned long n);
+_BUR_PUBLIC unsigned long brwcsncat(unsigned short* pDestination, unsigned short* pSource, unsigned long n);
+_BUR_PUBLIC unsigned long brwcscat(unsigned short* pDestination, unsigned short* pSource);
+_BUR_PUBLIC signed long brwcscmp(unsigned short* pUcstr1, unsigned short* pUcstr2);
+_BUR_PUBLIC unsigned long brwcslen(unsigned short* pwcString);
+_BUR_PUBLIC unsigned long brwcsset(unsigned short* pDestination, unsigned long len, unsigned short symbol);
+_BUR_PUBLIC signed long brwcsncmp(unsigned short* pwcString1, unsigned short* pwcString2, unsigned long n);
+_BUR_PUBLIC unsigned long brwcscpy(unsigned short* pDestination, unsigned short* pSource);
+_BUR_PUBLIC unsigned long brwcsrchr(unsigned short* pDestination, unsigned short symbol);
+_BUR_PUBLIC unsigned long brwcschr(unsigned short* pDestination, unsigned short symbol);
+
+
+/* Constants */
+#ifdef _REPLACE_CONST
+ #define brwU8toUC 0U
+ #define brwUCtoU8 1U
+#else
+ _GLOBAL_CONST unsigned char brwU8toUC;
+ _GLOBAL_CONST unsigned char brwUCtoU8;
+#endif
+
+
+
+
+#ifdef __cplusplus
+};
+#endif
+#endif /* _ASBRWSTR_ */
+
diff --git a/example/As6Project/Logical/Libraries/_AS/AsBrWStr/SGC/AsBrWStr.h b/example/As6Project/Logical/Libraries/_AS/AsBrWStr/SGC/AsBrWStr.h
new file mode 100644
index 0000000..456b6dd
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/AsBrWStr/SGC/AsBrWStr.h
@@ -0,0 +1,50 @@
+/* Automation Studio generated header file */
+/* Do not edit ! */
+
+#ifndef _ASBRWSTR_
+#define _ASBRWSTR_
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include
+
+#ifndef _IEC_CONST
+#define _IEC_CONST _WEAK const
+#endif
+
+/* Constants */
+#ifdef _REPLACE_CONST
+ #define brwUCtoU8 1U
+ #define brwU8toUC 0U
+#else
+ _IEC_CONST unsigned char brwUCtoU8 = 1U;
+ _IEC_CONST unsigned char brwU8toUC = 0U;
+#endif
+
+
+
+
+
+
+
+/* Prototyping of functions and function blocks */
+unsigned long brwcsconv(unsigned char* pDestination, unsigned char* pSource, unsigned char level);
+unsigned long brwcsncpy(unsigned short* pDestination, unsigned short* pSource, unsigned long n);
+unsigned long brwcsncat(unsigned short* pDestination, unsigned short* pSource, unsigned long n);
+unsigned long brwcscat(unsigned short* pDestination, unsigned short* pSource);
+signed long brwcscmp(unsigned short* pUcstr1, unsigned short* pUcstr2);
+unsigned long brwcslen(unsigned short* pwcString);
+unsigned long brwcsset(unsigned short* pDestination, unsigned long len, unsigned short symbol);
+signed long brwcsncmp(unsigned short* pwcString1, unsigned short* pwcString2, unsigned long n);
+unsigned long brwcscpy(unsigned short* pDestination, unsigned short* pSource);
+unsigned long brwcsrchr(unsigned short* pDestination, unsigned short symbol);
+unsigned long brwcschr(unsigned short* pDestination, unsigned short symbol);
+
+
+#ifdef __cplusplus
+};
+#endif
+#endif /* _ASBRWSTR_ */
+
diff --git a/example/As6Project/Logical/Libraries/_AS/AsBrWStr/binary.lby b/example/As6Project/Logical/Libraries/_AS/AsBrWStr/binary.lby
new file mode 100644
index 0000000..de98f4d
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/AsBrWStr/binary.lby
@@ -0,0 +1,9 @@
+
+
+
+
+ AsBrWStr.fun
+ AsBrWStr.typ
+ AsBrWStr.var
+
+
diff --git a/example/As6Project/Logical/Libraries/_AS/Package.pkg b/example/As6Project/Logical/Libraries/_AS/Package.pkg
new file mode 100644
index 0000000..4f748b7
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/Package.pkg
@@ -0,0 +1,10 @@
+
+
+
+
+ astime
+ runtime
+ AsBrStr
+ AsBrWStr
+
+
\ No newline at end of file
diff --git a/example/As6Project/Logical/Libraries/_AS/astime/SG3/astime.h b/example/As6Project/Logical/Libraries/_AS/astime/SG3/astime.h
new file mode 100644
index 0000000..b0c328a
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/astime/SG3/astime.h
@@ -0,0 +1,130 @@
+/* Automation Studio generated header file */
+/* Do not edit ! */
+
+#ifndef _ASTIME_
+#define _ASTIME_
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include
+
+#include
+
+#ifndef _IEC_CONST
+#define _IEC_CONST _WEAK const
+#endif
+
+/* Constants */
+#ifdef _REPLACE_CONST
+ #define timERR_AR 33213U
+ #define timERR_INVALID_DTSTRUCTURE 33212U
+ #define timERR_INVALID_LEN 33211U
+ #define timERR_INVALID_PARAMETER 33210U
+ #define timTIME_SERVER 2U
+ #define timREAL_TIME_CLOCK 1U
+ #define timNO_DST 3U
+ #define timDAYLIGHT_SAVING_TIME 2U
+ #define timNORMAL_TIME 1U
+ #define TIME_MAX 2073600000
+ #define TIME_MIN (-2073600000)
+ #define DATE_AND_TIME_MAX 4102444799U
+ #define timEXSETTIME_NO_OPTION 0U
+ #define timEXSETTIME_NO_LOGENTRY 1U
+#else
+ _IEC_CONST unsigned short timERR_AR = 33213U;
+ _IEC_CONST unsigned short timERR_INVALID_DTSTRUCTURE = 33212U;
+ _IEC_CONST unsigned short timERR_INVALID_LEN = 33211U;
+ _IEC_CONST unsigned short timERR_INVALID_PARAMETER = 33210U;
+ _IEC_CONST unsigned char timTIME_SERVER = 2U;
+ _IEC_CONST unsigned char timREAL_TIME_CLOCK = 1U;
+ _IEC_CONST unsigned char timNO_DST = 3U;
+ _IEC_CONST unsigned char timDAYLIGHT_SAVING_TIME = 2U;
+ _IEC_CONST unsigned char timNORMAL_TIME = 1U;
+ _IEC_CONST signed long TIME_MAX = 2073600000;
+ _IEC_CONST signed long TIME_MIN = -2073600000;
+ _IEC_CONST unsigned long DATE_AND_TIME_MAX = 4102444799U;
+ _IEC_CONST unsigned char timEXSETTIME_NO_OPTION = 0U;
+ _IEC_CONST unsigned char timEXSETTIME_NO_LOGENTRY = 1U;
+#endif
+
+
+
+
+/* Datatypes and datatypes of function blocks */
+typedef struct TIMEStructure
+{ signed char day;
+ unsigned char hour;
+ unsigned char minute;
+ unsigned char second;
+ unsigned short millisec;
+ unsigned short microsec;
+} TIMEStructure;
+
+typedef struct DTStructure
+{ unsigned short year;
+ unsigned char month;
+ unsigned char day;
+ unsigned char wday;
+ unsigned char hour;
+ unsigned char minute;
+ unsigned char second;
+ unsigned short millisec;
+ unsigned short microsec;
+} DTStructure;
+
+typedef struct DTExSetTime
+{
+ /* VAR_INPUT (analog) */
+ plcdt DT1;
+ unsigned char Option;
+ /* VAR_OUTPUT (analog) */
+ unsigned short status;
+ /* VAR_INPUT (digital) */
+ plcbit enable;
+} DTExSetTime_typ;
+
+typedef struct DTSetTime
+{
+ /* VAR_INPUT (analog) */
+ plcdt DT1;
+ /* VAR_OUTPUT (analog) */
+ unsigned short status;
+ /* VAR_INPUT (digital) */
+ plcbit enable;
+} DTSetTime_typ;
+
+typedef struct DTGetTime
+{
+ /* VAR_OUTPUT (analog) */
+ unsigned short status;
+ plcdt DT1;
+ /* VAR_INPUT (digital) */
+ plcbit enable;
+} DTGetTime_typ;
+
+
+
+/* Prototyping of functions and function blocks */
+void DTExSetTime(struct DTExSetTime* inst);
+void DTSetTime(struct DTSetTime* inst);
+void DTGetTime(struct DTGetTime* inst);
+unsigned long ascTIMEStructure(unsigned long pTIMEStructure, unsigned long pStr, unsigned long len);
+unsigned long ascDTStructure(unsigned long pDTStructure, unsigned long pStr, unsigned long len);
+unsigned long ascTIME(plctime TIME1, unsigned long pStr, unsigned long len);
+unsigned long ascDT(plcdt DT1, unsigned long pStr, unsigned long len);
+plctime TIMEStructure_TO_TIME(unsigned long pTIMEStructure);
+unsigned long TIME_TO_TIMEStructure(plctime TIME1, unsigned long pTIMEStructure);
+plcdt DTStructure_TO_DT(unsigned long pDTStructure);
+unsigned long DT_TO_DTStructure(plcdt DT1, unsigned long pDTStructure);
+unsigned long DiffT(plctime TIME2, plctime TIME1);
+unsigned long DiffDT(plcdt DT2, plcdt DT1);
+
+
+#ifdef __cplusplus
+};
+#endif
+#endif /* _ASTIME_ */
+
+
diff --git a/example/As6Project/Logical/Libraries/_AS/astime/SG4/astime.h b/example/As6Project/Logical/Libraries/_AS/astime/SG4/astime.h
new file mode 100644
index 0000000..ffa4415
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/astime/SG4/astime.h
@@ -0,0 +1,362 @@
+/* Automation Studio generated header file */
+/* Do not edit ! */
+
+#ifndef _ASTIME_
+#define _ASTIME_
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include
+
+#include
+
+#ifndef _BUR_PUBLIC
+#define _BUR_PUBLIC
+#endif
+/* Datatypes and datatypes of function blocks */
+typedef struct TIMEStructure
+{ signed char day;
+ unsigned char hour;
+ unsigned char minute;
+ unsigned char second;
+ unsigned short millisec;
+ unsigned short microsec;
+} TIMEStructure;
+
+typedef struct DTStructure
+{ unsigned short year;
+ unsigned char month;
+ unsigned char day;
+ unsigned char wday;
+ unsigned char hour;
+ unsigned char minute;
+ unsigned char second;
+ unsigned short millisec;
+ unsigned short microsec;
+} DTStructure;
+
+typedef struct DTExSetTime
+{
+ /* VAR_INPUT (analog) */
+ plcdt DT1;
+ unsigned char Option;
+ /* VAR_OUTPUT (analog) */
+ unsigned short status;
+ /* VAR_INPUT (digital) */
+ plcbit enable;
+} DTExSetTime_typ;
+
+typedef struct DTSetTime
+{
+ /* VAR_INPUT (analog) */
+ plcdt DT1;
+ /* VAR_OUTPUT (analog) */
+ unsigned short status;
+ /* VAR_INPUT (digital) */
+ plcbit enable;
+} DTSetTime_typ;
+
+typedef struct DTGetTime
+{
+ /* VAR_OUTPUT (analog) */
+ unsigned short status;
+ plcdt DT1;
+ /* VAR_INPUT (digital) */
+ plcbit enable;
+} DTGetTime_typ;
+
+typedef struct UtcDTGetTime
+{
+ /* VAR_OUTPUT (analog) */
+ unsigned short status;
+ plcdt DT1;
+ /* VAR_INPUT (digital) */
+ plcbit enable;
+} UtcDTGetTime_typ;
+
+typedef struct UtcDTSetTime
+{
+ /* VAR_INPUT (analog) */
+ plcdt DT1;
+ /* VAR_OUTPUT (analog) */
+ unsigned short status;
+ /* VAR (analog) */
+ unsigned short i_state;
+ unsigned short i_result;
+ unsigned long i_tmp;
+ /* VAR_INPUT (digital) */
+ plcbit enable;
+} UtcDTSetTime_typ;
+
+typedef struct UtcDTExSetTime
+{
+ /* VAR_INPUT (analog) */
+ plcdt DT1;
+ unsigned char Option;
+ /* VAR_OUTPUT (analog) */
+ unsigned short status;
+ /* VAR (analog) */
+ unsigned short i_state;
+ unsigned short i_result;
+ unsigned long i_tmp;
+ /* VAR_INPUT (digital) */
+ plcbit enable;
+} UtcDTExSetTime_typ;
+
+typedef struct DTStructureGetTime
+{
+ /* VAR_INPUT (analog) */
+ unsigned long pDTStructure;
+ /* VAR_OUTPUT (analog) */
+ unsigned short status;
+ /* VAR_INPUT (digital) */
+ plcbit enable;
+} DTStructureGetTime_typ;
+
+typedef struct DTStructureSetTime
+{
+ /* VAR_INPUT (analog) */
+ unsigned long pDTStructure;
+ /* VAR_OUTPUT (analog) */
+ unsigned short status;
+ /* VAR_INPUT (digital) */
+ plcbit enable;
+} DTStructureSetTime_typ;
+
+typedef struct DTStructureExSetTime
+{
+ /* VAR_INPUT (analog) */
+ unsigned long pDTStructure;
+ unsigned char Option;
+ /* VAR_OUTPUT (analog) */
+ unsigned short status;
+ /* VAR_INPUT (digital) */
+ plcbit enable;
+} DTStructureExSetTime_typ;
+
+typedef struct UtcDTStructureGetTime
+{
+ /* VAR_INPUT (analog) */
+ unsigned long pDTStructure;
+ /* VAR_OUTPUT (analog) */
+ unsigned short status;
+ /* VAR_INPUT (digital) */
+ plcbit enable;
+} UtcDTStructureGetTime_typ;
+
+typedef struct UtcDTStructureSetTime
+{
+ /* VAR_INPUT (analog) */
+ unsigned long pDTStructure;
+ /* VAR_OUTPUT (analog) */
+ unsigned short status;
+ /* VAR (analog) */
+ unsigned short i_state;
+ unsigned short i_result;
+ unsigned long i_tmp;
+ /* VAR_INPUT (digital) */
+ plcbit enable;
+} UtcDTStructureSetTime_typ;
+
+typedef struct UtcDTStructureExSetTime
+{
+ /* VAR_INPUT (analog) */
+ unsigned long pDTStructure;
+ unsigned char Option;
+ /* VAR_OUTPUT (analog) */
+ unsigned short status;
+ /* VAR (analog) */
+ unsigned short i_state;
+ unsigned short i_result;
+ unsigned long i_tmp;
+ /* VAR_INPUT (digital) */
+ plcbit enable;
+} UtcDTStructureExSetTime_typ;
+
+typedef struct UtcDT_TO_LocalDTStructure
+{
+ /* VAR_INPUT (analog) */
+ plcdt DT1;
+ unsigned long pDTStructure;
+ /* VAR_OUTPUT (analog) */
+ unsigned short status;
+ /* VAR (analog) */
+ unsigned short i_state;
+ unsigned short i_result;
+ unsigned long i_tmp;
+ /* VAR_INPUT (digital) */
+ plcbit enable;
+} UtcDT_TO_LocalDTStructure_typ;
+
+typedef struct LocalDT_TO_UtcDTStructure
+{
+ /* VAR_INPUT (analog) */
+ plcdt DT1;
+ unsigned long pDTStructure;
+ /* VAR_OUTPUT (analog) */
+ unsigned short status;
+ /* VAR (analog) */
+ unsigned short i_state;
+ unsigned short i_result;
+ unsigned long i_tmp;
+ /* VAR_INPUT (digital) */
+ plcbit enable;
+} LocalDT_TO_UtcDTStructure_typ;
+
+typedef struct UtcDTStructure_TO_LocalDT
+{
+ /* VAR_INPUT (analog) */
+ unsigned long pDTStructure;
+ /* VAR_OUTPUT (analog) */
+ plcdt DT1;
+ unsigned short status;
+ /* VAR (analog) */
+ unsigned short i_state;
+ unsigned short i_result;
+ unsigned long i_tmp;
+ /* VAR_INPUT (digital) */
+ plcbit enable;
+} UtcDTStructure_TO_LocalDT_typ;
+
+typedef struct LocalDTStructure_TO_UtcDT
+{
+ /* VAR_INPUT (analog) */
+ unsigned long pDTStructure;
+ /* VAR_OUTPUT (analog) */
+ plcdt DT1;
+ unsigned short status;
+ /* VAR (analog) */
+ unsigned short i_state;
+ unsigned short i_result;
+ unsigned long i_tmp;
+ /* VAR_INPUT (digital) */
+ plcbit enable;
+} LocalDTStructure_TO_UtcDT_typ;
+
+typedef struct TimeDeviceGetInfo
+{
+ /* VAR_INPUT (analog) */
+ unsigned long pServer;
+ unsigned char len;
+ /* VAR_OUTPUT (analog) */
+ unsigned char timeDevice;
+ float avgDeviation;
+ unsigned short status;
+ /* VAR (analog) */
+ unsigned short i_state;
+ unsigned short i_result;
+ unsigned long i_tmp;
+ /* VAR_INPUT (digital) */
+ plcbit enable;
+} TimeDeviceGetInfo_typ;
+
+typedef struct DstGetInfo
+{
+ /* VAR_INPUT (analog) */
+ unsigned long pDTStructure;
+ /* VAR_OUTPUT (analog) */
+ unsigned char dstState;
+ unsigned short status;
+ /* VAR (analog) */
+ unsigned short i_state;
+ unsigned short i_result;
+ unsigned long i_tmp;
+ /* VAR_INPUT (digital) */
+ plcbit enable;
+} DstGetInfo_typ;
+
+typedef struct DstGetInfoDT
+{
+ /* VAR_INPUT (analog) */
+ plcdt DT1;
+ /* VAR_OUTPUT (analog) */
+ unsigned char dstState;
+ unsigned short status;
+ /* VAR (analog) */
+ unsigned short i_state;
+ unsigned short i_result;
+ unsigned long i_tmp;
+ /* VAR_INPUT (digital) */
+ plcbit enable;
+} DstGetInfoDT_typ;
+
+
+
+/* Prototyping of functions and function blocks */
+_BUR_PUBLIC void DTExSetTime(struct DTExSetTime* inst);
+_BUR_PUBLIC void DTSetTime(struct DTSetTime* inst);
+_BUR_PUBLIC void DTGetTime(struct DTGetTime* inst);
+_BUR_PUBLIC void UtcDTGetTime(struct UtcDTGetTime* inst);
+_BUR_PUBLIC void UtcDTSetTime(struct UtcDTSetTime* inst);
+_BUR_PUBLIC void UtcDTExSetTime(struct UtcDTExSetTime* inst);
+_BUR_PUBLIC void DTStructureGetTime(struct DTStructureGetTime* inst);
+_BUR_PUBLIC void DTStructureSetTime(struct DTStructureSetTime* inst);
+_BUR_PUBLIC void DTStructureExSetTime(struct DTStructureExSetTime* inst);
+_BUR_PUBLIC void UtcDTStructureGetTime(struct UtcDTStructureGetTime* inst);
+_BUR_PUBLIC void UtcDTStructureSetTime(struct UtcDTStructureSetTime* inst);
+_BUR_PUBLIC void UtcDTStructureExSetTime(struct UtcDTStructureExSetTime* inst);
+_BUR_PUBLIC void UtcDT_TO_LocalDTStructure(struct UtcDT_TO_LocalDTStructure* inst);
+_BUR_PUBLIC void LocalDT_TO_UtcDTStructure(struct LocalDT_TO_UtcDTStructure* inst);
+_BUR_PUBLIC void UtcDTStructure_TO_LocalDT(struct UtcDTStructure_TO_LocalDT* inst);
+_BUR_PUBLIC void LocalDTStructure_TO_UtcDT(struct LocalDTStructure_TO_UtcDT* inst);
+_BUR_PUBLIC void TimeDeviceGetInfo(struct TimeDeviceGetInfo* inst);
+_BUR_PUBLIC void DstGetInfo(struct DstGetInfo* inst);
+_BUR_PUBLIC void DstGetInfoDT(struct DstGetInfoDT* inst);
+_BUR_PUBLIC plctime clock_ms(void);
+_BUR_PUBLIC unsigned long ascTIMEStructure(unsigned long pTIMEStructure, unsigned long pStr, unsigned long len);
+_BUR_PUBLIC unsigned long ascDTStructure(unsigned long pDTStructure, unsigned long pStr, unsigned long len);
+_BUR_PUBLIC unsigned long ascTIME(plctime TIME1, unsigned long pStr, unsigned long len);
+_BUR_PUBLIC unsigned long ascDT(plcdt DT1, unsigned long pStr, unsigned long len);
+_BUR_PUBLIC plctime TIMEStructure_TO_TIME(unsigned long pTIMEStructure);
+_BUR_PUBLIC unsigned long TIME_TO_TIMEStructure(plctime TIME1, unsigned long pTIMEStructure);
+_BUR_PUBLIC plcdt DTStructure_TO_DT(unsigned long pDTStructure);
+_BUR_PUBLIC unsigned long DT_TO_DTStructure(plcdt DT1, unsigned long pDTStructure);
+_BUR_PUBLIC unsigned long DiffT(plctime TIME2, plctime TIME1);
+_BUR_PUBLIC unsigned long DiffDT(plcdt DT2, plcdt DT1);
+
+
+/* Constants */
+#ifdef _REPLACE_CONST
+ #define timERR_AR 33213U
+ #define timERR_INVALID_DTSTRUCTURE 33212U
+ #define timERR_INVALID_LEN 33211U
+ #define timERR_INVALID_PARAMETER 33210U
+ #define timREDUND_INTERFACE 3U
+ #define timTIME_SERVER 2U
+ #define timREAL_TIME_CLOCK 1U
+ #define timNO_DST 3U
+ #define timDAYLIGHT_SAVING_TIME 2U
+ #define timNORMAL_TIME 1U
+ #define TIME_MAX 2073600000
+ #define TIME_MIN (-2073600000)
+ #define DATE_AND_TIME_MAX 4102444799U
+ #define timEXSETTIME_NO_OPTION 0U
+ #define timEXSETTIME_NO_LOGENTRY 1U
+#else
+ _GLOBAL_CONST unsigned short timERR_AR;
+ _GLOBAL_CONST unsigned short timERR_INVALID_DTSTRUCTURE;
+ _GLOBAL_CONST unsigned short timERR_INVALID_LEN;
+ _GLOBAL_CONST unsigned short timERR_INVALID_PARAMETER;
+ _GLOBAL_CONST unsigned char timREDUND_INTERFACE;
+ _GLOBAL_CONST unsigned char timTIME_SERVER;
+ _GLOBAL_CONST unsigned char timREAL_TIME_CLOCK;
+ _GLOBAL_CONST unsigned char timNO_DST;
+ _GLOBAL_CONST unsigned char timDAYLIGHT_SAVING_TIME;
+ _GLOBAL_CONST unsigned char timNORMAL_TIME;
+ _GLOBAL_CONST signed long TIME_MAX;
+ _GLOBAL_CONST signed long TIME_MIN;
+ _GLOBAL_CONST unsigned long DATE_AND_TIME_MAX;
+ _GLOBAL_CONST unsigned char timEXSETTIME_NO_OPTION;
+ _GLOBAL_CONST unsigned char timEXSETTIME_NO_LOGENTRY;
+#endif
+
+
+
+
+#ifdef __cplusplus
+};
+#endif
+#endif /* _ASTIME_ */
+
diff --git a/example/As6Project/Logical/Libraries/_AS/astime/SGC/astime.h b/example/As6Project/Logical/Libraries/_AS/astime/SGC/astime.h
new file mode 100644
index 0000000..b0c328a
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/astime/SGC/astime.h
@@ -0,0 +1,130 @@
+/* Automation Studio generated header file */
+/* Do not edit ! */
+
+#ifndef _ASTIME_
+#define _ASTIME_
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include
+
+#include
+
+#ifndef _IEC_CONST
+#define _IEC_CONST _WEAK const
+#endif
+
+/* Constants */
+#ifdef _REPLACE_CONST
+ #define timERR_AR 33213U
+ #define timERR_INVALID_DTSTRUCTURE 33212U
+ #define timERR_INVALID_LEN 33211U
+ #define timERR_INVALID_PARAMETER 33210U
+ #define timTIME_SERVER 2U
+ #define timREAL_TIME_CLOCK 1U
+ #define timNO_DST 3U
+ #define timDAYLIGHT_SAVING_TIME 2U
+ #define timNORMAL_TIME 1U
+ #define TIME_MAX 2073600000
+ #define TIME_MIN (-2073600000)
+ #define DATE_AND_TIME_MAX 4102444799U
+ #define timEXSETTIME_NO_OPTION 0U
+ #define timEXSETTIME_NO_LOGENTRY 1U
+#else
+ _IEC_CONST unsigned short timERR_AR = 33213U;
+ _IEC_CONST unsigned short timERR_INVALID_DTSTRUCTURE = 33212U;
+ _IEC_CONST unsigned short timERR_INVALID_LEN = 33211U;
+ _IEC_CONST unsigned short timERR_INVALID_PARAMETER = 33210U;
+ _IEC_CONST unsigned char timTIME_SERVER = 2U;
+ _IEC_CONST unsigned char timREAL_TIME_CLOCK = 1U;
+ _IEC_CONST unsigned char timNO_DST = 3U;
+ _IEC_CONST unsigned char timDAYLIGHT_SAVING_TIME = 2U;
+ _IEC_CONST unsigned char timNORMAL_TIME = 1U;
+ _IEC_CONST signed long TIME_MAX = 2073600000;
+ _IEC_CONST signed long TIME_MIN = -2073600000;
+ _IEC_CONST unsigned long DATE_AND_TIME_MAX = 4102444799U;
+ _IEC_CONST unsigned char timEXSETTIME_NO_OPTION = 0U;
+ _IEC_CONST unsigned char timEXSETTIME_NO_LOGENTRY = 1U;
+#endif
+
+
+
+
+/* Datatypes and datatypes of function blocks */
+typedef struct TIMEStructure
+{ signed char day;
+ unsigned char hour;
+ unsigned char minute;
+ unsigned char second;
+ unsigned short millisec;
+ unsigned short microsec;
+} TIMEStructure;
+
+typedef struct DTStructure
+{ unsigned short year;
+ unsigned char month;
+ unsigned char day;
+ unsigned char wday;
+ unsigned char hour;
+ unsigned char minute;
+ unsigned char second;
+ unsigned short millisec;
+ unsigned short microsec;
+} DTStructure;
+
+typedef struct DTExSetTime
+{
+ /* VAR_INPUT (analog) */
+ plcdt DT1;
+ unsigned char Option;
+ /* VAR_OUTPUT (analog) */
+ unsigned short status;
+ /* VAR_INPUT (digital) */
+ plcbit enable;
+} DTExSetTime_typ;
+
+typedef struct DTSetTime
+{
+ /* VAR_INPUT (analog) */
+ plcdt DT1;
+ /* VAR_OUTPUT (analog) */
+ unsigned short status;
+ /* VAR_INPUT (digital) */
+ plcbit enable;
+} DTSetTime_typ;
+
+typedef struct DTGetTime
+{
+ /* VAR_OUTPUT (analog) */
+ unsigned short status;
+ plcdt DT1;
+ /* VAR_INPUT (digital) */
+ plcbit enable;
+} DTGetTime_typ;
+
+
+
+/* Prototyping of functions and function blocks */
+void DTExSetTime(struct DTExSetTime* inst);
+void DTSetTime(struct DTSetTime* inst);
+void DTGetTime(struct DTGetTime* inst);
+unsigned long ascTIMEStructure(unsigned long pTIMEStructure, unsigned long pStr, unsigned long len);
+unsigned long ascDTStructure(unsigned long pDTStructure, unsigned long pStr, unsigned long len);
+unsigned long ascTIME(plctime TIME1, unsigned long pStr, unsigned long len);
+unsigned long ascDT(plcdt DT1, unsigned long pStr, unsigned long len);
+plctime TIMEStructure_TO_TIME(unsigned long pTIMEStructure);
+unsigned long TIME_TO_TIMEStructure(plctime TIME1, unsigned long pTIMEStructure);
+plcdt DTStructure_TO_DT(unsigned long pDTStructure);
+unsigned long DT_TO_DTStructure(plcdt DT1, unsigned long pDTStructure);
+unsigned long DiffT(plctime TIME2, plctime TIME1);
+unsigned long DiffDT(plcdt DT2, plcdt DT1);
+
+
+#ifdef __cplusplus
+};
+#endif
+#endif /* _ASTIME_ */
+
+
diff --git a/example/As6Project/Logical/Libraries/_AS/astime/astime.fun b/example/As6Project/Logical/Libraries/_AS/astime/astime.fun
new file mode 100644
index 0000000..23a6cf6
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/astime/astime.fun
@@ -0,0 +1,333 @@
+
+{REDUND_OK} FUNCTION_BLOCK DTExSetTime (*sets the current time using the DATE_AND_TIME data type*)
+ VAR_INPUT
+ enable :BOOL; (*enables execution*)
+ DT1 :DATE_AND_TIME; (*date and time to be written*)
+ Option :USINT; (*additional option: timEXSETTIME_NO_OPTION, timEXSETTIME_NO_LOGENTRY*)
+ END_VAR
+ VAR_OUTPUT
+ status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
+ END_VAR
+END_FUNCTION_BLOCK
+
+{REDUND_OK} FUNCTION_BLOCK DTSetTime (*sets current time in DATE_AND_TIME data type*)
+ VAR_INPUT
+ enable :BOOL; (*enables execution*)
+ DT1 :DATE_AND_TIME; (*date and time to be written*)
+ END_VAR
+ VAR_OUTPUT
+ status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
+ END_VAR
+END_FUNCTION_BLOCK
+
+{REDUND_OK} FUNCTION_BLOCK DTGetTime (*reads the current time in the DATE_AND_TIME data type*)
+ VAR_INPUT
+ enable :BOOL; (*enables execution*)
+ END_VAR
+ VAR_OUTPUT
+ status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
+ DT1 :DATE_AND_TIME; (*date and time read*)
+ END_VAR
+END_FUNCTION_BLOCK
+
+{REDUND_OK} FUNCTION clock_ms : TIME (*provides a continuous millisecond counter in the TIME data type*)
+END_FUNCTION
+
+{REDUND_OK} FUNCTION_BLOCK UtcDTGetTime (*reads the current UTC-time in the DATE_AND_TIME data type*)
+ VAR_INPUT
+ enable :BOOL; (*enables execution*)
+ END_VAR
+ VAR_OUTPUT
+ status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
+ DT1 :DATE_AND_TIME; (*UTC date and time read*)
+ END_VAR
+END_FUNCTION_BLOCK
+
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK UtcDTSetTime (*sets current UTC-time in DATE_AND_TIME data type*)
+ VAR_INPUT
+ enable :BOOL; (*enables execution*)
+ DT1 :DATE_AND_TIME; (*UTC date and time to be written*)
+ END_VAR
+ VAR_OUTPUT
+ status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
+ END_VAR
+ VAR
+ i_state : UINT; (*internal variable*)
+ i_result : UINT; (*internal variable*)
+ i_tmp : UDINT; (*internal variable*)
+ END_VAR
+END_FUNCTION_BLOCK
+
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK UtcDTExSetTime (*sets current UTC-time in DATE_AND_TIME data type*)
+ VAR_INPUT
+ enable :BOOL; (*enables execution*)
+ DT1 :DATE_AND_TIME; (*UTC date and time to be written*)
+ Option :USINT; (*additional option: timEXSETTIME_NO_OPTION, timEXSETTIME_NO_LOGENTRY*)
+ END_VAR
+ VAR_OUTPUT
+ status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
+ END_VAR
+ VAR
+ i_state : UINT; (*internal variable*)
+ i_result : UINT; (*internal variable*)
+ i_tmp : UDINT; (*internal variable*)
+ END_VAR
+END_FUNCTION_BLOCK
+
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DTStructureGetTime (*reads the current time in the calendar structure*)
+ VAR_INPUT
+ enable :BOOL; (*enables execution*)
+ pDTStructure :UDINT; (*address of the calendar structure*)
+ END_VAR
+ VAR_OUTPUT
+ status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
+ END_VAR
+END_FUNCTION_BLOCK
+
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DTStructureSetTime (*sets current time in calendar structure*)
+ VAR_INPUT
+ enable :BOOL; (*enables execution*)
+ pDTStructure :UDINT; (*address of the calendar structure*)
+ END_VAR
+ VAR_OUTPUT
+ status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
+ END_VAR
+END_FUNCTION_BLOCK
+
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DTStructureExSetTime (*sets current time in calendar structure*)
+ VAR_INPUT
+ enable :BOOL; (*enables execution*)
+ pDTStructure :UDINT; (*address of the calendar structure*)
+ Option :USINT; (*additional option: timEXSETTIME_NO_OPTION, timEXSETTIME_NO_LOGENTRY*)
+ END_VAR
+ VAR_OUTPUT
+ status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
+ END_VAR
+END_FUNCTION_BLOCK
+
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK UtcDTStructureGetTime (*reads the UTC time in the calendar structure*)
+ VAR_INPUT
+ enable :BOOL; (*enables execution*)
+ pDTStructure :UDINT; (*address of the calendar structure*)
+ END_VAR
+ VAR_OUTPUT
+ status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, 0xXXXX = see help*)
+ END_VAR
+END_FUNCTION_BLOCK
+
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK UtcDTStructureSetTime (*sets UTC time in calendar structure*)
+ VAR_INPUT
+ enable :BOOL; (*enables execution*)
+ pDTStructure :UDINT; (*address of the calendar structure*)
+ END_VAR
+ VAR_OUTPUT
+ status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
+ END_VAR
+ VAR
+ i_state : UINT; (*internal variable*)
+ i_result : UINT; (*internal variable*)
+ i_tmp : UDINT; (*internal variable*)
+ END_VAR
+END_FUNCTION_BLOCK
+
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK UtcDTStructureExSetTime (*sets UTC time in calendar structure*)
+ VAR_INPUT
+ enable :BOOL; (*enables execution*)
+ pDTStructure :UDINT; (*address of the calendar structure*)
+ Option :USINT; (*additional option: timEXSETTIME_NO_OPTION, timEXSETTIME_NO_LOGENTRY*)
+ END_VAR
+ VAR_OUTPUT
+ status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
+ END_VAR
+ VAR
+ i_state : UINT; (*internal variable*)
+ i_result : UINT; (*internal variable*)
+ i_tmp : UDINT; (*internal variable*)
+ END_VAR
+END_FUNCTION_BLOCK
+
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK UtcDT_TO_LocalDTStructure (*sets current UTC-time in DATE_AND_TIME data type*)
+ VAR_INPUT
+ enable :BOOL; (*enables execution*)
+ DT1 :DATE_AND_TIME; (*UTC date and time*)
+ pDTStructure :UDINT; (*address of the calendar structure*)
+ END_VAR
+ VAR_OUTPUT
+ status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
+ END_VAR
+ VAR
+ i_state : UINT; (*internal variable*)
+ i_result : UINT; (*internal variable*)
+ i_tmp : UDINT; (*internal variable*)
+ END_VAR
+END_FUNCTION_BLOCK
+
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK LocalDT_TO_UtcDTStructure (*sets current UTC-time in DATE_AND_TIME data type*)
+ VAR_INPUT
+ enable :BOOL; (*enables execution*)
+ DT1 :DATE_AND_TIME; (*Local date and time*)
+ pDTStructure :UDINT; (*address of the calendar structure*)
+ END_VAR
+ VAR_OUTPUT
+ status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
+ END_VAR
+ VAR
+ i_state : UINT; (*internal variable*)
+ i_result : UINT; (*internal variable*)
+ i_tmp : UDINT; (*internal variable*)
+ END_VAR
+END_FUNCTION_BLOCK
+
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK UtcDTStructure_TO_LocalDT (*sets current UTC-time in DATE_AND_TIME data type*)
+ VAR_INPUT
+ enable :BOOL; (*enables execution*)
+ pDTStructure :UDINT; (*address of the calendar structure*)
+ END_VAR
+ VAR_OUTPUT
+ DT1 :DATE_AND_TIME; (*Local date and time*)
+ status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
+ END_VAR
+ VAR
+ i_state : UINT; (*internal variable*)
+ i_result : UINT; (*internal variable*)
+ i_tmp : UDINT; (*internal variable*)
+ END_VAR
+END_FUNCTION_BLOCK
+
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK LocalDTStructure_TO_UtcDT (*sets current UTC-time in DATE_AND_TIME data type*)
+ VAR_INPUT
+ enable :BOOL; (*enables execution*)
+ pDTStructure :UDINT; (*address of the calendar structure*)
+ END_VAR
+ VAR_OUTPUT
+ DT1 :DATE_AND_TIME; (*UTC date and time*)
+ status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
+ END_VAR
+ VAR
+ i_state : UINT; (*internal variable*)
+ i_result : UINT; (*internal variable*)
+ i_tmp : UDINT; (*internal variable*)
+ END_VAR
+END_FUNCTION_BLOCK
+
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION ascTIMEStructure : UDINT (*converts a "time" structure to a character string in the format "15:14:13\0"*)
+ VAR_INPUT
+ pTIMEStructure :UDINT; (*address of the time structure*)
+ pStr :UDINT; (*address of the character field*)
+ len :UDINT; (*length of the character field *)
+ END_VAR
+END_FUNCTION
+
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION ascDTStructure : UDINT (*converts a "date" structure to a character string in the format "Sun Jan 3 15:14:13 1988\0"*)
+ VAR_INPUT
+ pDTStructure :UDINT; (*address of the calendar structure *)
+ pStr :UDINT; (*address of the character field*)
+ len :UDINT; (*length of the character field*)
+ END_VAR
+END_FUNCTION
+
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION ascTIME : UDINT (*converts the TIME data type to a character string in the format "15:14:13\0"*)
+ VAR_INPUT
+ TIME1 :TIME; (*time*)
+ pStr :UDINT; (*address of the character field*)
+ len :UDINT; (*length of the character field*)
+ END_VAR
+END_FUNCTION
+
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION ascDT : UDINT (*converts the DATE_AND_TIME data type to character string in the format "Sun Jan 3 15:14:13 1988\0"*)
+ VAR_INPUT
+ DT1 :DATE_AND_TIME; (*date and time*)
+ pStr :UDINT; (*address of the character field*)
+ len :UDINT; (*length of the character field*)
+ END_VAR
+END_FUNCTION
+
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION TIMEStructure_TO_TIME : TIME (*converts a "time" structure to the TIME data type*)
+ VAR_INPUT
+ pTIMEStructure :UDINT; (*address of the time structure*)
+ END_VAR
+END_FUNCTION
+
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION TIME_TO_TIMEStructure : UDINT (*converts the TIME data type to a "time" structure*)
+ VAR_INPUT
+ TIME1 :TIME; (*time*)
+ pTIMEStructure :UDINT; (*address of the calendar structure*)
+ END_VAR
+END_FUNCTION
+
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION DTStructure_TO_DT : DATE_AND_TIME (*converts a "date" structure to the DATE_AND_TIME data type*)
+ VAR_INPUT
+ pDTStructure :UDINT; (*address of the calendar structure*)
+ END_VAR
+END_FUNCTION
+
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION DT_TO_DTStructure : UDINT (*converts the DATE_AND_TIME data type to a "date" structure*)
+ VAR_INPUT
+ DT1 :DATE_AND_TIME; (*date and time*)
+ pDTStructure :UDINT; (*address of the calendar structure*)
+ END_VAR
+END_FUNCTION
+
+{REDUND_OK} FUNCTION DiffT : UDINT (*shows the difference between two times (TIME data type) expressed in milliseconds*)
+ VAR_INPUT
+ TIME2 :TIME; (*time 2*)
+ TIME1 :TIME; (*time 1*)
+ END_VAR
+END_FUNCTION
+
+{REDUND_OK} FUNCTION DiffDT : UDINT (*shows the difference between two times (DATE_AND_TIME data type) expressed in seconds*)
+ VAR_INPUT
+ DT2 :DATE_AND_TIME; (*date and time 2*)
+ DT1 :DATE_AND_TIME; (*date and time 1*)
+ END_VAR
+END_FUNCTION
+
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK TimeDeviceGetInfo (*read information about time device*)
+ VAR_INPUT
+ enable :BOOL; (*enables execution*)
+ pServer :UDINT; (*Pointer to string*)
+ len :USINT; (*length of pServer*)
+ END_VAR
+ VAR_OUTPUT
+ timeDevice :USINT; (*sntpREAL_TIME_CLOCK or sntpTIME_SERVER*)
+ avgDeviation :REAL; (*average deviation between software time and time device*)
+ status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
+ END_VAR
+ VAR
+ i_state :UINT; (*internal variable*)
+ i_result :UINT; (*internal variable*)
+ i_tmp :UDINT; (*internal variable*)
+ END_VAR
+END_FUNCTION_BLOCK
+
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DstGetInfo (*read information about time device*)
+ VAR_INPUT
+ enable :BOOL; (*enables execution*)
+ pDTStructure :UDINT; (*Pointer to DTStructure*)
+ END_VAR
+ VAR_OUTPUT
+ dstState :USINT; (*timDAYLIGHT_SAVING_TIME, timNORMAL_TIME or timNO_DST*)
+ status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
+ END_VAR
+ VAR
+ i_state :UINT; (*internal variable*)
+ i_result :UINT; (*internal variable*)
+ i_tmp :UDINT; (*internal variable*)
+ END_VAR
+END_FUNCTION_BLOCK
+
+{REDUND_CONTEXT} {REDUND_UNREPLICABLE} FUNCTION_BLOCK DstGetInfoDT (*read information about time device*)
+ VAR_INPUT
+ enable :BOOL; (*enables execution*)
+ DT1 :DATE_AND_TIME; (*date and time in UTC*)
+ END_VAR
+ VAR_OUTPUT
+ dstState :USINT; (*timDAYLIGHT_SAVING_TIME, timNORMAL_TIME or timNO_DST*)
+ status :UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
+ END_VAR
+ VAR
+ i_state :UINT; (*internal variable*)
+ i_result :UINT; (*internal variable*)
+ i_tmp :UDINT; (*internal variable*)
+ END_VAR
+END_FUNCTION_BLOCK
diff --git a/example/As6Project/Logical/Libraries/_AS/astime/astime.typ b/example/As6Project/Logical/Libraries/_AS/astime/astime.typ
new file mode 100644
index 0000000..3609d6e
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/astime/astime.typ
@@ -0,0 +1,22 @@
+
+TYPE
+ TIMEStructure : STRUCT (*time structure*)
+ day : SINT ; (*day (1-31)*)
+ hour : USINT ; (*hours (0-23)*)
+ minute : USINT ; (*minutes (0-59)*)
+ second : USINT ; (*seconds (0-59)*)
+ millisec : UINT ; (*milliseconds (0-999)*)
+ microsec : UINT ; (*microseconds (0-999)*)
+ END_STRUCT;
+ DTStructure : STRUCT (*date structure*)
+ year : UINT ; (*year*)
+ month : USINT ; (*month (1-12)*)
+ day : USINT ; (*day (1-31)*)
+ wday : USINT ; (*day of the week (0-6), e.g. 0 = Sunday, 6 = Saturday*)
+ hour : USINT ; (*hours (0-23)*)
+ minute : USINT ; (*minutes (0-59)*)
+ second : USINT ; (*seconds (0-59)*)
+ millisec : UINT ; (*milliseconds (0-999)*)
+ microsec : UINT ; (*microseconds (0-999)*)
+ END_STRUCT;
+END_TYPE
diff --git a/example/As6Project/Logical/Libraries/_AS/astime/astime.var b/example/As6Project/Logical/Libraries/_AS/astime/astime.var
new file mode 100644
index 0000000..70e0c26
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/astime/astime.var
@@ -0,0 +1,18 @@
+
+VAR CONSTANT
+ timEXSETTIME_NO_LOGENTRY : USINT := 1;
+ timEXSETTIME_NO_OPTION : USINT := 0;
+ DATE_AND_TIME_MAX : UDINT := 4102444799;
+ TIME_MIN : DINT := -2073600000;
+ TIME_MAX : DINT := 2073600000;
+ timNORMAL_TIME : USINT := 1;
+ timDAYLIGHT_SAVING_TIME : USINT := 2;
+ timNO_DST : USINT := 3;
+ timREAL_TIME_CLOCK : USINT := 1;
+ timTIME_SERVER : USINT := 2;
+ timREDUND_INTERFACE : USINT := 3;
+ timERR_INVALID_PARAMETER : UINT := 33210;
+ timERR_INVALID_LEN : UINT := 33211;
+ timERR_INVALID_DTSTRUCTURE : UINT := 33212;
+ timERR_AR : UINT := 33213;
+END_VAR
diff --git a/example/As6Project/Logical/Libraries/_AS/astime/binary.lby b/example/As6Project/Logical/Libraries/_AS/astime/binary.lby
new file mode 100644
index 0000000..4ce250f
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/astime/binary.lby
@@ -0,0 +1,12 @@
+
+
+
+
+ astime.fun
+ astime.typ
+ astime.var
+
+
+
+
+
diff --git a/example/As6Project/Logical/Libraries/_AS/runtime/SG3/runtime.h b/example/As6Project/Logical/Libraries/_AS/runtime/SG3/runtime.h
new file mode 100644
index 0000000..360394e
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/runtime/SG3/runtime.h
@@ -0,0 +1,80 @@
+/* Automation Studio generated header file */
+/* Do not edit ! */
+
+#ifndef _RUNTIME_
+#define _RUNTIME_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+
+#ifndef _IEC_CONST
+#define _IEC_CONST _WEAK const
+#endif
+
+/* Constants */
+#ifdef _REPLACE_CONST
+ #define ERR_OK 0
+ #define ERR_NOTIMPLEMENTED 9999
+ #define ERR_FUB_ENABLE_FALSE 0xFFFE
+ #define ERR_FUB_BUSY 0xFFFF
+
+/* IEC 61131-3 Datentypen */
+ #define IEC_DATATYPE_BOOL 1
+ #define IEC_DATATYPE_SINT 2
+ #define IEC_DATATYPE_INT 3
+ #define IEC_DATATYPE_DINT 4
+ #define IEC_DATATYPE_USINT 5
+ #define IEC_DATATYPE_UINT 6
+ #define IEC_DATATYPE_UDINT 7
+ #define IEC_DATATYPE_REAL 8
+ #define IEC_DATATYPE_STRING 9
+ #define IEC_DATATYPE_ULINT 10
+ #define IEC_DATATYPE_DATE_AND_TIME 11
+ #define IEC_DATATYPE_TIME 12
+ #define IEC_DATATYPE_DATE 13
+ #define IEC_DATATYPE_LREAL 14
+ #define IEC_DATATYPE_TIME_OF_DAY 16
+ #define IEC_DATATYPE_BYTE 17
+ #define IEC_DATATYPE_WORD 18
+ #define IEC_DATATYPE_DWORD 19
+ #define IEC_DATATYPE_LWORD 20
+ #define IEC_DATATYPE_WSTRING 21
+ #define IEC_DATATYPE_LINT 23
+
+#else
+ _IEC_CONST unsigned short ERR_OK = 0U;
+ _IEC_CONST unsigned short ERR_NOTIMPLEMENTED = 9999U;
+ _IEC_CONST unsigned short ERR_FUB_ENABLE_FALSE = 0xFFFEU;
+ _IEC_CONST unsigned short ERR_FUB_BUSY = 0xFFFFU;
+
+ /* IEC 61131-3 Datentypen */
+ _IEC_CONST unsigned short IEC_DATATYPE_BOOL = 1;
+ _IEC_CONST unsigned short IEC_DATATYPE_SINT = 2;
+ _IEC_CONST unsigned short IEC_DATATYPE_INT = 3;
+ _IEC_CONST unsigned short IEC_DATATYPE_DINT = 4;
+ _IEC_CONST unsigned short IEC_DATATYPE_USINT = 5;
+ _IEC_CONST unsigned short IEC_DATATYPE_UINT = 6;
+ _IEC_CONST unsigned short IEC_DATATYPE_UDINT = 7;
+ _IEC_CONST unsigned short IEC_DATATYPE_REAL = 8;
+ _IEC_CONST unsigned short IEC_DATATYPE_STRING = 9;
+ _IEC_CONST unsigned short IEC_DATATYPE_ULINT = 10;
+ _IEC_CONST unsigned short IEC_DATATYPE_DATE_AND_TIME = 11;
+ _IEC_CONST unsigned short IEC_DATATYPE_TIME = 12;
+ _IEC_CONST unsigned short IEC_DATATYPE_DATE = 13;
+ _IEC_CONST unsigned short IEC_DATATYPE_LREAL = 14;
+ _IEC_CONST unsigned short IEC_DATATYPE_TIME_OF_DAY = 16;
+ _IEC_CONST unsigned short IEC_DATATYPE_BYTE = 17;
+ _IEC_CONST unsigned short IEC_DATATYPE_WORD = 18;
+ _IEC_CONST unsigned short IEC_DATATYPE_DWORD = 19;
+ _IEC_CONST unsigned short IEC_DATATYPE_LWORD = 20;
+ _IEC_CONST unsigned short IEC_DATATYPE_WSTRING = 21;
+ _IEC_CONST unsigned short IEC_DATATYPE_LINT = 23;
+#endif
+
+#ifdef __cplusplus
+};
+#endif
+#endif /* _RUNTIME_ */
+
diff --git a/example/As6Project/Logical/Libraries/_AS/runtime/SG4/runtime.h b/example/As6Project/Logical/Libraries/_AS/runtime/SG4/runtime.h
new file mode 100644
index 0000000..fa683ca
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/runtime/SG4/runtime.h
@@ -0,0 +1,486 @@
+/* Automation Studio generated header file */
+/* Do not edit ! */
+
+#ifndef _RUNTIME_
+#define _RUNTIME_
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include
+
+#ifndef _BUR_PUBLIC
+#define _BUR_PUBLIC
+#endif
+/* Datatypes and datatypes of function blocks */
+typedef struct SFCActionControl
+{
+ /* VAR_INPUT (analog) */
+ plctime T;
+ /* VAR (analog) */
+ unsigned char S_FF_SET;
+ unsigned char S_FF_R1;
+ unsigned char S_FF_Q;
+ unsigned char dummy1;
+ plctime L_TMR_PT;
+ plctime L_TMR_ET;
+ plctime L_TMR_STAR;
+ unsigned char L_TMR_IN;
+ unsigned char L_TMR_Q;
+ unsigned char L_TMR_M;
+ unsigned char dummy2;
+ plctime D_TMR_PT;
+ plctime D_TMR_ET;
+ plctime D_TMR_STAR;
+ unsigned char D_TMR_IN;
+ unsigned char D_TMR_Q;
+ unsigned char D_TMR_M;
+ unsigned char dummy3;
+ unsigned char P_TRIG_CLK;
+ unsigned char P_TRIG_Q;
+ unsigned char P_TRIG_M;
+ unsigned char dummy4;
+ plctime SD_TMR_PT;
+ plctime SD_TMR_ET;
+ plctime SD_TMR_STA;
+ unsigned char SD_TMR_IN;
+ unsigned char SD_TMR_Q;
+ unsigned char SD_TMR_M;
+ unsigned char dummy5;
+ unsigned char SD_FF_SET;
+ unsigned char SD_FF_R1;
+ unsigned char SD_FF_Q;
+ unsigned char DS_FF_SET;
+ unsigned char DS_FF_R1;
+ unsigned char DS_FF_Q;
+ plctime DS_TMR_PT;
+ plctime DS_TMR_ET;
+ plctime DS_TMR_STA;
+ unsigned char DS_TMR_IN;
+ unsigned char DS_TMR_Q;
+ unsigned char DS_TMR_M;
+ unsigned char dummy6;
+ unsigned char SL_FF_SET;
+ unsigned char SL_FF_R1;
+ unsigned char SL_FF_Q;
+ unsigned char dummy7;
+ plctime SL_TMR_PT;
+ plctime SL_TMR_ET;
+ plctime SL_TMR_STA;
+ unsigned char SL_TMR_IN;
+ unsigned char SL_TMR_Q;
+ unsigned char SL_TMR_M;
+ unsigned char dummy8;
+ /* VAR_INPUT (digital) */
+ plcbit N;
+ plcbit R0;
+ plcbit S0;
+ plcbit L;
+ plcbit D;
+ plcbit P;
+ plcbit SD;
+ plcbit DS;
+ plcbit SL;
+ /* VAR_OUTPUT (digital) */
+ plcbit Q;
+} SFCActionControl_typ;
+
+typedef struct SFCActionType
+{ plcbit x;
+ plcbit _x;
+ plctime t;
+ plctime _t;
+ struct SFCActionControl AC;
+} SFCActionType;
+
+typedef struct SFCAC2
+{
+ /* VAR_INPUT (analog) */
+ plctime T;
+ /* VAR (analog) */
+ unsigned char S_FF_SET;
+ unsigned char S_FF_R1;
+ unsigned char S_FF_Q;
+ plctime L_TMR_PT;
+ plctime L_TMR_ET;
+ plctime L_TMR_STAR;
+ unsigned char L_TMR_IN;
+ unsigned char L_TMR_Q;
+ unsigned char L_TMR_M;
+ plctime D_TMR_PT;
+ plctime D_TMR_ET;
+ plctime D_TMR_STAR;
+ unsigned char D_TMR_IN;
+ unsigned char D_TMR_Q;
+ unsigned char D_TMR_M;
+ plctime SD_TMR_PT;
+ plctime SD_TMR_ET;
+ plctime SD_TMR_STA;
+ unsigned char SD_TMR_IN;
+ unsigned char SD_TMR_Q;
+ unsigned char SD_TMR_M;
+ unsigned char SD_FF_SET;
+ unsigned char SD_FF_R1;
+ unsigned char SD_FF_Q1;
+ unsigned char DS_FF_SET;
+ unsigned char DS_FF_R1;
+ unsigned char DS_FF_Q1;
+ plctime DS_TMR_PT;
+ plctime DS_TMR_ET;
+ plctime DS_TMR_STA;
+ unsigned char DS_TMR_IN;
+ unsigned char DS_TMR_Q;
+ unsigned char DS_TMR_M;
+ unsigned char SL_FF_SET;
+ unsigned char SL_FF_R1;
+ unsigned char SL_FF_Q;
+ plctime SL_TMR_PT;
+ plctime SL_TMR_ET;
+ plctime SL_TMR_STA;
+ unsigned char SL_TMR_IN;
+ unsigned char SL_TMR_Q;
+ unsigned char SL_TMR_M;
+ unsigned char P_TRIG_Q;
+ unsigned char P_TRIG_M;
+ unsigned char Q_TRIG_Q;
+ unsigned char Q_TRIG_M;
+ unsigned char P1_TRIG_Q;
+ unsigned char P1_TRIG_M;
+ unsigned char P0_TRIG_Q;
+ unsigned char P0_TRIG_M;
+ /* VAR_INPUT (digital) */
+ plcbit N;
+ plcbit R0;
+ plcbit S0;
+ plcbit L;
+ plcbit D;
+ plcbit P;
+ plcbit P1;
+ plcbit P0;
+ plcbit SD;
+ plcbit DS;
+ plcbit SL;
+ /* VAR_OUTPUT (digital) */
+ plcbit Q;
+ plcbit A;
+} SFCAC2_typ;
+
+typedef struct SFCActionType2
+{ plcbit x;
+ plcbit _x;
+ struct SFCAC2 AC;
+} SFCActionType2;
+
+typedef struct SFCActionCType
+{ plcbit x;
+ plcbit _x;
+ plcbit force;
+ plcbit _force;
+ plcbit active;
+ plcbit _active;
+ plcbit error;
+ struct SFCActionControl AC;
+} SFCActionCType;
+
+typedef struct SFCActionCType2
+{ plcbit x;
+ plcbit _x;
+ plcbit force;
+ plcbit _force;
+ plcbit active;
+ plcbit _active;
+ plcbit error;
+ struct SFCAC2 AC;
+} SFCActionCType2;
+
+typedef struct TimerType
+{ double ptime;
+ double etime;
+ double start;
+ unsigned char in;
+ unsigned char q;
+} TimerType;
+
+typedef struct SFCAC3
+{
+ /* VAR_INPUT (analog) */
+ double T;
+ double T_ACT;
+ /* VAR (analog) */
+ struct TimerType L_TMR;
+ struct TimerType D_TMR;
+ struct TimerType SD_TMR;
+ struct TimerType DS_TMR;
+ struct TimerType SL_TMR;
+ unsigned char S_FF_Q1;
+ unsigned char SD_FF_Q1;
+ unsigned char DS_FF_Q1;
+ unsigned char SL_FF_Q1;
+ unsigned char P_R_TRIG_Q;
+ unsigned char P_R_TRIG_M;
+ unsigned char Q_F_TRIG_Q;
+ unsigned char Q_F_TRIG_M;
+ unsigned char P1_R_TRIG_Q;
+ unsigned char P1_R_TRIG_M;
+ unsigned char P0_F_TRIG_Q;
+ unsigned char P0_F_TRIG_M;
+ /* VAR_INPUT (digital) */
+ plcbit N;
+ plcbit R0;
+ plcbit S0;
+ plcbit L;
+ plcbit D;
+ plcbit P;
+ plcbit P1;
+ plcbit P0;
+ plcbit SD;
+ plcbit DS;
+ plcbit SL;
+ plcbit PAUSE;
+ /* VAR_OUTPUT (digital) */
+ plcbit Q;
+ plcbit A;
+} SFCAC3_typ;
+
+typedef struct SFCActionCType3
+{ double t;
+ double _t;
+ double tp;
+ plcbit x;
+ plcbit _x;
+ plcbit force;
+ plcbit _force;
+ plcbit active;
+ plcbit _active;
+ plcbit error;
+ struct SFCAC3 AC;
+} SFCActionCType3;
+
+typedef struct SFCStepType
+{ plcbit x;
+ plctime t;
+ plcbit _x;
+ plctime _t;
+} SFCStepType;
+
+typedef struct SFCStepCType
+{ plctime t;
+ plctime _t;
+ unsigned long inactive_actions;
+ unsigned long _inactive_actions;
+ unsigned long error_actions;
+ plcbit x;
+ plcbit _x;
+ plcbit x_activate;
+ plcbit force;
+ plcbit _force;
+ plcbit active;
+ plcbit _active;
+ plcbit error;
+ plcbit tip;
+ plcbit tip_disable_duration;
+ plcbit tip_disable_action;
+} SFCStepCType;
+
+typedef struct SFCStepCType3
+{ double t;
+ double _t;
+ double tp;
+ unsigned long inactive_actions;
+ unsigned long _inactive_actions;
+ unsigned long error_actions;
+ plcbit x;
+ plcbit _x;
+ plcbit x_activate;
+ plcbit force;
+ plcbit _force;
+ plcbit active;
+ plcbit _active;
+ plcbit error;
+ plcbit tip;
+ plcbit tip_disable_duration;
+ plcbit tip_disable_action;
+} SFCStepCType3;
+
+typedef struct SFCSimpleStepCType
+{ plctime t;
+ plctime _t;
+ plcbit x;
+ plcbit _x;
+ plcbit x_activate;
+ plcbit force;
+ plcbit _force;
+ plcbit active;
+ plcbit _active;
+ plcbit error;
+ plcbit tip;
+ plcbit tip_disable_duration;
+ plcbit tip_disable_action;
+} SFCSimpleStepCType;
+
+typedef struct SFCSimpleStepCType3
+{ double t;
+ double _t;
+ double tp;
+ plcbit x;
+ plcbit _x;
+ plcbit x_activate;
+ plcbit force;
+ plcbit _force;
+ plcbit active;
+ plcbit _active;
+ plcbit error;
+ plcbit tip;
+ plcbit tip_disable_duration;
+ plcbit tip_disable_action;
+} SFCSimpleStepCType3;
+
+typedef struct SFCTransitionCType
+{ plcbit force;
+ plcbit _force;
+ plcbit active;
+ plcbit _active;
+} SFCTransitionCType;
+
+typedef struct ArFBStateInternalType
+{ unsigned long ExecuteRef;
+ unsigned long BusyRef;
+ unsigned long DoneRef;
+ unsigned long ErrorRef;
+ unsigned long ActiveRef;
+ unsigned long StatusRef;
+ unsigned long FBCyclic;
+ unsigned long AsyfumaState;
+ unsigned long FBResetOut;
+ unsigned long Argument;
+ unsigned long State;
+ plcbit ExecutePrev;
+} ArFBStateInternalType;
+
+typedef struct ArFBAsyFuMaInternalType
+{ unsigned short State;
+ signed long Result;
+} ArFBAsyFuMaInternalType;
+
+typedef struct r_trig
+{
+ /* VAR_INPUT (digital) */
+ plcbit CLK;
+ /* VAR_OUTPUT (digital) */
+ plcbit Q;
+ /* VAR (digital) */
+ plcbit M;
+} r_trig_typ;
+
+typedef struct f_trig
+{
+ /* VAR_INPUT (digital) */
+ plcbit CLK;
+ /* VAR_OUTPUT (digital) */
+ plcbit Q;
+ /* VAR (digital) */
+ plcbit M;
+} f_trig_typ;
+
+typedef struct rf_trig
+{
+ /* VAR_INPUT (digital) */
+ plcbit CLK;
+ /* VAR_OUTPUT (digital) */
+ plcbit Q;
+ /* VAR (digital) */
+ plcbit M;
+} rf_trig_typ;
+
+
+
+/* Prototyping of functions and function blocks */
+_BUR_PUBLIC void r_trig(struct r_trig* inst);
+_BUR_PUBLIC void f_trig(struct f_trig* inst);
+_BUR_PUBLIC void rf_trig(struct rf_trig* inst);
+_BUR_PUBLIC void SFCActionControl(struct SFCActionControl* inst);
+_BUR_PUBLIC void SFCAC2(struct SFCAC2* inst);
+_BUR_PUBLIC void SFCAC3(struct SFCAC3* inst);
+_BUR_PUBLIC plctime GetTime(void);
+_BUR_PUBLIC double RealTan(double x);
+_BUR_PUBLIC double RealAtan(double x);
+_BUR_PUBLIC double RealAsin(double x);
+_BUR_PUBLIC double RealAcos(double x);
+_BUR_PUBLIC double RealExp(double x);
+_BUR_PUBLIC double RealLn(double x);
+_BUR_PUBLIC double RealLog(double x);
+_BUR_PUBLIC double RealExpt(double x, double y);
+_BUR_PUBLIC double RealAbs(double x);
+_BUR_PUBLIC double RealSin(double x);
+_BUR_PUBLIC double RealCos(double x);
+_BUR_PUBLIC double RealSqrt(double x);
+
+
+/* Constants */
+#ifdef _REPLACE_CONST
+ #define IEC_DATATYPE_LINT 23U
+ #define IEC_DATATYPE_WSTRING 21U
+ #define IEC_DATATYPE_LWORD 20U
+ #define IEC_DATATYPE_DWORD 19U
+ #define IEC_DATATYPE_WORD 18U
+ #define IEC_DATATYPE_BYTE 17U
+ #define IEC_DATATYPE_TIME_OF_DAY 16U
+ #define IEC_DATATYPE_LREAL 14U
+ #define IEC_DATATYPE_DATE 13U
+ #define IEC_DATATYPE_TIME 12U
+ #define IEC_DATATYPE_DATE_AND_TIME 11U
+ #define IEC_DATATYPE_ULINT 10U
+ #define IEC_DATATYPE_STRING 9U
+ #define IEC_DATATYPE_REAL 8U
+ #define IEC_DATATYPE_UDINT 7U
+ #define IEC_DATATYPE_UINT 6U
+ #define IEC_DATATYPE_USINT 5U
+ #define IEC_DATATYPE_DINT 4U
+ #define IEC_DATATYPE_INT 3U
+ #define IEC_DATATYPE_SINT 2U
+ #define IEC_DATATYPE_BOOL 1U
+ #define ERR_FB_NOT_IMPLEMENTED (-1070585592)
+ #define ERR_FUB_REDUNDANT 35688U
+ #define ERR_FUB_BUSY 65535U
+ #define ERR_FUB_ENABLE_FALSE 65534U
+ #define ERR_NOTIMPLEMENTED 9999U
+ #define ERR_OK 0U
+#else
+ _GLOBAL_CONST unsigned short IEC_DATATYPE_LINT;
+ _GLOBAL_CONST unsigned short IEC_DATATYPE_WSTRING;
+ _GLOBAL_CONST unsigned short IEC_DATATYPE_LWORD;
+ _GLOBAL_CONST unsigned short IEC_DATATYPE_DWORD;
+ _GLOBAL_CONST unsigned short IEC_DATATYPE_WORD;
+ _GLOBAL_CONST unsigned short IEC_DATATYPE_BYTE;
+ _GLOBAL_CONST unsigned short IEC_DATATYPE_TIME_OF_DAY;
+ _GLOBAL_CONST unsigned short IEC_DATATYPE_LREAL;
+ _GLOBAL_CONST unsigned short IEC_DATATYPE_DATE;
+ _GLOBAL_CONST unsigned short IEC_DATATYPE_TIME;
+ _GLOBAL_CONST unsigned short IEC_DATATYPE_DATE_AND_TIME;
+ _GLOBAL_CONST unsigned short IEC_DATATYPE_ULINT;
+ _GLOBAL_CONST unsigned short IEC_DATATYPE_STRING;
+ _GLOBAL_CONST unsigned short IEC_DATATYPE_REAL;
+ _GLOBAL_CONST unsigned short IEC_DATATYPE_UDINT;
+ _GLOBAL_CONST unsigned short IEC_DATATYPE_UINT;
+ _GLOBAL_CONST unsigned short IEC_DATATYPE_USINT;
+ _GLOBAL_CONST unsigned short IEC_DATATYPE_DINT;
+ _GLOBAL_CONST unsigned short IEC_DATATYPE_INT;
+ _GLOBAL_CONST unsigned short IEC_DATATYPE_SINT;
+ _GLOBAL_CONST unsigned short IEC_DATATYPE_BOOL;
+ _GLOBAL_CONST signed long ERR_FB_NOT_IMPLEMENTED;
+ _GLOBAL_CONST unsigned short ERR_FUB_REDUNDANT;
+ _GLOBAL_CONST unsigned short ERR_FUB_BUSY;
+ _GLOBAL_CONST unsigned short ERR_FUB_ENABLE_FALSE;
+ _GLOBAL_CONST unsigned short ERR_NOTIMPLEMENTED;
+ _GLOBAL_CONST unsigned short ERR_OK;
+#endif
+
+
+
+
+#ifdef __cplusplus
+};
+#endif
+#endif /* _RUNTIME_ */
+
diff --git a/example/As6Project/Logical/Libraries/_AS/runtime/SGC/runtime.h b/example/As6Project/Logical/Libraries/_AS/runtime/SGC/runtime.h
new file mode 100644
index 0000000..360394e
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/runtime/SGC/runtime.h
@@ -0,0 +1,80 @@
+/* Automation Studio generated header file */
+/* Do not edit ! */
+
+#ifndef _RUNTIME_
+#define _RUNTIME_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+
+#ifndef _IEC_CONST
+#define _IEC_CONST _WEAK const
+#endif
+
+/* Constants */
+#ifdef _REPLACE_CONST
+ #define ERR_OK 0
+ #define ERR_NOTIMPLEMENTED 9999
+ #define ERR_FUB_ENABLE_FALSE 0xFFFE
+ #define ERR_FUB_BUSY 0xFFFF
+
+/* IEC 61131-3 Datentypen */
+ #define IEC_DATATYPE_BOOL 1
+ #define IEC_DATATYPE_SINT 2
+ #define IEC_DATATYPE_INT 3
+ #define IEC_DATATYPE_DINT 4
+ #define IEC_DATATYPE_USINT 5
+ #define IEC_DATATYPE_UINT 6
+ #define IEC_DATATYPE_UDINT 7
+ #define IEC_DATATYPE_REAL 8
+ #define IEC_DATATYPE_STRING 9
+ #define IEC_DATATYPE_ULINT 10
+ #define IEC_DATATYPE_DATE_AND_TIME 11
+ #define IEC_DATATYPE_TIME 12
+ #define IEC_DATATYPE_DATE 13
+ #define IEC_DATATYPE_LREAL 14
+ #define IEC_DATATYPE_TIME_OF_DAY 16
+ #define IEC_DATATYPE_BYTE 17
+ #define IEC_DATATYPE_WORD 18
+ #define IEC_DATATYPE_DWORD 19
+ #define IEC_DATATYPE_LWORD 20
+ #define IEC_DATATYPE_WSTRING 21
+ #define IEC_DATATYPE_LINT 23
+
+#else
+ _IEC_CONST unsigned short ERR_OK = 0U;
+ _IEC_CONST unsigned short ERR_NOTIMPLEMENTED = 9999U;
+ _IEC_CONST unsigned short ERR_FUB_ENABLE_FALSE = 0xFFFEU;
+ _IEC_CONST unsigned short ERR_FUB_BUSY = 0xFFFFU;
+
+ /* IEC 61131-3 Datentypen */
+ _IEC_CONST unsigned short IEC_DATATYPE_BOOL = 1;
+ _IEC_CONST unsigned short IEC_DATATYPE_SINT = 2;
+ _IEC_CONST unsigned short IEC_DATATYPE_INT = 3;
+ _IEC_CONST unsigned short IEC_DATATYPE_DINT = 4;
+ _IEC_CONST unsigned short IEC_DATATYPE_USINT = 5;
+ _IEC_CONST unsigned short IEC_DATATYPE_UINT = 6;
+ _IEC_CONST unsigned short IEC_DATATYPE_UDINT = 7;
+ _IEC_CONST unsigned short IEC_DATATYPE_REAL = 8;
+ _IEC_CONST unsigned short IEC_DATATYPE_STRING = 9;
+ _IEC_CONST unsigned short IEC_DATATYPE_ULINT = 10;
+ _IEC_CONST unsigned short IEC_DATATYPE_DATE_AND_TIME = 11;
+ _IEC_CONST unsigned short IEC_DATATYPE_TIME = 12;
+ _IEC_CONST unsigned short IEC_DATATYPE_DATE = 13;
+ _IEC_CONST unsigned short IEC_DATATYPE_LREAL = 14;
+ _IEC_CONST unsigned short IEC_DATATYPE_TIME_OF_DAY = 16;
+ _IEC_CONST unsigned short IEC_DATATYPE_BYTE = 17;
+ _IEC_CONST unsigned short IEC_DATATYPE_WORD = 18;
+ _IEC_CONST unsigned short IEC_DATATYPE_DWORD = 19;
+ _IEC_CONST unsigned short IEC_DATATYPE_LWORD = 20;
+ _IEC_CONST unsigned short IEC_DATATYPE_WSTRING = 21;
+ _IEC_CONST unsigned short IEC_DATATYPE_LINT = 23;
+#endif
+
+#ifdef __cplusplus
+};
+#endif
+#endif /* _RUNTIME_ */
+
diff --git a/example/As6Project/Logical/Libraries/_AS/runtime/binary.lby b/example/As6Project/Logical/Libraries/_AS/runtime/binary.lby
new file mode 100644
index 0000000..92ad626
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/runtime/binary.lby
@@ -0,0 +1,9 @@
+
+
+
+
+ runtime.fun
+ runtime.typ
+ runtime.var
+
+
diff --git a/example/As6Project/Logical/Libraries/_AS/runtime/runtime.fun b/example/As6Project/Logical/Libraries/_AS/runtime/runtime.fun
new file mode 100644
index 0000000..4d2564d
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/runtime/runtime.fun
@@ -0,0 +1,282 @@
+
+{REDUND_OK} FUNCTION_BLOCK r_trig (*for internal use only - do not use this function in user programs*)
+ VAR_INPUT
+ CLK :BOOL;
+ END_VAR
+ VAR_OUTPUT
+ Q :BOOL;
+ END_VAR
+ VAR
+ M :BOOL;
+ END_VAR
+END_FUNCTION_BLOCK
+{REDUND_OK} FUNCTION_BLOCK f_trig (*for internal use only - do not use this function in user programs*)
+ VAR_INPUT
+ CLK :BOOL;
+ END_VAR
+ VAR_OUTPUT
+ Q :BOOL;
+ END_VAR
+ VAR
+ M :BOOL;
+ END_VAR
+END_FUNCTION_BLOCK
+{REDUND_OK} FUNCTION_BLOCK rf_trig (*for internal use only - do not use this function in user programs*)
+ VAR_INPUT
+ CLK :BOOL;
+ END_VAR
+ VAR_OUTPUT
+ Q :BOOL;
+ END_VAR
+ VAR
+ M :BOOL;
+ END_VAR
+END_FUNCTION_BLOCK
+FUNCTION GetTime : TIME (*for internal use only - do not use this function in user programs*)
+END_FUNCTION
+{REDUND_OK} FUNCTION_BLOCK SFCActionControl (*for internal use only - do not use this function in user programs*)
+ VAR_INPUT
+ N :BOOL;
+ R0 :BOOL;
+ S0 :BOOL;
+ L :BOOL;
+ D :BOOL;
+ P :BOOL;
+ SD :BOOL;
+ DS :BOOL;
+ SL :BOOL;
+ T :TIME;
+ END_VAR
+ VAR_OUTPUT
+ Q :BOOL;
+ END_VAR
+ VAR
+ S_FF_SET :USINT;
+ S_FF_R1 :USINT;
+ S_FF_Q :USINT;
+ dummy1 :USINT;
+ L_TMR_PT :TIME;
+ L_TMR_ET :TIME;
+ L_TMR_STAR :TIME;
+ L_TMR_IN :USINT;
+ L_TMR_Q :USINT;
+ L_TMR_M :USINT;
+ dummy2 :USINT;
+ D_TMR_PT :TIME;
+ D_TMR_ET :TIME;
+ D_TMR_STAR :TIME;
+ D_TMR_IN :USINT;
+ D_TMR_Q :USINT;
+ D_TMR_M :USINT;
+ dummy3 :USINT;
+ P_TRIG_CLK :USINT;
+ P_TRIG_Q :USINT;
+ P_TRIG_M :USINT;
+ dummy4 :USINT;
+ SD_TMR_PT :TIME;
+ SD_TMR_ET :TIME;
+ SD_TMR_STA :TIME;
+ SD_TMR_IN :USINT;
+ SD_TMR_Q :USINT;
+ SD_TMR_M :USINT;
+ dummy5 :USINT;
+ SD_FF_SET :USINT;
+ SD_FF_R1 :USINT;
+ SD_FF_Q :USINT;
+ DS_FF_SET :USINT;
+ DS_FF_R1 :USINT;
+ DS_FF_Q :USINT;
+ DS_TMR_PT :TIME;
+ DS_TMR_ET :TIME;
+ DS_TMR_STA :TIME;
+ DS_TMR_IN :USINT;
+ DS_TMR_Q :USINT;
+ DS_TMR_M :USINT;
+ dummy6 :USINT;
+ SL_FF_SET :USINT;
+ SL_FF_R1 :USINT;
+ SL_FF_Q :USINT;
+ dummy7 :USINT;
+ SL_TMR_PT :TIME;
+ SL_TMR_ET :TIME;
+ SL_TMR_STA :TIME;
+ SL_TMR_IN :USINT;
+ SL_TMR_Q :USINT;
+ SL_TMR_M :USINT;
+ dummy8 :USINT;
+ END_VAR
+END_FUNCTION_BLOCK
+{REDUND_OK} FUNCTION_BLOCK SFCAC2 (*for internal use only - do not use this function in user programs*)
+ VAR_INPUT
+ N : {REDUND_UNREPLICABLE} BOOL;
+ R0 : {REDUND_UNREPLICABLE} BOOL;
+ S0 : {REDUND_UNREPLICABLE} BOOL;
+ L : {REDUND_UNREPLICABLE} BOOL;
+ D : {REDUND_UNREPLICABLE} BOOL;
+ P : {REDUND_UNREPLICABLE} BOOL;
+ P1 : {REDUND_UNREPLICABLE} BOOL;
+ P0 : {REDUND_UNREPLICABLE} BOOL;
+ SD : {REDUND_UNREPLICABLE} BOOL;
+ DS : {REDUND_UNREPLICABLE} BOOL;
+ SL : {REDUND_UNREPLICABLE} BOOL;
+ T :TIME;
+ END_VAR
+ VAR_OUTPUT
+ Q :BOOL;
+ A :BOOL;
+ END_VAR
+ VAR
+ S_FF_SET :USINT;
+ S_FF_R1 :USINT;
+ S_FF_Q :USINT;
+ L_TMR_PT :TIME;
+ L_TMR_ET :TIME;
+ L_TMR_STAR :TIME;
+ L_TMR_IN :USINT;
+ L_TMR_Q :USINT;
+ L_TMR_M :USINT;
+ D_TMR_PT :TIME;
+ D_TMR_ET :TIME;
+ D_TMR_STAR :TIME;
+ D_TMR_IN :USINT;
+ D_TMR_Q :USINT;
+ D_TMR_M :USINT;
+ SD_TMR_PT :TIME;
+ SD_TMR_ET :TIME;
+ SD_TMR_STA :TIME;
+ SD_TMR_IN :USINT;
+ SD_TMR_Q :USINT;
+ SD_TMR_M :USINT;
+ SD_FF_SET :USINT;
+ SD_FF_R1 :USINT;
+ SD_FF_Q1 :USINT;
+ DS_FF_SET :USINT;
+ DS_FF_R1 :USINT;
+ DS_FF_Q1 :USINT;
+ DS_TMR_PT :TIME;
+ DS_TMR_ET :TIME;
+ DS_TMR_STA :TIME;
+ DS_TMR_IN :USINT;
+ DS_TMR_Q :USINT;
+ DS_TMR_M :USINT;
+ SL_FF_SET :USINT;
+ SL_FF_R1 :USINT;
+ SL_FF_Q :USINT;
+ SL_TMR_PT :TIME;
+ SL_TMR_ET :TIME;
+ SL_TMR_STA :TIME;
+ SL_TMR_IN :USINT;
+ SL_TMR_Q :USINT;
+ SL_TMR_M :USINT;
+ P_TRIG_Q :USINT;
+ P_TRIG_M :USINT;
+ Q_TRIG_Q :USINT;
+ Q_TRIG_M :USINT;
+ P1_TRIG_Q :USINT;
+ P1_TRIG_M :USINT;
+ P0_TRIG_Q :USINT;
+ P0_TRIG_M :USINT;
+ END_VAR
+END_FUNCTION_BLOCK
+{REDUND_OK} FUNCTION RealTan : LREAL
+ VAR_INPUT
+ x :LREAL;
+ END_VAR
+END_FUNCTION
+{REDUND_OK} FUNCTION RealAtan : LREAL
+ VAR_INPUT
+ x :LREAL;
+ END_VAR
+END_FUNCTION
+{REDUND_OK} FUNCTION RealAsin : LREAL
+ VAR_INPUT
+ x :LREAL;
+ END_VAR
+END_FUNCTION
+{REDUND_OK} FUNCTION RealAcos : LREAL
+ VAR_INPUT
+ x :LREAL;
+ END_VAR
+END_FUNCTION
+{REDUND_OK} FUNCTION RealExp : LREAL
+ VAR_INPUT
+ x :LREAL;
+ END_VAR
+END_FUNCTION
+{REDUND_OK} FUNCTION RealLn : LREAL
+ VAR_INPUT
+ x :LREAL;
+ END_VAR
+END_FUNCTION
+{REDUND_OK} FUNCTION RealLog : LREAL
+ VAR_INPUT
+ x :LREAL;
+ END_VAR
+END_FUNCTION
+{REDUND_OK} FUNCTION RealExpt : LREAL
+ VAR_INPUT
+ x :LREAL;
+ y :LREAL;
+ END_VAR
+END_FUNCTION
+{REDUND_OK} FUNCTION RealAbs : LREAL
+ VAR_INPUT
+ x :LREAL;
+ END_VAR
+END_FUNCTION
+{REDUND_OK} FUNCTION RealSin : LREAL
+ VAR_INPUT
+ x :LREAL;
+ END_VAR
+END_FUNCTION
+{REDUND_OK} FUNCTION RealCos : LREAL
+ VAR_INPUT
+ x :LREAL;
+ END_VAR
+END_FUNCTION
+{REDUND_OK} FUNCTION RealSqrt : LREAL
+ VAR_INPUT
+ x :LREAL;
+ END_VAR
+END_FUNCTION
+{REDUND_OK} FUNCTION_BLOCK SFCAC3 (*for internal use only - do not use this function in user programs*)
+ VAR_INPUT
+ N : {REDUND_UNREPLICABLE} BOOL;
+ R0 : {REDUND_UNREPLICABLE} BOOL;
+ S0 : {REDUND_UNREPLICABLE} BOOL;
+ L : {REDUND_UNREPLICABLE} BOOL;
+ D : {REDUND_UNREPLICABLE} BOOL;
+ P : {REDUND_UNREPLICABLE} BOOL;
+ P1 : {REDUND_UNREPLICABLE} BOOL;
+ P0 : {REDUND_UNREPLICABLE} BOOL;
+ SD : {REDUND_UNREPLICABLE} BOOL;
+ DS : {REDUND_UNREPLICABLE} BOOL;
+ SL : {REDUND_UNREPLICABLE} BOOL;
+ T :LREAL;
+ T_ACT : {REDUND_UNREPLICABLE} LREAL;
+ PAUSE : {REDUND_UNREPLICABLE} BOOL;
+ END_VAR
+ VAR_OUTPUT
+ Q : {REDUND_UNREPLICABLE} BOOL;
+ A :BOOL;
+ END_VAR
+ VAR
+ L_TMR :TimerType;
+ D_TMR :TimerType;
+ SD_TMR :TimerType;
+ DS_TMR :TimerType;
+ SL_TMR :TimerType;
+ S_FF_Q1 :USINT;
+ SD_FF_Q1 :USINT;
+ DS_FF_Q1 :USINT;
+ SL_FF_Q1 :USINT;
+ P_R_TRIG_Q : {REDUND_UNREPLICABLE} USINT;
+ P_R_TRIG_M :USINT;
+ Q_F_TRIG_Q : {REDUND_UNREPLICABLE} USINT;
+ Q_F_TRIG_M :USINT;
+ P1_R_TRIG_Q : {REDUND_UNREPLICABLE} USINT;
+ P1_R_TRIG_M :USINT;
+ P0_F_TRIG_Q : {REDUND_UNREPLICABLE} USINT;
+ P0_F_TRIG_M :USINT;
+ END_VAR
+END_FUNCTION_BLOCK
diff --git a/example/As6Project/Logical/Libraries/_AS/runtime/runtime.typ b/example/As6Project/Logical/Libraries/_AS/runtime/runtime.typ
new file mode 100644
index 0000000..4bf1514
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/runtime/runtime.typ
@@ -0,0 +1,156 @@
+
+TYPE
+ SFCActionType : STRUCT (*internal use*)
+ x : BOOL;
+ _x : BOOL;
+ t : TIME;
+ _t : TIME;
+ AC : SFCActionControl;
+ END_STRUCT;
+ SFCActionType2 : STRUCT (*internal use*)
+ x : BOOL;
+ _x : BOOL;
+ AC : SFCAC2;
+ END_STRUCT;
+ SFCActionCType : STRUCT (*internal use*)
+ x : BOOL;
+ _x : BOOL;
+ force : BOOL;
+ _force : BOOL;
+ active : BOOL;
+ _active : BOOL;
+ error : BOOL;
+ AC : SFCActionControl;
+ END_STRUCT;
+ SFCActionCType2 : STRUCT (*internal use*)
+ x : BOOL;
+ _x : BOOL;
+ force : BOOL;
+ _force : BOOL;
+ active : BOOL;
+ _active : BOOL;
+ error : BOOL;
+ AC : SFCAC2;
+ END_STRUCT;
+ SFCActionCType3 : STRUCT (*internal use*)
+ t : LREAL;
+ _t : LREAL;
+ tp : LREAL;
+ x : BOOL;
+ _x : BOOL;
+ force : BOOL;
+ _force : BOOL;
+ active : BOOL;
+ _active : BOOL;
+ error : BOOL;
+ AC : SFCAC3;
+ END_STRUCT;
+ SFCStepType : STRUCT (*internal use*)
+ x : BOOL;
+ t : TIME;
+ _x : BOOL;
+ _t : TIME;
+ END_STRUCT;
+ SFCStepCType : STRUCT (*internal use*)
+ t : TIME;
+ _t : TIME;
+ inactive_actions : UDINT;
+ _inactive_actions : UDINT;
+ error_actions : UDINT;
+ x : BOOL;
+ _x : BOOL;
+ x_activate : BOOL;
+ force : BOOL;
+ _force : BOOL;
+ active : BOOL;
+ _active : BOOL;
+ error : BOOL;
+ tip : BOOL;
+ tip_disable_duration: BOOL;
+ tip_disable_action : BOOL;
+ END_STRUCT;
+ SFCStepCType3 : STRUCT (*internal use*)
+ t : LREAL;
+ _t : LREAL;
+ tp : LREAL;
+ inactive_actions : UDINT;
+ _inactive_actions : UDINT;
+ error_actions : UDINT;
+ x : BOOL;
+ _x : BOOL;
+ x_activate : {REDUND_UNREPLICABLE} BOOL;
+ force : BOOL;
+ _force : BOOL;
+ active : BOOL;
+ _active : BOOL;
+ error : BOOL;
+ tip : BOOL;
+ tip_disable_duration : BOOL;
+ tip_disable_action : BOOL;
+ END_STRUCT;
+ SFCSimpleStepCType : STRUCT (*internal use*)
+ t : TIME;
+ _t : TIME;
+ x : BOOL;
+ _x : BOOL;
+ x_activate : BOOL;
+ force : BOOL;
+ _force : BOOL;
+ active : BOOL;
+ _active : BOOL;
+ error : BOOL;
+ tip : BOOL;
+ tip_disable_duration : BOOL;
+ tip_disable_action : BOOL;
+ END_STRUCT;
+ SFCSimpleStepCType3 : STRUCT (*internal use*)
+ t : LREAL;
+ _t : LREAL;
+ tp : LREAL;
+ x : BOOL;
+ _x : BOOL;
+ x_activate : {REDUND_UNREPLICABLE} BOOL;
+ force : BOOL;
+ _force : BOOL;
+ active : BOOL;
+ _active : BOOL;
+ error : BOOL;
+ tip : BOOL;
+ tip_disable_duration : BOOL;
+ tip_disable_action : BOOL;
+ END_STRUCT;
+ SFCTransitionCType : STRUCT (*internal use*)
+ force : BOOL;
+ _force : BOOL;
+ active : BOOL;
+ _active : BOOL;
+ END_STRUCT;
+ TimerType : STRUCT (*internal use*)
+ ptime : LREAL;
+ etime : LREAL;
+ start : LREAL;
+ in : USINT;
+ q : USINT;
+ END_STRUCT;
+
+ ArFBStateInternalType : STRUCT (*fb state machine internal context*)
+ ExecuteRef : UDINT;
+ BusyRef : UDINT;
+ DoneRef : UDINT;
+ ErrorRef : UDINT;
+ ActiveRef : UDINT;
+ StatusRef : UDINT;
+ FBCyclic : UDINT;
+ AsyfumaState : UDINT;
+ FBResetOut : UDINT;
+ Argument : UDINT;
+ State : UDINT;
+ ExecutePrev : BOOL;
+ END_STRUCT;
+
+ ArFBAsyFuMaInternalType : STRUCT (*asynchronous function manager internal context*)
+ State : UINT;
+ Result : DINT;
+ END_STRUCT;
+
+END_TYPE
diff --git a/example/As6Project/Logical/Libraries/_AS/runtime/runtime.var b/example/As6Project/Logical/Libraries/_AS/runtime/runtime.var
new file mode 100644
index 0000000..c955341
--- /dev/null
+++ b/example/As6Project/Logical/Libraries/_AS/runtime/runtime.var
@@ -0,0 +1,35 @@
+
+ (*Common Functionblock Status*)
+VAR CONSTANT
+ ERR_OK : UINT := 0; (*no error*)
+ ERR_NOTIMPLEMENTED : UINT := 9999; (*function or function block not implemented*)
+ ERR_FUB_ENABLE_FALSE : UINT := 16#FFFE; (*function block parameter "enable" is FALSE*)
+ ERR_FUB_BUSY : UINT := 16#FFFF; (*function block still working*)
+ ERR_FUB_REDUNDANT : UINT := 35688; (*This FUB can not be used on the standby CPU*)
+ ERR_FB_NOT_IMPLEMENTED: DINT := -1070585592;(*function or function block not implemented for the target system*)
+END_VAR
+
+(*IEC 61131-3 Datatypes*)
+VAR CONSTANT
+ IEC_DATATYPE_BOOL : UINT := 1; (*8 Bit containing a boolean value FALSE=0 or TRUE=1*)
+ IEC_DATATYPE_SINT : UINT := 2; (*8 Bit signed integer*)
+ IEC_DATATYPE_INT : UINT := 3; (*16 Bit signed integer*)
+ IEC_DATATYPE_DINT : UINT := 4; (*32 Bit signed integer*)
+ IEC_DATATYPE_USINT : UINT := 5; (*8 Bit unsigned integer*)
+ IEC_DATATYPE_UINT : UINT := 6; (*16 Bit unsigned integer*)
+ IEC_DATATYPE_UDINT : UINT := 7; (*32 Bit unsigned integer*)
+ IEC_DATATYPE_REAL : UINT := 8; (*32 Bit floating point number*)
+ IEC_DATATYPE_STRING : UINT := 9; (*Variable-length single-byte character string*)
+ IEC_DATATYPE_ULINT : UINT := 10; (*64 Bit unsigned integer*)
+ IEC_DATATYPE_DATE_AND_TIME : UINT := 11; (*32 Bit of Date in Seconds since 01.01.1970 00:00:00*)
+ IEC_DATATYPE_TIME : UINT := 12; (*32 Bit of Time in ms*)
+ IEC_DATATYPE_DATE : UINT := 13; (*32 Bit of Date (only)*)
+ IEC_DATATYPE_LREAL : UINT := 14; (*64 Bit floating point number*)
+ IEC_DATATYPE_TIME_OF_DAY: UINT := 16; (*32 Bit Time of day (only)*)
+ IEC_DATATYPE_BYTE : UINT := 17; (*Bit string of length 8*)
+ IEC_DATATYPE_WORD : UINT := 18; (*Bit string of length 16*)
+ IEC_DATATYPE_DWORD : UINT := 19; (*Bit string of length 32*)
+ IEC_DATATYPE_LWORD : UINT := 20; (*Bit string of length 64*)
+ IEC_DATATYPE_WSTRING : UINT := 21; (*Variable-length double-byte character string*)
+ IEC_DATATYPE_LINT : UINT := 23; (*64 Bit signed integer*)
+END_VAR
diff --git a/example/As6Project/Logical/Package.pkg b/example/As6Project/Logical/Package.pkg
new file mode 100644
index 0000000..7a1c7ee
--- /dev/null
+++ b/example/As6Project/Logical/Package.pkg
@@ -0,0 +1,10 @@
+
+
+
+
+ Global.typ
+ Global.var
+ Libraries
+ Programs
+
+
\ No newline at end of file
diff --git a/example/As6Project/Logical/Programs/Default/ANSIC.prg b/example/As6Project/Logical/Programs/Default/ANSIC.prg
new file mode 100644
index 0000000..30934ba
--- /dev/null
+++ b/example/As6Project/Logical/Programs/Default/ANSIC.prg
@@ -0,0 +1,9 @@
+
+
+
+
+ Main.c
+ Types.typ
+ Variables.var
+
+
\ No newline at end of file
diff --git a/example/As6Project/Logical/Programs/Default/Main.c b/example/As6Project/Logical/Programs/Default/Main.c
new file mode 100644
index 0000000..0f4fb8b
--- /dev/null
+++ b/example/As6Project/Logical/Programs/Default/Main.c
@@ -0,0 +1,37 @@
+
+#include
+
+#ifdef _DEFAULT_INCLUDES
+ #include
+#endif
+
+#include "string.h"
+#include
+
+void _INIT ProgramInit(void)
+{
+}
+
+
+void _CYCLIC ProgramCyclic(void)
+{
+ if(calldtoa) {
+ calldtoa = 0;
+
+ pString = stringdtoa(val, (char*)buffer, ndigits, sizeof(buffer));
+ if(pString) {
+ len = strlen((char*)pString);
+ strcpy((char*)string, (char*)pString);
+ }
+
+ }
+
+
+
+}
+
+void _EXIT ProgramExit(void)
+{
+
+}
+
diff --git a/example/As6Project/Logical/Programs/Default/Types.typ b/example/As6Project/Logical/Programs/Default/Types.typ
new file mode 100644
index 0000000..5dc40af
--- /dev/null
+++ b/example/As6Project/Logical/Programs/Default/Types.typ
@@ -0,0 +1,4 @@
+
+TYPE
+
+END_TYPE
diff --git a/example/As6Project/Logical/Programs/Default/Variables.var b/example/As6Project/Logical/Programs/Default/Variables.var
new file mode 100644
index 0000000..b203071
--- /dev/null
+++ b/example/As6Project/Logical/Programs/Default/Variables.var
@@ -0,0 +1,9 @@
+VAR
+ ndigits : UDINT;
+ val : LREAL;
+ calldtoa : BOOL;
+ len : UDINT;
+ string : ARRAY[0..3] OF STRING[80];
+ buffer : ARRAY[0..3] OF STRING[80];
+ pString : UDINT;
+END_VAR
diff --git a/example/As6Project/Logical/Programs/Package.pkg b/example/As6Project/Logical/Programs/Package.pkg
new file mode 100644
index 0000000..9f53426
--- /dev/null
+++ b/example/As6Project/Logical/Programs/Package.pkg
@@ -0,0 +1,7 @@
+
+
+
+
+ Default
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/Config.pkg b/example/As6Project/Physical/ARM/Config.pkg
new file mode 100644
index 0000000..2f67f96
--- /dev/null
+++ b/example/As6Project/Physical/ARM/Config.pkg
@@ -0,0 +1,11 @@
+
+
+
+
+ Hardware.hw
+ Hardware.hwl
+ X20CP0410
+ Hardware.jpg
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/Hardware.hw b/example/As6Project/Physical/ARM/Hardware.hw
new file mode 100644
index 0000000..3892886
--- /dev/null
+++ b/example/As6Project/Physical/ARM/Hardware.hw
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/Hardware.hwl b/example/As6Project/Physical/ARM/Hardware.hwl
new file mode 100644
index 0000000..6c94f55
--- /dev/null
+++ b/example/As6Project/Physical/ARM/Hardware.hwl
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/Hardware.jpg b/example/As6Project/Physical/ARM/Hardware.jpg
new file mode 100644
index 0000000..12bc267
Binary files /dev/null and b/example/As6Project/Physical/ARM/Hardware.jpg differ
diff --git a/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/CertificateRevocationLists/Package.pkg b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/CertificateRevocationLists/Package.pkg
new file mode 100644
index 0000000..973c732
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/CertificateRevocationLists/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/CertificateSigningRequests/Package.pkg b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/CertificateSigningRequests/Package.pkg
new file mode 100644
index 0000000..683b25c
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/CertificateSigningRequests/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/OwnCertificates/Certificates/Package.pkg b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/OwnCertificates/Certificates/Package.pkg
new file mode 100644
index 0000000..66601a5
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/OwnCertificates/Certificates/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/OwnCertificates/Package.pkg b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/OwnCertificates/Package.pkg
new file mode 100644
index 0000000..08d5735
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/OwnCertificates/Package.pkg
@@ -0,0 +1,8 @@
+
+
+
+
+ Certificates
+ PrivateKeys
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/OwnCertificates/PrivateKeys/Package.pkg b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/OwnCertificates/PrivateKeys/Package.pkg
new file mode 100644
index 0000000..b03ca4c
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/OwnCertificates/PrivateKeys/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/Package.pkg b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/Package.pkg
new file mode 100644
index 0000000..3748db4
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/Package.pkg
@@ -0,0 +1,10 @@
+
+
+
+
+ OwnCertificates
+ ThirdPartyCertificates
+ CertificateRevocationLists
+ CertificateSigningRequests
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/ThirdPartyCertificates/Package.pkg b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/ThirdPartyCertificates/Package.pkg
new file mode 100644
index 0000000..7ea4734
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/ThirdPartyCertificates/Package.pkg
@@ -0,0 +1,7 @@
+
+
+
+
+ SoftwareCertificates
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/ThirdPartyCertificates/SoftwareCertificates/Package.pkg b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/ThirdPartyCertificates/SoftwareCertificates/Package.pkg
new file mode 100644
index 0000000..0c531bc
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/ThirdPartyCertificates/SoftwareCertificates/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/Firewall/Package.pkg b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/Firewall/Package.pkg
new file mode 100644
index 0000000..591a078
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/Firewall/Package.pkg
@@ -0,0 +1,7 @@
+
+
+
+
+ Rules.firewallRules
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/Firewall/Rules.firewallRules b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/Firewall/Rules.firewallRules
new file mode 100644
index 0000000..8748b19
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/Firewall/Rules.firewallRules
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/Package.pkg b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/Package.pkg
new file mode 100644
index 0000000..d88458a
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/Package.pkg
@@ -0,0 +1,10 @@
+
+
+
+
+ UserRoleSystem
+ CertificateStore
+ TransportLayerSecurity
+ Firewall
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/TransportLayerSecurity/Package.pkg b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/TransportLayerSecurity/Package.pkg
new file mode 100644
index 0000000..58a4ff8
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/TransportLayerSecurity/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/UserRoleSystem/BRRole.brrole b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/UserRoleSystem/BRRole.brrole
new file mode 100644
index 0000000..6795c17
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/UserRoleSystem/BRRole.brrole
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/UserRoleSystem/Package.pkg b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/UserRoleSystem/Package.pkg
new file mode 100644
index 0000000..9dd97ab
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/UserRoleSystem/Package.pkg
@@ -0,0 +1,9 @@
+
+
+
+
+ Role.role
+ User.user
+ BRRole.brrole
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/UserRoleSystem/Role.role b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/UserRoleSystem/Role.role
new file mode 100644
index 0000000..a4ef7ad
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/UserRoleSystem/Role.role
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/UserRoleSystem/User.user b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/UserRoleSystem/User.user
new file mode 100644
index 0000000..593efe2
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/UserRoleSystem/User.user
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/Connectivity/Package.pkg b/example/As6Project/Physical/ARM/X20CP0410/Connectivity/Package.pkg
new file mode 100644
index 0000000..bfea000
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/Connectivity/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/Cpu.per b/example/As6Project/Physical/ARM/X20CP0410/Cpu.per
new file mode 100644
index 0000000..14f5eae
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/Cpu.per
@@ -0,0 +1,4 @@
+
+VAR_CONFIG
+
+END_VAR
diff --git a/example/As6Project/Physical/ARM/X20CP0410/Cpu.pkg b/example/As6Project/Physical/ARM/X20CP0410/Cpu.pkg
new file mode 100644
index 0000000..0b26561
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/Cpu.pkg
@@ -0,0 +1,28 @@
+
+
+
+
+ Cpu.sw
+ Cpu.per
+ IoMap.iom
+ PvMap.vvm
+ Connectivity
+ TextSystem
+ UnitSystem
+ AccessAndSecurity
+ mappControl
+ mappMotion
+ mappServices
+ mappSafety
+ mappView
+ mappVision
+ mappCockpit
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/Cpu.sw b/example/As6Project/Physical/ARM/X20CP0410/Cpu.sw
new file mode 100644
index 0000000..d89d74f
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/Cpu.sw
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/IoMap.iom b/example/As6Project/Physical/ARM/X20CP0410/IoMap.iom
new file mode 100644
index 0000000..14f5eae
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/IoMap.iom
@@ -0,0 +1,4 @@
+
+VAR_CONFIG
+
+END_VAR
diff --git a/example/As6Project/Physical/ARM/X20CP0410/PvMap.vvm b/example/As6Project/Physical/ARM/X20CP0410/PvMap.vvm
new file mode 100644
index 0000000..14f5eae
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/PvMap.vvm
@@ -0,0 +1,4 @@
+
+VAR_CONFIG
+
+END_VAR
diff --git a/example/As6Project/Physical/ARM/X20CP0410/TextSystem/Package.pkg b/example/As6Project/Physical/ARM/X20CP0410/TextSystem/Package.pkg
new file mode 100644
index 0000000..24b827e
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/TextSystem/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/UnitSystem/Package.pkg b/example/As6Project/Physical/ARM/X20CP0410/UnitSystem/Package.pkg
new file mode 100644
index 0000000..f45ab49
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/UnitSystem/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/mappCockpit/Package.pkg b/example/As6Project/Physical/ARM/X20CP0410/mappCockpit/Package.pkg
new file mode 100644
index 0000000..f031b15
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/mappCockpit/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/mappControl/Package.pkg b/example/As6Project/Physical/ARM/X20CP0410/mappControl/Package.pkg
new file mode 100644
index 0000000..e5d9739
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/mappControl/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/mappMotion/Package.pkg b/example/As6Project/Physical/ARM/X20CP0410/mappMotion/Package.pkg
new file mode 100644
index 0000000..0d34e88
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/mappMotion/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/mappSafety/Package.pkg b/example/As6Project/Physical/ARM/X20CP0410/mappSafety/Package.pkg
new file mode 100644
index 0000000..5ba4780
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/mappSafety/Package.pkg
@@ -0,0 +1,8 @@
+
+
+
+
+ SafeApplication
+ SafeCommissioning
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/mappSafety/SafeApplication/Package.pkg b/example/As6Project/Physical/ARM/X20CP0410/mappSafety/SafeApplication/Package.pkg
new file mode 100644
index 0000000..9efcef1
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/mappSafety/SafeApplication/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/mappSafety/SafeCommissioning/Package.pkg b/example/As6Project/Physical/ARM/X20CP0410/mappSafety/SafeCommissioning/Package.pkg
new file mode 100644
index 0000000..d23129f
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/mappSafety/SafeCommissioning/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/mappServices/Package.pkg b/example/As6Project/Physical/ARM/X20CP0410/mappServices/Package.pkg
new file mode 100644
index 0000000..bdbbebd
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/mappServices/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/mappView/Package.pkg b/example/As6Project/Physical/ARM/X20CP0410/mappView/Package.pkg
new file mode 100644
index 0000000..2900995
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/mappView/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/ARM/X20CP0410/mappVision/Package.pkg b/example/As6Project/Physical/ARM/X20CP0410/mappVision/Package.pkg
new file mode 100644
index 0000000..7c77cf1
--- /dev/null
+++ b/example/As6Project/Physical/ARM/X20CP0410/mappVision/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/CertificateRevocationLists/Package.pkg b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/CertificateRevocationLists/Package.pkg
new file mode 100644
index 0000000..10e1bab
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/CertificateRevocationLists/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/CertificateSigningRequests/Package.pkg b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/CertificateSigningRequests/Package.pkg
new file mode 100644
index 0000000..1c929de
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/CertificateSigningRequests/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/OwnCertificates/Certificates/Package.pkg b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/OwnCertificates/Certificates/Package.pkg
new file mode 100644
index 0000000..fbb044b
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/OwnCertificates/Certificates/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/OwnCertificates/Package.pkg b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/OwnCertificates/Package.pkg
new file mode 100644
index 0000000..af9e8e4
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/OwnCertificates/Package.pkg
@@ -0,0 +1,8 @@
+
+
+
+
+ Certificates
+ PrivateKeys
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/OwnCertificates/PrivateKeys/Package.pkg b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/OwnCertificates/PrivateKeys/Package.pkg
new file mode 100644
index 0000000..6a55aa2
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/OwnCertificates/PrivateKeys/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/Package.pkg b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/Package.pkg
new file mode 100644
index 0000000..a2b3a11
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/Package.pkg
@@ -0,0 +1,10 @@
+
+
+
+
+ OwnCertificates
+ ThirdPartyCertificates
+ CertificateRevocationLists
+ CertificateSigningRequests
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/ThirdPartyCertificates/Package.pkg b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/ThirdPartyCertificates/Package.pkg
new file mode 100644
index 0000000..11603db
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/ThirdPartyCertificates/Package.pkg
@@ -0,0 +1,7 @@
+
+
+
+
+ SoftwareCertificates
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/ThirdPartyCertificates/SoftwareCertificates/Package.pkg b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/ThirdPartyCertificates/SoftwareCertificates/Package.pkg
new file mode 100644
index 0000000..c53e656
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/ThirdPartyCertificates/SoftwareCertificates/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/Firewall/Package.pkg b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/Firewall/Package.pkg
new file mode 100644
index 0000000..0d836d3
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/Firewall/Package.pkg
@@ -0,0 +1,7 @@
+
+
+
+
+ Rules.firewallRules
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/Firewall/Rules.firewallRules b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/Firewall/Rules.firewallRules
new file mode 100644
index 0000000..add65ef
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/Firewall/Rules.firewallRules
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/Package.pkg b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/Package.pkg
new file mode 100644
index 0000000..2648337
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/Package.pkg
@@ -0,0 +1,10 @@
+
+
+
+
+ UserRoleSystem
+ CertificateStore
+ TransportLayerSecurity
+ Firewall
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/TransportLayerSecurity/Package.pkg b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/TransportLayerSecurity/Package.pkg
new file mode 100644
index 0000000..f820e78
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/TransportLayerSecurity/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/UserRoleSystem/BRRole.brrole b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/UserRoleSystem/BRRole.brrole
new file mode 100644
index 0000000..6795c17
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/UserRoleSystem/BRRole.brrole
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/UserRoleSystem/Package.pkg b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/UserRoleSystem/Package.pkg
new file mode 100644
index 0000000..9dd97ab
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/UserRoleSystem/Package.pkg
@@ -0,0 +1,9 @@
+
+
+
+
+ Role.role
+ User.user
+ BRRole.brrole
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/UserRoleSystem/Role.role b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/UserRoleSystem/Role.role
new file mode 100644
index 0000000..39281ec
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/UserRoleSystem/Role.role
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/UserRoleSystem/User.user b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/UserRoleSystem/User.user
new file mode 100644
index 0000000..a6b973c
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/UserRoleSystem/User.user
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/Connectivity/OpcUaCs/Package.pkg b/example/As6Project/Physical/Intel/5PC900_TS17_04/Connectivity/OpcUaCs/Package.pkg
new file mode 100644
index 0000000..c43b450
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/Connectivity/OpcUaCs/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/Connectivity/Package.pkg b/example/As6Project/Physical/Intel/5PC900_TS17_04/Connectivity/Package.pkg
new file mode 100644
index 0000000..666b638
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/Connectivity/Package.pkg
@@ -0,0 +1,7 @@
+
+
+
+
+ OpcUaCs
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/Cpu.per b/example/As6Project/Physical/Intel/5PC900_TS17_04/Cpu.per
new file mode 100644
index 0000000..14f5eae
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/Cpu.per
@@ -0,0 +1,4 @@
+
+VAR_CONFIG
+
+END_VAR
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/Cpu.pkg b/example/As6Project/Physical/Intel/5PC900_TS17_04/Cpu.pkg
new file mode 100644
index 0000000..31a52f2
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/Cpu.pkg
@@ -0,0 +1,27 @@
+
+
+
+
+ Cpu.sw
+ Cpu.per
+ IoMap.iom
+ PvMap.vvm
+ Connectivity
+ TextSystem
+ UnitSystem
+ AccessAndSecurity
+ mappControl
+ mappMotion
+ mappServices
+ mappView
+ mappVision
+ mappCockpit
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/Cpu.sw b/example/As6Project/Physical/Intel/5PC900_TS17_04/Cpu.sw
new file mode 100644
index 0000000..ca84a73
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/Cpu.sw
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/IoMap.iom b/example/As6Project/Physical/Intel/5PC900_TS17_04/IoMap.iom
new file mode 100644
index 0000000..14f5eae
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/IoMap.iom
@@ -0,0 +1,4 @@
+
+VAR_CONFIG
+
+END_VAR
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/PvMap.vvm b/example/As6Project/Physical/Intel/5PC900_TS17_04/PvMap.vvm
new file mode 100644
index 0000000..14f5eae
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/PvMap.vvm
@@ -0,0 +1,4 @@
+
+VAR_CONFIG
+
+END_VAR
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/TextSystem/Package.pkg b/example/As6Project/Physical/Intel/5PC900_TS17_04/TextSystem/Package.pkg
new file mode 100644
index 0000000..321c2b6
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/TextSystem/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/UnitSystem/Package.pkg b/example/As6Project/Physical/Intel/5PC900_TS17_04/UnitSystem/Package.pkg
new file mode 100644
index 0000000..dbd64ad
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/UnitSystem/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/mappCockpit/Package.pkg b/example/As6Project/Physical/Intel/5PC900_TS17_04/mappCockpit/Package.pkg
new file mode 100644
index 0000000..35a14eb
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/mappCockpit/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/mappControl/Package.pkg b/example/As6Project/Physical/Intel/5PC900_TS17_04/mappControl/Package.pkg
new file mode 100644
index 0000000..9dbadad
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/mappControl/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/mappMotion/Package.pkg b/example/As6Project/Physical/Intel/5PC900_TS17_04/mappMotion/Package.pkg
new file mode 100644
index 0000000..ecc31c8
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/mappMotion/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/mappServices/Package.pkg b/example/As6Project/Physical/Intel/5PC900_TS17_04/mappServices/Package.pkg
new file mode 100644
index 0000000..3d375fc
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/mappServices/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/mappView/Package.pkg b/example/As6Project/Physical/Intel/5PC900_TS17_04/mappView/Package.pkg
new file mode 100644
index 0000000..480d4d9
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/mappView/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/5PC900_TS17_04/mappVision/Package.pkg b/example/As6Project/Physical/Intel/5PC900_TS17_04/mappVision/Package.pkg
new file mode 100644
index 0000000..62837d9
--- /dev/null
+++ b/example/As6Project/Physical/Intel/5PC900_TS17_04/mappVision/Package.pkg
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/Config.pkg b/example/As6Project/Physical/Intel/Config.pkg
new file mode 100644
index 0000000..97f3cc1
--- /dev/null
+++ b/example/As6Project/Physical/Intel/Config.pkg
@@ -0,0 +1,11 @@
+
+
+
+
+ Hardware.hw
+ Hardware.hwl
+ 5PC900_TS17_04
+ Hardware.jpg
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/Hardware.hw b/example/As6Project/Physical/Intel/Hardware.hw
new file mode 100644
index 0000000..f6f4d37
--- /dev/null
+++ b/example/As6Project/Physical/Intel/Hardware.hw
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/Hardware.hwl b/example/As6Project/Physical/Intel/Hardware.hwl
new file mode 100644
index 0000000..fa5970d
--- /dev/null
+++ b/example/As6Project/Physical/Intel/Hardware.hwl
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example/As6Project/Physical/Intel/Hardware.jpg b/example/As6Project/Physical/Intel/Hardware.jpg
new file mode 100644
index 0000000..5ae7e40
Binary files /dev/null and b/example/As6Project/Physical/Intel/Hardware.jpg differ
diff --git a/example/As6Project/Physical/Physical.pkg b/example/As6Project/Physical/Physical.pkg
new file mode 100644
index 0000000..351df13
--- /dev/null
+++ b/example/As6Project/Physical/Physical.pkg
@@ -0,0 +1,8 @@
+
+
+
+
+ Intel
+ ARM
+
+
\ No newline at end of file
diff --git a/example/As6Project/README.md b/example/As6Project/README.md
new file mode 100644
index 0000000..a26d5f0
--- /dev/null
+++ b/example/As6Project/README.md
@@ -0,0 +1,3 @@
+# ASStarter (Build me up)
+
+ASStarter is a minimal Automation studio project used by the Buttercup framework to automatically create starter projects.
\ No newline at end of file
diff --git a/example/As6Project/package-lock.json b/example/As6Project/package-lock.json
new file mode 100644
index 0000000..49e47e4
--- /dev/null
+++ b/example/As6Project/package-lock.json
@@ -0,0 +1,29 @@
+{
+ "name": "@loupeteam/librarybuilderproject",
+ "version": "0.2.0",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "@loupeteam/librarybuilderproject",
+ "version": "0.2.0",
+ "license": "MIT",
+ "dependencies": {
+ "@loupeteam/librarybuilderproject": "^0.3.0",
+ "@loupeteam/stringext": "^0.14.4"
+ }
+ },
+ "node_modules/@loupeteam/librarybuilderproject": {
+ "version": "0.3.0",
+ "resolved": "https://npm.pkg.github.com/download/@loupeteam/librarybuilderproject/0.3.0/9c3c1fc98350439d618573f3b465d94e3ae1e000",
+ "integrity": "sha512-kUOwhpPoqQ1DikLGFBH3c8+nsb28ayX2IpQRC0UaEg34cV4GrRoI0FvkSovc3tgrGohpyvxFPRy5C6TM5wj7JA==",
+ "license": "MIT"
+ },
+ "node_modules/@loupeteam/stringext": {
+ "version": "0.14.4",
+ "resolved": "https://npm.pkg.github.com/download/@loupeteam/stringext/0.14.4/94cecc972c68673d69c605dba4b7904618e24cfc",
+ "integrity": "sha512-IhMDGSyclNrv5mYs+kyqN5OHLQrSsktZFvULrWgwr3lg0/Bl+xiO6EvehLWRbZNWZUGWFeaYhBSevv73tIZqow==",
+ "license": "Loupe Software License Agreement"
+ }
+ }
+}
diff --git a/example/As6Project/package.json b/example/As6Project/package.json
new file mode 100644
index 0000000..4ef4aec
--- /dev/null
+++ b/example/As6Project/package.json
@@ -0,0 +1,22 @@
+{
+ "name": "@loupeteam/librarybuilderproject",
+ "version": "0.2.0",
+ "description": "LibraryBuilderProject is a minimal Automation studio project used to build libraries for Intel and ARM configurations",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/loupeteam/StarterAsProject.git"
+ },
+ "author": "Loupe",
+ "license": "MIT",
+ "lpmConfig": {
+ "deploymentConfigs": [
+ "Intel",
+ "ARM"
+ ],
+ "gitClient": "GitExtensions"
+ },
+ "dependencies": {
+ "@loupeteam/librarybuilderproject": "^0.3.0",
+ "@loupeteam/stringext": "^0.14.4"
+ }
+}
diff --git a/example/AsProject/AsProject.apj b/example/AsProject/AsProject.apj
index ec5b008..37df849 100644
--- a/example/AsProject/AsProject.apj
+++ b/example/AsProject/AsProject.apj
@@ -7,7 +7,4 @@
-
-
-
\ No newline at end of file
diff --git a/example/AsProject/Physical/Intel/5PC900_TS17_04/Cpu.pkg b/example/AsProject/Physical/Intel/5PC900_TS17_04/Cpu.pkg
index a6e3a52..bb60475 100644
--- a/example/AsProject/Physical/Intel/5PC900_TS17_04/Cpu.pkg
+++ b/example/AsProject/Physical/Intel/5PC900_TS17_04/Cpu.pkg
@@ -22,6 +22,6 @@
-
+
\ No newline at end of file
diff --git a/src/Ar/StringExt/internal.c b/src/Ar/StringExt/internal.c
index 136db29..ae7bd89 100644
--- a/src/Ar/StringExt/internal.c
+++ b/src/Ar/StringExt/internal.c
@@ -5,7 +5,7 @@ extern "C"
{
#endif
-#include "includes/rtkBase.h"
+#include
#ifdef __cplusplus
};
@@ -15,7 +15,7 @@ extern "C"
//#define USE_SEMAPHORE
#ifdef USE_SEMAPHORE
-#include "includes/rtkSemaphore.h"
+#include
static __thread RTK_SEM_H criticalSection[2] = {0};
@@ -24,7 +24,7 @@ static __thread RTK_SEM_H criticalSection[2] = {0};
#define RELEASE(section) RtkReleaseSemaphore(section)
#else // if USE_SEMAPHORE
-#include "includes/rtkCriticalSection.h"
+#include
static __thread RTK_CRIT_SEC_H criticalSection[2] = {0};
diff --git a/src/Ar/StringExt/time.cpp b/src/Ar/StringExt/time.cpp
index 0b59533..2da4973 100644
--- a/src/Ar/StringExt/time.cpp
+++ b/src/Ar/StringExt/time.cpp
@@ -19,20 +19,29 @@
#include "string.h"
+//TODO: These time functions don't seem to be supported in AS6
+// 1. Figure out if we can use them
+// 2. Check if AS4 somehow, since they seem to at least build there
+#ifndef __arm__
#define __XSI_VISIBLE 1
+#endif
#include "time.h"
unsigned long stringfTime(unsigned long dest, unsigned long destSize, unsigned long format, DATE_AND_TIME time) {
if(!dest || !destSize || !format) return 0; // Return if null pointers or if destSize is 0
tm t = {};
+#ifndef __arm__
gmtime_r((time_t*)&time, &t);
+#endif
return strftime((char*)dest, destSize, (char*)format, &t);
}
DATE_AND_TIME stringpTime(unsigned long src, unsigned long format) {
if(!src || !format) return 0; // Return if null pointers
tm t = {};
+#ifndef __arm__
strptime((char*)src, (char*)format, &t);
+#endif
return mktime(&t);
}