Hauptseite | Klassenhierarchie | Alphabetische Liste | Auflistung der Klassen | Auflistung der Dateien | Klassen-Elemente

Cfps Klassenreferenz

contains all functions working with the fps Mehr...

#include <fps.hpp>

Klassendiagramm für Cfps:

CTCPIPConnector CTCPIPComm CTCPIPCommReceive CTCPIPCommSend CTCPIPCommConnect CTraceObject CTraceObject CTraceObject Aufstellung aller Elemente

Öffentliche Typen

enum  VERBINDUNG { MODEM, NETZWERK, RS232 }
 possible types of connection Mehr...

enum  CONVERT_TO { SPEC, MV, MM }
 possible working units Mehr...


Öffentliche Methoden

 Cfps ()
 Create the required Events ( use for synchronization with the receive thread ).

virtual ~Cfps ()
 Closed Handles for Events ( use for synchronization with the receive thread ).

VERBINDUNG GetCurrentConnectionType (void) const
void SetCurrentConnectionType (const VERBINDUNG eNewConnectionType)
void GetCallnumber (char *pcCallnumber, unsigned int ucBufLen)
 delivers the current number to call by a modem

void SetCallnumber (char *pcNewCallnumber)
 sets the current number to call by a modem

bool GetOperatingState (int &Flags)
 delivers the current operation flags

structure :

bit meaning

0 switch between operation mode ( 0 = Bereich, 1 = Schaltpunkt )
1 ---
2 ---
3 ---
4 ---
5 Update : ( set by fps device when sampling finished )
6 Record : start sampling if bit set
7 ReCalc : transfer values from fps input buffer to fps work buffer


bool SetOperatingState (int Flags)
 Sets the current operating state ( see GetOperationState for details ).

bool ReadSensor (SENSOR_TYPE &CurrentSensorValues)
 Delivers the current values in the fps input buffer into the overgiven structure of type SENSOR_TYPE

structure of SENSOR_TYPE ( defined in the file fps.hpp )

struct SENSOR_TYPE
{
int open; value which means state AUF ( open )
int c; " " " " C
int b; " " " " B
int a; " " " " A
int closed; " " " " ZU ( closed )
};.

bool WriteSensor (SENSOR_TYPE NewSensorValues)
 Writes the overgiven values into the fps input buffer ( see ReadSensor for details ).

bool ReadInterpolatedSensor (SENSOR_TYPE &CurrentSensorValues)
 Read in the fps working buffer ( see ReadSensor for more details ).

bool GetOutOfRangeFlags (int &Flags)
 delivers the "out of range" flags

structure

bit meaning ( if set )

0 Unterspannung ( low voltage )
1 Überspannung ( high voltage )
2 Untertemperatur ( low temperature )
3 Übertemperatur ( high temperature )
4 ---
5 ---
6 ---
7 ---


bool FetchStuetzArrayFromFps (void)
 delivers the stored stuetzstellen ( data points ) from the fps device the read in values are stored in the CFpsConvert class, so you can do some converting right after this

bool StoreStuetzArrayInFps (void)
 stores the current used stuetzstellen ( data points ) into the fps device

void GetTolerance (float &fUnterTolerance, float &fUeberTolerance)
 read in the tolerance values ( this value is stored in the fps in the place of the last stuetzstelle

void SaveTolerance (float fUnterTolerance, float fUeberTolerance)
 saves the tolance value in the fps ( this value is stored in the place of the last stuetzstelle

bool GetSensorSamples (float SenSamp[640], unsigned int uiBegin=0, unsigned int uiLength=640)
 delivers the sample of sensor data from the last sampling ( see GetOperatingState for more details )

bool GetVoltageSamples (float VoltageSample[640], unsigned int uiBegin=0, unsigned int uiLength=640)
 delivers the sample of voltage data from the last sampling ( see GetOperatingState for more details )

bool GetPortBSamples (int PortBSample[640], unsigned int uiBegin=0, unsigned int uiLength=640)
 delivers the sample of PortB data from the last sampling ( see GetCurrentState for more details )

bool GetCurrentSensorValue (float &CurSen, CONVERT_TO eConvertTo=SPEC)
 delivers the current sensor value

bool GetCurrentVoltage (float &CurOperatingVoltage)
 delivers the current voltage of the fps device ( in mV )

bool GetCurrentTemperature (float &CurrentTemperature)
 delivers the current temperature of the fps device ( in °C )

bool GetPortB (int &Flags)
 delivers the current state of the fps device

bit meaning
0 ---
1 ---
2 ---
3 offen ( open )
4 C
5 B
6 A
7 zu ( closed )
8 ---
9 ---
10 ---
11 ---
12 ---
13 ---
14 ---
15 ---


bool StartSampling (void)
 starts the sampling of sensor, voltage and portb data a value will be measured every 30 milliseconds 640 measures will be taken at all

bool IsSamplingDone (bool &bDone)
 tests if the sampling is already done

bool ResetEx (void)
 resets the OutOfRangeFlags writes back the week and year of the production of the fps devise and their serial number

bool GetServiceInfo (int &Week, int &Year, int &Serialnumber)
 delivers the week and year of the production of the fps device and their serialnumber

bool PasswordLogin (char *szIpAddress, char *szPassword, unsigned int uiBasePort, unsigned int uiPortnumber)
 handle the password login use the routine to connect to a password protected gateway

void GetCallNumber (char *pcCallNumber, unsigned int uiBufLen)
 delivers the currently used call number for a modem connection

void SetCallNumber (char *pcNewCallNumber)
 sets the currently used call number for a modem connection

bool InitModem (void)
 connect to modem

virtual bool initialize (void)
 init socket connection

void GetModemInitString (char *pcModemInitString, unsigned int BufLen)
 delivers the string which will be send to modem for initializing ( at commands )

void SetModemInitString (char *pcNewModemInitString)
 sets the string which will be send to modem for initializing ( at commands )

void GetModemDialString (char *pcModemDialString, unsigned int BufLen)
 delivers the string which will be send to modem for dialing ( at commands )

void SetModemDialString (char *pcNewModemDialString)
 sets the string which will be send to modem for dialing ( at commands )

void GetModemOkString (char *pcModemOkString, unsigned int BufLen)
 the modem answers the initializing by sending a string Use this routine to get the string which will be interpreted as a correct initialisation default : OK

void SetModemOkString (char *pcModemOkString)
 the modem answers the initializing by sending a string Use this routine to set the string which will be interpreted as a correct initialisation default : OK

void GetModemConnectString (char *pcModemConnectString, unsigned int BufLen)
 the modem answers the try to connect to another modem by sending a string Use this routine to get the string which will be interpreted as a correct connection default : CONNECT

void SetModemConnectString (char *pcModemConnectString)
 the modem answers the try to connect to another modem by sending a string Use this routine to set the string which will be interpreted as a correct connection default : CONNECT

unsigned int GetModemInitTimeout (void) const
 delivers the timeout value for initializing the modem

void SetModemInitTimeout (const unsigned int uiNewTimeOut)
 sets the timeout value for initializing the modem

unsigned int GetModemDialTimeout (void) const
 delivers the timeout value for establishing a connection with other modem ( dialing )

void SetModemDialTimeout (const unsigned int uiNewTimeoutValue)
 sets the timeout value for establishing a connection with other modem ( dialing )

void SetTcpIpAddress (char const *pcIpAddress)
 sets the tcpipaddress of the fps -device

void GetTcpIpAddress (char *pcIpAddress, SIZE_T BufLen)
 delivers the tcpipaddress of the fps -device

void SetTcpIpPort (unsigned int uiNewPort)
 sets the communication port

unsigned int GetTcpIpPort (void)
 delivers the communication port the default port is 5000

void SetBasePort (const unsigned int nBasePort)
 Set the base port of TCP/IP connection for login.

unsigned int GetBasePort (void) const
 Get the base port of TCP/IP connection for login.

void SetRcvTimeOut (const DWORD dwNewTimeOut)
 sets timeout ( for receiving data )

DWORD GetRcvTimeOut (void) const
 delivers the timeout for receiving data default 5 seconds

void ReadProfileFile (const std::string &sFilename)
 read address data from profile file

void ReadProfileFileConnectionType (const std::string &sFilename)
 read connection type from profile file and set it in the class data.

void WriteProfileFile (std::string sFilename)
 write address data to profile file

bool FetchData (RECEIVED_TYPE &Command, ADDRESS_TYPE &nAddress, unsigned int &uiLength, std::vector< unsigned char > &aucData)
 encapsolated functions in CRcvBuffer

bool StoreData (const RECEIVED_TYPE Command, const ADDRESS_TYPE nAddress, const unsigned int uiLength, const std::vector< unsigned char > &aucData=std::vector< unsigned char >::vector())
 encapsolated functions in CRcvBuffer


Öffentliche Attribute

CFpsConvert m_oConvert
 handle stuetzstellen ( data points ) for converting voltage to mm use this object to convert between :

native and spec ( depends on what is currently used ( switch with SetMeasureMode ) )
spec and native
mV and mm
mm and mV
native and mV
native and mm
mV and native
mm and native



Geschützte Methoden

bool ReadFpsEeprom (ADDRESS_TYPE nAddress, unsigned int uiLength)
 read in a block of data from eeprom memory from fps device the received data will be stored in m_Eeprom

bool ReadFpsProgram (ADDRESS_TYPE nAddress, unsigned int uiLength)
 read in a block of data from program memory from fps device the received data will be stored in m_Program

bool ReadFpsRam (ADDRESS_TYPE nAddress, unsigned int uiLength)
 read in a block of data from ram memory from fps device the received data will be stored in m_Ram

bool WriteFpsEeprom (ADDRESS_TYPE nAddress, unsigned int uiLength, std::vector< unsigned char > aucData)
 write a block of data to eeprom memory in the fps device

bool WriteFpsProgram (ADDRESS_TYPE nAddress, unsigned int uiLength, std::vector< unsigned char > aucData)
 write a block of data to program memory in the fps device

bool WriteFpsRam (ADDRESS_TYPE nAddress, unsigned int uiLength, std::vector< unsigned char > aucData)
 write a block of data to ram memory in the fps device

RECEIVED_TYPE WaitForData (void)
 wait for incoming data timeout = internal timeout


Private Methoden

 Cfps (const Cfps &NewObject)
 don't use a copy constructor ( therefor it's private )

Cfpsoperator= (const Cfps &OldObject)
 don't use an assign operator ( therefor it's private )

bool ReadDataPointHeader (void)
 read in header information from fps

bool ReadDataPoints (void)
 read in data points from fps

bool WriteDataPointHeader (void)
 write header information to fps

bool WriteDataPoints (void)
 write data points to fps

void ReadEepromDataReq (ADDRESS_TYPE nAddress, unsigned int uiLength)
 this function will be call when a ReadEepromReq was received It sends a signal to the working thread.

void ReadProgramDataReq (ADDRESS_TYPE nAddress, unsigned int uiLength)
 this function will be call when a ReadProgramReq was received It sends a signal to the working thread.

void ReadRamDataReq (ADDRESS_TYPE nAddress, unsigned int uiLength)
 this function will be call when a ReadRamReq was received It sends a signal to the working thread.

void WriteEepromDataReq (ADDRESS_TYPE nAddress, unsigned int uiLength, const std::vector< unsigned char > &aucData)
 this function will be call when a WriteEepromReq was received It sends a signal to the working thread.

void WriteProgramDataReq (ADDRESS_TYPE nAddress, unsigned int uiLength, const std::vector< unsigned char > &aucData)
 this function will be call when a WriteProgramReq was received It sends a signal to the working thread.

void WriteRamDataReq (ADDRESS_TYPE nAddress, unsigned int uiLength, const std::vector< unsigned char > &aucData)
 this function will be call when a WriteRamReq was received

void ReadEepromDataCnf (ADDRESS_TYPE nAddress, unsigned int uiLength, const std::vector< unsigned char > &aucData)
 this function will be call when a ReadEepromCnf was received

void ReadProgramDataCnf (ADDRESS_TYPE nAddress, unsigned int uiLength, const std::vector< unsigned char > &aucData)
 this function will be call when a ReadProgramCnf was received

void ReadRamDataCnf (ADDRESS_TYPE nAddress, unsigned int uiLength, const std::vector< unsigned char > &aucData)
 this function will be call when a ReadRamCnf was received

void WriteEepromDataCnf (ADDRESS_TYPE nAddress, unsigned int uiLength)
 this function will be call when a WriteEepromCnf was received

void WriteProgramDataCnf (ADDRESS_TYPE nAddress, unsigned int uiLength)
 this function will be call when a WriteProgramCnf was received

void WriteRamDataCnf (ADDRESS_TYPE nAddress, unsigned int uiLength)
 this function will be call when a WriteRamCnf was received

void StatusInfo (ADDRESS_TYPE nAddress, unsigned int uiLength, const std::vector< unsigned char > &aucData)
 this function will be call when a StatusInfo was received

void ConnectIndication (void)
 will be called if a connection was exstablished

void DisconnectIndication (void)
 will be called if the connection was broken

unsigned int GetMaxRetryCount (void) const
 delivers max.

void SetMaxRetryCount (const unsigned int uiNewRetryCount)
 sets the max.

unsigned int GetMaxBlockLength (void) const
 get max block length transfered from/to fps

void SetMaxBlockLength (unsigned int uiNewMaxBlockLength)
 set max block length transfered from/to fps

void InformAboutNewData (const HANDLE hEvent) const
 Signal received command from receive thread to waiting thread.

bool TestRcvData (RECEIVED_TYPE Command, ADDRESS_TYPE nAddress, unsigned int uiLength, std::vector< unsigned char > &aucTestedData)
 needed in the function ReadFps to test the received data

bool Loc_GetRcvData (RECEIVED_TYPE eExpectedRcvType, ADDRESS_TYPE nAddress, unsigned int uiLength, std::vector< unsigned char > &aucBuffer)
 adds received data to the overgiven buffer

bool LockFpsReq (void)
 locking communication to the fps device ( from / to receive thread )

bool UnlockFpsReq (void)
 unlocking communication to the fps device ( from / to receive thread )


Private Attribute

CRcvBuffer m_oRcvBuffer
 handle receive buffer

HANDLE m_hRcvEventFpsDataMovement
 Signal : we've received a command.

HANDLE m_hRcvEventConnect
 Signal : we've established a connection.

HANDLE m_hRcvEventDisconnect
 Signal : our connection was broken.

DWORD m_dwRcvTimeOut
 Timeout value for receiving data from the fps device.

VERBINDUNG m_eNeuVerb
 current connection type

char m_sCallNumber [200]
 current call number if MODEM is selected

char m_sTcpIpAddress [200]
 TcpIp Address of the gateway.

unsigned int m_uiTcpIpPort
 Portnumber used for communication with the gateway.

unsigned int m_uiBasePort
 Port of TCP/IP connection for login (base port).

unsigned int m_uiMaxRetry
 max # of retries to send request to the fps

unsigned int m_uiMaxBlockLength
 max block length transfered from/to fps

char m_sModemInitString [200]
 initstring ( used for connection with modem )

char m_sModemDialString [200]
 dialstring ( used for connection with modem )

char m_sModemOkString [200]
 string indicating a correct initialisation of the modem

char m_sModemConnectString [200]
 string indicating a correct connection of the modem

int m_uiModemInitTimeout
 init timeout for modem initializing

int m_uiModemDailTimeout
 dial timeout. tiemout during a try to connect with another modem

std::vector< unsigned char > m_aucEeprom
 received data ( eeprom )

std::vector< unsigned char > m_aucProgram
 received data ( program )

std::vector< unsigned char > m_aucRam
 received data ( ram )

HANDLE m_hBlockRequest
 Mutex : blocking mutliply request to the fps.


Ausführliche Beschreibung

contains all functions working with the fps

Version:
1.0
Autor:
Ingo Fröhlich


Dokumentation der Aufzählungstypen

enum Cfps::CONVERT_TO
 

possible working units

Aufzählungswerte:
MV  use the currently used working unit
MM  use mm

enum Cfps::VERBINDUNG
 

possible types of connection

Aufzählungswerte:
NETZWERK  a modem connection
RS232  a direct connection via RS232


Beschreibung der Konstruktoren und Destruktoren

Cfps::Cfps  ) 
 

Create the required Events ( use for synchronization with the receive thread ).

Autor:
Ingo Fröhlich date 12.07.2001
Copyright 2001 Analytica GmbH

Log
fps.cpp,v
Revision 1.14 2008/02/12 16:20:16 axelschmidt neuer Verbindungstyp, default rs232

Revision 1.13 2003/07/23 09:57:55 ThomasWeber Zusätzliche Methoden für Set und Get des Basis-Port für das Login hinzugefügt Die Read und Write Methode für das ini-File angepasst

Revision 1.12 2003/02/06 14:16:51 UdoWeber

  • Funktion Über/Untertoleranz hinzugefügt
  • Fehler beim Beenden der Anwendung (TCPIPComm::DisInd beim terminieren)
  • Berechnungsfehler bei Konvertierung mm/mV beseitigt

Revision 1.11 2002/10/17 08:30:12 IngoFroehlich Letzte Modifikationen für Lernen Plus:

  • Speicherung der Linearisierungskurve in mV für Controller

Revision 1.10 2002/02/22 16:23:08 IngoFroehlich aktuelle Einheit wird nicht mehr aus dem FPS gelesen.

Revision 1.9 2001/10/22 15:07:57 IngoFroehlich no message

Revision 1.8 2001/09/10 12:21:42 IngoFroehlich no message

Revision 1.7 2001/09/05 15:14:39 IngoFroehlich no message

Revision 1.6 2001/08/10 15:14:14 IngoFroehlich no message

Revision 1.5 2001/07/23 08:29:26 IngoFroehlich no message

Revision 1.4 2001/07/18 11:30:34 IngoFroehlich changed wrong initial owner value for mutex

Revision 1.3 2001/07/17 15:54:12 IngoFroehlich initialize without paramter possible, programm will use default portnumber and ipaddress or in case readprofilefile was called before, it will use data from this file

Revision 1.2 2001/07/17 10:30:42 IngoFroehlich added : read timeout values and fps - addresses from .ini file Enhanced : readability

Revision 1.1 2001/07/13 08:02:40 IngoFroehlich no message

Id
fps.cpp,v 1.14 2008/02/12 16:20:16 axelschmidt Exp


Dokumentation der Elementfunktionen

void Cfps::ConnectIndication void   )  [private, virtual]
 

will be called if a connection was exstablished

Parameter:
--- 
Rückgabe:
---

Implementiert CTCPIPComm.

void Cfps::DisconnectIndication void   )  [private, virtual]
 

will be called if the connection was broken

Parameter:
--- 
Rückgabe:
---

Implementiert CTCPIPComm.

bool Cfps::FetchData RECEIVED_TYPE &  Command,
ADDRESS_TYPE &  nAddress,
unsigned int &  uiLength,
std::vector< unsigned char > &  aucData
 

encapsolated functions in CRcvBuffer

Parameter:
buffer to store rcv command, address, data block length and data
Rückgabe:
true : ok

bool Cfps::FetchStuetzArrayFromFps void   ) 
 

delivers the stored stuetzstellen ( data points ) from the fps device the read in values are stored in the CFpsConvert class, so you can do some converting right after this

Zu beachten:
you can store the stuetzstellen ( data points ) with StoreStuetzArrayInFps
Parameter:
--- 
Rückgabe:
true : operation was successfull, false else

unsigned int Cfps::GetBasePort void   )  const
 

Get the base port of TCP/IP connection for login.

Parameter:
base port for login

void Cfps::GetCallNumber char *  pcCallNumber,
unsigned int  uiBufLen
 

delivers the currently used call number for a modem connection

Parameter:
returned : buffer in which the current modem number will be stored
length of the buffer ( in bytes )
Rückgabe:
---

void Cfps::GetCallnumber char *  pcCallnumber,
unsigned int  ucBufLen
 

delivers the current number to call by a modem

Parameter:
buffer,in which the current number will be stored
length of the buffer
Rückgabe:
---

Cfps::VERBINDUNG Cfps::GetCurrentConnectionType void   )  const
 

Parameter:
--- 
Rückgabe:
current connection type

bool Cfps::GetCurrentSensorValue float &  CurSen,
CONVERT_TO  eConvertTo = SPEC
 

delivers the current sensor value

the unit in which the return value will be can be specified with the second argument

SPEC => depend on what is currently used ( set / change with SetMeasureMode ) MV => returns mV MM => returns mm

Zu beachten:
default is SPEC
Parameter:
returned current sensor value,
optional the unit of the return value ( see upove for details )
Rückgabe:
true : operation successfull

false else

bool Cfps::GetCurrentTemperature float &  CurrentTemperature  ) 
 

delivers the current temperature of the fps device ( in °C )

Parameter:
returned the current temperature
Rückgabe:
true operation was successfull

false else

bool Cfps::GetCurrentVoltage float &  CurOperatingVoltage  ) 
 

delivers the current voltage of the fps device ( in mV )

Parameter:
returned :the current voltage
Rückgabe:
true : operation was successfull, false else

unsigned int Cfps::GetMaxBlockLength void   )  const [private]
 

get max block length transfered from/to fps

Parameter:
--- 
Rückgabe:
the max. block length

unsigned int Cfps::GetMaxRetryCount void   )  const [private]
 

delivers max.

number of retries sending a request to the fps

Parameter:
--- 
Rückgabe:
the max. number of retries

void Cfps::GetModemConnectString char *  pcModemConnectString,
unsigned int  BufLen
 

the modem answers the try to connect to another modem by sending a string Use this routine to get the string which will be interpreted as a correct connection default : CONNECT

Parameter:
return connect string
size of the buffer
Rückgabe:
---

void Cfps::GetModemDialString char *  pcModemDialString,
unsigned int  BufLen
 

delivers the string which will be send to modem for dialing ( at commands )

Zu beachten:
call number will be added, so don't set it here
Parameter:
returned : buffer in which the string will be stored
size of the buffer ( in bytes )
Rückgabe:
---

unsigned int Cfps::GetModemDialTimeout void   )  const
 

delivers the timeout value for establishing a connection with other modem ( dialing )

Parameter:
--- 
Rückgabe:
the current timeout value

void Cfps::GetModemInitString char *  pcModemInitString,
unsigned int  BufLen
 

delivers the string which will be send to modem for initializing ( at commands )

Parameter:
returned buffer in which the string will be stored
size of the buffer ( in bytes )
Rückgabe:
---

unsigned int Cfps::GetModemInitTimeout void   )  const
 

delivers the timeout value for initializing the modem

Parameter:
--- 
Rückgabe:
the current timeout value

void Cfps::GetModemOkString char *  pcModemOkString,
unsigned int  BufLen
 

the modem answers the initializing by sending a string Use this routine to get the string which will be interpreted as a correct initialisation default : OK

Parameter:
return ok string
size of the buffer
Rückgabe:
---

bool Cfps::GetOperatingState int &  Flags  ) 
 

delivers the current operation flags

structure :

bit meaning

0 switch between operation mode ( 0 = Bereich, 1 = Schaltpunkt )
1 ---
2 ---
3 ---
4 ---
5 Update : ( set by fps device when sampling finished )
6 Record : start sampling if bit set
7 ReCalc : transfer values from fps input buffer to fps work buffer

Zu beachten:
You can set the operating state with SetOperatingState
Parameter:
returning flags
Rückgabe:
true : operation was successfull, false else

bool Cfps::GetOutOfRangeFlags int &  Flags  ) 
 

delivers the "out of range" flags

structure

bit meaning ( if set )

0 Unterspannung ( low voltage )
1 Überspannung ( high voltage )
2 Untertemperatur ( low temperature )
3 Übertemperatur ( high temperature )
4 ---
5 ---
6 ---
7 ---

Parameter:
read in flags
Rückgabe:
true : operation was successfull, false else

bool Cfps::GetPortB int &  Flags  ) 
 

delivers the current state of the fps device

bit meaning
0 ---
1 ---
2 ---
3 offen ( open )
4 C
5 B
6 A
7 zu ( closed )
8 ---
9 ---
10 ---
11 ---
12 ---
13 ---
14 ---
15 ---

Parameter:
returned flags ( see upove for details )
Rückgabe:
true operation was successfull

false else

bool Cfps::GetPortBSamples int  PortBSample[640],
unsigned int  uiBegin = 0,
unsigned int  uiLength = 640
 

delivers the sample of PortB data from the last sampling ( see GetCurrentState for more details )

Zu beachten:
the data transfer of the whole sampling data takes a lot of time ( about 20 seconds ) You can break it down into small packages, which are more easier to handle by setting the start offset and length of the block you want to read in.
Parameter:
array in which the sampling data will be stored,
optional : start of the block, which will be transfered,
optional : length of the block, which will be transfered
Rückgabe:
true : operation successfull

DWORD Cfps::GetRcvTimeOut void   )  const
 

delivers the timeout for receiving data default 5 seconds

Parameter:
--- 
Rückgabe:
currently used timout value

bool Cfps::GetSensorSamples float  SenSamp[640],
unsigned int  uiBegin = 0,
unsigned int  uiLength = 640
 

delivers the sample of sensor data from the last sampling ( see GetOperatingState for more details )

Zu beachten:
the data transfer of the whole sampling data takes a lot of time ( about 20 seconds ) You can break it down into small packages, which are more easier to handle by setting the start offset and length of the block you want to read in.
Parameter:
array in which the sampling data will be stored,
optional : start of the block, which will be transfered,
optional : length of the block, which will be transfered
Rückgabe:
true : operation successfull

bool Cfps::GetServiceInfo int &  Week,
int &  Year,
int &  Serialnumber
 

delivers the week and year of the production of the fps device and their serialnumber

Parameter:
returned week
returned year
returned serialnumber
Rückgabe:
true operation was successfull

void Cfps::GetTcpIpAddress char *  pcIpAddress,
SIZE_T  BufLen
 

delivers the tcpipaddress of the fps -device

Parameter:
buffer in which the current tcpip address will be stored in,
length of the buffer
Rückgabe:
---

unsigned int Cfps::GetTcpIpPort void   ) 
 

delivers the communication port the default port is 5000

Parameter:
--- 
Rückgabe:
the currently used port number

void Cfps::GetTolerance float &  fUnterTolerance,
float &  fUeberTolerance
 

read in the tolerance values ( this value is stored in the fps in the place of the last stuetzstelle

Parameter:
(+) tolerance value ( in the currently used unit )
(-) tolerance value ( in the currently used unit )
Rückgabe:
---

bool Cfps::GetVoltageSamples float  VoltageSample[640],
unsigned int  uiBegin = 0,
unsigned int  uiLength = 640
 

delivers the sample of voltage data from the last sampling ( see GetOperatingState for more details )

Zu beachten:
the data transfer of the whole sampling data takes a lot of time ( about 20 seconds ) You can break it down into small packages, which are more easier to handle by setting the start offset and length of the block you want to read in.
Parameter:
array in which the sampling data will be stored,
optional : start of the block, which will be transfered,
optional : length of the block, which will be transfered
Rückgabe:
true : operation successfull

void Cfps::InformAboutNewData const HANDLE  hEvent  )  const [private]
 

Signal received command from receive thread to waiting thread.

Parameter:
handle of the signal the send
Rückgabe:
---

bool Cfps::initialize void   )  [virtual]
 

init socket connection

Set the required data with SetTcpIpAddress and SetTcpIpPort

Parameter:
--- 
Rückgabe:
true connection established

false else

bool Cfps::InitModem void   ) 
 

connect to modem

Zu beachten:
Set the apropriate before ( using ReadProfileFile ) or set it by hand
addtional note : you need to open a connection to the gateway before trying to connect to a modem

When set by hand

Set using

Callnumber SetCallNumber
Initstring ( at commands ) for modem SetModemInitString
Dialstring ( at commands ) for modem SetModemDialString
string indicating a correct initialisation of the modem SetModemOkString
string indicating a correct connection SetModemConnectString

Parameter:
--- 
Rückgabe:
true connect was successfull

false else

bool Cfps::IsSamplingDone bool &  bDone  ) 
 

tests if the sampling is already done

Parameter:
--- 
Rückgabe:
true sampling is finished

false else

bool Cfps::Loc_GetRcvData RECEIVED_TYPE  eExpectedRcvType,
ADDRESS_TYPE  nAddress,
unsigned int  uiLength,
std::vector< unsigned char > &  aucBuffer
[private]
 

adds received data to the overgiven buffer

Parameter:
expected command,
expected address,
expected length
returned added received data
Rückgabe:
true operation was successfull

false else

bool Cfps::LockFpsReq void   )  [private]
 

locking communication to the fps device ( from / to receive thread )

Parameter:
--- 
Rückgabe:
true lock successfull

false else

bool Cfps::PasswordLogin char *  szIpAddress,
char *  szPassword,
unsigned int  uiBasePort,
unsigned int  uiPortnumber
 

handle the password login use the routine to connect to a password protected gateway

Parameter:
Tcpip Address of the gateway,
password,@param Baseport ( used for password exchange ),
Port to connect to if password is valid
Rückgabe:
true operation successfull

false else

bool Cfps::ReadDataPointHeader void   )  [private]
 

read in header information from fps

Parameter:
--- 
Rückgabe:
true operation was successfull

bool Cfps::ReadDataPoints void   )  [private]
 

read in data points from fps

Parameter:
--- 
Rückgabe:
true operation was successfull

void Cfps::ReadEepromDataCnf ADDRESS_TYPE  nAddress,
unsigned int  uiLength,
const std::vector< unsigned char > &  aucData
[private, virtual]
 

this function will be call when a ReadEepromCnf was received

Parameter:
received address, received length, read data
Rückgabe:
---

Implementiert CTCPIPConnector.

void Cfps::ReadEepromDataReq ADDRESS_TYPE  nAddress,
unsigned int  uiLength
[private, virtual]
 

this function will be call when a ReadEepromReq was received It sends a signal to the working thread.

You can catch those signals be using WaitForData

Parameter:
received address, received length
Rückgabe:
---

Implementiert CTCPIPConnector.

bool Cfps::ReadFpsEeprom ADDRESS_TYPE  nAddress,
unsigned int  uiLength
[protected]
 

read in a block of data from eeprom memory from fps device the received data will be stored in m_Eeprom

Parameter:
address of the block to read,
length of the block
Rückgabe:
true : operation successfull, false else

bool Cfps::ReadFpsProgram ADDRESS_TYPE  nAddress,
unsigned int  uiLength
[protected]
 

read in a block of data from program memory from fps device the received data will be stored in m_Program

Parameter:
address of the block to read,
length of the block
Rückgabe:
true operation successfull

false else

bool Cfps::ReadFpsRam ADDRESS_TYPE  nAddress,
unsigned int  uiLength
[protected]
 

read in a block of data from ram memory from fps device the received data will be stored in m_Ram

Parameter:
address of the block to read,
length of the block
Rückgabe:
true operation successfull

false else

bool Cfps::ReadInterpolatedSensor SENSOR_TYPE CurrentSensorValues  ) 
 

Read in the fps working buffer ( see ReadSensor for more details ).

Parameter:
read in values ( struct SENSOR_TYPE )
Rückgabe:
operation was successfull, false else

void Cfps::ReadProfileFile const std::string &  sFilename  ) 
 

read address data from profile file

read in tcpip address, portnumber, receive timeout value and internal used timeout value ( this value will be used as timeout value for communication will the separated received thread ), strings for communication with a modem

Zu beachten:
Default values ( in case of an error ):

tcpip address : localhost ( equals 127.0.0.1 )
port number : 5000
receive timeout : 5 seconds
internal timeout : 5 seconds
Ok string ( modem ) : OK
CONNECT string ( modem ) : CONNECT
Parameter:
filename of the profile file
Rückgabe:
---

void Cfps::ReadProfileFileConnectionType const std::string &  sFilename  ) 
 

read connection type from profile file and set it in the class data.

Parameter:
filename of the profile file
Rückgabe:
---

void Cfps::ReadProgramDataCnf ADDRESS_TYPE  nAddress,
unsigned int  uiLength,
const std::vector< unsigned char > &  aucData
[private, virtual]
 

this function will be call when a ReadProgramCnf was received

Parameter:
received address, received length, read data
Rückgabe:
---

Implementiert CTCPIPConnector.

void Cfps::ReadProgramDataReq ADDRESS_TYPE  nAddress,
unsigned int  uiLength
[private, virtual]
 

this function will be call when a ReadProgramReq was received It sends a signal to the working thread.

You can catch those signals be using WaitForData

Parameter:
received address, received length
Rückgabe:
---

Implementiert CTCPIPConnector.

void Cfps::ReadRamDataCnf ADDRESS_TYPE  nAddress,
unsigned int  uiLength,
const std::vector< unsigned char > &  aucData
[private, virtual]
 

this function will be call when a ReadRamCnf was received

Parameter:
received address, received length, read data
Rückgabe:
---

Implementiert CTCPIPConnector.

void Cfps::ReadRamDataReq ADDRESS_TYPE  nAddress,
unsigned int  uiLength
[private, virtual]
 

this function will be call when a ReadRamReq was received It sends a signal to the working thread.

You can catch those signals be using WaitForData

Parameter:
received address, received length
Rückgabe:
---

Implementiert CTCPIPConnector.

bool Cfps::ReadSensor SENSOR_TYPE CurrentSensorValues  ) 
 

Delivers the current values in the fps input buffer into the overgiven structure of type SENSOR_TYPE

structure of SENSOR_TYPE ( defined in the file fps.hpp )

struct SENSOR_TYPE
{
int open; value which means state AUF ( open )
int c; " " " " C
int b; " " " " B
int a; " " " " A
int closed; " " " " ZU ( closed )
};.

Zu beachten:
these values are in native format. Use the CFpsConvert class to convert between native and specific ( mV or mm )
further notice : You can set fps input buffer with WriteSensor

Parameter:
read in values ( struct SENSOR_TYPE )
Rückgabe:
true : operation was successfull, false else

bool Cfps::ResetEx void   ) 
 

resets the OutOfRangeFlags writes back the week and year of the production of the fps devise and their serial number

Parameter:
--- 
Rückgabe:
true operation was successfull

false else

void Cfps::SaveTolerance float  fUnterTolerance,
float  fUeberTolerance
 

saves the tolance value in the fps ( this value is stored in the place of the last stuetzstelle

Parameter:
(+) tolerance value ( in the currently used unit )
(-) tolerance value ( in the currently used unit )
Rückgabe:
---

void Cfps::SetBasePort const unsigned int  nBasePort  ) 
 

Set the base port of TCP/IP connection for login.

Parameter:
nBasePort port for login

void Cfps::SetCallNumber char *  pcNewCallNumber  ) 
 

sets the currently used call number for a modem connection

Parameter:
the new call number
Rückgabe:
---

void Cfps::SetCallnumber char *  pcNewCallnumber  ) 
 

sets the current number to call by a modem

Parameter:
the new Callnumber
Rückgabe:
---

void Cfps::SetCurrentConnectionType const VERBINDUNG  eNewConnectionType  ) 
 

Parameter:
new connection type
Rückgabe:
---

void Cfps::SetMaxBlockLength unsigned int  uiNewMaxBlockLength  )  [private]
 

set max block length transfered from/to fps

Parameter:
the new max. block length
Rückgabe:
---

void Cfps::SetMaxRetryCount const unsigned int  uiNewRetryCount  )  [private]
 

sets the max.

number of retries sending a request to the fps

Parameter:
new retry count
Rückgabe:
---

void Cfps::SetModemConnectString char *  pcModemConnectString  ) 
 

the modem answers the try to connect to another modem by sending a string Use this routine to set the string which will be interpreted as a correct connection default : CONNECT

Parameter:
connect string
Rückgabe:
---

void Cfps::SetModemDialString char *  pcNewModemDialString  ) 
 

sets the string which will be send to modem for dialing ( at commands )

Zu beachten:
call number will be added, so don't set it here
Parameter:
new dial string
Rückgabe:
---

void Cfps::SetModemDialTimeout const unsigned int  uiNewTimeoutValue  ) 
 

sets the timeout value for establishing a connection with other modem ( dialing )

Parameter:
new timeout value
Rückgabe:
---

void Cfps::SetModemInitString char *  pcNewModemInitString  ) 
 

sets the string which will be send to modem for initializing ( at commands )

Zu beachten:
switch off echoing here
Parameter:
new modem init string
Rückgabe:
---

void Cfps::SetModemInitTimeout const unsigned int  uiNewTimeOut  ) 
 

sets the timeout value for initializing the modem

Parameter:
new timeout value
Rückgabe:
---

void Cfps::SetModemOkString char *  pcModemOkString  ) 
 

the modem answers the initializing by sending a string Use this routine to set the string which will be interpreted as a correct initialisation default : OK

Parameter:
ok string
Rückgabe:
---

bool Cfps::SetOperatingState int  Flags  ) 
 

Sets the current operating state ( see GetOperationState for details ).

Parameter:
flags to set
Rückgabe:
true : operation was successfull, false else

void Cfps::SetRcvTimeOut const DWORD  dwNewTimeOut  ) 
 

sets timeout ( for receiving data )

Parameter:
new timeout value ( in milli seconds )
Rückgabe:
---

void Cfps::SetTcpIpAddress char const *  pcIpAddress  ) 
 

sets the tcpipaddress of the fps -device

Parameter:
c - string with the tcpip address
Rückgabe:
---

void Cfps::SetTcpIpPort unsigned int  uiNewPort  ) 
 

sets the communication port

Parameter:
port number
Rückgabe:
---

bool Cfps::StartSampling void   ) 
 

starts the sampling of sensor, voltage and portb data a value will be measured every 30 milliseconds 640 measures will be taken at all

Parameter:
--- 
Rückgabe:
true operation was successfull

false else

void Cfps::StatusInfo ADDRESS_TYPE  nAddress,
unsigned int  uiLength,
const std::vector< unsigned char > &  aucData
[private, virtual]
 

this function will be call when a StatusInfo was received

Parameter:
received address, received length
Rückgabe:
---

Implementiert CTCPIPConnector.

bool Cfps::StoreData const RECEIVED_TYPE  Command,
const ADDRESS_TYPE  nAddress,
const unsigned int  uiLength,
const std::vector< unsigned char > &  aucData = std::vector<unsigned char>::vector()
 

encapsolated functions in CRcvBuffer

Parameter:
new command, new address, new data block length, new data
Rückgabe:
true : ok

bool Cfps::StoreStuetzArrayInFps void   ) 
 

stores the current used stuetzstellen ( data points ) into the fps device

Parameter:
--- 
Rückgabe:
true : operation was successfull, false else

bool Cfps::TestRcvData RECEIVED_TYPE  Command,
ADDRESS_TYPE  nAddress,
unsigned int  uiLength,
std::vector< unsigned char > &  aucTestedData
[private]
 

needed in the function ReadFps to test the received data

Parameter:
expected command,
expected address,
expected length of the received command block
returned the received data if valid
Rückgabe:
true data is valid

false else

bool Cfps::UnlockFpsReq void   )  [private]
 

unlocking communication to the fps device ( from / to receive thread )

Parameter:
--- 
Rückgabe:
true unlock successfull

false else

RECEIVED_TYPE Cfps::WaitForData void   )  [protected]
 

wait for incoming data timeout = internal timeout

Parameter:
--- 
Rückgabe:
received command or NONE ( see fps_rcvbuffer.hpp for details )

bool Cfps::WriteDataPointHeader void   )  [private]
 

write header information to fps

Parameter:
--- 
Rückgabe:
true operation was successfull

bool Cfps::WriteDataPoints void   )  [private]
 

write data points to fps

Parameter:
--- 
Rückgabe:
true operation was successfull

void Cfps::WriteEepromDataCnf ADDRESS_TYPE  nAddress,
unsigned int  uiLength
[private, virtual]
 

this function will be call when a WriteEepromCnf was received

Parameter:
received address, received length
Rückgabe:
---

Implementiert CTCPIPConnector.

void Cfps::WriteEepromDataReq ADDRESS_TYPE  nAddress,
unsigned int  uiLength,
const std::vector< unsigned char > &  aucData
[private, virtual]
 

this function will be call when a WriteEepromReq was received It sends a signal to the working thread.

You can catch those signals be using WaitForData

Parameter:
received address, received length, data which should be written
Rückgabe:
---

Implementiert CTCPIPConnector.

bool Cfps::WriteFpsEeprom ADDRESS_TYPE  nAddress,
unsigned int  uiLength,
std::vector< unsigned char >  aucData
[protected]
 

write a block of data to eeprom memory in the fps device

Parameter:
address of the block to write,
length of the block,
data to write
Rückgabe:
true operation successfull

false else

bool Cfps::WriteFpsProgram ADDRESS_TYPE  nAddress,
unsigned int  uiLength,
std::vector< unsigned char >  aucData
[protected]
 

write a block of data to program memory in the fps device

Parameter:
address of the block to write,
length of the block,
data to write
Rückgabe:
true operation successfull

false else

bool Cfps::WriteFpsRam ADDRESS_TYPE  nAddress,
unsigned int  uiLength,
std::vector< unsigned char >  aucData
[protected]
 

write a block of data to ram memory in the fps device

Parameter:
address of the block to write,
length of the block,
data to write
Rückgabe:
true operation successfull

false else

void Cfps::WriteProfileFile std::string  sFilename  ) 
 

write address data to profile file

write tcpip address, portnumber, receive timeout value and internal used timeout value ( this value will be used as timeout value for communication will the separated received thread ), strings for communication with a modem

Parameter:
filename of the profile file
Rückgabe:
---

void Cfps::WriteProgramDataCnf ADDRESS_TYPE  nAddress,
unsigned int  uiLength
[private, virtual]
 

this function will be call when a WriteProgramCnf was received

Parameter:
received address, received length
Rückgabe:
---

Implementiert CTCPIPConnector.

void Cfps::WriteProgramDataReq ADDRESS_TYPE  nAddress,
unsigned int  uiLength,
const std::vector< unsigned char > &  aucData
[private, virtual]
 

this function will be call when a WriteProgramReq was received It sends a signal to the working thread.

You can catch those signals be using WaitForData

Parameter:
received address, received length, data which should be written
Rückgabe:
---

Implementiert CTCPIPConnector.

void Cfps::WriteRamDataCnf ADDRESS_TYPE  nAddress,
unsigned int  uiLength
[private, virtual]
 

this function will be call when a WriteRamCnf was received

Parameter:
received address, received length
Rückgabe:
---

Implementiert CTCPIPConnector.

void Cfps::WriteRamDataReq ADDRESS_TYPE  nAddress,
unsigned int  uiLength,
const std::vector< unsigned char > &  aucData
[private, virtual]
 

this function will be call when a WriteRamReq was received

Parameter:
received address, received length, data which should be written
Rückgabe:
---

Implementiert CTCPIPConnector.

bool Cfps::WriteSensor SENSOR_TYPE  NewSensorValues  ) 
 

Writes the overgiven values into the fps input buffer ( see ReadSensor for details ).

Parameter:
values to write ( struct SENSOR_TYPE )
Rückgabe:
true : operation was successfull, false else


Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Dateien:
Erzeugt am Tue Mar 11 14:25:17 2008 für SchunkFPS von doxygen 1.3.7