Changeset 19416


Ignore:
Timestamp:
Dec 5, 2018, 8:40:02 PM (9 months ago)
Author:
tbretz
Message:
Allow RECONNECT also if the IndraDrives are unavailable. Allow to propagate an error in PDO2 (the default in our PLCs is 'no error')
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/drivectrl.cc

    r19386 r19416  
    805805        kAxisRpmMode  = 0x04,  // SPS reports
    806806        kAxisRf       = 0x20,  // IndraDrive reports Rf (Regler freigegeben)
     807        kAxisError    = 0x40,  // IndraDrive reports an error
    807808        kAxisHasPower = 0x80   // IndraDrive reports axis power on
    808809    };
     
    824825         TX3M_STATUS.4  := FB_soll_drehen_links OR FB_soll_drehen_rechts OR FB_soll_schwenk_auf OR FB_soll_schwenk_ab;
    825826         TX3M_STATUS.5  := X_ist_freigegeben;
    826          TX3M_STATUS.6  := 1;
     827         TX3M_STATUS.6  := NOT X_Fehler; (only in MATE, FACT==1)
    827828         TX3M_STATUS.7  := LeistungEinAz;
    828829
     
    857858        }
    858859
    859         const uint8_t axis = (data[0]&0xa1) | (data[3]&0x06);
     860        const uint8_t axis = (data[0]&0xa1) | (data[3]&0x46);
    860861        if (fStatusAxis[node/2]!=axis)
    861862        {
     
    866867            const bool rpm    = axis&kAxisRpmMode;  // 04
    867868            const bool rf     = axis&kAxisRf;       // 20
     869            const bool err    = axis&kAxisError;    // 40
    868870            const bool power  = axis&kAxisHasPower; // 80
    869871
    870872            ostringstream out;
    871873            if (ready)  out << " DKC-Ready";
    872             if (move)   out << " Moving";
     874            if (move && !err)
     875                        out << " Moving";
    873876            if (rpm)    out << " RpmMode";
    874877            if (rf)     out << " RF";
    875878            if (power)  out << " PowerOn";
     879            if (err)    out << " ERROR";
    876880
    877881            Info("New axis status["+string(node==kNodeAz?"Az":"Zd")+"]:"+out.str());
     
    29162920
    29172921        // Conenction commands
    2918         T::AddEvent("DISCONNECT", State::kConnected)
     2922        T::AddEvent("DISCONNECT", State::kConnected, State::kUnavailable)
    29192923            (bind(&StateMachineDrive::Disconnect, this))
    29202924            ("disconnect from ethernet");
    29212925
    2922         T::AddEvent("RECONNECT", "O", State::kDisconnected, State::kConnected)
     2926        T::AddEvent("RECONNECT", "O", State::kDisconnected, State::kConnected, State::kUnavailable)
    29232927            (bind(&StateMachineDrive::Reconnect, this, placeholders::_1))
    29242928            ("(Re)connect Ethernet connection to SPS, a new address can be given"
Note: See TracChangeset for help on using the changeset viewer.