Ignore:
Timestamp:
03/02/03 17:08:13 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/devdrv/macs.cc

    r1758 r1804  
    3131    : NodeDrv(nodeid, name, out), fMacId(2*nodeid+1),
    3232    fPos(0), fPosTime(0.0), fPdoPos(0), fPdoTime(0.0),
    33     fPosActive(0), fRpmActive(0)
     33    fPosActive(0), fRpmActive(0), fStatusPdo3(0xff)
    3434{
    3535//    fTimeout = new TTimer(this, 100); //, kFALSE); // 100ms, asynchronous
     
    5757
    5858    case 0x2002:
    59         cout << GetNodeName() << ": Actual velocity: " << dec << val << endl;
     59        cout << GetNodeName() << ": Current velocity: " << dec << val << endl;
    6060        fVel = val;
    6161        return;
     
    273273    SetNoWait(TRUE);
    274274
    275     StartGuarding(100, 2);
    276     StartHostGuarding();
     275    //    StartGuarding(500, 2);
     276    //    StartHostGuarding();
    277277}
    278278
     
    300300    SetPDO1On(FALSE);
    301301
    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     */
    305307
    306308    /*
     
    550552}
    551553
     554void 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
    552581// FIXME? Handling of fIsZombie?
    553582void Macs::HandleError()
Note: See TracChangeset for help on using the changeset viewer.