2025-03-12 10:03:16 +08:00
|
|
|
|
/*
|
|
|
|
|
|
@file FesDef.h
|
|
|
|
|
|
@brief 头文件
|
|
|
|
|
|
@author thxiao
|
|
|
|
|
|
@history
|
|
|
|
|
|
2019-02-20 thxiao 增加转发规约的接口结构;DI增加转发站标志,增加转发功能
|
|
|
|
|
|
2019-03-11 thxiao 增加规约映射表,数据按规约点的顺序排列.方便工程在完成的情况下,现场工程又修改了点顺序。
|
|
|
|
|
|
2019-03-18 thxiao 转发规约遥控指令需要RtuNo,SFesRxDoCmd\SFesRxAoCmd\SFesRxMoCmd增加定义
|
|
|
|
|
|
2019-06-05 thxiao SFesRtuParam 增加车站描述,方便保存录波按“车站\设备”保存
|
|
|
|
|
|
2019-06-10 thxiao SFesRtuDevParam 增加录波路径,方便保存录波按“车站\设备”保存
|
|
|
|
|
|
2019-06-11 thxiao CN_SFesSimComFrameMaxLen=300 监视帧最大长度由120变为300
|
|
|
|
|
|
2019-08-30 thxiao SFesAi 增加 float fPercentValue; 转换后的突变比较范围
|
|
|
|
|
|
2019-09-18 thxiao SFesChanParam,SFesRtuParam,增加报警使能
|
|
|
|
|
|
2019-10-21 thxiao 点结构增加字段
|
|
|
|
|
|
2020-01-16 thxiao 前置点增加点描述
|
|
|
|
|
|
2020-03-11 thxiao SFesRtuParam 增加设备类型、整数设备类型,一般为采集串口RTU使用,避免判断字符串,优化查找时间
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
#define WIN32_LEAN_AND_MEAN
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
#include <map>
|
|
|
|
|
|
//#include <deque>
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef WIN32
|
|
|
|
|
|
#pragma warning(disable: 4100)//未引用的形参
|
|
|
|
|
|
#pragma warning(disable: 4101)//未引用的局部变量
|
|
|
|
|
|
#pragma warning(disable: 4251)//需要有dll接口由class"xxxx"的客户端使用
|
|
|
|
|
|
#pragma warning(disable: 4267)// “=”: 从“size_t”转换到“int”,可能丢失数据
|
|
|
|
|
|
#pragma warning(disable: 4305)// “初始化”: 从“double”到“float”截断
|
2025-03-12 14:17:53 +08:00
|
|
|
|
#pragma warning(disable: 4275)// 非 dll 接口 class“google::protobuf::Message”用作 dll 接口 class“iot_idl::
|
2025-03-12 10:03:16 +08:00
|
|
|
|
#pragma warning(disable: 4819)//该文件包含不能在当前代码页(0)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
|
|
|
|
|
|
#pragma warning(disable: 4474)// sprintf: 格式字符串中传递的参数太多
|
|
|
|
|
|
#pragma warning(disable: 4313)//“sprintf”: 格式字符串中的“%d”与“char *”类型的参数 5 冲突
|
|
|
|
|
|
|
|
|
|
|
|
#include <Windows.h>
|
|
|
|
|
|
#include <Winsock2.h>
|
|
|
|
|
|
#define in_addr_t unsigned long
|
|
|
|
|
|
#define SHUT_RDWR 2
|
|
|
|
|
|
#ifndef INET_ADDRSTRLEN
|
|
|
|
|
|
#define INET_ADDRSTRLEN 16
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#define socklen_t int
|
|
|
|
|
|
#else
|
|
|
|
|
|
#include <sys/socket.h>
|
|
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
|
|
#include <sys/time.h>
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
#include <netinet/in.h>
|
|
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
|
|
#include <errno.h>
|
|
|
|
|
|
#include <netdb.h>
|
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
|
typedef int SOCKET;
|
|
|
|
|
|
#define INVALID_SOCKET -1
|
|
|
|
|
|
#define SOCKET_ERROR -1
|
|
|
|
|
|
#define closesocket close
|
|
|
|
|
|
#define ioctlsocket ioctl
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef FESSIM
|
|
|
|
|
|
// 以下头文件FES仿真程序不需要使用,如有包含会编译出错
|
|
|
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
|
|
#include <boost/make_shared.hpp>
|
|
|
|
|
|
#include <boost/thread.hpp>
|
|
|
|
|
|
#include "pub_utility_api/TimerThreadBase.h"
|
|
|
|
|
|
#include "pub_utility_api/TimeUtil.h"
|
|
|
|
|
|
#include "pub_logger_api/logger.h"
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#include "common/Common.h"
|
|
|
|
|
|
#include "common/DataType.h"
|
|
|
|
|
|
#include "FesRdbStruct.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef PROTOCOLBASE_API_EXPORTS
|
|
|
|
|
|
#define PROTOCOLBASE_API G_DECL_EXPORT
|
|
|
|
|
|
#else
|
|
|
|
|
|
#define PROTOCOLBASE_API G_DECL_IMPORT
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
#ifdef PROTOCOLBASE_API_EXPORTS
|
|
|
|
|
|
#ifdef WIN32
|
|
|
|
|
|
#define PROTOCOLBASE_API G_DECL_EXPORT
|
|
|
|
|
|
#else
|
|
|
|
|
|
//LINUX下 默认情况下会使用C++ API函数命名规则(函数名会增加字符),使用extern "C"修饰后变为C的函数名,便于使用。
|
|
|
|
|
|
#define PROTOCOLBASE_API extern "C"
|
|
|
|
|
|
#endif
|
|
|
|
|
|
#else
|
|
|
|
|
|
#define PROTOCOLBASE_API G_DECL_IMPORT
|
|
|
|
|
|
#endif
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
|
|
const float CN_FesFloatCompare = 0.000001;//用于浮点型数据的比较
|
|
|
|
|
|
|
|
|
|
|
|
const int CN_FesMaxProtocolNum = 64; //系统可接入规约数
|
2025-10-14 09:23:42 +08:00
|
|
|
|
const int CN_FesMaxRtuNumPerChan = 64; //每个通道可接设备数(只对通道为polling方式)
|
2025-03-12 10:03:16 +08:00
|
|
|
|
const int CN_FesMaxChangeMultiple = 5; //变化数据缓冲区为数据个数的倍数
|
|
|
|
|
|
const int CN_FesMaxDzParamSize =800; //定值参数最大长度
|
|
|
|
|
|
const int CN_FesMaxDzNum =40; //定值最大个数一帧的定值个数最大40个(KBD104中规定)
|
|
|
|
|
|
const int CN_FesMaxDefCmdSize =512; //自定义命令最大长度
|
|
|
|
|
|
const int CN_FesMaxWaveFileNameSize =256; //录波文件名最大长度
|
|
|
|
|
|
const int CN_FesMaxModbusTxCmdNum =200; //MODBUS命令发送缓冲区最大条数
|
|
|
|
|
|
const int CN_FesMaxFaultNum =4; //事件中最大故障数据
|
|
|
|
|
|
const int CN_FesFwMaxCollectRtuNum =256; //RTU转发表里的采集RTU最大个数
|
|
|
|
|
|
const int CN_Fes_Fw_MaxMapping = 16; //转发协议最大转发站数目
|
|
|
|
|
|
|
|
|
|
|
|
//模拟量死区类型
|
|
|
|
|
|
const int CN_FesDeadbandType_Percent = 0; //上下限百分比
|
|
|
|
|
|
const int CN_FesDeadbandType_Abs = 1; //绝对值
|
|
|
|
|
|
const int CN_FesDeadbandType_None = 2; //不判断死区
|
|
|
|
|
|
|
|
|
|
|
|
//点值状态
|
|
|
|
|
|
const int CN_FesValueNotUpdate =0x00; //BIT0: 0:点值未更新 1:点已更新
|
|
|
|
|
|
const int CN_FesValueUpdate =0x01; //BIT0: 0:点值未更新 1:点已更新
|
|
|
|
|
|
const int CN_FesValueInvaild =0x02; //BIT1:0:点值有效 1:点值无效 设备报告无效
|
|
|
|
|
|
const int CN_FesValueExceed =0x04; //BIT2:0:点值正常 1:点值超限
|
|
|
|
|
|
const int CN_FesValueComDown =0x08; //BIT3:0:通信正常 1: 通信中断
|
|
|
|
|
|
const int CN_FesDoUnBlocked =0x80; //BIT7:0:五防闭锁 1: 五防解锁
|
|
|
|
|
|
|
|
|
|
|
|
//RTU状态
|
|
|
|
|
|
const int CN_FesRtuNotUsed = 0; //保留未用
|
|
|
|
|
|
const int CN_FesRtuNormal = 1; //RTU正常
|
|
|
|
|
|
const int CN_FesRtuComDown = 2; //RTU通信中断
|
|
|
|
|
|
|
|
|
|
|
|
//通道状态
|
|
|
|
|
|
const int CN_FesChanNotUsed = 0; //保留未用
|
|
|
|
|
|
const int CN_FesChanCheck = 1; //通道检测,使用但未正常通信
|
|
|
|
|
|
const int CN_FesChanRun = 2; //通道运行
|
|
|
|
|
|
const int CN_FesChanStop = 3; //通道停止
|
|
|
|
|
|
const int CN_FesChanErrRate = 4; //接收帧错误率高 错误率可以设置
|
|
|
|
|
|
|
|
|
|
|
|
//事件类型
|
|
|
|
|
|
const int CN_FesRtuSoeEvent = 1; //接入设备(RTU)SOE事件
|
|
|
|
|
|
const int CN_FesFepSoeEvent = 2; //前置终端(FEP)生成SOE事件
|
|
|
|
|
|
const int CN_FesRtuEvent = 3; //RTU事件
|
|
|
|
|
|
const int CN_FesChanEvent = 4; //通道事件
|
|
|
|
|
|
|
|
|
|
|
|
//通道性质
|
|
|
|
|
|
const int CN_FesComProperty_Collect = 0; //采集通道
|
|
|
|
|
|
const int CN_FesComProperty_Transmit = 1; //转发通道
|
|
|
|
|
|
|
|
|
|
|
|
//通道类型
|
|
|
|
|
|
const int CN_FesComNone =0;
|
|
|
|
|
|
const int CN_FesTcpClient =1;
|
|
|
|
|
|
const int CN_FesTcpServer =2;
|
|
|
|
|
|
const int CN_FesUdpClient =3;
|
|
|
|
|
|
const int CN_FesUdpServer =4;
|
|
|
|
|
|
const int CN_FesSerialPort =5;
|
|
|
|
|
|
|
|
|
|
|
|
//通道方式
|
|
|
|
|
|
const int CN_FesDoubleChanMode = 0; //0:双通道通信方式
|
|
|
|
|
|
const int CN_FesSingleChanMode = 1; //1:单通道方式
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//通道方式
|
|
|
|
|
|
const int CN_FesRunFlag = 1; //运行标志
|
|
|
|
|
|
const int CN_FesStopFlag = 0; //停运标志
|
|
|
|
|
|
|
|
|
|
|
|
//通道数据LinkStatus状态定义
|
|
|
|
|
|
const int CN_FesChanDisconnect =0; //通道停运
|
|
|
|
|
|
const int CN_FesChanConnecting =1; //正在连接
|
|
|
|
|
|
const int CN_FesChanConnect =2; //链接成功,通道运行
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//控制命令定义:选择、取消、执行
|
|
|
|
|
|
const int CN_ControlSelect =1;
|
|
|
|
|
|
const int CN_ControlAbort =2;
|
|
|
|
|
|
const int CN_ControlExecute =3;
|
|
|
|
|
|
const int CN_ControlPrevent = 4;
|
|
|
|
|
|
|
|
|
|
|
|
//定值命令定义: 读取、切区、下装、确定
|
|
|
|
|
|
const int CN_SettingRead =1;
|
|
|
|
|
|
const int CN_SettingAreaSwitch =2;
|
|
|
|
|
|
const int CN_SettingDownload =3;
|
|
|
|
|
|
const int CN_SettingAck =4;
|
|
|
|
|
|
|
|
|
|
|
|
//控制命令返回状态
|
|
|
|
|
|
const int CN_ControlFailed =0;
|
|
|
|
|
|
const int CN_ControlSuccess =1;
|
|
|
|
|
|
const int CN_ControlPointErr =2;
|
|
|
|
|
|
|
|
|
|
|
|
//AO命令数值类型
|
|
|
|
|
|
const int CN_AoValueType_Float =0;
|
|
|
|
|
|
const int CN_AoValueType_Int =1;
|
|
|
|
|
|
|
|
|
|
|
|
//FesSimServer
|
|
|
|
|
|
const int CN_FesSimSoeEventMaxBufSize =1024;
|
|
|
|
|
|
const int CN_FesSimRtuEventMaxBufSize =256;
|
|
|
|
|
|
const int CN_FesSimChanEventMaxBufSize =256;
|
|
|
|
|
|
const int CN_FesSimChanMonMaxBufSize =512;
|
|
|
|
|
|
|
|
|
|
|
|
//通信监视数据
|
|
|
|
|
|
const int CN_SFesSimComFrameMaxLen =300; //监视帧最大长度
|
|
|
|
|
|
const int CN_SFesSimComFrameTypeRecv = 0; //监视帧类型:接收
|
|
|
|
|
|
const int CN_SFesSimComFrameTypeSend = 1; //监视帧类型:发送
|
|
|
|
|
|
const int CN_SFesSimComDataType_Data = 0; //监视帧数据类型:数据
|
|
|
|
|
|
const int CN_SFesSimComDataType_Str = 1; //监视帧数据类型:字符数据
|
|
|
|
|
|
const int CN_SFesSimComFrameMaxNum = 7; //每次发送监视帧最大个数
|
|
|
|
|
|
|
|
|
|
|
|
const int CN_FesControlStrParamSize = 256;
|
|
|
|
|
|
|
|
|
|
|
|
//故障相定义 (SFesSoeEvent结构中FaultValTag定义)
|
|
|
|
|
|
const int CN_Fes_IA =1;
|
|
|
|
|
|
const int CN_Fes_IB =2;
|
|
|
|
|
|
const int CN_Fes_IC =3;
|
|
|
|
|
|
const int CN_Fes_I0 =4;
|
|
|
|
|
|
const int CN_Fes_I2 =5;
|
|
|
|
|
|
const int CN_Fes_UA =6;
|
|
|
|
|
|
const int CN_Fes_UB =7;
|
|
|
|
|
|
const int CN_Fes_UC =8;
|
|
|
|
|
|
const int CN_Fes_U0 =9;
|
|
|
|
|
|
const int CN_Fes_U2 =10;
|
|
|
|
|
|
const int CN_Fes_UAB =11;
|
|
|
|
|
|
const int CN_Fes_UBC =12;
|
|
|
|
|
|
const int CN_Fes_UCA =13;
|
|
|
|
|
|
const int CN_Fes_CLOSE_NUM =14;
|
|
|
|
|
|
|
|
|
|
|
|
//控制方向 0:FES外部(HMI) 1:FES内部(转发规约)
|
|
|
|
|
|
const int CN_Fes_CtrlDir_OutSide=0;
|
|
|
|
|
|
const int CN_Fes_CtrlDir_InSide=1;
|
|
|
|
|
|
|
|
|
|
|
|
//转发点数据来源
|
|
|
|
|
|
const int CN_FesFw_FesSrc = 0; //来源于FES
|
|
|
|
|
|
const int CN_FesFw_DPSrc = 1; //来源于DP
|
|
|
|
|
|
|
|
|
|
|
|
//遥信点类型
|
|
|
|
|
|
const int CN_FesFw_SDI = 0; //单点
|
|
|
|
|
|
const int CN_FesFw_DDI = 1; //双点
|
|
|
|
|
|
|
|
|
|
|
|
//点所属专业最多个数
|
|
|
|
|
|
const int CN_FesSubSystem_Max_Num = 16;
|
|
|
|
|
|
|
|
|
|
|
|
//点类型
|
|
|
|
|
|
const int CN_Fes_AI = 1;
|
|
|
|
|
|
const int CN_Fes_DI = 2;
|
|
|
|
|
|
const int CN_Fes_ACC = 3;
|
|
|
|
|
|
const int CN_Fes_MI = 4;
|
|
|
|
|
|
const int CN_Fes_DO = 5;
|
|
|
|
|
|
const int CN_Fes_A0 = 6;
|
|
|
|
|
|
const int CN_Fes_MO = 7;
|
|
|
|
|
|
const int CN_Fes_Setting = 8;
|
|
|
|
|
|
|
|
|
|
|
|
const float CN_FesFwAIChangeScale = 0.0001;
|
|
|
|
|
|
|
|
|
|
|
|
//RTU 类型
|
|
|
|
|
|
const int CN_Fes_RTU_Collect = 0;//采集RTU
|
|
|
|
|
|
const int CN_Fes_RTU_Forward = 1;//转发RTU
|
|
|
|
|
|
|
|
|
|
|
|
//Modbus Frame Type
|
|
|
|
|
|
#define DI_BYTE_LH 0 //数字量帧(单字节)
|
|
|
|
|
|
#define DI_UWord_HL 1 //数字量帧(16bit 高字节前)
|
|
|
|
|
|
#define DI_UWord_LH 2 //数字量帧(16bit 低字节前)
|
|
|
|
|
|
#define AI_Word_HL 3 //模拟量帧(16bit 有符号 高字节前)
|
|
|
|
|
|
#define AI_Word_LH 4 //模拟量帧(16bit 有符号 低字节前)
|
|
|
|
|
|
#define AI_UWord_HL 5 //模拟量帧(16bit 无符号 高字节前)
|
|
|
|
|
|
#define AI_UWord_LH 6 //模拟量帧(16bit 无符号 低字节前)
|
|
|
|
|
|
#define AI_DWord_HH 7 //模拟量帧(32bit 有符号 高字前 高字节前)
|
|
|
|
|
|
#define AI_DWord_LH 8 //模拟量帧(32bit 有符号 低字前 高字节前)
|
|
|
|
|
|
#define AI_DWord_LL 9 //模拟量帧(32bit 有符号 低字前 低字节前)
|
|
|
|
|
|
#define AI_UDWord_HH 10 //模拟量帧(32bit 无符号 高字前 高字节前)
|
|
|
|
|
|
#define AI_UDWord_LH 11 //模拟量帧(32bit 无符号 低字前 高字节前)
|
|
|
|
|
|
#define AI_UDWord_LL 12 //模拟量帧(32bit 无符号 低字前 低字节前)
|
|
|
|
|
|
#define AI_Float_HH 13 //模拟量帧(四字节浮点 高字前 高字节前)
|
|
|
|
|
|
#define AI_Float_LH 14 //模拟量帧(四字节浮点 低字前 高字节前)
|
|
|
|
|
|
#define AI_Float_LL 15 //模拟量帧(四字节浮点 低字前 低字节前)
|
|
|
|
|
|
#define ACC_Word_HL 16 //整形量帧(16bit 有符号 高字节前)
|
|
|
|
|
|
#define ACC_Word_LH 17 //整形量帧(16bit 有符号 低字节前)
|
|
|
|
|
|
#define ACC_UWord_HL 18 //整形量帧(16bit 无符号 高字节前)
|
|
|
|
|
|
#define ACC_UWord_LH 19 //整形量帧(16bit 无符号 低字节前)
|
|
|
|
|
|
#define ACC_DWord_HH 20 //整形量帧(32bit 有符号 高字前 高字节前)
|
|
|
|
|
|
#define ACC_DWord_LH 21 //整形量帧(32bit 有符号 低字前 高字节前)
|
|
|
|
|
|
#define ACC_DWord_LL 22 //整形量帧(32bit 有符号 低字前 低字节前)
|
|
|
|
|
|
#define ACC_UDWord_HH 23 //整形量帧(32bit 无符号 高字前 高字节前)
|
|
|
|
|
|
#define ACC_UDWord_LH 24 //整形量帧(32bit 无符号 低字前 高字节前)
|
|
|
|
|
|
#define ACC_UDWord_LL 25 //整形量帧(32bit 无符号 低字前 低字节前)
|
|
|
|
|
|
#define ACC_Float_HH 26 //整形量帧(四字节浮点 高字前 高字节前)
|
|
|
|
|
|
#define ACC_Float_LH 27 //整形量帧(四字节浮点 低字前 高字节前)
|
|
|
|
|
|
#define ACC_Float_LL 28 //整形量帧(四字节浮点 低字前 低字节前)
|
|
|
|
|
|
#define MI_Word_HL 29 //混合量帧(16bit 有符号 高字节前)
|
|
|
|
|
|
#define MI_Word_LH 30 //混合量帧(16bit 有符号 低字节前)
|
|
|
|
|
|
#define MI_UWord_HL 31 //混合量帧(16bit 无符号 高字节前)
|
|
|
|
|
|
#define MI_UWord_LH 32 //混合量帧(16bit 无符号 低字节前)
|
|
|
|
|
|
#define MI_DWord_HH 33 //混合量帧(32bit 有符号 高字前 高字节前)
|
|
|
|
|
|
#define MI_DWord_LH 34 //混合量帧(32bit 有符号 低字前 高字节前)
|
|
|
|
|
|
#define MI_DWord_LL 35 //混合量帧(32bit 有符号 低字前 低字节前)
|
|
|
|
|
|
#define MI_UDWord_HH 36 //混合量帧(32bit 无符号 高字前 高字节前)
|
|
|
|
|
|
#define MI_UDWord_LH 37 //混合量帧(32bit 无符号 低字前 高字节前)
|
|
|
|
|
|
#define MI_UDWord_LL 38 //混合量帧(32bit 无符号 低字前 低字节前)
|
|
|
|
|
|
|
|
|
|
|
|
#define SPEAM_SOE 40 //施耐德SOE帧
|
|
|
|
|
|
#define PLC_DZ 41 //PLC_DZ
|
|
|
|
|
|
#define PLC_SOE 42 //PLC_SOE
|
|
|
|
|
|
#define PLC_DZ_DWord_HH 43 //PLC_DZ(四字节定值,高字前、高字节前)
|
|
|
|
|
|
|
|
|
|
|
|
#define AI_Hybrid_Type 44 //模拟量混合量帧
|
|
|
|
|
|
#define ACC_Hybrid_Type 45 //累积量混合量帧
|
|
|
|
|
|
|
|
|
|
|
|
#define DZ_DI_BYTE_LH 46 //数字量帧(单字节)
|
|
|
|
|
|
#define DZ_DI_UWord_HL 47 //数字量帧(16bit 高字节前)
|
|
|
|
|
|
#define DZ_DI_UWord_LH 48 //数字量帧(16bit 低字节前)
|
|
|
|
|
|
#define DZ_AI_Word_HL 49 //模拟量帧(16bit 有符号 高字节前)
|
|
|
|
|
|
#define DZ_AI_Word_LH 50 //模拟量帧(16bit 有符号 低字节前)
|
|
|
|
|
|
#define DZ_AI_UWord_HL 51 //模拟量帧(16bit 无符号 高字节前)
|
|
|
|
|
|
#define DZ_AI_UWord_LH 52 //模拟量帧(16bit 无符号 低字节前)
|
|
|
|
|
|
#define DZ_AI_DWord_HH 53 //模拟量帧(32bit 有符号 高字前 高字节前)
|
|
|
|
|
|
#define DZ_AI_DWord_LH 54 //模拟量帧(32bit 有符号 低字前 高字节前)
|
|
|
|
|
|
#define DZ_AI_DWord_LL 55 //模拟量帧(32bit 有符号 低字前 低字节前)
|
|
|
|
|
|
#define DZ_AI_UDWord_HH 56 //模拟量帧(32bit 无符号 高字前 高字节前)
|
|
|
|
|
|
#define DZ_AI_UDWord_LH 57 //模拟量帧(32bit 无符号 低字前 高字节前)
|
|
|
|
|
|
#define DZ_AI_UDWord_LL 58 //模拟量帧(32bit 无符号 低字前 低字节前)
|
|
|
|
|
|
#define DZ_AI_Float_HH 59 //模拟量帧(四字节浮点 高字前 高字节前)
|
|
|
|
|
|
#define DZ_AI_Float_LH 60 //模拟量帧(四字节浮点 低字前 高字节前)
|
|
|
|
|
|
#define DZ_AI_Float_LL 61 //模拟量帧(四字节浮点 低字前 低字节前)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/********************************************************************************************************************/
|
|
|
|
|
|
//以下内部结构
|
|
|
|
|
|
//主备通道状态
|
|
|
|
|
|
#define EN_MAIN_CHAN 0
|
|
|
|
|
|
#define EN_BACKUP_CHAN 1
|
|
|
|
|
|
|
|
|
|
|
|
//线程运行状态
|
|
|
|
|
|
#define EN_THREAD_STOP 0
|
|
|
|
|
|
#define EN_THREAD_RUN 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//转发五防闭锁标志
|
|
|
|
|
|
#define CN_FW_YK_UNBLOCK 0x8000 //五防解锁
|
|
|
|
|
|
#define CN_FW_YK_BLOCK 0x0000 //五防闭锁
|
|
|
|
|
|
#define CN_FW_YK_UNBLOCKCLEAR 0x7fff //五防解锁清除
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//MODBUS配置
|
|
|
|
|
|
typedef struct _SModbusCmd{
|
|
|
|
|
|
int Index; //序号
|
|
|
|
|
|
int Rtuaddr; //设备站址
|
|
|
|
|
|
int FunCode; //功能码(即MODBUS中的命令码)
|
|
|
|
|
|
int StartAddr; //数据起始地址
|
|
|
|
|
|
int DataLen; //数据长度
|
|
|
|
|
|
int PollTime; //命令下发周期(相对时间,一个周期=50ms)
|
|
|
|
|
|
int Type; //帧类别
|
|
|
|
|
|
int PollTimeCount; //命令下发周期计数
|
|
|
|
|
|
int IsCreateSoe; //对遥信帧有效,0:不产生SOE,1:产生SOE
|
|
|
|
|
|
int Param1; //保留参数1
|
|
|
|
|
|
int Param2; //保留参数2
|
|
|
|
|
|
int Param3; //保留参数3
|
|
|
|
|
|
int Param4; //保留参数4
|
|
|
|
|
|
int Used; //块使能
|
|
|
|
|
|
bool CommandSendFlag; //数据块轮询时间到就开始发送
|
|
|
|
|
|
int64 lastPollTime;
|
|
|
|
|
|
_SModbusCmd()
|
|
|
|
|
|
{
|
|
|
|
|
|
Index=0; //序号
|
|
|
|
|
|
Rtuaddr=0; //设备站址
|
|
|
|
|
|
FunCode=0; //功能码(即MODBUS中的命令码)
|
|
|
|
|
|
StartAddr=0; //数据起始地址
|
|
|
|
|
|
DataLen=0; //数据长度
|
|
|
|
|
|
PollTime=0; //命令下发周期(相对时间,一个周期=50ms)
|
|
|
|
|
|
Type=0; //帧类别
|
|
|
|
|
|
PollTimeCount=0; //命令下发周期计数
|
|
|
|
|
|
IsCreateSoe=0; //对遥信帧有效,0:不产生SOE,1:产生SOE
|
|
|
|
|
|
Param1 = 0; //保留参数1
|
|
|
|
|
|
Param2 = 0; //保留参数2
|
|
|
|
|
|
Param3 = 0; //保留参数3
|
|
|
|
|
|
Param4 = 0; //保留参数4
|
|
|
|
|
|
Used = 1;
|
|
|
|
|
|
CommandSendFlag = true; //数据块轮询时间到就开始发送(数据块第一次都会发送)
|
|
|
|
|
|
lastPollTime = 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}SModbusCmd;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int num;
|
|
|
|
|
|
int readx;
|
|
|
|
|
|
int writex;
|
|
|
|
|
|
SModbusCmd *pCmd;
|
|
|
|
|
|
}SModbusCmdBuf;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int readx;
|
|
|
|
|
|
int writex;
|
|
|
|
|
|
SModbusCmd cmd[CN_FesMaxModbusTxCmdNum];
|
|
|
|
|
|
}SModbuTxCmdBuf;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int MappingIndex;
|
|
|
|
|
|
int RemoteNo;
|
|
|
|
|
|
}SFesFwMapping;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int SrcSubSystem; //点所属专业
|
|
|
|
|
|
int AiFlag;
|
|
|
|
|
|
int DiFlag;
|
|
|
|
|
|
int AccFlag;
|
|
|
|
|
|
int MiFlag;
|
|
|
|
|
|
}SFesSubSystem;
|
|
|
|
|
|
|
|
|
|
|
|
//变化数据缓存区
|
|
|
|
|
|
const int CN_SFesAiJudge_Deadband = 0x01;
|
|
|
|
|
|
const int CN_SFesAiJudge_Limit = 0x02;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SFesAi{
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
char TableName[CN_FesMaxTableNameSize];
|
|
|
|
|
|
char ColumnName[CN_FesMaxColumnNameSize];
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize];
|
|
|
|
|
|
char PointTagName[CN_FesMaxTagSize];
|
|
|
|
|
|
char PointDesc[CN_FesMaxDescSize];//2020-01-16 thxiao 增加点描述
|
|
|
|
|
|
short IsFilter; //是否过滤AI突变
|
|
|
|
|
|
short IsZeroBand;//是否判断归零死区
|
|
|
|
|
|
int Percent; //突变百分比
|
|
|
|
|
|
float fPercentValue; //2019-08-30 thxiao 转换后的突变比较范围
|
|
|
|
|
|
int DeadBandType;//死区类型
|
|
|
|
|
|
float DeadBand; //死区值
|
|
|
|
|
|
float ZeroBand; //归零死区
|
|
|
|
|
|
float Base; //基值
|
|
|
|
|
|
float Coeff; //系数;
|
|
|
|
|
|
float MaxRange; //度上限
|
|
|
|
|
|
float MinRange; //度下限
|
|
|
|
|
|
int Param1; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param2; //规约参数,每种协议含义相同。 如modbus FunNo
|
|
|
|
|
|
int Param3; //规约参数,每种协议含义相同。 如modbus DataAddress
|
|
|
|
|
|
int Param4; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param5; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param6; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param7; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param8; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Used;
|
|
|
|
|
|
float DeadBandValue;//根据配置计算处理的死区
|
|
|
|
|
|
int JudgeFlag; //判断标志,置位了,才做对应的判断
|
|
|
|
|
|
float Value;
|
|
|
|
|
|
float LastFilterValue; //上次收到的值,用于过滤AI突变
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
int FwMapNum; //转发映射个数
|
|
|
|
|
|
SFesFwMapping FwMapping[CN_Fes_Fw_MaxMapping];//对应的转发点号,快速找到转发点
|
|
|
|
|
|
_SFesAi(){
|
|
|
|
|
|
PointNo = 0;
|
|
|
|
|
|
memset(TableName, 0, CN_FesMaxTableNameSize);
|
|
|
|
|
|
memset(ColumnName, 0, CN_FesMaxColumnNameSize);
|
|
|
|
|
|
memset(TagName, 0, CN_FesMaxTagSize);
|
|
|
|
|
|
memset(PointTagName, 0, CN_FesMaxTagSize);
|
|
|
|
|
|
memset(PointDesc, 0, CN_FesMaxDescSize);
|
|
|
|
|
|
IsFilter = 0;
|
|
|
|
|
|
Percent = 0;
|
|
|
|
|
|
fPercentValue = 0;
|
|
|
|
|
|
DeadBandType = 0;
|
|
|
|
|
|
DeadBand = 0;
|
|
|
|
|
|
ZeroBand = 0;
|
|
|
|
|
|
Base = 0.0;
|
|
|
|
|
|
Coeff = 0.0;
|
|
|
|
|
|
MaxRange = 0.0;
|
|
|
|
|
|
MinRange = 0.0;
|
|
|
|
|
|
Param1 = 0;
|
|
|
|
|
|
Param2 = 0;
|
|
|
|
|
|
Param3 = 0;
|
|
|
|
|
|
Param4 = 0;
|
|
|
|
|
|
Param5 = 0;
|
|
|
|
|
|
Param6 = 0;
|
|
|
|
|
|
Param7 = 0;
|
|
|
|
|
|
Param8 = 0;
|
|
|
|
|
|
Used = 0;
|
|
|
|
|
|
DeadBandValue = 0;
|
|
|
|
|
|
JudgeFlag = 0;
|
|
|
|
|
|
Value = 0;
|
|
|
|
|
|
LastFilterValue = 0;
|
|
|
|
|
|
Status = 0;
|
|
|
|
|
|
time = 0;
|
|
|
|
|
|
FwMapNum = 0;
|
|
|
|
|
|
memset(&FwMapping[0], 0, sizeof(SFesFwMapping)*CN_Fes_Fw_MaxMapping);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}SFesAi;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SFesDi {
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
char TableName[CN_FesMaxTableNameSize];
|
|
|
|
|
|
char ColumnName[CN_FesMaxColumnNameSize];
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize];
|
|
|
|
|
|
char PointTagName[CN_FesMaxTagSize];
|
|
|
|
|
|
char PointDesc[CN_FesMaxDescSize];//2020-01-16 thxiao 增加点描述
|
|
|
|
|
|
int IsFilterErr; //是否过滤错误DI
|
|
|
|
|
|
int IsFilterDisturb;//是否过滤DI抖动
|
|
|
|
|
|
int DisturbTime; //抖动时限
|
|
|
|
|
|
int Revers; //取反
|
|
|
|
|
|
int Attribute; //点属性
|
|
|
|
|
|
int RelateDI; //关联遥信
|
|
|
|
|
|
int Param1; //规约参数,每种协议含义相同。 如modbus FunNo
|
|
|
|
|
|
int Param2; //规约参数,每种协议含义相同。 如modbus DataAddress
|
|
|
|
|
|
int Param3; //规约参数,每种协议含义相同。 如modbus InfoNo
|
|
|
|
|
|
int Param4; //规约参数,每种协议各不相同。
|
|
|
|
|
|
int Param5; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param6; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param7; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param8; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Used;
|
|
|
|
|
|
int Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
int FwMapNum; //转发映射个数
|
|
|
|
|
|
SFesFwMapping FwMapping[CN_Fes_Fw_MaxMapping];//对应的转发点号,快速找到转发点
|
|
|
|
|
|
_SFesDi() {
|
|
|
|
|
|
PointNo = 0;
|
|
|
|
|
|
memset(TableName, 0, CN_FesMaxTableNameSize);
|
|
|
|
|
|
memset(ColumnName, 0, CN_FesMaxColumnNameSize);
|
|
|
|
|
|
memset(TagName, 0, CN_FesMaxTagSize);
|
|
|
|
|
|
memset(PointTagName, 0, CN_FesMaxTagSize);
|
|
|
|
|
|
memset(PointDesc, 0, CN_FesMaxDescSize);
|
|
|
|
|
|
IsFilterErr = 0;
|
|
|
|
|
|
IsFilterDisturb = 0;
|
|
|
|
|
|
DisturbTime = 0;
|
|
|
|
|
|
Revers = 0;
|
|
|
|
|
|
Attribute = 0;
|
|
|
|
|
|
RelateDI = 0;
|
|
|
|
|
|
Param1 = 0;
|
|
|
|
|
|
Param2 = 0;
|
|
|
|
|
|
Param3 = 0;
|
|
|
|
|
|
Param4 = 0;
|
|
|
|
|
|
Param5 = 0;
|
|
|
|
|
|
Param6 = 0;
|
|
|
|
|
|
Param7 = 0;
|
|
|
|
|
|
Param8 = 0;
|
|
|
|
|
|
Used = 0;
|
|
|
|
|
|
Value = 0;
|
|
|
|
|
|
Status = 0;
|
|
|
|
|
|
time = 0;
|
|
|
|
|
|
FwMapNum = 0;
|
|
|
|
|
|
memset(&FwMapping[0], 0, sizeof(SFesFwMapping)*CN_Fes_Fw_MaxMapping);
|
|
|
|
|
|
}
|
|
|
|
|
|
}SFesDi;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SFesAcc {
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
char TableName[CN_FesMaxTableNameSize];
|
|
|
|
|
|
char ColumnName[CN_FesMaxColumnNameSize];
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize];
|
|
|
|
|
|
char PointTagName[CN_FesMaxTagSize];
|
|
|
|
|
|
char PointDesc[CN_FesMaxDescSize];//2020-01-16 thxiao 增加点描述
|
|
|
|
|
|
float Base; //基值
|
2025-03-13 14:24:11 +08:00
|
|
|
|
double Coeff; //系数;
|
2025-03-12 10:03:16 +08:00
|
|
|
|
int Param1; //规约参数,每种协议各不相同。 如modbus FunNo
|
|
|
|
|
|
int Param2; //规约参数,每种协议各不相同。 如modbus DataAddress
|
|
|
|
|
|
int Param3; //规约参数,每种协议各不相同。 如modbus InfoNo
|
|
|
|
|
|
int Param4; //规约参数,每种协议各不相同。 如modbus ValueType
|
|
|
|
|
|
int Param5; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param6; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param7; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param8; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Used;
|
|
|
|
|
|
int64 Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
int FwMapNum; //转发映射个数
|
|
|
|
|
|
SFesFwMapping FwMapping[CN_Fes_Fw_MaxMapping];//对应的转发点号,快速找到转发点
|
|
|
|
|
|
_SFesAcc() {
|
|
|
|
|
|
PointNo = 0;
|
|
|
|
|
|
memset(TableName, 0, CN_FesMaxTableNameSize);
|
|
|
|
|
|
memset(ColumnName, 0, CN_FesMaxColumnNameSize);
|
|
|
|
|
|
memset(TagName, 0, CN_FesMaxTagSize);
|
|
|
|
|
|
memset(PointTagName, 0, CN_FesMaxTagSize);
|
|
|
|
|
|
memset(PointDesc, 0, CN_FesMaxDescSize);
|
|
|
|
|
|
Base = 0;
|
|
|
|
|
|
Coeff = 0;
|
|
|
|
|
|
Param1 = 0;
|
|
|
|
|
|
Param2 = 0;
|
|
|
|
|
|
Param3 = 0;
|
|
|
|
|
|
Param4 = 0;
|
|
|
|
|
|
Param5 = 0;
|
|
|
|
|
|
Param6 = 0;
|
|
|
|
|
|
Param7 = 0;
|
|
|
|
|
|
Param8 = 0;
|
|
|
|
|
|
Used = 0;
|
|
|
|
|
|
Value = 0;
|
|
|
|
|
|
Status = 0;
|
|
|
|
|
|
time = 0;
|
|
|
|
|
|
FwMapNum = 0;
|
|
|
|
|
|
memset(&FwMapping[0], 0, sizeof(SFesFwMapping)*CN_Fes_Fw_MaxMapping);
|
|
|
|
|
|
}
|
|
|
|
|
|
}SFesAcc;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SFesMi {
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
char TableName[CN_FesMaxTableNameSize];
|
|
|
|
|
|
char ColumnName[CN_FesMaxColumnNameSize];
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize];
|
|
|
|
|
|
char PointTagName[CN_FesMaxTagSize];
|
|
|
|
|
|
char PointDesc[CN_FesMaxDescSize];//2020-01-16 thxiao 增加点描述
|
|
|
|
|
|
int Base; //基值
|
|
|
|
|
|
int Coeff; //系数;
|
|
|
|
|
|
int MaxRange; //度上限
|
|
|
|
|
|
int MinRange; //度下限
|
|
|
|
|
|
int Param1; //规约参数,每种协议各不相同。 如modbus FunNo
|
|
|
|
|
|
int Param2; //规约参数,每种协议各不相同。 如modbus DataAddress
|
|
|
|
|
|
int Param3; //规约参数,每种协议各不相同。 如modbus InfoNo
|
|
|
|
|
|
int Param4; //规约参数,每种协议各不相同。 如modbus ValueType
|
|
|
|
|
|
int Param5; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param6; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param7; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param8; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Used;
|
|
|
|
|
|
int Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
int FwMapNum; //转发映射个数
|
|
|
|
|
|
SFesFwMapping FwMapping[CN_Fes_Fw_MaxMapping];//对应的转发点号,快速找到转发点
|
|
|
|
|
|
_SFesMi() {
|
|
|
|
|
|
PointNo = 0;
|
|
|
|
|
|
memset(TableName, 0, CN_FesMaxTableNameSize);
|
|
|
|
|
|
memset(ColumnName, 0, CN_FesMaxColumnNameSize);
|
|
|
|
|
|
memset(TagName, 0, CN_FesMaxTagSize);
|
|
|
|
|
|
memset(PointTagName, 0, CN_FesMaxTagSize);
|
|
|
|
|
|
memset(PointDesc, 0, CN_FesMaxDescSize);
|
|
|
|
|
|
Base = 0;
|
|
|
|
|
|
Coeff = 0;
|
|
|
|
|
|
MaxRange = 0;
|
|
|
|
|
|
MinRange = 0;
|
|
|
|
|
|
Param1 = 0;
|
|
|
|
|
|
Param2 = 0;
|
|
|
|
|
|
Param3 = 0;
|
|
|
|
|
|
Param4 = 0;
|
|
|
|
|
|
Param5 = 0;
|
|
|
|
|
|
Param6 = 0;
|
|
|
|
|
|
Param7 = 0;
|
|
|
|
|
|
Param8 = 0;
|
|
|
|
|
|
Used = 0;
|
|
|
|
|
|
Value = 0;
|
|
|
|
|
|
Status = 0;
|
|
|
|
|
|
time = 0;
|
|
|
|
|
|
FwMapNum = 0;
|
|
|
|
|
|
memset(&FwMapping[0], 0, sizeof(SFesFwMapping)*CN_Fes_Fw_MaxMapping);
|
|
|
|
|
|
}
|
|
|
|
|
|
}SFesMi;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
char used;
|
|
|
|
|
|
char unBlockFlag; //1:解锁 0:闭锁
|
|
|
|
|
|
}SFesWfParam;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Attribute
|
|
|
|
|
|
//Bit0 遥控类型。0脉冲输出,1自保持输出(需要程序清零)。
|
|
|
|
|
|
//Bit1 遥控复归。0:表示普通遥控,1:表示复归。
|
|
|
|
|
|
//Bit2 特殊遥控点0:表示普通遥控,1:特殊遥控点。
|
|
|
|
|
|
const int CN_FesDo_Normal = 0x00;
|
|
|
|
|
|
const int CN_FesDo_Pulse = 0x00;
|
|
|
|
|
|
const int CN_FesDo_Keep = 0x01;
|
|
|
|
|
|
const int CN_FesDo_Reset = 0x02;
|
|
|
|
|
|
const int CN_FesDo_Special = 0x04;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SFesDo {
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
char PointTagName[CN_FesMaxTagSize];
|
|
|
|
|
|
char PointDesc[CN_FesMaxDescSize];//2020-01-16 thxiao 增加点描述
|
|
|
|
|
|
int Attribute; //点属性
|
|
|
|
|
|
int ControlParam; //遥控参数
|
|
|
|
|
|
int Param1; //规约参数,每种协议含义相同。 如modbus FunNo
|
|
|
|
|
|
int Param2; //规约参数,每种协议含义相同。 如modbus DataAddress
|
|
|
|
|
|
int Param3; //规约参数,每种协议含义相同。 如modbus InfoNo
|
|
|
|
|
|
int Param4; //规约参数,每种协议各不相同。
|
|
|
|
|
|
int Param5; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param6; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param7; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param8; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Used;
|
|
|
|
|
|
int Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
SFesWfParam wfParam;//五防参数
|
|
|
|
|
|
_SFesDo() {
|
|
|
|
|
|
PointNo = 0;
|
|
|
|
|
|
memset(PointTagName, 0, CN_FesMaxTagSize);
|
|
|
|
|
|
memset(PointDesc, 0, CN_FesMaxDescSize);
|
|
|
|
|
|
memset(&wfParam, 0, sizeof(wfParam));
|
|
|
|
|
|
Attribute = 0;
|
|
|
|
|
|
ControlParam = 0;
|
|
|
|
|
|
Param1 = 0;
|
|
|
|
|
|
Param2 = 0;
|
|
|
|
|
|
Param3 = 0;
|
|
|
|
|
|
Param4 = 0;
|
|
|
|
|
|
Param5 = 0;
|
|
|
|
|
|
Param6 = 0;
|
|
|
|
|
|
Param7 = 0;
|
|
|
|
|
|
Param8 = 0;
|
|
|
|
|
|
Used = 0;
|
|
|
|
|
|
Value = 0;
|
|
|
|
|
|
Status = 0;
|
|
|
|
|
|
time = 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}SFesDo;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SFesAo {
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
char PointTagName[CN_FesMaxTagSize];
|
|
|
|
|
|
char PointDesc[CN_FesMaxDescSize];//2020-01-16 thxiao 增加点描述
|
|
|
|
|
|
float Base; //基值
|
|
|
|
|
|
float Coeff; //系数;
|
|
|
|
|
|
float MaxRange; //度上限
|
|
|
|
|
|
float MinRange; //度下限
|
|
|
|
|
|
int Param1; //规约参数,每种协议含义相同。 如modbus FunNo
|
|
|
|
|
|
int Param2; //规约参数,每种协议含义相同。 如modbus DataAddress
|
|
|
|
|
|
int Param3; //规约参数,每种协议含义相同。 如modbus InfoNo
|
|
|
|
|
|
int Param4; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param5; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param6; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param7; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param8; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Used;
|
|
|
|
|
|
float Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
_SFesAo() {
|
|
|
|
|
|
PointNo = 0;
|
|
|
|
|
|
memset(PointTagName, 0, CN_FesMaxTagSize);
|
|
|
|
|
|
memset(PointDesc, 0, CN_FesMaxDescSize);
|
|
|
|
|
|
Base = 0;
|
|
|
|
|
|
Coeff = 0;
|
|
|
|
|
|
MaxRange = 0;
|
|
|
|
|
|
MinRange = 0;
|
|
|
|
|
|
Param1 = 0;
|
|
|
|
|
|
Param2 = 0;
|
|
|
|
|
|
Param3 = 0;
|
|
|
|
|
|
Param4 = 0;
|
|
|
|
|
|
Param5 = 0;
|
|
|
|
|
|
Param6 = 0;
|
|
|
|
|
|
Param7 = 0;
|
|
|
|
|
|
Param8 = 0;
|
|
|
|
|
|
Used = 0;
|
|
|
|
|
|
Value = 0;
|
|
|
|
|
|
Status = 0;
|
|
|
|
|
|
time = 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}SFesAo;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SFesMo{
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
char PointTagName[CN_FesMaxTagSize];
|
|
|
|
|
|
char PointDesc[CN_FesMaxDescSize];//2020-01-16 thxiao 增加点描述
|
|
|
|
|
|
int Base; //基值
|
|
|
|
|
|
int Coeff; //系数;
|
|
|
|
|
|
int MaxRange; //度上限
|
|
|
|
|
|
int MinRange; //度下限
|
|
|
|
|
|
int Param1; //规约参数,每种协议各不相同。 如modbus FunNo
|
|
|
|
|
|
int Param2; //规约参数,每种协议各不相同。 如modbus DataAddress
|
|
|
|
|
|
int Param3; //规约参数,每种协议各不相同。 如modbus InfoNo
|
|
|
|
|
|
int Param4; //规约参数,每种协议各不相同。 如modbus ValueType
|
|
|
|
|
|
int Param5; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param6; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param7; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param8; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Used;
|
|
|
|
|
|
int Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
_SFesMo() {
|
|
|
|
|
|
PointNo = 0;
|
|
|
|
|
|
memset(PointTagName, 0, CN_FesMaxTagSize);
|
|
|
|
|
|
memset(PointDesc, 0, CN_FesMaxDescSize);
|
|
|
|
|
|
Base = 0;
|
|
|
|
|
|
Coeff = 0;
|
|
|
|
|
|
MaxRange = 0;
|
|
|
|
|
|
MinRange = 0;
|
|
|
|
|
|
Param1 = 0;
|
|
|
|
|
|
Param2 = 0;
|
|
|
|
|
|
Param3 = 0;
|
|
|
|
|
|
Param4 = 0;
|
|
|
|
|
|
Param5 = 0;
|
|
|
|
|
|
Param6 = 0;
|
|
|
|
|
|
Param7 = 0;
|
|
|
|
|
|
Param8 = 0;
|
|
|
|
|
|
Used = 0;
|
|
|
|
|
|
Value = 0;
|
|
|
|
|
|
Status = 0;
|
|
|
|
|
|
time = 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}SFesMo;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
// char TagName[CN_FesMaxTagSize];
|
|
|
|
|
|
char PointTagName[CN_FesMaxTagSize];
|
|
|
|
|
|
int GroupNo; //定值组号
|
|
|
|
|
|
int CodeNo; //定值代号
|
|
|
|
|
|
int SeqNo; //定值序号
|
|
|
|
|
|
int DzType; //定值类型
|
|
|
|
|
|
int Unit; //单位
|
|
|
|
|
|
double Base; //基值
|
|
|
|
|
|
double Coeff; //系数;
|
|
|
|
|
|
double MaxRange; //度上限
|
|
|
|
|
|
double MinRange; //度下限
|
|
|
|
|
|
int Param1; //规约参数
|
|
|
|
|
|
int Param2; //规约参数
|
|
|
|
|
|
int Param3; //规约参数
|
|
|
|
|
|
int Param4; //规约参数
|
|
|
|
|
|
int Param5; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param6; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param7; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Param8; //规约参数,每种协议含义相同。
|
|
|
|
|
|
int Used;
|
|
|
|
|
|
int ValueType;
|
|
|
|
|
|
union
|
|
|
|
|
|
{
|
|
|
|
|
|
int iVal;
|
|
|
|
|
|
float fVal;
|
|
|
|
|
|
|
|
|
|
|
|
}Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
}SFesDz;
|
|
|
|
|
|
|
|
|
|
|
|
//转发表变化数据缓冲区
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int RemoteNo; //远动序号
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize]; //标签名
|
|
|
|
|
|
char PointDesc[CN_FesMaxDescSize]; //点描述
|
|
|
|
|
|
char DPTagName[CN_FesMaxTagSize]; //后台标签名
|
|
|
|
|
|
int FesRtuNo; //采集rtu号
|
|
|
|
|
|
int FesPointNo; //采集点号
|
|
|
|
|
|
int DpSeqNo; //组号
|
|
|
|
|
|
double Coeff; //系数;
|
|
|
|
|
|
double Base; //修正值
|
|
|
|
|
|
int DeadBandType; //死区类型
|
|
|
|
|
|
double DeadBand; //死区值
|
|
|
|
|
|
int Property; //属性
|
|
|
|
|
|
int SrcLocationID; //所属厂站
|
|
|
|
|
|
int SrcSubSystem; //所属专业
|
|
|
|
|
|
int ResParam1; //规约参数1
|
|
|
|
|
|
int ResParam2; //规约参数2
|
|
|
|
|
|
int ResParam3; //规约参数3
|
|
|
|
|
|
int ResParam4; //规约参数4
|
|
|
|
|
|
int ResParam5; //规约参数5
|
|
|
|
|
|
int ResParam6; //规约参数6
|
|
|
|
|
|
int ResParam7; //规约参数7
|
|
|
|
|
|
char StrParam[CN_FesMaxTagSize];
|
|
|
|
|
|
int SrcType; //点来源(0:FES 1:DP)
|
|
|
|
|
|
int Used;
|
|
|
|
|
|
float Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
}SFesFwAi;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int RemoteNo; //远动序号
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize]; //采集标签名
|
|
|
|
|
|
char PointDesc[CN_FesMaxDescSize]; //点描述
|
|
|
|
|
|
char DPTagName[CN_FesMaxTagSize]; //后台标签名
|
|
|
|
|
|
int FesRtuNo; //采集rtu号
|
|
|
|
|
|
int FesPointNo; //采集点号
|
|
|
|
|
|
int DpSeqNo; //后台点序号
|
|
|
|
|
|
int Property; //属性
|
|
|
|
|
|
int SrcLocationID; //所属厂站
|
|
|
|
|
|
int SrcSubSystem; //所属专业
|
|
|
|
|
|
int ResParam1; //规约参数1
|
|
|
|
|
|
int ResParam2; //规约参数2
|
|
|
|
|
|
int ResParam3; //规约参数3
|
|
|
|
|
|
int ResParam4; //规约参数4
|
|
|
|
|
|
int ResParam5; //规约参数5
|
|
|
|
|
|
int ResParam6; //规约参数6
|
|
|
|
|
|
int ResParam7; //规约参数7
|
|
|
|
|
|
char StrParam[CN_FesMaxTagSize];
|
|
|
|
|
|
int SrcType; //点来源(0:FES 1:DP)
|
|
|
|
|
|
short Used;
|
|
|
|
|
|
short InitFlag; //数值已更新,因为DP->FES数据要产生SOE,所以需要。
|
|
|
|
|
|
int Value;
|
|
|
|
|
|
uint32 Status; //bit7:1 (五防解锁) 0(五防闭锁)
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
//五防信息
|
|
|
|
|
|
int DORemoteNo; //对应的转发遥控号
|
|
|
|
|
|
}SFesFwDi;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int RemoteNo; //远动序号
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize]; //采集标签名
|
|
|
|
|
|
char PointDesc[CN_FesMaxDescSize]; //点描述
|
|
|
|
|
|
char DPTagName[CN_FesMaxTagSize]; //后台标签名
|
|
|
|
|
|
int FesRtuNo; //采集rtu号
|
|
|
|
|
|
int FesPointNo; //采集点号
|
|
|
|
|
|
int DpSeqNo; //后台点序号
|
|
|
|
|
|
double Coeff; //系数;
|
|
|
|
|
|
double Base; //修正值
|
|
|
|
|
|
int Property; //属性
|
|
|
|
|
|
int SrcLocationID; //所属厂站
|
|
|
|
|
|
int SrcSubSystem; //所属专业
|
|
|
|
|
|
int ResParam1; //规约参数1
|
|
|
|
|
|
int ResParam2; //规约参数2
|
|
|
|
|
|
int ResParam3; //规约参数3
|
|
|
|
|
|
int ResParam4; //规约参数4
|
|
|
|
|
|
int ResParam5; //规约参数5
|
|
|
|
|
|
int ResParam6; //规约参数6
|
|
|
|
|
|
int ResParam7; //规约参数7
|
|
|
|
|
|
char StrParam[CN_FesMaxTagSize];
|
|
|
|
|
|
int SrcType; //点来源(0:FES 1:DP)
|
|
|
|
|
|
int Used;
|
|
|
|
|
|
int64 Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
}SFesFwAcc;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int RemoteNo; //远动序号
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize]; //采集标签名
|
|
|
|
|
|
char PointDesc[CN_FesMaxDescSize]; //点描述
|
|
|
|
|
|
char DPTagName[CN_FesMaxTagSize]; //后台标签名
|
|
|
|
|
|
int FesRtuNo; //采集rtu号
|
|
|
|
|
|
int FesPointNo; //采集点号
|
|
|
|
|
|
int DpSeqNo; //组号
|
|
|
|
|
|
double Coeff; //系数;
|
|
|
|
|
|
double Base; //修正值
|
|
|
|
|
|
int Property; //属性
|
|
|
|
|
|
int SrcLocationID; //所属厂站
|
|
|
|
|
|
int SrcSubSystem; //所属专业
|
|
|
|
|
|
int ResParam1; //规约参数1
|
|
|
|
|
|
int ResParam2; //规约参数2
|
|
|
|
|
|
int ResParam3; //规约参数3
|
|
|
|
|
|
int ResParam4; //规约参数4
|
|
|
|
|
|
int ResParam5; //规约参数5
|
|
|
|
|
|
int ResParam6; //规约参数6
|
|
|
|
|
|
int ResParam7; //规约参数7
|
|
|
|
|
|
char StrParam[CN_FesMaxTagSize];
|
|
|
|
|
|
int SrcType; //点来源(0:FES 1:DP)
|
|
|
|
|
|
int Used;
|
|
|
|
|
|
int Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
}SFesFwMi;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int RemoteNo; //远动序号
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize]; //采集标签名
|
|
|
|
|
|
char PointDesc[CN_FesMaxDescSize]; //点描述
|
|
|
|
|
|
int FesRtuNo; //采集rtu号
|
|
|
|
|
|
int FesPointNo; //采集点号
|
|
|
|
|
|
double MaxRange; //度上限
|
|
|
|
|
|
double MinRange; //度下限
|
|
|
|
|
|
double Coeff; //系数;
|
|
|
|
|
|
double Base; //修正值
|
|
|
|
|
|
int Property; //属性
|
|
|
|
|
|
int SrcLocationID; //所属厂站
|
|
|
|
|
|
int SrcSubSystem; //所属专业
|
|
|
|
|
|
int ResParam1; //规约参数1
|
|
|
|
|
|
int ResParam2; //规约参数2
|
|
|
|
|
|
int ResParam3; //规约参数3
|
|
|
|
|
|
int ResParam4; //规约参数4
|
|
|
|
|
|
int ResParam5; //规约参数5
|
|
|
|
|
|
int ResParam6; //规约参数6
|
|
|
|
|
|
int ResParam7; //规约参数7
|
|
|
|
|
|
char StrParam[CN_FesMaxTagSize];
|
|
|
|
|
|
int SrcType; //点来源(0:FES 1:DP)
|
|
|
|
|
|
int Used;
|
|
|
|
|
|
float Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
}SFesFwAo;
|
|
|
|
|
|
|
|
|
|
|
|
const int CN_FesFwDoPointNum=5;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int RemoteNo; //远动序号
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize]; //采集标签名
|
|
|
|
|
|
char PointDesc[CN_FesMaxDescSize]; //点描述
|
|
|
|
|
|
int FesRtuNo; //采集rtu号
|
|
|
|
|
|
int FesPointNum;//分量数
|
|
|
|
|
|
int FesPointNo[CN_FesFwDoPointNum]; //采集点号
|
|
|
|
|
|
int Property; //属性
|
|
|
|
|
|
int SrcLocationID; //所属厂站
|
|
|
|
|
|
int SrcSubSystem; //所属专业
|
|
|
|
|
|
int ResParam1; //规约参数1
|
|
|
|
|
|
int ResParam2; //规约参数2
|
|
|
|
|
|
int ResParam3; //规约参数3
|
|
|
|
|
|
int ResParam4; //规约参数4
|
|
|
|
|
|
int ResParam5; //规约参数5
|
|
|
|
|
|
int ResParam6; //规约参数6
|
|
|
|
|
|
int ResParam7; //规约参数7
|
|
|
|
|
|
char StrParam[CN_FesMaxTagSize];
|
|
|
|
|
|
int SrcType; //点来源(0:FES 1:DP)
|
|
|
|
|
|
int Used;
|
|
|
|
|
|
int Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
//五防信息
|
|
|
|
|
|
int DIRemoteNo; //对应的转发遥信号
|
|
|
|
|
|
uint64 WfBlockedTimeout; //五防闭锁时间
|
|
|
|
|
|
}SFesFwDo;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int RemoteNo; //远动序号
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize]; //采集标签名
|
|
|
|
|
|
char PointDesc[CN_FesMaxDescSize]; //点描述
|
|
|
|
|
|
int FesRtuNo; //采集rtu号
|
|
|
|
|
|
int FesPointNo; //采集点号
|
|
|
|
|
|
double MaxRange; //度上限
|
|
|
|
|
|
double MinRange; //度下限
|
|
|
|
|
|
int Property; //属性
|
|
|
|
|
|
int SrcLocationID; //所属厂站
|
|
|
|
|
|
int SrcSubSystem; //所属专业
|
|
|
|
|
|
int ResParam1; //规约参数1
|
|
|
|
|
|
int ResParam2; //规约参数2
|
|
|
|
|
|
int ResParam3; //规约参数3
|
|
|
|
|
|
int ResParam4; //规约参数4
|
|
|
|
|
|
int ResParam5; //规约参数5
|
|
|
|
|
|
int ResParam6; //规约参数6
|
|
|
|
|
|
int ResParam7; //规约参数7
|
|
|
|
|
|
char StrParam[CN_FesMaxTagSize];
|
|
|
|
|
|
int SrcType; //点来源(0:FES 1:DP)
|
|
|
|
|
|
int Used;
|
|
|
|
|
|
float Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
}SFesFwMo;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//FES间的RTU数据交互
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
float Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
}SFesRtuAiValue;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
int Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
}SFesRtuDiValue;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
int64 Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
}SFesRtuAccValue;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
int Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
}SFesRtuMiValue;
|
|
|
|
|
|
|
|
|
|
|
|
//Fes间采集RTU与转发RTU数据交互
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
float Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
}SFesFwRtuAiValue;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
int Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
}SFesFwRtuDiValue;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
int64 Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
}SFesFwRtuAccValue;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//SCADA 与FES间的数据交互 变化数据缓存区
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
char TableName[CN_FesMaxTableNameSize];
|
|
|
|
|
|
char ColumnName[CN_FesMaxColumnNameSize];
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize];
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
float Value;
|
|
|
|
|
|
uint64 time;
|
|
|
|
|
|
int RtuNo;
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
}SFesChgAi;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
char TableName[CN_FesMaxTableNameSize];
|
|
|
|
|
|
char ColumnName[CN_FesMaxColumnNameSize];
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize];
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
int Value;
|
|
|
|
|
|
uint64 time;
|
|
|
|
|
|
int RtuNo;
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
}SFesChgDi;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
char TableName[CN_FesMaxTableNameSize];
|
|
|
|
|
|
char ColumnName[CN_FesMaxColumnNameSize];
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize];
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
int64 Value;
|
|
|
|
|
|
uint64 time;
|
|
|
|
|
|
int RtuNo;
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
}SFesChgAcc;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
char TableName[CN_FesMaxTableNameSize];
|
|
|
|
|
|
char ColumnName[CN_FesMaxColumnNameSize];
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize];
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
int Value;
|
|
|
|
|
|
uint64 time;
|
|
|
|
|
|
int RtuNo;
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
}SFesChgMi;
|
|
|
|
|
|
|
|
|
|
|
|
//SCADA 与FES间的数据交互 全数据
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
char TableName[CN_FesMaxTableNameSize];
|
|
|
|
|
|
char ColumnName[CN_FesMaxColumnNameSize];
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize];
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
float Value;
|
|
|
|
|
|
}SFesAllAi;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
char TableName[CN_FesMaxTableNameSize];
|
|
|
|
|
|
char ColumnName[CN_FesMaxColumnNameSize];
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize];
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
int Value;
|
|
|
|
|
|
}SFesAllDi;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
char TableName[CN_FesMaxTableNameSize];
|
|
|
|
|
|
char ColumnName[CN_FesMaxColumnNameSize];
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize];
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
int64 Value;
|
|
|
|
|
|
}SFesAllAcc;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
char TableName[CN_FesMaxTableNameSize];
|
|
|
|
|
|
char ColumnName[CN_FesMaxColumnNameSize];
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize];
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
int Value;
|
|
|
|
|
|
}SFesAllMi;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
|
int ChanNo;
|
|
|
|
|
|
int Status;
|
|
|
|
|
|
float ErrRate;
|
|
|
|
|
|
uint64 time;
|
|
|
|
|
|
}SFesChanStatus;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
|
int RtuNo;
|
|
|
|
|
|
int Status;
|
|
|
|
|
|
uint64 time;
|
|
|
|
|
|
}SFesRtuStatus;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
|
char TableName[CN_FesMaxTableNameSize];
|
|
|
|
|
|
char ColumnName[CN_FesMaxColumnNameSize];
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize];
|
|
|
|
|
|
uint32 Status; //遥测信状态
|
|
|
|
|
|
int Value; //点值
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
int FaultNum; //故障值个数
|
|
|
|
|
|
int FaultValTag [CN_FesMaxFaultNum];//表明以下数值的来源
|
|
|
|
|
|
float FaultVal[CN_FesMaxFaultNum];
|
|
|
|
|
|
int RtuNo; //RTU号
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
}SFesSoeEvent;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
|
char ChanTagName[CN_FesMaxTagSize];//通道标签
|
|
|
|
|
|
int nChannelNo; //通道号
|
|
|
|
|
|
char ChanName[CN_FesMaxNameSize];//通道名词
|
|
|
|
|
|
char ChanDesc[CN_FesMaxDescSize];//通道描述
|
|
|
|
|
|
int nLocationId; //车站
|
|
|
|
|
|
int nSubSystem; //专业
|
|
|
|
|
|
int nRegionId; //责任区ID
|
|
|
|
|
|
uint32 Status; //通道状态
|
|
|
|
|
|
float ErrRate; //通道误码率
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
}SFesChanEvent;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
|
char RtuTagName[CN_FesMaxTagSize];//RTU标签
|
|
|
|
|
|
int nRtuNo; //RTU号
|
|
|
|
|
|
char RtuName[CN_FesMaxNameSize];//rtu名词
|
|
|
|
|
|
char RtuDesc[CN_FesMaxDescSize];//rtu描述
|
|
|
|
|
|
int nLocationId; //车站
|
|
|
|
|
|
int nSubSystem; //专业
|
|
|
|
|
|
int nRegionId; //责任区ID
|
|
|
|
|
|
uint32 Status; //RTU状态
|
|
|
|
|
|
int CurrentChanNo;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
}SFesRtuEvent;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SFesRxDoCmd{
|
|
|
|
|
|
char TableName[CN_FesMaxTableNameSize];
|
|
|
|
|
|
char ColumnName[CN_FesMaxColumnNameSize];
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize];
|
|
|
|
|
|
char RtuName[CN_FesMaxNameSize];
|
|
|
|
|
|
int CtrlDir; //控制方向 0:FES外部(HMI) 1:FES内部(转发规约)
|
|
|
|
|
|
int FwSubSystem; //转发专业
|
|
|
|
|
|
int FwRtuNo; //转发RTU号
|
|
|
|
|
|
int FwPointNo; //转发点号
|
|
|
|
|
|
int RtuNo; //源RTU号
|
|
|
|
|
|
int PointID; //源点号
|
|
|
|
|
|
int SubSystem; //源专业
|
|
|
|
|
|
int iValue; //目标值(DO、MO)
|
|
|
|
|
|
int CtrlActType; //控制类型 选择、取消、执行,
|
|
|
|
|
|
int TagtState;
|
|
|
|
|
|
uint64 Param1;
|
|
|
|
|
|
uint64 Param2;
|
|
|
|
|
|
float fParam;
|
|
|
|
|
|
char strParam[CN_FesControlStrParamSize];
|
|
|
|
|
|
_SFesRxDoCmd()
|
|
|
|
|
|
{
|
|
|
|
|
|
memset(TableName,0,sizeof(TableName));
|
|
|
|
|
|
memset(ColumnName,0,sizeof(ColumnName));
|
|
|
|
|
|
memset(TagName,0,sizeof(TagName));
|
|
|
|
|
|
memset(RtuName,0,sizeof(RtuName));
|
|
|
|
|
|
CtrlDir=0;
|
|
|
|
|
|
RtuNo = 0;
|
|
|
|
|
|
PointID = 0;
|
|
|
|
|
|
SubSystem = 0;
|
|
|
|
|
|
FwSubSystem = 0;
|
|
|
|
|
|
FwRtuNo = 0;
|
|
|
|
|
|
FwPointNo = 0;
|
|
|
|
|
|
iValue = 0; //目标值(DO、MO)
|
|
|
|
|
|
CtrlActType = 0; //控制类型 选择、取消、执行,
|
|
|
|
|
|
TagtState = 0;
|
|
|
|
|
|
Param1 = 0;
|
|
|
|
|
|
Param2 = 0;
|
|
|
|
|
|
fParam = 0;
|
|
|
|
|
|
memset(strParam,0,sizeof(strParam));
|
|
|
|
|
|
}
|
|
|
|
|
|
}SFesRxDoCmd;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SFesTxDoCmd{
|
|
|
|
|
|
char TableName[CN_FesMaxTableNameSize];
|
|
|
|
|
|
char ColumnName[CN_FesMaxColumnNameSize];
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize];
|
|
|
|
|
|
char RtuName[CN_FesMaxNameSize];
|
|
|
|
|
|
int CtrlDir; //控制方向 0:FES外部(HMI) 1:FES内部(转发规约)
|
|
|
|
|
|
int FwSubSystem; //转发专业
|
|
|
|
|
|
int FwRtuNo; //转发RTU号
|
|
|
|
|
|
int FwPointNo; //转发点号
|
|
|
|
|
|
int RtuNo; //源RTU号
|
|
|
|
|
|
int PointID; //源点号
|
|
|
|
|
|
int SubSystem; //源专业
|
|
|
|
|
|
int retStatus; //返回状态
|
|
|
|
|
|
uint64 Param1;
|
|
|
|
|
|
uint64 Param2;
|
|
|
|
|
|
float fParam;
|
|
|
|
|
|
char strParam[CN_FesControlStrParamSize];
|
|
|
|
|
|
int CtrlActType; //控制类型 选择、取消、执行,
|
|
|
|
|
|
_SFesTxDoCmd()
|
|
|
|
|
|
{
|
|
|
|
|
|
memset(TableName,0,sizeof(TableName));
|
|
|
|
|
|
memset(ColumnName,0,sizeof(ColumnName));
|
|
|
|
|
|
memset(TagName,0,sizeof(TagName));
|
|
|
|
|
|
memset(RtuName,0,sizeof(RtuName));
|
|
|
|
|
|
CtrlDir=0;
|
|
|
|
|
|
RtuNo = 0;
|
|
|
|
|
|
PointID = 0;
|
|
|
|
|
|
SubSystem = 0;
|
|
|
|
|
|
FwSubSystem = 0;
|
|
|
|
|
|
FwRtuNo = 0;
|
|
|
|
|
|
FwPointNo = 0;
|
|
|
|
|
|
retStatus = 0; //返回状态
|
|
|
|
|
|
CtrlActType = 0; //控制类型 选择、取消、执行,
|
|
|
|
|
|
Param1 = 0;
|
|
|
|
|
|
Param2 = 0;
|
|
|
|
|
|
fParam = 0;
|
|
|
|
|
|
memset(strParam,0,sizeof(strParam));
|
|
|
|
|
|
}
|
|
|
|
|
|
}SFesTxDoCmd;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SFesRxAoCmd{
|
|
|
|
|
|
char TableName[CN_FesMaxTableNameSize];
|
|
|
|
|
|
char ColumnName[CN_FesMaxColumnNameSize];
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize];
|
|
|
|
|
|
char RtuName[CN_FesMaxNameSize];
|
|
|
|
|
|
int CtrlDir; //控制方向 0:FES外部(HMI) 1:FES内部(转发规约)
|
|
|
|
|
|
int FwSubSystem; //转发专业
|
|
|
|
|
|
int FwRtuNo; //转发RTU号
|
|
|
|
|
|
int FwPointNo; //转发点号
|
|
|
|
|
|
int RtuNo; //源RTU号
|
|
|
|
|
|
int PointID; //源点号
|
|
|
|
|
|
int SubSystem; //源专业
|
|
|
|
|
|
float fValue; //目标值(AO)
|
|
|
|
|
|
int CtrlActType; //控制类型 选择、取消、执行,
|
|
|
|
|
|
int TagtState;
|
|
|
|
|
|
uint64 Param1;
|
|
|
|
|
|
uint64 Param2;
|
|
|
|
|
|
float fParam;
|
|
|
|
|
|
char strParam[CN_FesControlStrParamSize];
|
|
|
|
|
|
_SFesRxAoCmd()
|
|
|
|
|
|
{
|
|
|
|
|
|
memset(TableName,0,sizeof(TableName));
|
|
|
|
|
|
memset(ColumnName,0,sizeof(ColumnName));
|
|
|
|
|
|
memset(TagName,0,sizeof(TagName));
|
|
|
|
|
|
memset(RtuName,0,sizeof(RtuName));
|
|
|
|
|
|
CtrlDir=0;
|
|
|
|
|
|
RtuNo = 0;
|
|
|
|
|
|
PointID = 0;
|
|
|
|
|
|
SubSystem = 0;
|
|
|
|
|
|
FwSubSystem = 0;
|
|
|
|
|
|
FwRtuNo = 0;
|
|
|
|
|
|
FwPointNo = 0;
|
|
|
|
|
|
fValue = 0; //目标值(AO)
|
|
|
|
|
|
CtrlActType = 0; //控制类型 选择、取消、执行,
|
|
|
|
|
|
TagtState = 0;
|
|
|
|
|
|
Param1 = 0;
|
|
|
|
|
|
Param2 = 0;
|
|
|
|
|
|
fParam = 0;
|
|
|
|
|
|
memset(strParam,0,sizeof(strParam));
|
|
|
|
|
|
}
|
|
|
|
|
|
}SFesRxAoCmd;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SFesTxAoCmd{
|
|
|
|
|
|
char TableName[CN_FesMaxTableNameSize];
|
|
|
|
|
|
char ColumnName[CN_FesMaxColumnNameSize];
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize];
|
|
|
|
|
|
char RtuName[CN_FesMaxNameSize];
|
|
|
|
|
|
int CtrlDir; //控制方向 0:FES外部(HMI) 1:FES内部(转发规约)
|
|
|
|
|
|
int FwSubSystem; //转发专业
|
|
|
|
|
|
int FwRtuNo; //转发RTU号
|
|
|
|
|
|
int FwPointNo; //转发点号
|
|
|
|
|
|
int RtuNo; //源RTU号
|
|
|
|
|
|
int PointID; //源点号
|
|
|
|
|
|
int SubSystem; //源专业
|
|
|
|
|
|
int retStatus; //返回状态
|
|
|
|
|
|
uint64 Param1;
|
|
|
|
|
|
uint64 Param2;
|
|
|
|
|
|
float fParam;
|
|
|
|
|
|
char strParam[CN_FesControlStrParamSize];
|
|
|
|
|
|
int CtrlActType; //控制类型 选择、取消、执行,
|
|
|
|
|
|
_SFesTxAoCmd()
|
|
|
|
|
|
{
|
|
|
|
|
|
memset(TableName,0,sizeof(TableName));
|
|
|
|
|
|
memset(ColumnName,0,sizeof(ColumnName));
|
|
|
|
|
|
memset(TagName,0,sizeof(TagName));
|
|
|
|
|
|
memset(RtuName,0,sizeof(RtuName));
|
|
|
|
|
|
CtrlDir=0;
|
|
|
|
|
|
RtuNo = 0;
|
|
|
|
|
|
PointID = 0;
|
|
|
|
|
|
SubSystem = 0;
|
|
|
|
|
|
FwSubSystem = 0;
|
|
|
|
|
|
FwRtuNo = 0;
|
|
|
|
|
|
FwPointNo = 0;
|
|
|
|
|
|
retStatus = 0;
|
|
|
|
|
|
CtrlActType = 0; //控制类型 选择、取消、执行,
|
|
|
|
|
|
Param1 = 0;
|
|
|
|
|
|
Param2 = 0;
|
|
|
|
|
|
fParam = 0;
|
|
|
|
|
|
memset(strParam,0,sizeof(strParam));
|
|
|
|
|
|
}
|
|
|
|
|
|
}SFesTxAoCmd;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SFesRxMoCmd{
|
|
|
|
|
|
char TableName[CN_FesMaxTableNameSize];
|
|
|
|
|
|
char ColumnName[CN_FesMaxColumnNameSize];
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize];
|
|
|
|
|
|
char RtuName[CN_FesMaxNameSize];
|
|
|
|
|
|
int CtrlDir; //控制方向 0:FES外部(HMI) 1:FES内部(转发规约)
|
|
|
|
|
|
int FwSubSystem; //转发专业
|
|
|
|
|
|
int FwRtuNo; //转发RTU号
|
|
|
|
|
|
int FwPointNo; //转发点号
|
|
|
|
|
|
int RtuNo; //源RTU号
|
|
|
|
|
|
int PointID; //源点号
|
|
|
|
|
|
int SubSystem; //源专业
|
|
|
|
|
|
int iValue; //目标值(DO、MO)
|
|
|
|
|
|
int CtrlActType; //控制类型 选择、取消、执行,
|
|
|
|
|
|
int TagtState;
|
|
|
|
|
|
uint64 Param1;
|
|
|
|
|
|
uint64 Param2;
|
|
|
|
|
|
float fParam;
|
|
|
|
|
|
char strParam[CN_FesControlStrParamSize];
|
|
|
|
|
|
_SFesRxMoCmd()
|
|
|
|
|
|
{
|
|
|
|
|
|
memset(TableName,0,sizeof(TableName));
|
|
|
|
|
|
memset(ColumnName,0,sizeof(ColumnName));
|
|
|
|
|
|
memset(TagName,0,sizeof(TagName));
|
|
|
|
|
|
memset(RtuName,0,sizeof(RtuName));
|
|
|
|
|
|
CtrlDir=0;
|
|
|
|
|
|
RtuNo = 0;
|
|
|
|
|
|
PointID = 0;
|
|
|
|
|
|
SubSystem = 0;
|
|
|
|
|
|
FwSubSystem = 0;
|
|
|
|
|
|
FwRtuNo = 0;
|
|
|
|
|
|
FwPointNo = 0;
|
|
|
|
|
|
iValue = 0; //目标值(DO、MO)
|
|
|
|
|
|
CtrlActType = 0; //控制类型 选择、取消、执行,
|
|
|
|
|
|
TagtState = 0;
|
|
|
|
|
|
Param1 = 0;
|
|
|
|
|
|
Param2 = 0;
|
|
|
|
|
|
fParam = 0;
|
|
|
|
|
|
memset(strParam,0,sizeof(strParam));
|
|
|
|
|
|
}
|
|
|
|
|
|
}SFesRxMoCmd;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SFesTxMoCmd{
|
|
|
|
|
|
char TableName[CN_FesMaxTableNameSize];
|
|
|
|
|
|
char ColumnName[CN_FesMaxColumnNameSize];
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize];
|
|
|
|
|
|
char RtuName[CN_FesMaxNameSize];
|
|
|
|
|
|
int CtrlDir; //控制方向 0:FES外部(HMI) 1:FES内部(转发规约)
|
|
|
|
|
|
int FwSubSystem; //转发专业
|
|
|
|
|
|
int FwRtuNo; //转发RTU号
|
|
|
|
|
|
int FwPointNo; //转发点号
|
|
|
|
|
|
int RtuNo; //源RTU号
|
|
|
|
|
|
int PointID; //源点号
|
|
|
|
|
|
int SubSystem; //源专业
|
|
|
|
|
|
int retStatus; //返回状态
|
|
|
|
|
|
uint64 Param1;
|
|
|
|
|
|
uint64 Param2;
|
|
|
|
|
|
float fParam;
|
|
|
|
|
|
char strParam[CN_FesControlStrParamSize];
|
|
|
|
|
|
int CtrlActType; //控制类型 选择、取消、执行,
|
|
|
|
|
|
_SFesTxMoCmd()
|
|
|
|
|
|
{
|
|
|
|
|
|
memset(TableName,0,sizeof(TableName));
|
|
|
|
|
|
memset(ColumnName,0,sizeof(ColumnName));
|
|
|
|
|
|
memset(TagName,0,sizeof(TagName));
|
|
|
|
|
|
memset(RtuName,0,sizeof(RtuName));
|
|
|
|
|
|
CtrlDir=0;
|
|
|
|
|
|
RtuNo = 0;
|
|
|
|
|
|
PointID = 0;
|
|
|
|
|
|
SubSystem = 0;
|
|
|
|
|
|
FwSubSystem = 0;
|
|
|
|
|
|
FwRtuNo = 0;
|
|
|
|
|
|
FwPointNo = 0;
|
|
|
|
|
|
retStatus = 0;
|
|
|
|
|
|
CtrlActType = 0; //控制类型 选择、取消、执行,
|
|
|
|
|
|
Param1 = 0;
|
|
|
|
|
|
Param2 = 0;
|
|
|
|
|
|
fParam = 0;
|
|
|
|
|
|
memset(strParam,0,sizeof(strParam));
|
|
|
|
|
|
}
|
|
|
|
|
|
}SFesTxMoCmd;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize];//Point tag
|
|
|
|
|
|
int Index; //Point index
|
|
|
|
|
|
int iValue; //Point Value
|
|
|
|
|
|
}SFesRxSetting;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
|
int RtuNo;
|
|
|
|
|
|
int DevId; //PCS3000 下的DevId
|
|
|
|
|
|
int CtrlActType; //控制类型 读取,下装、确定
|
|
|
|
|
|
int Num; //定值个数,下装定值和确定修改定值(Num=0), 读取保护定值(Num!=0),不超过100点
|
|
|
|
|
|
SFesRxSetting Setting[CN_FesMaxDzNum];//定值
|
|
|
|
|
|
}SFesRxSettingCmd;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
|
int RtuNo;
|
|
|
|
|
|
int DevId; //PCS3000 下的DevId
|
|
|
|
|
|
int CtrlActType; //控制类型 读取,下装、确定
|
|
|
|
|
|
int retStatus; //返回状态
|
|
|
|
|
|
int Num; //定值个数,下装定值和确定修改定值(Num=0), 读取保护定值(Num!=0),不超过100点
|
|
|
|
|
|
SFesRxSetting Setting[CN_FesMaxDzNum];//定值
|
|
|
|
|
|
char strParam[CN_FesControlStrParamSize];
|
|
|
|
|
|
}SFesTxSettingCmd;
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
|
char TableName[CN_FesMaxTableNameSize];
|
|
|
|
|
|
char ColumnName[CN_FesMaxColumnNameSize];
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize];
|
|
|
|
|
|
char RtuName[CN_FesMaxNameSize];
|
|
|
|
|
|
int DevId; //PCS3000 下的DevId
|
|
|
|
|
|
int ParamLen;
|
|
|
|
|
|
byte Param[CN_FesMaxDefCmdSize]; //自定义命令
|
|
|
|
|
|
}SFesRxDefCmd;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
|
char TableName[CN_FesMaxTableNameSize];
|
|
|
|
|
|
char ColumnName[CN_FesMaxColumnNameSize];
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize];
|
|
|
|
|
|
char RtuName[CN_FesMaxNameSize];
|
|
|
|
|
|
int DevId; //PCS3000 下的DevId
|
|
|
|
|
|
int retStatus; //返回状态
|
|
|
|
|
|
int ParamLen;
|
|
|
|
|
|
byte Param[CN_FesMaxDefCmdSize]; //自定义命令
|
|
|
|
|
|
char strParam[CN_FesControlStrParamSize];
|
|
|
|
|
|
}SFesTxDefCmd;
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
|
std::string name;
|
|
|
|
|
|
std::string value;
|
|
|
|
|
|
}FesDefCmd;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SFesRxDefCmd {
|
|
|
|
|
|
char TableName[CN_FesMaxTableNameSize];
|
|
|
|
|
|
char ColumnName[CN_FesMaxColumnNameSize];
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize];
|
|
|
|
|
|
char RtuName[CN_FesMaxNameSize];
|
|
|
|
|
|
int DevId; //PCS3000 下的DevId
|
|
|
|
|
|
int CmdNum;
|
|
|
|
|
|
int CtrlDir; //控制方向 0:FES外部(HMI) 1:FES内部(转发规约)
|
|
|
|
|
|
int SrcRtuNo; //转发规约源RTU号
|
|
|
|
|
|
std::vector <FesDefCmd> VecCmd;
|
|
|
|
|
|
_SFesRxDefCmd()
|
|
|
|
|
|
{
|
|
|
|
|
|
memset(TableName, 0, sizeof(TableName));
|
|
|
|
|
|
memset(ColumnName, 0, sizeof(ColumnName));
|
|
|
|
|
|
memset(TagName, 0, sizeof(TagName));
|
|
|
|
|
|
memset(RtuName, 0, sizeof(RtuName));
|
|
|
|
|
|
DevId = 0;
|
|
|
|
|
|
CmdNum = 0;
|
|
|
|
|
|
CtrlDir = 0;
|
|
|
|
|
|
SrcRtuNo = 0;
|
|
|
|
|
|
//VecCmd.clear();
|
|
|
|
|
|
}
|
|
|
|
|
|
}SFesRxDefCmd;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SFesTxDefCmd{
|
|
|
|
|
|
char TableName[CN_FesMaxTableNameSize];
|
|
|
|
|
|
char ColumnName[CN_FesMaxColumnNameSize];
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize];
|
|
|
|
|
|
char RtuName[CN_FesMaxNameSize];
|
|
|
|
|
|
int DevId; //PCS3000 下的DevId
|
|
|
|
|
|
int retStatus; //返回状态
|
|
|
|
|
|
int CmdNum;
|
|
|
|
|
|
std::vector <FesDefCmd> VecCmd;
|
|
|
|
|
|
char strParam[CN_FesControlStrParamSize];
|
|
|
|
|
|
int CtrlDir; //控制方向 0:FES外部(HMI) 1:FES内部(转发规约)
|
|
|
|
|
|
int SrcRtuNo; //转发规约源RTU号
|
|
|
|
|
|
_SFesTxDefCmd()
|
|
|
|
|
|
{
|
|
|
|
|
|
memset(TableName,0,sizeof(TableName));
|
|
|
|
|
|
memset(ColumnName,0,sizeof(ColumnName));
|
|
|
|
|
|
memset(TagName,0,sizeof(TagName));
|
|
|
|
|
|
memset(RtuName,0,sizeof(RtuName));
|
|
|
|
|
|
DevId = 0;
|
|
|
|
|
|
retStatus = 0;
|
|
|
|
|
|
CmdNum = 0;
|
|
|
|
|
|
SrcRtuNo = 0;
|
|
|
|
|
|
memset(strParam,0,sizeof(strParam));
|
|
|
|
|
|
}
|
|
|
|
|
|
}SFesTxDefCmd;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
|
int RtuNo;
|
|
|
|
|
|
int DevId;
|
|
|
|
|
|
int fileSize;
|
|
|
|
|
|
char fileName[CN_FesMaxWaveFileNameSize];
|
|
|
|
|
|
}SFesWaveForm;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
|
{
|
|
|
|
|
|
int ProtocolId;
|
|
|
|
|
|
char Name[CN_FesMaxNameSize];
|
|
|
|
|
|
}SFesProtocolName;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
|
char NetDesc[CN_FesMaxNetDescSize]; //通道IP
|
|
|
|
|
|
int PortNo;//通道网络端口
|
|
|
|
|
|
}SFesNetRoute;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
|
int ChanNo; //通道号
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize]; //RTU
|
|
|
|
|
|
char ChanName[CN_FesMaxNameSize];//通道名
|
|
|
|
|
|
char ChanDesc[CN_FesMaxDescSize];//通道描述
|
|
|
|
|
|
int nLocationId; //车站
|
|
|
|
|
|
int nSubSystem; //专业
|
|
|
|
|
|
int nRegionId; //责任区ID
|
|
|
|
|
|
int Used; //通道使用标志
|
|
|
|
|
|
float ErrRateLimit; //帧错误标准
|
|
|
|
|
|
SFesNetRoute NetRoute[CN_FesMaxNetRouteNum];
|
|
|
|
|
|
int CommProperty; //通道性质 0:接收通道 1:转发通道
|
|
|
|
|
|
int CommType; //通信方式
|
|
|
|
|
|
int ChanMode; //通道方式0:双通道通信方式 1:单通道方式
|
|
|
|
|
|
int ProtocolId; //规约类型
|
|
|
|
|
|
int ConnectWaitSec;
|
|
|
|
|
|
int RespTimeout; //响应超时
|
|
|
|
|
|
int RetryTimes; //最大重连次数
|
|
|
|
|
|
int RecvTimeout; //接收超时,单位ms
|
|
|
|
|
|
int ConnectTimeout; //链接超时
|
|
|
|
|
|
int MaxRxSize; //接收缓存区长度
|
|
|
|
|
|
int MaxTxSize; //发送缓存区长度
|
|
|
|
|
|
int BackupChanNo[CN_FesMaxChangeChanNum-1];//实际配置的备用通道号
|
|
|
|
|
|
//char ComPortName[CN_FesMaxNameSize];//串口端口名
|
|
|
|
|
|
int BaudRate; //波特率设置
|
|
|
|
|
|
int Parity; //校验位
|
|
|
|
|
|
int DataBit; //数据位
|
|
|
|
|
|
int StopBit; //停止位
|
|
|
|
|
|
int ResParam1;
|
|
|
|
|
|
int ResParam2;
|
|
|
|
|
|
int SetTimeEnable; //通道对时使能
|
|
|
|
|
|
int LocalPortNo; //本地端口号
|
|
|
|
|
|
int AlarmEnable; //2019-09-18 thxiao 增加报警使能
|
|
|
|
|
|
}SFesChanParam;
|
|
|
|
|
|
|
|
|
|
|
|
//本结构是通道管理的内部结构,备用通道收发的统计数据(RxNum、TxNum、ErrCnt)在自己通道结构中,
|
|
|
|
|
|
//其他数据都在主通道结构中
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
|
uint32 Writex;//写指针
|
|
|
|
|
|
uint32 Readx; //读指针
|
|
|
|
|
|
byte *pData; //数据内容
|
|
|
|
|
|
}SFesChanRxBuf;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
|
uint32 Writex;//写指针
|
|
|
|
|
|
uint32 Readx; //读指针
|
|
|
|
|
|
byte *pData; //数据内容
|
|
|
|
|
|
}SFesChanTxBuf;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
|
int RtuNo; //RTU号
|
|
|
|
|
|
char TagName[CN_FesMaxTagSize]; //RTU
|
|
|
|
|
|
char RtuName[CN_FesMaxNameSize]; //RTU
|
|
|
|
|
|
char RtuDesc[CN_FesMaxDescSize];//rtu描述
|
|
|
|
|
|
int nLocationId;//车站
|
|
|
|
|
|
char LocationDesc[CN_FesMaxDescSize];//2019-06-05 thxiao 车站描述
|
|
|
|
|
|
int nSubSystem; //专业
|
|
|
|
|
|
int Used; //使用标志
|
|
|
|
|
|
int RtuAddr; //RTU地址
|
|
|
|
|
|
int ChanNo; //通道号
|
|
|
|
|
|
int RecvFailLimit; //连续接收数据失败计数(>5代表停运)
|
|
|
|
|
|
int ProtocolId; //规约类型 2018-12-25 add by thxiao
|
|
|
|
|
|
int AlarmEnable; //报警使能 2019-09-18 add by thxiao
|
|
|
|
|
|
int ResParam1;
|
|
|
|
|
|
int ResParam2;
|
|
|
|
|
|
int ResParam3;
|
|
|
|
|
|
int ControlDisable; //遥控禁止 1:禁止 0:允许
|
|
|
|
|
|
int ClearDataEnable; //设备离线数据清零 1:清零 0:保持数据
|
|
|
|
|
|
char DevType[CN_FesMaxTagSize]; //2020-03-09 thxiao 设备类型
|
|
|
|
|
|
int iDevType; //2020-03-11 thxiao 整数设备类型,一般为采集串口RTU使用,避免判断字符串,优化查找时间
|
|
|
|
|
|
int WaveEnable; //录波使能 1:是 0:否
|
|
|
|
|
|
SModbusCmdBuf ModbusCmdBuf;
|
|
|
|
|
|
}SFesRtuParam;
|
|
|
|
|
|
|
|
|
|
|
|
//FesSimServer
|
|
|
|
|
|
typedef struct
|
|
|
|
|
|
{
|
|
|
|
|
|
int RefreshFlag; //数据刷新标志为1:事件写入缓冲区 0:不写入缓存区
|
|
|
|
|
|
int Overflow; //事件溢出标志 1:溢出 0:正常
|
|
|
|
|
|
int Readx;
|
|
|
|
|
|
int Writex;
|
|
|
|
|
|
SFesSoeEvent Event[CN_FesSimSoeEventMaxBufSize];
|
|
|
|
|
|
}SFesSimServerSoeEventBuf;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
|
{
|
|
|
|
|
|
int RefreshFlag; //数据刷新标志为1:事件写入缓冲区 0:不写入缓存区
|
|
|
|
|
|
int Overflow; //事件溢出标志 1:溢出 0:正常
|
|
|
|
|
|
int Readx;
|
|
|
|
|
|
int Writex;
|
|
|
|
|
|
SFesRtuEvent Event[CN_FesSimRtuEventMaxBufSize];
|
|
|
|
|
|
}SFesSimServerRtuEventBuf;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
|
{
|
|
|
|
|
|
int RefreshFlag; //数据刷新标志为1:事件写入缓冲区 0:不写入缓存区
|
|
|
|
|
|
int Overflow; //事件溢出标志 1:溢出 0:正常
|
|
|
|
|
|
int Readx;
|
|
|
|
|
|
int Writex;
|
|
|
|
|
|
SFesChanEvent Event[CN_FesSimChanEventMaxBufSize];
|
|
|
|
|
|
}SFesSimServerChanEventBuf;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
|
int RxNum; //
|
|
|
|
|
|
int TxNum; //
|
|
|
|
|
|
int ErrNum;
|
|
|
|
|
|
}SFesChanStatistics;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
|
char FrameType; //0:data 1:string
|
|
|
|
|
|
char DataType;
|
|
|
|
|
|
short FrameLen;
|
|
|
|
|
|
uint64 Time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
byte Data[CN_SFesSimComFrameMaxLen];
|
|
|
|
|
|
}SFesChanFrame;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
|
{
|
|
|
|
|
|
int RefreshFlag; //数据刷新标志为1:事件写入缓冲区 0:不写入缓存区
|
|
|
|
|
|
int ChanNo;
|
|
|
|
|
|
int Overflow; //事件溢出标志 1:溢出 0:正常
|
|
|
|
|
|
int RxNum; //
|
|
|
|
|
|
int TxNum; //
|
|
|
|
|
|
int ErrNum;
|
|
|
|
|
|
int Readx;
|
|
|
|
|
|
int Writex;
|
|
|
|
|
|
SFesChanFrame Frame[CN_FesSimChanMonMaxBufSize];
|
|
|
|
|
|
}SFesSimServerChanMonBuf;
|
|
|
|
|
|
|
|
|
|
|
|
//网络通信事件队列结构,通信层和应用层互相交互
|
|
|
|
|
|
const int CN_FesNetEvent_Waitting_Connect = 1;
|
|
|
|
|
|
const int CN_FesNetEvent_Connect = 2;
|
|
|
|
|
|
const int CN_FesNetEvent_Disconnect = 3;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
|
{
|
|
|
|
|
|
uint64 Time;
|
|
|
|
|
|
int EventType;
|
|
|
|
|
|
}SFesNetEvent;
|
|
|
|
|
|
|
|
|
|
|
|
//应用层事件请求,应用层和通信层互相交互
|
|
|
|
|
|
const int CN_FesAppNetEvent_CloseSock = 1;
|
|
|
|
|
|
const int CN_FesAppNetEvent_ReopenChan = 2;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
|
{
|
|
|
|
|
|
uint64 Time;
|
|
|
|
|
|
int EventType;
|
|
|
|
|
|
}SFesAppNetEvent;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//设备信息表
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
|
int CfgSize;
|
|
|
|
|
|
int DataSize;
|
|
|
|
|
|
int Year;
|
|
|
|
|
|
int Mon;
|
|
|
|
|
|
int Day;
|
|
|
|
|
|
int Hour;
|
|
|
|
|
|
int Min;
|
|
|
|
|
|
//int Sec;
|
|
|
|
|
|
int mSec; //sec*1000+msec;
|
|
|
|
|
|
}SFesRtuWareform;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
|
int DevId;
|
|
|
|
|
|
char DevDesc[CN_FesMaxNameSize];
|
|
|
|
|
|
int ChildDevId;
|
|
|
|
|
|
SFesRtuWareform Record;
|
|
|
|
|
|
char LuboPath[CN_FesMaxDescSize];//2019-06-10 thxiao 增加录波路径,方便保存录波按“车站\设备”保存
|
|
|
|
|
|
}SFesRtuDevParam;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
|
int RtuNo;
|
|
|
|
|
|
int DevNum;
|
|
|
|
|
|
SFesRtuDevParam *pDev;
|
|
|
|
|
|
//int WfDataLen; //录波数据长度
|
|
|
|
|
|
//byte *pWfData; //录波数据缓存区
|
|
|
|
|
|
//int RecvDataIndex; //录波数据保存当前数据长度
|
|
|
|
|
|
}SFesRtuDevInfo;
|
|
|
|
|
|
//增加一个数据初始化筛选转发表的采集RTU号
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int CollectRtuNum;
|
|
|
|
|
|
int CollectRtuCount;
|
|
|
|
|
|
int CollectRtuNo[CN_FesFwMaxCollectRtuNum];
|
|
|
|
|
|
}SFesCollectRtu;
|
|
|
|
|
|
|
|
|
|
|
|
//转发规约的接口结构
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int RemoteNo; //远动号
|
|
|
|
|
|
int RtuNo; //RTU号
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
float Value;
|
|
|
|
|
|
uint64 time;
|
|
|
|
|
|
}SFesFwChgAi;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int RemoteNo; //远动号
|
|
|
|
|
|
int RtuNo; //RTU号
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
int Value;
|
|
|
|
|
|
uint64 time;
|
|
|
|
|
|
}SFesFwChgDi;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
|
|
int RemoteNo; //远动号
|
|
|
|
|
|
int RtuNo; //RTU号
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
uint32 Status; //遥测信状态
|
|
|
|
|
|
int Value; //点值
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
int FaultNum; //故障值个数
|
|
|
|
|
|
int FaultValTag [CN_FesMaxFaultNum];//表明以下数值的来源
|
|
|
|
|
|
float FaultVal[CN_FesMaxFaultNum];
|
|
|
|
|
|
}SFesFwSoeEvent;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int RemoteNo; //远动号
|
|
|
|
|
|
int RtuNo; //RTU号
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
int64 Value;
|
|
|
|
|
|
uint64 time;
|
|
|
|
|
|
}SFesFwChgAcc;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int RemoteNo; //远动号
|
|
|
|
|
|
int RtuNo; //RTU号
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
int Value;
|
|
|
|
|
|
uint64 time;
|
|
|
|
|
|
}SFesFwChgMi;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int SrcSubSystem; //所属专业
|
|
|
|
|
|
int SrcRtuNo; //RTU号
|
|
|
|
|
|
int SrcPointNo;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
}SFesFwChgDo;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SFesFwDoRespCmd{
|
|
|
|
|
|
int FwRtuNo; //RTU号
|
|
|
|
|
|
int FwPointNo; //遥控点号
|
|
|
|
|
|
int retStatus; //返回状态
|
|
|
|
|
|
int CtrlActType; //控制类型 选择、取消、执行,
|
|
|
|
|
|
uint64 Param1;
|
|
|
|
|
|
uint64 Param2;
|
|
|
|
|
|
float fParam;
|
|
|
|
|
|
_SFesFwDoRespCmd()
|
|
|
|
|
|
{
|
|
|
|
|
|
FwRtuNo=0;
|
|
|
|
|
|
FwPointNo = 0; //遥控点号
|
|
|
|
|
|
retStatus = 0; //返回状态
|
|
|
|
|
|
CtrlActType = 0; //控制类型 选择、取消、执行,
|
|
|
|
|
|
Param1 = 0;
|
|
|
|
|
|
Param2 = 0;
|
|
|
|
|
|
fParam = 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}SFesFwDoRespCmd;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SFesFwAoRespCmd{
|
|
|
|
|
|
int FwRtuNo; //RTU号
|
|
|
|
|
|
int FwPointNo; //遥控点号
|
|
|
|
|
|
int retStatus; //返回状态
|
|
|
|
|
|
uint64 Param1;
|
|
|
|
|
|
uint64 Param2;
|
|
|
|
|
|
float fParam;
|
|
|
|
|
|
int CtrlActType; //控制类型 选择、取消、执行,
|
|
|
|
|
|
_SFesFwAoRespCmd()
|
|
|
|
|
|
{
|
|
|
|
|
|
FwRtuNo =0;
|
|
|
|
|
|
FwPointNo =0;
|
|
|
|
|
|
retStatus = 0;
|
|
|
|
|
|
CtrlActType = 0; //控制类型 选择、取消、执行,
|
|
|
|
|
|
Param1 = 0;
|
|
|
|
|
|
Param2 = 0;
|
|
|
|
|
|
fParam = 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}SFesFwAoRespCmd;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SFesFwMoRespCmd {
|
|
|
|
|
|
int FwRtuNo; //RTU号
|
|
|
|
|
|
int FwPointNo; //遥控点号
|
|
|
|
|
|
int retStatus; //返回状态
|
|
|
|
|
|
uint64 Param1;
|
|
|
|
|
|
uint64 Param2;
|
|
|
|
|
|
float fParam;
|
|
|
|
|
|
int CtrlActType; //控制类型 选择、取消、执行,
|
|
|
|
|
|
_SFesFwMoRespCmd()
|
|
|
|
|
|
{
|
|
|
|
|
|
FwRtuNo =0;
|
|
|
|
|
|
FwPointNo = 0; //遥控点号
|
|
|
|
|
|
retStatus = 0;
|
|
|
|
|
|
CtrlActType = 0; //控制类型 选择、取消、执行,
|
|
|
|
|
|
Param1 = 0;
|
|
|
|
|
|
Param2 = 0;
|
|
|
|
|
|
fParam = 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}SFesFwMoRespCmd;
|
|
|
|
|
|
|
|
|
|
|
|
//201-03-011 thxiao 增加规约映射表,数据按规约点的顺序排列.方便工程在完成的情况下,现场工程又修改了点顺序。
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int Used;
|
|
|
|
|
|
int PIndex; //use param1.
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
int Param2; //规约参数,每种协议含义不相同。 如modbus FunNo
|
|
|
|
|
|
int Param3; //规约参数,每种协议含义不相同。 如modbus DataAddress
|
|
|
|
|
|
int Param4; //规约参数,每种协议含义不相同。 如modbus InfoNo
|
|
|
|
|
|
}SFesAiIndex;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int Used;
|
|
|
|
|
|
int PIndex; //use param1.
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
int Param2; //规约参数,每种协议含义不相同。 如modbus FunNo
|
|
|
|
|
|
int Param3; //规约参数,每种协议含义不相同。 如modbus DataAddress
|
|
|
|
|
|
int Param4; //规约参数,每种协议含义不相同。 如modbus InfoNo
|
|
|
|
|
|
}SFesDiIndex;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int Used;
|
|
|
|
|
|
int PIndex; //use param1.
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
int Param2; //规约参数,每种协议含义不相同。 如modbus FunNo
|
|
|
|
|
|
int Param3; //规约参数,每种协议含义不相同。 如modbus DataAddress
|
|
|
|
|
|
int Param4; //规约参数,每种协议含义不相同。 如modbus InfoNo
|
|
|
|
|
|
}SFesAccIndex;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int Used;
|
|
|
|
|
|
int PIndex; //use param1.
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
int Param2; //规约参数,每种协议含义不相同。 如modbus FunNo
|
|
|
|
|
|
int Param3; //规约参数,每种协议含义不相同。 如modbus DataAddress
|
|
|
|
|
|
int Param4; //规约参数,每种协议含义不相同。 如modbus InfoNo
|
|
|
|
|
|
}SFesMiIndex;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int Used;
|
|
|
|
|
|
int PIndex; //use param1.
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
int Param2; //规约参数,每种协议含义不相同。 如modbus FunNo
|
|
|
|
|
|
int Param3; //规约参数,每种协议含义不相同。 如modbus DataAddress
|
|
|
|
|
|
int Param4; //规约参数,每种协议含义不相同。 如modbus InfoNo
|
|
|
|
|
|
}SFesDoIndex;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int Used;
|
|
|
|
|
|
int PIndex; //use param1.
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
int Param2; //规约参数,每种协议含义相同。 如modbus FunNo
|
|
|
|
|
|
int Param3; //规约参数,每种协议含义相同。 如modbus DataAddress
|
|
|
|
|
|
int Param4; //规约参数,每种协议含义相同。 如modbus InfoNo
|
|
|
|
|
|
}SFesAoIndex;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int Used;
|
|
|
|
|
|
int PIndex; //use param1.
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
int Param2; //规约参数,每种协议含义不相同。 如modbus FunNo
|
|
|
|
|
|
int Param3; //规约参数,每种协议含义不相同。 如modbus DataAddress
|
|
|
|
|
|
int Param4; //规约参数,每种协议含义不相同。 如modbus InfoNo
|
|
|
|
|
|
}SFesMoIndex;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int Used;
|
|
|
|
|
|
int PIndex; //use param1.
|
|
|
|
|
|
int PointNo;
|
|
|
|
|
|
int Param2; //规约参数,每种协议含义不相同。 如modbus FunNo
|
|
|
|
|
|
int Param3; //规约参数,每种协议含义不相同。 如modbus DataAddress
|
|
|
|
|
|
int Param4; //规约参数,每种协议含义不相同。 如modbus InfoNo
|
|
|
|
|
|
}SFesDzIndex;
|
|
|
|
|
|
|
|
|
|
|
|
//车站
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int nLocationId;//车站
|
|
|
|
|
|
char LocationDesc[CN_FesMaxDescSize];//2019-06-05 thxiao 车站描述
|
|
|
|
|
|
}SFesLocation;
|
|
|
|
|
|
|
|
|
|
|
|
/********************************************************************************
|
|
|
|
|
|
/* 转发公共数据
|
|
|
|
|
|
*********************************************************************************/
|
|
|
|
|
|
typedef struct _SFesFwPubAi {
|
|
|
|
|
|
int SrcLocationID; //点所属厂站
|
|
|
|
|
|
int SrcSubSystem; //点所属专业
|
|
|
|
|
|
char DPTagName[CN_FesMaxTagSize]; //后台标签名
|
|
|
|
|
|
int FesRtuNo; //采集rtu号
|
|
|
|
|
|
int SrcPointNo; //采集点号
|
|
|
|
|
|
float Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
int FwMapNum; //转发映射个数
|
|
|
|
|
|
SFesFwMapping FwMapping[CN_Fes_Fw_MaxMapping];//对应的转发点号,快速找到转发点
|
|
|
|
|
|
_SFesFwPubAi()
|
|
|
|
|
|
{
|
|
|
|
|
|
SrcLocationID = 0;
|
|
|
|
|
|
SrcSubSystem = 0;
|
|
|
|
|
|
memset(DPTagName, 0, CN_FesMaxTagSize);
|
|
|
|
|
|
FesRtuNo = 0;
|
|
|
|
|
|
SrcPointNo = 0;
|
|
|
|
|
|
Value = 0;
|
|
|
|
|
|
Status = 0;
|
|
|
|
|
|
time = 0;
|
|
|
|
|
|
FwMapNum = 0;
|
|
|
|
|
|
memset(&FwMapping[0], 0, sizeof(SFesFwMapping)*CN_Fes_Fw_MaxMapping);
|
|
|
|
|
|
}
|
|
|
|
|
|
}SFesFwPubAi;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SFesFwPubDi {
|
|
|
|
|
|
int SrcLocationID; //点所属厂站
|
|
|
|
|
|
int SrcSubSystem; //点所属专业
|
|
|
|
|
|
char DPTagName[CN_FesMaxTagSize]; //后台标签名
|
|
|
|
|
|
int FesRtuNo; //采集rtu号
|
|
|
|
|
|
int SrcPointNo; //采集点号/DP点号
|
|
|
|
|
|
int Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
short PointType; //0:单点 1:双点
|
|
|
|
|
|
short FwMapNum; //转发映射个数
|
|
|
|
|
|
SFesFwMapping FwMapping[CN_Fes_Fw_MaxMapping];//对应的转发点号,快速找到转发点
|
|
|
|
|
|
_SFesFwPubDi()
|
|
|
|
|
|
{
|
|
|
|
|
|
SrcLocationID = 0;
|
|
|
|
|
|
SrcSubSystem = 0;
|
|
|
|
|
|
memset(DPTagName, 0, CN_FesMaxTagSize);
|
|
|
|
|
|
FesRtuNo = 0;
|
|
|
|
|
|
SrcPointNo = 0;
|
|
|
|
|
|
Value = 0;
|
|
|
|
|
|
Status = 0;
|
|
|
|
|
|
time = 0;
|
|
|
|
|
|
FwMapNum = 0;
|
|
|
|
|
|
memset(&FwMapping[0], 0, sizeof(SFesFwMapping)*CN_Fes_Fw_MaxMapping);
|
|
|
|
|
|
}
|
|
|
|
|
|
}SFesFwPubDi;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SFesFwPubAcc {
|
|
|
|
|
|
int SrcLocationID; //点所属厂站
|
|
|
|
|
|
int SrcSubSystem; //点所属专业
|
|
|
|
|
|
char DPTagName[CN_FesMaxTagSize]; //后台标签名
|
|
|
|
|
|
int FesRtuNo; //采集rtu号
|
|
|
|
|
|
int SrcPointNo; //采集点号
|
|
|
|
|
|
uint64 Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
int FwMapNum; //转发映射个数
|
|
|
|
|
|
SFesFwMapping FwMapping[CN_Fes_Fw_MaxMapping];//对应的转发点号,快速找到转发点
|
|
|
|
|
|
_SFesFwPubAcc()
|
|
|
|
|
|
{
|
|
|
|
|
|
SrcLocationID = 0;
|
|
|
|
|
|
SrcSubSystem = 0;
|
|
|
|
|
|
memset(DPTagName, 0, CN_FesMaxTagSize);
|
|
|
|
|
|
FesRtuNo = 0;
|
|
|
|
|
|
SrcPointNo = 0;
|
|
|
|
|
|
Value = 0;
|
|
|
|
|
|
Status = 0;
|
|
|
|
|
|
time = 0;
|
|
|
|
|
|
FwMapNum = 0;
|
|
|
|
|
|
memset(&FwMapping[0], 0, sizeof(SFesFwMapping)*CN_Fes_Fw_MaxMapping);
|
|
|
|
|
|
}
|
|
|
|
|
|
}SFesFwPubAcc;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SFesFwPubMi {
|
|
|
|
|
|
int SrcLocationID; //点所属厂站
|
|
|
|
|
|
int SrcSubSystem; //点所属专业
|
|
|
|
|
|
char DPTagName[CN_FesMaxTagSize]; //后台标签名
|
|
|
|
|
|
int FesRtuNo; //采集rtu号
|
|
|
|
|
|
int SrcPointNo; //采集点号
|
|
|
|
|
|
int Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
int FwMapNum; //转发映射个数
|
|
|
|
|
|
SFesFwMapping FwMapping[CN_Fes_Fw_MaxMapping];//对应的转发点号,快速找到转发点
|
|
|
|
|
|
_SFesFwPubMi()
|
|
|
|
|
|
{
|
|
|
|
|
|
SrcLocationID = 0;
|
|
|
|
|
|
SrcSubSystem = 0;
|
|
|
|
|
|
memset(DPTagName, 0, CN_FesMaxTagSize);
|
|
|
|
|
|
FesRtuNo = 0;
|
|
|
|
|
|
SrcPointNo = 0;
|
|
|
|
|
|
Value = 0;
|
|
|
|
|
|
Status = 0;
|
|
|
|
|
|
time = 0;
|
|
|
|
|
|
FwMapNum = 0;
|
|
|
|
|
|
memset(&FwMapping[0], 0, sizeof(SFesFwMapping)*CN_Fes_Fw_MaxMapping);
|
|
|
|
|
|
}
|
|
|
|
|
|
}SFesFwPubMi;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SFesFwPubDo {
|
|
|
|
|
|
int SrcLocationID; //点所属厂站
|
|
|
|
|
|
int SrcSubSystem; //点所属专业
|
|
|
|
|
|
int FesRtuNo; //采集rtu号
|
|
|
|
|
|
int SrcPointNo; //采集点号/DP点号
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
_SFesFwPubDo()
|
|
|
|
|
|
{
|
|
|
|
|
|
SrcLocationID = 0;
|
|
|
|
|
|
SrcSubSystem = 0;
|
|
|
|
|
|
FesRtuNo = 0;
|
|
|
|
|
|
SrcPointNo = 0;
|
|
|
|
|
|
Status = 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}SFesFwPubDo;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SFesFwDoBusCmd {
|
|
|
|
|
|
int FwSubSystem; //转发专业
|
|
|
|
|
|
int FwRtuNo; //转发RTU号
|
|
|
|
|
|
int FwPointNo; //转发点号
|
|
|
|
|
|
int SubSystem; //源专业
|
|
|
|
|
|
int RtuNo; //源RTU号
|
|
|
|
|
|
int PointID; //源点号
|
|
|
|
|
|
int retStatus; //返回状态
|
|
|
|
|
|
int CtrlActType; //控制类型 选择、取消、执行,
|
|
|
|
|
|
int iValue; //目标值(DO、MO)
|
|
|
|
|
|
uint64 Param1;
|
|
|
|
|
|
uint64 Param2;
|
|
|
|
|
|
float fParam;
|
|
|
|
|
|
_SFesFwDoBusCmd()
|
|
|
|
|
|
{
|
|
|
|
|
|
FwSubSystem = 0;
|
|
|
|
|
|
FwRtuNo = 0;
|
|
|
|
|
|
FwPointNo = 0;
|
|
|
|
|
|
RtuNo = 0;
|
|
|
|
|
|
PointID = 0;
|
|
|
|
|
|
SubSystem = 0;
|
|
|
|
|
|
retStatus = 0; //返回状态
|
|
|
|
|
|
CtrlActType = 0; //控制类型 选择、取消、执行,
|
|
|
|
|
|
iValue = 0;
|
|
|
|
|
|
Param1 = 0;
|
|
|
|
|
|
Param2 = 0;
|
|
|
|
|
|
fParam = 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}SFesFwDoBusCmd;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SFesFwAoBusCmd {
|
|
|
|
|
|
int FwSubSystem; //转发专业
|
|
|
|
|
|
int FwRtuNo; //转发RTU号
|
|
|
|
|
|
int FwPointNo; //转发点号
|
|
|
|
|
|
int SubSystem; //源专业
|
|
|
|
|
|
int RtuNo; //源RTU号
|
|
|
|
|
|
int PointID; //源点号
|
|
|
|
|
|
int retStatus; //返回状态
|
|
|
|
|
|
int CtrlActType; //控制类型 选择、取消、执行,
|
|
|
|
|
|
float fValue; //目标值(AO)
|
|
|
|
|
|
uint64 Param1;
|
|
|
|
|
|
uint64 Param2;
|
|
|
|
|
|
float fParam;
|
|
|
|
|
|
_SFesFwAoBusCmd()
|
|
|
|
|
|
{
|
|
|
|
|
|
FwSubSystem = 0;
|
|
|
|
|
|
FwRtuNo = 0;
|
|
|
|
|
|
FwPointNo = 0;
|
|
|
|
|
|
RtuNo = 0;
|
|
|
|
|
|
PointID = 0;
|
|
|
|
|
|
SubSystem = 0;
|
|
|
|
|
|
retStatus = 0;
|
|
|
|
|
|
CtrlActType = 0; //控制类型 选择、取消、执行,
|
|
|
|
|
|
fValue = 0;
|
|
|
|
|
|
Param1 = 0;
|
|
|
|
|
|
Param2 = 0;
|
|
|
|
|
|
fParam = 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}SFesFwAoBusCmd;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SFesFwMoBusCmd {
|
|
|
|
|
|
int FwSubSystem; //转发专业
|
|
|
|
|
|
int FwRtuNo; //转发RTU号
|
|
|
|
|
|
int FwPointNo; //转发点号
|
|
|
|
|
|
int SubSystem; //源专业
|
|
|
|
|
|
int RtuNo; //源RTU号
|
|
|
|
|
|
int PointID; //源点号
|
|
|
|
|
|
int retStatus; //返回状态
|
|
|
|
|
|
int CtrlActType; //控制类型 选择、取消、执行,
|
|
|
|
|
|
int iValue; //目标值(DO、MO)
|
|
|
|
|
|
uint64 Param1;
|
|
|
|
|
|
uint64 Param2;
|
|
|
|
|
|
float fParam;
|
|
|
|
|
|
_SFesFwMoBusCmd()
|
|
|
|
|
|
{
|
|
|
|
|
|
FwSubSystem = 0;
|
|
|
|
|
|
FwRtuNo = 0;
|
|
|
|
|
|
FwPointNo = 0;
|
|
|
|
|
|
RtuNo = 0;
|
|
|
|
|
|
PointID = 0;
|
|
|
|
|
|
SubSystem = 0;
|
|
|
|
|
|
retStatus = 0;
|
|
|
|
|
|
CtrlActType = 0; //控制类型 选择、取消、执行,
|
|
|
|
|
|
iValue = 0;
|
|
|
|
|
|
Param1 = 0;
|
|
|
|
|
|
Param2 = 0;
|
|
|
|
|
|
fParam = 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
}SFesFwMoBusCmd;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
float Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
}SFesFwAiValue;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
}SFesFwDiValue;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int64 Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
}SFesFwAccValue;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
|
int Value;
|
|
|
|
|
|
uint32 Status;
|
|
|
|
|
|
uint64 time; //1970-01-01 00:00 至今的毫秒数
|
|
|
|
|
|
}SFesFwMiValue;
|
|
|
|
|
|
|