rllib  1
rlopcxmlda.h
Go to the documentation of this file.
1 /***************************************************************************
2  rlopcxmlda.h - description
3  -------------------
4  begin : Mon Aug 27 2007
5  copyright : (C) 2007 by pvbrowser
6  email : lehrig@t-online.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This library is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as *
13  * published by the Free Software Foundation *
14  * *
15  ***************************************************************************/
22 #ifndef _RL_OPC_XML_DA_H_
23 #define _RL_OPC_XML_DA_H_
24 
25 #include "rldefine.h"
26 #include "rlmailbox.h"
27 #include "rlsharedmemory.h"
28 
34 {
35 public:
36  // shared memory header
37  typedef struct
38  {
39  char ident[4]; // must be "opc"
40  int maxItemNameLength; // maximum length of an item name
41  int maxNameLength; // maximum length of the item value
42  int numItems; // number of items in shared memory
43  int readErrorCount; // 0...65536 incremented by each read error
44  int writeErrorCount; // 0...65536 incremented by each write error
45  int spare[8]; // for future use
46  char cspare[32]; // for future use
47  }SHM_HEADER;
48 
50  {
51  OPCXMLDA_ERROR = 256*256*128
52  };
53 
54 #ifdef RLWIN32
55  rlOpcXmlDa(const char *mailbox="c:\\automation\\mbx\\opcxmlda.mbx", const char *shared_memory="c:\\automation\\shm\\opcxmlda.shm", long shared_memory_size=65536);
56 #else
57  rlOpcXmlDa(const char *mailbox="/srv/automation/mbx/opcxmlda.mbx", const char *shared_memory="/srv/automation/shm/opcxmlda.shm", long shared_memory_size=65536);
58 #endif
59  virtual ~rlOpcXmlDa();
60  const char *stringValue(const char *variable);
61  int intValue(const char *variable);
62  float floatValue(const char *variable);
63  int writeStringValue(const char *variable, const char *value);
64  int writeIntValue(const char *variable, int value);
65  int writeFloatValue(const char *variable, float value);
66  int readErrorCount();
67  int writeErrorCount();
68  int shmStatus(); // 0 if shared memory is ok | ERROR if shared memory is not ok
69 
70 private:
72  const char *shmvalues;
75 };
76 
77 #endif
78 
virtual ~rlOpcXmlDa()
Definition: rlopcxmlda.cpp:29
int writeFloatValue(const char *variable, float value)
Definition: rlopcxmlda.cpp:101
rlOpcXmlDa(const char *mailbox="c:\utomation\bx\pcxmlda.mbx", const char *shared_memory="c:\utomation\hm\pcxmlda.shm", long shared_memory_size=65536)
Definition: rlopcxmlda.cpp:21
const char * stringValue(const char *variable)
Definition: rlopcxmlda.cpp:35
float floatValue(const char *variable)
Definition: rlopcxmlda.cpp:74
rlSharedMemory * shm
Definition: rlopcxmlda.h:74
int writeIntValue(const char *variable, int value)
Definition: rlopcxmlda.cpp:95
int writeErrorCount()
Definition: rlopcxmlda.cpp:113
int readErrorCount()
Definition: rlopcxmlda.cpp:107
SHM_HEADER * shmheader
Definition: rlopcxmlda.h:71
int writeStringValue(const char *variable, const char *value)
Definition: rlopcxmlda.cpp:89
int shmStatus()
Definition: rlopcxmlda.cpp:119
int intValue(const char *variable)
Definition: rlopcxmlda.cpp:59
rlMailbox * mbx
Definition: rlopcxmlda.h:73
const char * shmvalues
Definition: rlopcxmlda.h:72