28 (
int boardnr,
int nodeid, RCS_MESSAGETELEGRAM_10& _telegramm){
31 readConfigurationMessage(_telegramm);
32 rlDebugPrintf(
"Initialising new node...\n BoardNr. %d NodeId %d Productstr %s ...",
33 boardnr, nodeid, abDeviceName.ascii());
35 ini = getEDS(abDeviceName);
39 rlDebugPrintf(
" ProductName=%s \n ", ini->text(
"DeviceInfo",
"ProductName"));
40 rlDebugPrintf(
" Filename=%s \n ", ini->text(
"FileInfo",
"FileName"));
42 objdir =
new ObjDir(ini);
46 rlDebugPrintf(
"ERROR!\n NO EDS FILE FOUND FOR \"%s\"!\n", abDeviceName.ascii());
55 rlDebugPrintf(
" PDO Gr�en:transmit PDOs: %d receive PDOs: %d\n",
60 while(objdir->OVAdressExists(adr,0) == 0)
66 rlDebugPrintf(
"ERROR IN EDS FILE: errorous number of Mapping entries\n");
78 while(objdir->OVAdressExists(adr,0) == 0)
84 rlDebugPrintf(
"ERROR IN EDS FILE: errorous number of Mapping entries\n");
112 QString dirname(getenv(
"EdsDir"));
113 if (dirname.isEmpty()){
116 QString productname(_productstr);
117 QDir edsdir(dirname);
118 edsdir.setNameFilter(
"*.EDS; *.eds");
119 QStringList::Iterator dirit;
121 dirlist = edsdir.entryList();
123 for ( dirit = dirlist.begin(); dirit != dirlist.end(); ++dirit ) {
130 exportname =QString(_ini->
text(
"DeviceInfo",
"ProductName"));
131 searchval = exportname.contains(productname,
false);
147 usIdentNumber = (
unsigned short) (_message.d[2]+_message.d[1]*pow(256,1));
148 usVendorIdent = (
unsigned short) (_message.d[4]+_message.d[3]*pow(256,1));
171 tempPDO->
bPDOSize = _message.d[startadress+k+1];
174 (_message.d[startadress+k+3]*pow(256,0)
175 + _message.d[startadress+k+4]);
202 cout<<
"\n\n******** Configuration Board " 210 cout<<
"\n PDO count :"<<int(
pdocount);
214 cout<<
"\n\n - - - - PDOs -> - - - - -";
218 cout<<
"\n+ PDO No. "<<j;
219 cout<<
"\nPDO Direction :Send PDO";
227 cout<<
"\n+ PDO No. "<<j;
228 cout<<
"\nPDO Direction :Receive PDO";
234 cout<<
"\n **********************************************\n\n";
256 edsbuffer =
objdir->get_objparameter(ObjDir::DATATYPE, objindex, subindex);
263 if (edsbuffer ==
"ERROR"){
266 edsbuffer.remove(
"0x");
267 typenr = edsbuffer.toInt(&ok, 16);
296 if (
objdir==0)
return false;
int rlDebugPrintf(const char *format,...)
#define DIRECTION_RECEIVE
definition of CanOpen structs for CanOpen Deamon
int nodeID
current node ID (1-127)
#define TRANSMIT_PDO_MAPPING_MAXADRESS
const char * text(const char *section, const char *name)
int getBoardID()
returns the board ID the node is connected to.
#define DATA_DIRECTION_MASK
unsigned short usPDOAddress
fixes the PDO position in the card memory
#define DIRECTION_TRANSMIT
int objecttype(int objindex, int subindex)
returns the type of a specific entry in the object directory
int read(const char *filename)
unsigned char usVendorIdent
Unique vendor number if available.
short bPDODirection
1 = receive PDO / 2 = send PDO [indicate by PDO No]
#define TRANSMIT_PDO_MAPPING_STARTADRESS
QPtrVector< rlCanPDO > pdoList[2]
contains transmit PDOs
unsigned char bPDOSize
size of a PDO / max 8 Bytes
int boardID
curent board ID (0-3)
unsigned char bDataPosition
if only one bit is set in a PDO, this value shows its position
#define RECEIVE_PDO_MAPPING_MAXADRESS
QString abVendorName
specific node informations. extracted from message telegramm
int getNodeID()
returns the current node ID of the node
rlIniFile * getEDS(const char *_productstr)
finds the eds file matching the product string in [DeviceInfo] ProductName
unsigned char bMasterAddress
int getPdoCount()
returns the current number of all installed PDOs (Process Data Objects)
void readConfigurationMessage(RCS_MESSAGETELEGRAM_10 &_message)
reads out the configuration of a node from the CanOpenMaster board
void showConfiguration()
prints out the configuration of the node
#define RECEIVE_PDO_MAPPING_STARTADRESS
int getTransmitPdoCount()
returns the current number of all installed transmit PDOs
int getReceivePdoCount()
returns the current number of all installed reiceive PDOs
unsigned short usIdentNumber
Unique device number if available.
PDO object which is part of one of the two pdo lists in the node class.
bool hasMapping()
indicates if a node available mapping
~rlCanNode()
calls destructors of rlinifile obj and objdir