Changeset 1804 for trunk/MagicSoft/Cosy/devdrv/macs.cc
- Timestamp:
- 03/02/03 17:08:13 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/devdrv/macs.cc
r1758 r1804 31 31 : NodeDrv(nodeid, name, out), fMacId(2*nodeid+1), 32 32 fPos(0), fPosTime(0.0), fPdoPos(0), fPdoTime(0.0), 33 fPosActive(0), fRpmActive(0) 33 fPosActive(0), fRpmActive(0), fStatusPdo3(0xff) 34 34 { 35 35 // fTimeout = new TTimer(this, 100); //, kFALSE); // 100ms, asynchronous … … 57 57 58 58 case 0x2002: 59 cout << GetNodeName() << ": Actualvelocity: " << dec << val << endl;59 cout << GetNodeName() << ": Current velocity: " << dec << val << endl; 60 60 fVel = val; 61 61 return; … … 273 273 SetNoWait(TRUE); 274 274 275 StartGuarding(100, 2);276 StartHostGuarding();275 // StartGuarding(500, 2); 276 // StartHostGuarding(); 277 277 } 278 278 … … 300 300 SetPDO1On(FALSE); 301 301 302 lout << "- " << GetNodeName() << ": Motor off." << endl; 303 SendSDO(0x3000, string('o', 'f', 'f')); 304 WaitForSdo(0x3000); 302 /* 303 lout << "- " << GetNodeName() << ": Motor off." << endl; 304 SendSDO(0x3000, string('o', 'f', 'f')); 305 WaitForSdo(0x3000); 306 */ 305 307 306 308 /* … … 550 552 } 551 553 554 void Macs::HandlePDO3(BYTE_t *data, timeval_t *tv) 555 { 556 // 3 5 7 9 557 // 1100 1010 1110 1001 558 if (fStatusPdo3 == data[3]) 559 return; 560 561 lout << GetNodeName() << ": Status PDO3 = "; 562 const Bool_t ready = data[3]&0x01; 563 const Bool_t fuse = data[3]&0x02; 564 const Bool_t emcy = data[3]&0x04; 565 const Bool_t vltg = data[3]&0x08; 566 const Bool_t mode = data[3]&0x10; 567 const Bool_t rf = data[3]&0x20; 568 const Bool_t brake = data[3]&0x40; 569 if (ready) lout << "DKC-Ready "; 570 if (fuse) lout << "FuseOk "; 571 if (emcy) lout << "EmcyOk "; 572 if (vltg) lout << "OvervoltOk "; 573 if (mode) lout << "SwitchToManualMode "; 574 if (rf) lout << "RF "; 575 if (brake) lout << "BrakeOpen "; 576 lout << endl; 577 578 fStatusPdo3 = data[3]; 579 } 580 552 581 // FIXME? Handling of fIsZombie? 553 582 void Macs::HandleError()
Note:
See TracChangeset
for help on using the changeset viewer.