02-04-2003 05:06 AM
02-04-2003 09:50 AM
02-04-2003 10:06 AM
02-05-2003 04:34 AM
07-14-2013 09:40 AM
I found the BOOL type occupies 4bytes instead of one BYTE. Hence declare BYTE in place of BOOL. Other date types does not have any influence.
Chcek the structure size with BYTE instead of BOOL.... You will get what you want
#pragma pack(push,PLC_TO_HMI,1)//pop,1)//,MyPackedData,1)
typedef struct
{
INT16 ifMachineMode;
char sMessage[101];
char sAlaram[101];
BYTE bfAutoOn;
BYTE bfAutoDone;
float LoadArray[10000];
double DistanceArray[10000];
float TorqueArray[10000];
double AngleArray[10000];
float rfUnlockLoadResult;
double rfUnlockAngleResult;
INT16 ifUnlockPlotPoints;
INT16 ifTiltPlotPoints;
INT16 ifLockPlotPoints;
float rfLockLoadResult;
double rfLockAngleResult;
double rfSlipDistanceResult;
float rfTiltLoadResult;
INT32 ifAdLoad;
INT32 ifAdTorque;
BYTE bfPassMsg;
BYTE bfFailMsg;
INT16 ifCycleDone;
INT16 ifOkCount;
INT16 ifNgCount;
float rfCycleTime;
float rfCurrentLoad;
double rfCurrentDistance;
float rfCurrentTorque;
double rfCurrentAngle;
BYTE Blinker500;
} PLC_TO_HMI;
PLC_TO_HMI Plc2Hmi;