6 #include "EcErrorSGDV.h"
9 #include <soem/ethercattype.h>
10 #include <soem/ethercatbase.h>
11 #include <soem/ethercatmain.h>
12 #include <soem/ethercatconfig.h>
13 #include <soem/ethercatdc.h>
14 #include <soem/nicdrv.h>
15 #include <soem/ethercatcoe.h>
16 #include <soem/ethercatprint.h>
27 unsigned int byteSize;
75 CW_DIASABLE_OP = 0x07,
76 CW_DISABLE_VOLTAGE = 0x00,
77 CW_FAULT_RESET = 0x80,
98 SW_NOT_READY_SWICH_ON = 0x00,
99 SW_SWITCH_ON_DISABLED = 0x40,
100 SW_READY_SWITCH_ON = 0x31,
101 SW_SWITCHED_ON = 0x33,
102 SW_OPERATION_ENABLED = 0x37,
103 SW_QUICK_STOP_ACTIVE = 0x07,
105 SW_FAULT_RACTION_ACTIVE = 0x0F,
106 SW_HIGH_MASK = 0x00FF,
107 SW_LOW_MASK = 0xFF00,
127 const std::string&
getName()
const;
143 void start() throw(EcErrorSGDV);
159 void stop() throw(EcErrorSGDV);
171 void setDC(
bool active,
unsigned int sync0Time,
unsigned int sync0Shift) throw(EcErrorSGDV);
192 bool writePDO (EcPDOEntry entry,
int value);
201 bool readPDO (EcPDOEntry entry,
int &value);
303 void setSGDVObject(uint16_t index, uint8_t subindex,
int psize,
void * param);
314 void getSGDVObject(uint16_t index, uint8_t subindex,
int *psize,
void *param);
323 boost::signals2::signal<
void (
int, uint16_t, int32_t, int32_t, int16_t, int64_t)>
slaveValues;
350 bool readXML() throw(EcErrorSGDV);
351 bool enableSpecificFunctions();
352 void loadDefaultPDO();
353 void loadParameters();
354 void si_PDOassign(uint16 slave, uint16 PDOassign);
356 int controlWordEntry;
357 int targetPositionEntry;
358 int targetVelocityEntry;
359 int targetTorqueEntry;
361 int actualPositionEntry;
362 int actualVelocityEntry;
363 int actualTorqueEntry;
365 bool wControlWordCapable;
366 bool wPositionCapable;
367 bool wVelocityCapable;
369 bool rStatusWordCapable;
370 bool rPositionCapable;
371 bool rVelocityCapable;
373 bool parameterSetting;
379 std::mutex slaveOutMutex;
380 std::mutex slaveInMutex;
384 std::mutex slaveInMutex;
387 std::vector <CoEparameter> m_params;
388 std::vector <PDOobject> inputObjects;
389 std::vector <PDOobject> outputObjects;
394 CONTROL_WORD = 0x6040,
395 TARGET_POSITION = 0x607A,
396 TARGET_VELOCITY = 0x60FF,
397 TARGET_TORQUE = 0x6071,
402 STATUS_WORD = 0x6041,
403 ACTUAL_POSITION = 0x6064,
404 ACTUAL_VELOCITY = 0x606C,
405 ACTUAL_TORQUE = 0x6077,
Definition: EcSlaveSGDV.h:85
Class EcSlave.
Definition: EcSlave.h:53
bool writePosition(int32_t position)
Write on the position object.
Definition: EcSlaveSGDV.cpp:311
void update()
Update the data.
Definition: EcSlaveSGDV.cpp:66
Definition: EcSlaveSGDV.h:32
EcPDOEntry
Definition: EcSlaveSGDV.h:54
bool readPDO(EcPDOEntry entry, int &value)
Read on the input PDOentry.
Definition: EcSlaveSGDV.cpp:231
Definition: EcSlaveSGDV.h:88
EcStatusWord
Definition: EcSlaveSGDV.h:96
Definition: EcSlaveSGDV.h:81
const std::string & getName() const
Gets the name.
Definition: EcSlaveSGDV.cpp:86
bool writeControlWord(uint16_t controlWord)
Write on the Controlword object.
Definition: EcSlaveSGDV.cpp:278
bool writePDO(EcPDOEntry entry, int value)
Writes on the output PDOentry.
Definition: EcSlaveSGDV.cpp:211
bool readActualValue(ActualValue &value)
read Actual values structure
Definition: EcSlaveSGDV.cpp:253
EcSlaveSGDV(ec_slavet *mem_loc)
Constructor.
Definition: EcSlaveSGDV.cpp:31
bool writeTorque(int16_t torque)
Write on the torque object.
Definition: EcSlaveSGDV.cpp:376
void setSGDVObject(uint16_t index, uint8_t subindex, int psize, void *param)
Set an SGDV object.
Definition: EcSlaveSGDV.cpp:822
boost::signals2::signal< void(int, uint16_t, int32_t, int32_t, int16_t, int64_t)> slaveValues
A signal to emit information.
Definition: EcSlaveSGDV.h:323
Class EcSlaveSGDV.
Definition: EcSlaveSGDV.h:47
bool writeVelocity(int32_t velocity)
Write on the velocity object.
Definition: EcSlaveSGDV.cpp:344
~EcSlaveSGDV()
Destructor.
Definition: EcSlaveSGDV.cpp:59
Definition: EcSlaveSGDV.h:84
Class EcErrorSGDV.
Definition: EcErrorSGDV.h:11
bool readPosition(int32_t &position)
Read the position object.
Definition: EcSlaveSGDV.cpp:328
bool readVelocity(int32_t &velocity)
Read the velocity object.
Definition: EcSlaveSGDV.cpp:360
EcControlWord
Definition: EcSlaveSGDV.h:69
void stop()
Stop motors.
Definition: EcSlaveSGDV.cpp:176
void setPDOBuffer(char *input, char *output)
Sets locations Buffer.
Definition: EcSlaveSGDV.cpp:165
bool readStatusWord(uint16_t &statusWord)
Read the Statusword object.
Definition: EcSlaveSGDV.cpp:295
void start()
Start motors.
Definition: EcSlaveSGDV.cpp:127
void setDC(bool active, unsigned int sync0Time, unsigned int sync0Shift)
Set DC.
Definition: EcSlaveSGDV.cpp:158
bool readTimestamp(int64 &time)
Read the actual timestamp.
Definition: EcSlaveSGDV.cpp:196
bool readTorque(int16_t &torque)
Read the torque object.
Definition: EcSlaveSGDV.cpp:392
void getSGDVObject(uint16_t index, uint8_t subindex, int *psize, void *param)
Set an SGDV object.
Definition: EcSlaveSGDV.cpp:827
Definition: EcSlaveSGDV.h:83
bool configure()
Configure the SGDV servopack.
Definition: EcSlaveSGDV.cpp:91
Definition: EcSlaveSGDV.h:79
Definition: EcMaster.h:37