| | |
| | | #define LoHofB(x) ((x)&0xf)
|
| | | #define HiHofB(x) (((x)>>4)&0xf)
|
| | |
|
| | | // ��Ϣ��
|
| | | // �����������ÿ�
|
| | | // �û�/ϵͳ�������ÿ�
|
| | | // 信息块
|
| | | // 工厂参数配置块
|
| | | // 用户/系统参数配置块
|
| | | //
|
| | | //
|
| | |
|
| | |
| | |
|
| | | enum enPortType
|
| | | {
|
| | | PortType_Com = 0, //�����ͨѶ
|
| | | PortType_Gen = 1, //ͨ��ͨѶ�����ɿ�
|
| | | PortType_Com = 0, //计算机通讯
|
| | | PortType_Gen = 1, //通用通讯,自由口
|
| | | PortType_KLink = 2, //KlinkͨѶ
|
| | | PortType_KBus = 3, //KBusͨѶ
|
| | | PortType_KNet = 4, // KNetͨѶ
|
| | | PortType_ModbusRTU = 5, //Modbus RTU ͨѶ
|
| | | };
|
| | |
|
| | | //ÿ��ģ���� 0/1/2/3/4/5/6/7/8�� ͨѶport
|
| | | //������ UART, ���ڣ����ߣ������ߵȣ�����port
|
| | | //���������������port
|
| | | //每个模块有 0/1/2/3/4/5/6/7/8个 通讯port
|
| | | //不限于 UART, 网口,无线,单总线等,都是port
|
| | | //甚至可以有虚拟的port
|
| | |
|
| | | typedef struct tagPortStat
|
| | | {
|
| | | UCHAR nWorking; //������
|
| | | UCHAR nStation; //�Լ�վ��
|
| | | UCHAR bBus; //����?,,ȫ˫��?
|
| | | UCHAR bMaster; //����
|
| | | UCHAR PortType; //�˿ڹ���ģʽ
|
| | | UCHAR nDevices; //���ӵ��豸����//�������Լ� //device list;
|
| | | UCHAR nWorking; //工作中
|
| | | UCHAR nStation; //自己站号
|
| | | UCHAR bBus; //总线?,,全双工?
|
| | | UCHAR bMaster; //主机
|
| | | UCHAR PortType; //端口工作模式
|
| | | UCHAR nDevices; //连接的设备数量//不包括自己 //device list;
|
| | |
|
| | | }stPortStat,*pPortStat;
|
| | |
|
| | |
| | |
|
| | | typedef struct tagKMFuncParam
|
| | | {
|
| | | USHORT EnablePLC:1; //ʹ���ڲ�PLC����
|
| | | USHORT RunMode; //����ģʽ
|
| | | USHORT EnablePLC:1; //使能内部PLC功能
|
| | | USHORT RunMode; //工作模式
|
| | | }stKMFuncParam;
|
| | |
|
| | | // ���������ַӳ��
|
| | | // 输入输出地址映射
|
| | |
|
| | | typedef struct tagComPortParam //4 Bytes
|
| | | {
|
| | |
| | | USHORT workmode; // SC1 // 2 Bytes 0=From jumper
|
| | | USHORT SwitchFunc; // SC2 // 2 Bytes
|
| | |
|
| | | USHORT OutMappings[6]; //12 Bytes //���ӳ��
|
| | | USHORT OutMappings[6]; //12 Bytes //输出映射
|
| | |
|
| | | stComPortParam PortParams[2]; // 8 Bytes
|
| | | stOutputHoldParam OutputParams[16]; //16 Bytes
|
| | |
| | | unsigned short EndSign1;
|
| | | }stStoredKMSysCfg,*pStoredKMSysCfg;
|
| | |
|
| | |
|
| | | /*
|
| | | typedef struct tagFactData
|
| | | {
|
| | |
| | |
|
| | | }stFactData;
|
| | | */
|
| | | typedef struct tagFactoryData //������������������
|
| | | typedef struct tagFactoryData //工厂量产参数,数据
|
| | | {
|
| | | USHORT Sign1;
|
| | | USHORT Seq1;
|
| | |
| | | stTimer Timers[TOTALTIMERS];
|
| | |
|
| | | union {
|
| | | unsigned short WX[KLDataWXCount]; //������X��Y
|
| | | unsigned short WX[KLDataWXCount]; //本机的X和Y
|
| | | unsigned char WXB[KLDataWXCount*2];
|
| | | };
|
| | | union {
|
| | | unsigned short WY[KLDataWYCount]; //������X��Y
|
| | | unsigned char WYB[KLDataWYCount*2]; //������X��Y
|
| | | unsigned short WY[KLDataWYCount]; //本机的X和Y
|
| | | unsigned char WYB[KLDataWYCount*2]; //本机的X和Y
|
| | | };
|
| | | unsigned short WR[KLDataWRCount];
|
| | |
|
| | |
| | | unsigned short SV[KLDataSVCount];
|
| | |
|
| | |
|
| | | unsigned short WLX[16]; //�����X��Y��Զ��ͨѶʱӳ���á�
|
| | | unsigned short WLX[16]; //虚拟的X和Y,远程通讯时映射用。
|
| | | unsigned short WLY[16];
|
| | | unsigned short WLR[16];
|
| | | unsigned short WSR[16];
|
| | |
| | | unsigned int DTD[KLDataDTCount];
|
| | | unsigned short DT[KLDataDTCount];
|
| | | unsigned char DTB[KLDataDTCount*2];
|
| | | }; |
| | | };
|
| | |
|
| | | // ���üĴ���
|
| | | // ϵͳ״̬�Ĵ���
|
| | | // ����Ĵ���
|
| | | // ���ԣ���ؼĴ���
|
| | | // 配置寄存器
|
| | | // 系统状态寄存器
|
| | | // 特殊寄存器
|
| | | // 调试,监控寄存器
|
| | | union {
|
| | | unsigned int SDD[KLDataSDTCount/2];
|
| | | unsigned short SDT[KLDataSDTCount];
|