rllib  1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
rlcanopen.h
Go to the documentation of this file.
1 /***************************************************************************
2  rlcanopen.cpp - description
3  -------------------
4  begin : Tue March 03 2004
5  copyright : (C) 2004 by Marc Br�tigam, Christian Wilmes, 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 
32 #ifndef NODES
33 #define NODES
34 
35 #define err00 "no error, command executed"
36 #define err03 "DESCRIPT table not found. DEVICE is not configured by SyCon"
37 #define err57 "sequence error. Check requested DeviceAdr of continued message"
38 #define err58 "no entry found for requested DeviceAdr of request message."
39 #define err100 "Communication ERROR!!!"
40 
41 #include "rlwthread.h"
42 #include "rlcannode.h"
43 #include <qvaluevector.h>
44 #include <qptrvector.h>
45 
46 
48 
55 class rlCanOpen
56 {
57  public:
58  rlCanOpen();
59  rlCanOpen(char* _inifilename);
60  ~rlCanOpen();
61 
63  int getBoardCount();
64 
66  int getActiveBoard();
67 
69  bool showNodeConfiguration(int _boardnr,int _nodeid);
70 
72  bool showNodeConfiguration(); // show all nodes
73 
82  int sdo_read ( int _boardnr,
83  int _nodeid,
84  int _objectindex,
85  int _subindex,
86  rlCanOpenTypes &_sdo_data);
87 
96  int sdo_write ( int _boardnr,
97  int _nodeid,
98  int _objectindex,
99  int _subindex,
100  rlCanOpenTypes &_sdo_data);
101 
111  int pdo_receive( int _boardnr,
112  int _nodeid,
113  int _pdonr,
114  int _mappingnr,
115  rlCanOpenTypes &_pdo_data);
116 
117 
123  int pdo_receive( int _boardnr,
124  int _nodeid,
125  int _pdonr,
126  rlCanOpenTypes &_pdo_data);
127 
128 
129 
136  int pdo_transmit( int _boardnr,
137  int _nodeid,
138  int _pdonr,
139  int _mappingnr,
140  rlCanOpenTypes &_pdo_data);
141 
147  int pdo_transmit( int _boardnr,
148  int _nodeid,
149  int _pdonr,
150  rlCanOpenTypes &_pdo_data);
151 
155  int getNodeIndex( int _boardnr,
156  int _nodeid,
157  int & _index);
158 
164  int getObjectType( int _boardnr,
165  int _nodeid,
166  int _objectindex,
167  int _subindex);
168 
174  int getNodeState( int _boardnr,
175  int _nodeid,
176  rlCanOpenTypes &_data);
177 
184  int restartBoard( int _boardnr, int _restarttype);
185 
196  int sendNMTCommand( int _boardnr,
197  int _nodeid,
198  unsigned char _cmd);
199 
200 
201 
202  bool is_twisted_type(int _canopentype);
203 
204 
205  private:
206 
211  bool getNodeConfiguration(int _nodeID);
212 
216  int getPdoID(int _boardnr, int _nodeid, int _objektindex, int _direction);
217 
220 
223  void read_inifile(const char* _filename);
224 
226  bool ini();
227 
229  void delmsg();
230 
232  bool iniboards();
233 
235  char err_out_buf[255];
236 
238  short sRet;
239 
241  FILE* err_fp;
242 
244  QString logFileName;
245 
247  RCS_MESSAGETELEGRAM_10 message;
248 
250  QPtrVector <rlCanNode> nodelist;
251 
254 
256  unsigned char messagenr;
257 
259  short setBoardActive(int _boardnr);
260 
263  int refreshMappingList( int _boardnr,
264  int _nodeid,
265  int _pdoID,
266  int _pdoDirection);
267 
270  int createNodes();
271 
273  int createMappingObjects( int _boardid,
274  int _nodeid,
275  int _pdoDirection);
276 
277 
278 
282 
283 };
284 
285 #endif