rllib
1
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
lib
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
33
class
rlOpcXmlDa
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
49
enum
OPC_XML_DA_ENUM
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
:
71
SHM_HEADER
*
shmheader
;
72
const
char
*
shmvalues
;
73
rlMailbox
*
mbx
;
74
rlSharedMemory
*
shm
;
75
};
76
77
#endif
78
Generated by
1.8.2