#pragma once #include "ZZ_Types.h" #define MAXBUFFER 10240 using namespace ZZ_MISCDEF; typedef struct tagTransportLayerInfomation { //Serial int iPortType; int iPortNumber; int indexBaudRate; int iBaudRate; int indexParity, indexBytesize, indexStopBits; //Mode bool Hw; bool Sw; bool Dtr, Rts; //Bit //Stop //MODEM CONTROL setting //MODEM LINE STATUS //TCP UDP }PortInfo; typedef struct tagMotorStatusInfo { float fVelocity; int iPosition; ZZ_U32 uiFlags; }MSInfo; typedef struct tagControllerParams { int bdr; //baud int mcs; //microsteps 0:full 1:half 2:4 3:8 4:16 5:32 6:64 7:128 8:256 float spd; //velocity float acc; //acceleration float dec; //deceleration float cra; //acc state current float crn; //normal state current float crh; //hold state current ZZ_U8 s1f; ZZ_U8 s1r; ZZ_U8 s2f; ZZ_U8 s2r; ZZ_U8 zmd; //zero mode ZZ_U8 osv; //open state sensor value ZZ_U8 snr; //zero sensor ZZ_U8 zsp; //zero safe position float zsd; //zero velocity }ControllerParams; typedef union { ZZ_U8 byteValue[4]; short i16Value[2]; ZZ_U16 u16Value[2]; int i32Value; float fValue; ZZ_U32 u32Value; }unValue; enum emVSMDTriggerEvent { NoAction =0, //无动作(只有状态位 S1 变化通知) ResetZeroPosition, //重新设置原点位置 DecSpdStop, //减速停止 DecSpdStopRZP, //减速停止,并在停止后重新设置原点位置 Stop, //立刻停止 StopRZP, //立刻停止,并在停止后重新设置原点位置 RunningPosDirect, //正向连续运转(正速度) RunningNegDirect, //反向连续运转(负速度) OfflineModeOn, //离线模式启动 OfflineModeOff //离线模式停止 };