diff --git a/dll/commdll.dll b/dll/commdll.dll index f9e2da5..c1ea9c8 100644 Binary files a/dll/commdll.dll and b/dll/commdll.dll differ diff --git a/dll/commdllD.dll b/dll/commdllD.dll index 5edecee..0eeca83 100644 Binary files a/dll/commdllD.dll and b/dll/commdllD.dll differ diff --git a/dll/iodll.dll b/dll/iodll.dll index 28eb6c5..eb12470 100644 Binary files a/dll/iodll.dll and b/dll/iodll.dll differ diff --git a/dll/iodllD.dll b/dll/iodllD.dll index 7a72648..d244502 100644 Binary files a/dll/iodllD.dll and b/dll/iodllD.dll differ diff --git a/dll/mcctrdll.dll b/dll/mcctrdll.dll index 2bf7a26..8ac2489 100644 Binary files a/dll/mcctrdll.dll and b/dll/mcctrdll.dll differ diff --git a/dll/mcctrdllD.dll b/dll/mcctrdllD.dll index ff1bd3d..2b06471 100644 Binary files a/dll/mcctrdllD.dll and b/dll/mcctrdllD.dll differ diff --git a/dll/secsgemdll.dll b/dll/secsgemdll.dll index 20f2326..bd4e8ea 100644 Binary files a/dll/secsgemdll.dll and b/dll/secsgemdll.dll differ diff --git a/dll/secsgemdllD.dll b/dll/secsgemdllD.dll index b27a673..e7c18a5 100644 Binary files a/dll/secsgemdllD.dll and b/dll/secsgemdllD.dll differ diff --git a/dll/utility.dll b/dll/utility.dll index 3c575af..27f4acd 100644 Binary files a/dll/utility.dll and b/dll/utility.dll differ diff --git a/dll/utilityD.dll b/dll/utilityD.dll index 2a7be38..d44b46b 100644 Binary files a/dll/utilityD.dll and b/dll/utilityD.dll differ diff --git a/iodll/Include/InputStatus.h b/iodll/Include/InputStatus.h index dadff0c..8e85065 100644 --- a/iodll/Include/InputStatus.h +++ b/iodll/Include/InputStatus.h @@ -8,8 +8,16 @@ namespace nsMMF { // !!! Do Not change the order to support MMF use case using InputStatus = struct _InputStatus { - char PtName[100]{}; + char PtName[80]{}; bool On{ false }; + // Padding + bool Padding1{ false }; + bool Padding2{ false }; + bool Padding3{ false }; + bool Padding4{ false }; + bool Padding5{ false }; + bool Padding6{ false }; + bool Padding7{ false }; // Assignment operator overload _InputStatus& operator=(const _InputStatus& rhs) diff --git a/iodll/Include/Motor.h b/iodll/Include/Motor.h index 0bb62dc..6e94882 100644 --- a/iodll/Include/Motor.h +++ b/iodll/Include/Motor.h @@ -118,9 +118,9 @@ enum MOTION_STATUS { + MOTION_END, MOTION_HOMING, MOTION_MOVING, - MOTION_END, MOTION_LIMIT_POS_HIT, MOTION_LIMIT_NEG_HIT, MOTION_LIMIT_HIT, diff --git a/iodll/Include/MotorStatus.h b/iodll/Include/MotorStatus.h index ceae6da..e65f2be 100644 --- a/iodll/Include/MotorStatus.h +++ b/iodll/Include/MotorStatus.h @@ -7,44 +7,47 @@ namespace nsMMF { // !!! Do Not change the order to support MMF use case - using MotorStatus = struct _MotorStatus { - bool NegLimHit{ false }; // 0 - bool PosLimHit{ false }; // 1 - bool Homed{ false }; // 2 - bool ServoReady{ false }; // 3 - bool ServoAlarm{ false }; // 4 - bool InPosition{ false }; // 5 - bool MtrOn{ false }; // 6 - bool MtrCurOnOff{ false }; // 7 // array to store motor On/Off States before maintenance mode - double MtrPos{ 0. }; // 8 - double PosErr{ 0. }; // 16 - unsigned short MotionStatus{ 0 }; // 24 - unsigned short Status{ 0 }; // 26 - int MtrNo{ 0 }; // 28 // motor no wrt the type of card used - int MtrType{ 0 }; // 32 // servo or stepper, with or without encoder feedback - int MtrCurPos{ 0 }; // 36 // array to store motor position before maintenance mode - char MotorName[104]{ "AACC" }; // 40~ 144 (original size 4 bytes - but has to end on a 8-byte align address) + using MotorStatus = struct _MotorStatus + { + char MotorName[80]{}; // offset 0 : 80 byte to align to 8 bytes + + bool NegLimHit{ false }; // 80 + bool PosLimHit{ false }; // 81 + bool Homed{ false }; // 82 + bool ServoReady{ false }; // 83 + bool ServoAlarm{ false }; // 84 + bool InPosition{ false }; // 85 + bool MtrOn{ false }; // 86 + bool MtrCurOnOff{ false }; // 87 // array to store motor On/Off States before maintenance mode + double MtrPos{ 0. }; // 88 + double PosErr{ 0. }; // 96 + unsigned short MotionStatus{ 0 }; // 104 + unsigned short Status{ 0 }; // 106 + int MtrNo{ 0 }; // 108 // motor no wrt the type of card used + int MtrType{ 0 }; // 112 // servo or stepper, with or without encoder feedback + int MtrCurPos{ 0 }; // 116 // array to store motor position before maintenance mode // Assignment operator overload _MotorStatus& operator=(const _MotorStatus& rhs) { - NegLimHit = rhs.NegLimHit; - PosLimHit = rhs.PosLimHit; - Homed = rhs.Homed; - ServoReady = rhs.ServoReady; - ServoAlarm = rhs.ServoAlarm; - InPosition = rhs.InPosition; - MtrOn = rhs.MtrOn; - MtrCurOnOff = rhs.MtrCurOnOff; - MtrPos = rhs.MtrPos; - PosErr = rhs.PosErr; - MotionStatus = rhs.MotionStatus; - Status = rhs.Status; - MtrNo = rhs.MtrNo; - MtrType = rhs.MtrType; - MtrCurPos = rhs.MtrCurPos; // strcpy_s(MotorName, rhs.MotorName); + // + NegLimHit = rhs.NegLimHit; + PosLimHit = rhs.PosLimHit; + Homed = rhs.Homed; + ServoReady = rhs.ServoReady; + ServoAlarm = rhs.ServoAlarm; + InPosition = rhs.InPosition; + MtrOn = rhs.MtrOn; + MtrCurOnOff = rhs.MtrCurOnOff; + MtrPos = rhs.MtrPos; + PosErr = rhs.PosErr; + MotionStatus = rhs.MotionStatus; + Status = rhs.Status; + MtrNo = rhs.MtrNo; + MtrType = rhs.MtrType; + MtrCurPos = rhs.MtrCurPos; return *this; } @@ -61,6 +64,9 @@ namespace nsMMF inline void from_json(const json& j, MotorStatus& x) { + std::string name = j.at("MotorName").get(); + strcpy_s(x.MotorName, name.c_str()); + getValue(j, "NegLimHit", x.NegLimHit); getValue(j, "PosLimHit", x.PosLimHit); getValue(j, "Homed", x.Homed); @@ -76,31 +82,27 @@ namespace nsMMF getValue(j, "MtrNo", x.MtrNo); getValue(j, "MtrType", x.MtrType); getValue(j, "MtrCurPos", x.MtrCurPos); - //getValue(j, "MotorName", x.MotorName); - - std::string name = j.at("MotorName").get(); - strcpy_s(x.MotorName, name.c_str()); } inline void to_json(json& j, const MotorStatus& x) { j = nlohmann::json{ - { "NegLimHit", x.NegLimHit }, - { "PosLimHit", x.PosLimHit }, - { "Homed", x.Homed }, - { "ServoReady", x.ServoReady }, - { "ServoAlarm", x.ServoAlarm }, - { "InPosition", x.InPosition }, - { "MtrOn", x.MtrOn }, - { "MtrCurOnOff", x.MtrCurOnOff }, - { "MtrPos", x.MtrPos }, - { "PosErr", x.PosErr }, - { "MotionStatus", x.MotionStatus }, - { "Status", x.Status }, - { "MtrNo", x.MtrNo }, - { "MtrType", x.MtrType }, - { "MtrCurPos", x.MtrCurPos }, - { "MotorName", x.MotorName } + { "MotorName", x.MotorName }, + { "NegLimHit", x.NegLimHit }, + { "PosLimHit", x.PosLimHit }, + { "Homed", x.Homed }, + { "ServoReady", x.ServoReady }, + { "ServoAlarm", x.ServoAlarm }, + { "InPosition", x.InPosition }, + { "MtrOn", x.MtrOn }, + { "MtrCurOnOff", x.MtrCurOnOff }, + { "MtrPos", x.MtrPos }, + { "PosErr", x.PosErr }, + { "MotionStatus", x.MotionStatus }, + { "Status", x.Status }, + { "MtrNo", x.MtrNo }, + { "MtrType", x.MtrType }, + { "MtrCurPos", x.MtrCurPos } }; } diff --git a/iodll/Include/OutputStatus.h b/iodll/Include/OutputStatus.h index 7d7bd9e..7d81714 100644 --- a/iodll/Include/OutputStatus.h +++ b/iodll/Include/OutputStatus.h @@ -8,10 +8,16 @@ namespace nsMMF { // !!! Do Not change the order to support MMF use case using OutputStatus = struct _OutputStatus { - char PtName[100]{}; + char PtName[80]{}; bool On{ false }; bool RequestChgState{ false }; bool ChgStateOn{ false }; + // Padding + bool Padding1{ false }; + bool Padding2{ false }; + bool Padding3{ false }; + bool Padding4{ false }; + bool Padding5{ false }; // Assignment operator overload _OutputStatus& operator=(const _OutputStatus& rhs) @@ -22,6 +28,13 @@ namespace nsMMF On = rhs.On; RequestChgState = rhs.RequestChgState; ChgStateOn = rhs.ChgStateOn; + // + Padding1 = rhs.Padding1; + Padding2 = rhs.Padding2; + Padding3 = rhs.Padding3; + Padding4 = rhs.Padding4; + Padding5 = rhs.Padding5; + // return *this; } };