SerRelayBoard.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
18 #ifndef SerRelayBoard_INCLUDEDEF_H
19 #define SerRelayBoard_INCLUDEDEF_H
20 
21 //-----------------------------------------------
23 #include <cob_relayboard/Mutex.h>
25 
26 //-----------------------------------------------
27 
33 {
34 public:
35 
36  SerRelayBoard(std::string ComPort, int ProtocolVersion = 1);
37 
39 
40  // Main control functions
41  bool init();
42  bool reset();
43  bool shutdown();
44 
45  int evalRxBuffer(); //needs to be calles to read new data from relayboard
46  int sendRequest(); //sends collected data and requests response
47 
48  //Services by relayboard
49  int setDigOut(int iChannel, bool bOn);
50  int getAnalogIn(int* piAnalogIn);
51  int getDigIn();
52  bool isEMStop();
53  bool isScannerStop();
55  {
57  }
59  {
60  return m_iChargeCurrent;
61  }
62 
63 
65  {
66  NO_ERROR = 0,
70  NO_MESSAGES = 4, //for a long time, no message have been received, check com port!
72  };
73 
75  {
86  };
87 
89  {
96  };
97 
98  enum TypeLCD
99  {
103  };
104 
105 protected:
106 
107 
108  std::string m_sNumComPort;
109 
110  void txCharArray();
111  void rxCharArray();
112 
113  void convDataToSendMsg(unsigned char cMsg[]);
114  bool convRecMsgToData(unsigned char cMsg[]);
115 
117 
120 
121  unsigned char m_cTextDisplay[60];
122 
123  //relayboard 1.4:
137 
138  //-----------------------
139  // send data
140 
141  // RelayBoard
144 
145  // IOBoard
147 
148  // MotCtrlBoards
151 
152  // USBoard
154 
155  //-----------------------
156  // rec data
163 
164  int m_iDigIn;
167 
169 
171 };
172 
173 
174 //-----------------------------------------------
175 #endif
unsigned char m_cTextDisplay[60]
int m_iVelCmdMotLeftEncS
double m_dLastPosRearLeft
SerialIO m_SerIO
int m_iVelCmdMotRightEncS
int m_iPosMeasMotRearLeftEnc
int m_iRelBoardAnalogIn[4]
Definition: Mutex.h:26
int m_iUSBoardSensorActive
int m_iVelCmdMotRearLeftEncS
void convDataToSendMsg(unsigned char cMsg[])
char m_cDebugRearLeft[4]
int m_iVelCmdMotRearRightEncS
int m_iMotRearRightStatus
int m_iVelMeasMotRearRightEncS
void rxCharArray()
int getBatteryVoltage()
Definition: SerRelayBoard.h:54
int setDigOut(int iChannel, bool bOn)
int m_iVelMeasMotRearLeftEncS
void txCharArray()
int m_iRelBoardBattVoltage
int m_iMotRearLeftStatus
bool convRecMsgToData(unsigned char cMsg[])
int m_iRelBoardTempSensor
std::string m_sNumComPort
int getAnalogIn(int *piAnalogIn)
char m_cDebugRearRight[4]
int getChargeCurrent()
Definition: SerRelayBoard.h:58
SerRelayBoard(std::string ComPort, int ProtocolVersion=1)
int m_iPosMeasMotRearRightEnc
double m_dLastPosRearRight


cob_relayboard
Author(s): Christian Connette
autogenerated on Wed Apr 7 2021 02:11:46