rllib  1
rlppiclient.h
Go to the documentation of this file.
1 /***************************************************************************
2  rlppiclient.h - description
3  -------------------
4  begin : Mon Jul 12 2004
5  copyright : (C) 2004 by R. Lehrig
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  ***************************************************************************/
16 #ifndef _RL_PPI_CLIENT_H_
17 #define _RL_PPI_CLIENT_H_
18 
19 #include "rldefine.h"
20 #include "rlmailbox.h"
21 #include "rlsharedmemory.h"
22 
29 {
30  public:
31  enum PPI_area
32  {
33  daveSD = 0x3,
34  daveInputs = 0x81,
35  daveOutputs = 0x82,
36  daveFlags = 0x83,
37  daveDB = 0x84, //data blocks
38  daveDI = 0x85, //not tested
39  daveLocal = 0x86, //not tested
40  daveV = 0x87, // don't know what it is
41  daveCounter = 28, //not tested
42  daveTimer = 29 //not tested
43  };
44  rlPPIClient(const char *mbxname, const char *shmname, int shmsize, int have_to_swap=1);
45  virtual ~rlPPIClient();
46  int write(int slave, int area, int dbnum, int start, int len, const unsigned char *data);
47  int writeFloat(int slave, int area, int dbnum, int start, int len, const float *val);
48  int writeDword(int slave, int area, int dbnum, int start, int len, const int *val);
49  int writeShort(int slave, int area, int dbnum, int start, int len, const short *val);
50  int writeUDword(int slave, int area, int dbnum, int start, int len, const unsigned int *val);
51  int writeUShort(int slave, int area, int dbnum, int start, int len, const unsigned short *val);
52  int read(int offset, int len);
53  float Float(int index);
54  int Dword(int index);
55  int Short(int index);
56  unsigned int UDword(int index);
57  unsigned int UShort(int index);
58  unsigned char buf[512]; // after calling read, the data is here
59  private:
61 };
62 
63 #endif
64 
int writeUShort(int slave, int area, int dbnum, int start, int len, const unsigned short *val)
rlPPIClient(const char *mbxname, const char *shmname, int shmsize, int have_to_swap=1)
Definition: rlppiclient.cpp:31
int writeShort(int slave, int area, int dbnum, int start, int len, const short *val)
int Short(int index)
float Float(int index)
int writeFloat(int slave, int area, int dbnum, int start, int len, const float *val)
Definition: rlppiclient.cpp:63
int writeUDword(int slave, int area, int dbnum, int start, int len, const unsigned int *val)
int read(int offset, int len)
unsigned int UShort(int index)
unsigned char buf[512]
Definition: rlppiclient.h:58
int write(int slave, int area, int dbnum, int start, int len, const unsigned char *data)
Definition: rlppiclient.cpp:41
unsigned int UDword(int index)
int writeDword(int slave, int area, int dbnum, int start, int len, const int *val)
Definition: rlppiclient.cpp:98
int Dword(int index)
virtual ~rlPPIClient()
Definition: rlppiclient.cpp:37
int have_to_swap
Definition: rlppiclient.h:60