rllib  1
rlsiemenstcpclient.h
Go to the documentation of this file.
1 /***************************************************************************
2  rlsiemenstcpclient.h - description
3  -------------------
4  begin : Mon Mar 08 2004
5  copyright : (C) 2004 by R. Lehrig
6  email : lehrig@t-online.de
7 
8  S7_200 update : Wed Mar 21 2007
9  copyright : (C) 2007 by Aljosa Merljak
10  Email : aljosa.merljak@datapan.si
11  ***************************************************************************/
12 
13 /***************************************************************************
14  * *
15  * This library is free software; you can redistribute it and/or modify *
16  * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as *
17  * published by the Free Software Foundation *
18  * *
19  ***************************************************************************/
20 #ifndef _RL_SIEMENS_TCP_CLIENT_H_
21 #define _RL_SIEMENS_TCP_CLIENT_H_
22 
23 #include "rldefine.h"
24 #include "rlsiemenstcp.h"
25 #include "rlmailbox.h"
26 #include "rlsharedmemory.h"
27 
34 {
35  public:
36  enum ORG
37  {
38  ORG_DB = 1,
39  ORG_M = 2,
40  ORG_E = 3,
41  ORG_A = 4,
42  ORG_PEPA = 5,
43  ORG_Z = 6,
44  ORG_T = 7
45  };
46  rlSiemensTCPClient(const char *mbxname, const char *shmname, int shmsize, int have_to_swap=1);
47  virtual ~rlSiemensTCPClient();
48  int write(int slave, int org, int dbnum, int start, int len, const unsigned char *buf, int function);
49  int writeBit(int slave, int org, int dbnum, int start, int offset, int len, const unsigned char *buf);
50  int writeByte(int slave, int org, int dbnum, int start, int len, const unsigned char *val);
51  int writeFloat(int slave, int org, int dbnum, int start, int len, const float *val);
52  int writeDword(int slave, int org, int dbnum, int start, int len, const int *val);
53  int writeShort(int slave, int org, int dbnum, int start, int len, const short *val);
54  int writeUDword(int slave, int org, int dbnum, int start, int len, const unsigned int *val);
55  int writeUShort(int slave, int org, int dbnum, int start, int len, const unsigned short *val);
56  int read(int offset, int len);
57  float Float(int index);
58  int Dword(int index);
59  int Short(int index);
60  unsigned int UDword(int index);
61  unsigned int UShort(int index);
62  unsigned char buf[2048]; // after calling read, the data is here
63  private:
65 };
66 
67 #endif
int writeByte(int slave, int org, int dbnum, int start, int len, const unsigned char *val)
unsigned int UDword(int index)
int write(int slave, int org, int dbnum, int start, int len, const unsigned char *buf, int function)
float Float(int index)
int writeUShort(int slave, int org, int dbnum, int start, int len, const unsigned short *val)
int writeFloat(int slave, int org, int dbnum, int start, int len, const float *val)
int writeShort(int slave, int org, int dbnum, int start, int len, const short *val)
int writeDword(int slave, int org, int dbnum, int start, int len, const int *val)
int writeUDword(int slave, int org, int dbnum, int start, int len, const unsigned int *val)
int read(int offset, int len)
rlSiemensTCPClient(const char *mbxname, const char *shmname, int shmsize, int have_to_swap=1)
unsigned char buf[2048]
unsigned int UShort(int index)
int writeBit(int slave, int org, int dbnum, int start, int offset, int len, const unsigned char *buf)