FACT++  1.0
void ConnectionDrive::HandlePdo3 ( const uint8_t &  node,
const uint8_t *  data,
const Time tv 
)
inlineprivate

Definition at line 787 of file drivectrl.cc.

References mode.

788  {
789  /*
790  TX1M_STATUS.0 := 1;
791  TX1M_STATUS.1 := ((NOT X_in_Standstill OR NOT X_in_AntriebHalt) AND (NOT X_PC_VStart AND NOT X_in_Pos)) OR X_PC_AnnounceStartMovement;
792  TX1M_STATUS.2 := X_PC_VStart;
793  TX1M_STATUS.6 := NOT X_ist_freigegeben;
794 
795  TX3M_STATUS.0 := X_ist_betriebsbereit;
796  TX3M_STATUS.1 := 1;
797  TX3M_STATUS.2 := Not_Aus_IO;
798  TX3M_STATUS.3 := UeberspannungsSchutz_OK;
799  TX3M_STATUS.4 := FB_soll_drehen_links OR FB_soll_drehen_rechts OR FB_soll_schwenk_auf OR FB_soll_schwenk_ab;
800  TX3M_STATUS.5 := X_ist_freigegeben;
801  TX3M_STATUS.6 := 1;
802  TX3M_STATUS.7 := LeistungEinAz;
803 
804  TX3M_STATUS.8 := NOT UPS_ALARM;
805  TX3M_STATUS.9 := UPS_BattMode;
806  TX3M_STATUS.10 := UPS_Charging;
807  */
808 
809  const uint8_t sys = ((data[0] & 0x1c)<<2) | (data[1]);
810  if (fStatusSys!=sys)
811  {
812  fStatusSys = sys;
813 
814  const bool alarm = sys&kUpsAlarm; // 01 TX3M.8 100
815  const bool batt = sys&kUpsBattery; // 02 TX3M.9 200
816  const bool charge = sys&kUpsCharging; // 04 TX3M.10 400
817  const bool emcy = sys&kEmergencyOk; // 10 TX3M.2 04
818  const bool vltg = sys&kOvervoltOk; // 20 TX3M.3 08
819  const bool mode = sys&kManualMode; // 40 TX3M.4 10
820 
821  ostringstream out;
822  if (alarm) out << " UPS-PowerLoss";
823  if (batt) out << " UPS-OnBattery";
824  if (charge) out << " UPS-Charging";
825  if (emcy) out << " EmcyOk";
826  if (vltg) out << " OvervoltOk";
827  if (mode) out << " ManualMove";
828 
829  Info("New system status["+to_string(node)+"]:"+out.str());
830  if (fVerbosity>1)
831  Out() << "PDO3[" << (int)node << "] StatusSys=" << hex << (int)fStatusSys << dec << endl;
832  }
833 
834  const uint8_t axis = (data[0]&0xa1) | (data[3]&0x06);
835  if (fStatusAxis[node/2]!=axis)
836  {
837  fStatusAxis[node/2] = axis;
838 
839  const bool ready = axis&kAxisBb; // 01
840  const bool move = axis&kAxisMoving; // 02
841  const bool rpm = axis&kAxisRpmMode; // 04
842  const bool rf = axis&kAxisRf; // 20
843  const bool power = axis&kAxisHasPower; // 80
844 
845  ostringstream out;
846  if (ready) out << " DKC-Ready";
847  if (move) out << " Moving";
848  if (rpm) out << " RpmMode";
849  if (rf) out << " RF";
850  if (power) out << " PowerOn";
851 
852  Info("New axis status["+to_string(node)+"]:"+out.str());
853  if (fVerbosity>1)
854  Out() << "PDO3[" << (int)node << "] StatusAxis=" << hex << (int)fStatusAxis[node/2] << dec << endl;
855  }
856 
857  array<uint8_t, 3> arr = {{ fStatusAxis[0], fStatusAxis[1], fStatusSys }};
858  UpdateStatus(tv, arr);
859  }
Definition: dns.c:26
uint8_t fStatusSys
Definition: drivectrl.cc:768
uint8_t fStatusAxis[2]
Definition: drivectrl.cc:767
int mode
std::ostream & Out()
Definition: Connection.h:51
virtual void UpdateStatus(const Time &, const array< uint8_t, 3 > &)
Definition: cosyctrl.cc:67
uint16_t fVerbosity
Definition: drivectrl.cc:484
float data[4 *1440]
int Info(const std::string &str)
Definition: MessageImp.h:47