Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpi4LabVIEW)  1.26.2
mlpiContainerLib.h
Go to the documentation of this file.
1 #ifndef __MLPICONTAINERLIB_H__
2 #define __MLPICONTAINERLIB_H__
3 
4 // -----------------------------------------------------------------------
5 // MLPI - <mlpiContainerLib.h>
6 // -----------------------------------------------------------------------
7 // Copyright (c) 2013 Bosch Rexroth. All rights reserved.
8 // Redistribution and use in source and binary forms of this MLPI software
9 // (SW) provided to you, with or without modification, are permitted
10 // without prior approval provided that the following conditions are met:
11 //
12 // 1. Redistributions of source code of SW must retain the above copyright
13 // notice, this list of conditions and the following disclaimer.
14 //
15 // 2. Redistributions in binary form of SW must reproduce the above copyright
16 // notice, this list of conditions and the following disclaimer in the
17 // documentation and/or other materials provided with the distribution.
18 //
19 // 3. User recognizes and acknowledges that it acquires no right,
20 // title or interest in or to any of the names or trademarks used in
21 // connection with the SW ("names") by virtue of this License and waives
22 // any right to or interest in the names. User recognizes and acknowledges
23 // that names of companies or names or products of companies displayed
24 // in the documentation of SW to indicate the interoperability of products
25 // with the SW are the names of their respective owners. The use of such
26 // names in the documentation of SW does not imply any sponsorship,
27 // approval, or endorsement by such companies of this product.
28 //
29 // 4. Modified code versions, i.e. any addition to or deletion from
30 // the substance or structure of the original code of the SW running
31 // the MLPI must be plainly marked as such and must not be misrepresented
32 // as being original SW.
33 //
34 // 5. The SW may only be used in connection with a Bosch Rexroth product.
35 //
36 // THIS INFORMATION IS PROVIDED BY BOSCH REXROTH CORPORATION "AS IS"
37 // AND WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING
38 // (BUT NOTLIMITED TO) ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
39 // FITNESS FOR ANY PARTICULAR PURPOSE, OR NON-INFRINGEMENT. WHILE THE
40 // INFORMATION PROVIDED IS BELIEVED TO BE ACCURATE, IT MAY INCLUDE
41 // ERRORS OR INACCURACIES.
42 // SUBJECT TO COMPULSORY STATUTORY PROVISIONS OF THE GERMAN LAW AS
43 // THE APPLICABLE LAW FOR THIS LICENSE BOSCH REXROTH CORPORATION WILL
44 // NOT BE LIABLE FOR ANY DAMAGES OF ANY KIND ARISING FROM THE USE OF
45 // THE SOFTWARE DISTRIBUTED HEREUNDER, INCLUDING BUT NOT LIMITED TO
46 // DIRECT, INDIRECT, INCIDENTAL, PUNITIVE, AND CONSEQUENTIAL DAMAGES.
47 // -----------------------------------------------------------------------
48 //
58 //
59 // -----------------------------------------------------------------------
60 
61 
62 
282 
297 
312 
410 
415 
416 
417 
418 // -----------------------------------------------------------------------
419 // GLOBAL INCLUDES
420 // -----------------------------------------------------------------------
421 #include "mlpiGlobal.h"
422 
423 
424 // -----------------------------------------------------------------------
425 // GLOBAL CONSTANTS
426 // -----------------------------------------------------------------------
427 #define MLPI_CONTAINER_TAG_SEPARATOR MLPI_ADAPT_STRING(';')
428 #define MLPI_CONTAINER_ARG_SEPARATOR MLPI_ADAPT_STRING(',')
429 
430 #define MLPI_CONTAINER_TAG_LOGICLIB_MEMORY_AREA MLPI_ADAPT_STRING("LOGICLIB_MEMORY_AREA")
431 #define MLPI_CONTAINER_TAG_LOGICLIB_SYMBOL MLPI_ADAPT_STRING("LOGICLIB_SYMBOL")
432 #define MLPI_CONTAINER_TAG_IOLIB_FIELBUS_IO MLPI_ADAPT_STRING("IOLIB_FIELBUS_IO") //<! Deprecated.
433 #define MLPI_CONTAINER_TAG_IOLIB_FIELDBUS_IO MLPI_ADAPT_STRING("IOLIB_FIELBUS_IO") //<! Spelling of "Fieldbus" was wrong till MLPI version 1.5.0.0. Due to compatibility reasons, we can not change the adapted string value.
434 #define MLPI_CONTAINER_TAG_ALIGNMENT_DUMMY MLPI_ADAPT_STRING("ALIGNMENT_DUMMY")
435 
436 #define MLPI_CONTAINER_ARG_IOLIB_IO_AREA_INPUT MLPI_ADAPT_STRING("INPUT")
437 #define MLPI_CONTAINER_ARG_IOLIB_IO_AREA_OUTPUT MLPI_ADAPT_STRING("OUTPUT")
438 
439 #define MLPI_CONTAINER_ARG_LOGICLIB_MEMORY_AREA_INPUT MLPI_ADAPT_STRING("INPUT")
440 #define MLPI_CONTAINER_ARG_LOGICLIB_MEMORY_AREA_OUTPUT MLPI_ADAPT_STRING("OUTPUT")
441 #define MLPI_CONTAINER_ARG_LOGICLIB_MEMORY_AREA_MARKER MLPI_ADAPT_STRING("MARKER")
442 
443 #define MLPI_CONTAINER_NAME_MAX_LENGTH (64)
444 
445 // -----------------------------------------------------------------------
446 // GLOBAL TYPEDEFS
447 // -----------------------------------------------------------------------
448 
452 {
456 
457 // message packing follows 8 byte natural alignment
458 #if !defined(TARGET_OS_VXWORKS)
459 #pragma pack(push,8)
460 #endif
461 
471 typedef struct MlpiContainerHandle
472 {
473  ULONG connectionID;
474  ULONG containerID;
476 
489 typedef struct MlpiContainerInformation
490 {
492  MlpiDateAndTime dateTime;
493  ULONG numItems;
494  ULONG numElementsTagList;
495  ULONG dataSize;
496  MlpiContainerAccess accessFlag;
498 
508 typedef struct MlpiContainerItemInformation
509 {
510  MlpiType type;
511  ULONG offset;
512  ULONG dataSize;
514 
515 
516 #if !defined(TARGET_OS_VXWORKS)
517 #pragma pack(pop)
518 #endif
519 
521 
522 
523 
524 
525 // -----------------------------------------------------------------------
526 // GLOBAL EXPORTS
527 // -----------------------------------------------------------------------
528 #ifdef MLPI_API
529  #undef MLPI_API
530 #endif
531 
532 #if defined(TARGET_OS_WINNT)
533  #if defined(MLPI_EXPORTS)
534  #define MLPI_API __declspec(dllexport)
535  #elif defined(MLPI_IMPORTS)
536  #define MLPI_API __declspec(dllimport)
537  #else
538  #define MLPI_API
539  #endif
540 #else
541  #if defined(MLPI_EXPORTS)
542  #define MLPI_API __attribute__ ((visibility("default")))
543  #elif defined(MLPI_IMPORTS)
544  #define MLPI_API
545  #else
546  #define MLPI_API
547  #endif
548 #endif
549 
550 #ifdef __cplusplus
551 extern "C" {
552 #endif
553 
554 
619 MLPI_API MLPIRESULT mlpiContainerCreate(const MLPIHANDLE connection, const WCHAR16 *tagList, const MlpiContainerAccess accessFlag, MlpiContainerHandle *handle, ULONG *dataSize);
620 
621 
635 MLPI_API MLPIRESULT mlpiContainerUpdate(const MLPIHANDLE connection, const MlpiContainerHandle handle, void *data, const ULONG dataSize);
636 
637 
651 MLPI_API MLPIRESULT mlpiContainerDestroy(const MLPIHANDLE connection, MlpiContainerHandle *handle);
652 
653 
673 MLPI_API MLPIRESULT mlpiContainerSetName(const MLPIHANDLE connection, const MlpiContainerHandle handle, const WCHAR16 *name);
674 
675 
697 MLPI_API MLPIRESULT mlpiContainerGetName(const MLPIHANDLE connection, const MlpiContainerHandle handle, WCHAR16 *name, const ULONG numElements);
698 
699 
737 
738 
775 MLPI_API MLPIRESULT mlpiContainerGetTagList(const MLPIHANDLE connection, const MlpiContainerHandle handle, WCHAR16 *tagList, const ULONG numElements);
776 
777 
822 MLPI_API MLPIRESULT mlpiContainerGetItemInformation(const MLPIHANDLE connection, const MlpiContainerHandle handle, MlpiContainerItemInformation *info, const ULONG numElements, ULONG *numElementsRet);
823 
824 
872 MLPI_API MLPIRESULT mlpiContainerGetSingleItemInformation(const MLPIHANDLE connection, const MlpiContainerHandle handle, const ULONG index, WCHAR16 *tag, const ULONG numElements, MlpiContainerItemInformation *info);
873 
874 
894 MLPI_API MLPIRESULT mlpiContainerGetNumberOfContainer(const MLPIHANDLE connection, ULONG *number);
895 
896 
944 MLPI_API MLPIRESULT mlpiContainerGetHandlesOfContainer(const MLPIHANDLE connection, MlpiContainerHandle *handles, const ULONG numElements, ULONG *numElementsRet);
945 
946 
947 
948 #ifdef __cplusplus
949 }
950 #endif
951 
952 
953 
954 #endif // endof: #ifndef __MLPICONTAINERLIB_H__
MLPIRESULT mlpiContainerSetName(const MLPIHANDLE connection, const MlpiContainerHandle handle, const WCHAR16 *name)
Using this function, you can assign a descriptive name to your container. The name can be any string...
MlpiContainerAccess
This enumeration defines whether we have a READ or WRITE container.
long MLPIRESULT
common MLPI-API return value
Definition: mlpiGlobal.h:200
struct MlpiContainerInformation MlpiContainerInformation
This structure defines the information content of a container.
MLPIRESULT mlpiContainerGetTagList(const MLPIHANDLE connection, const MlpiContainerHandle handle, WCHAR16 *tagList, const ULONG numElements)
This function returns the tag list of a container. This is the same tagList that was used to create t...
MLPIRESULT mlpiContainerGetSingleItemInformation(const MLPIHANDLE connection, const MlpiContainerHandle handle, const ULONG index, WCHAR16 *tag, const ULONG numElements, MlpiContainerItemInformation *info)
This function returns the item information of a single item in a container. It returns information ab...
MLPIRESULT mlpiContainerCreate(const MLPIHANDLE connection, const WCHAR16 *tagList, const MlpiContainerAccess accessFlag, MlpiContainerHandle *handle, ULONG *dataSize)
This function creates a new container. It has to be specified if the container is a read or write con...
MLPIRESULT mlpiContainerGetItemInformation(const MLPIHANDLE connection, const MlpiContainerHandle handle, MlpiContainerItemInformation *info, const ULONG numElements, ULONG *numElementsRet)
This function returns the item information of a container as an array of struct. Each element in the ...
Enumeration for write container.
wchar_t WCHAR16
UTF16 string.
Definition: mlpiGlobal.h:193
MLPIRESULT mlpiContainerGetName(const MLPIHANDLE connection, const MlpiContainerHandle handle, WCHAR16 *name, const ULONG numElements)
Using this function, you can read out the name of your container. The name can be any string with a m...
#define MLPI_CONTAINER_NAME_MAX_LENGTH
Maximum length of a container name.
MLPIRESULT mlpiContainerGetInformation(const MLPIHANDLE connection, const MlpiContainerHandle handle, MlpiContainerInformation *info)
Use this function to read various pieces of information about your container. This includes time of c...
MLPIRESULT mlpiContainerDestroy(const MLPIHANDLE connection, MlpiContainerHandle *handle)
This function destroys a container which has been created using mlpiContainerCreate. Containers consume memory resources of the server. You should therefore destroy any containers your application no longer needs!
struct MlpiDateAndTime MlpiDateAndTime
This structure defines the broken date and time information.
MLPIRESULT mlpiContainerGetHandlesOfContainer(const MLPIHANDLE connection, MlpiContainerHandle *handles, const ULONG numElements, ULONG *numElementsRet)
Returns the handles of all containers that were previously created on the device. ...
Enumeration for read container.
MLPIRESULT mlpiContainerGetNumberOfContainer(const MLPIHANDLE connection, ULONG *number)
This function returns the total number of containers created on the device. Also including containers...
MlpiType
This enumeration defines the basic types of as used by the MLPI.
Definition: mlpiGlobal.h:217
unsigned long ULONG
4 byte unsigned integer
Definition: mlpiGlobal.h:168
MLPIRESULT mlpiContainerUpdate(const MLPIHANDLE connection, const MlpiContainerHandle handle, void *data, const ULONG dataSize)
This function updates a container. If you pass a handle to a write container, then you also need to p...
struct MlpiContainerItemInformation MlpiContainerItemInformation
This structure defines the information of a container item.
unsigned long MLPIHANDLE
common MLPI-API handle value
Definition: mlpiGlobal.h:206
struct MlpiContainerHandle MlpiContainerHandle
This structure defines the handle to a container.