/********************************************************
*                                                                                                            
* 文 件 名： LogRecord.c  
* 版权说明： 北京交控科技有限公司 
* 创建时间： 2011-09-22
* 作    者： 
* 功能描述： 联锁机数据读取程序 
* 函数包括：
* 使用注意：
* 修改记录：   
*
********************************************************/ 

#include "LogRecord.h"
#include "../ParsePack/ParsePackVobcData.h"
#include <stdarg.h>


UINT8 colString[RELAY_SUM_MAX] = {0u};/*采集数据*/
UINT16 colStringLength = 0u;
UINT8 drvString[RELAY_SUM_MAX] = {0u};/*驱动数据*/
UINT16 drvStringLength = 0u;
AxisSectionDataStruct Record_AxisSecDataStru[AXIS_SECTION_SUM_MAX];/*参考计轴区段数据*/
SignalDataStruct Record_SignalDataStru[SIGNAL_SUM_MAX];/*参考信号机动态数据*/
EsbDataStruct Record_EsbDataStru[ESB_SUM_MAX]; /*参考ESB动态数据*/
SwitchDataStruct Record_SwitchDataStru[SWITCH_SUM_MAX];/*参考道岔动态数据*/
PhysicalSectionDataStruct Record_PhysicalSectionDataStru[PHYSICAL_SECTION_SUM_MAX];/*参考物理区段动态数据*/
RouteDataStruct Record_RouteDataStru[ROUTE_SUM_MAX];/*参考进路动态数据*/
NonRouteDataStruct Record_NonRouteDataStru[NONROUTE_ID_NUM_MAX]; /*参考非进路调车动态数据*/
LogicSectionDataStruct Record_LogicSecDataStru[LOGIC_SECTION_SUM_MAX];/*参考逻辑区段动态数据*/
WashMachineDataStruct Record_WashMachineDataStru[WASHMACHINE_SUM_MAX]; /*参考洗车机动态数据*/
PsdDataStruct Record_PsdDataStru[PSD_SUM_MAX];/*参考屏蔽门动态数据*/
GaragedoorDataStruct Record_GaragedoorDataStru[GARAGE_DOOR_SUM_MAX];   /*参考车库门数据结构体*/
FloodGateDataStruct Record_FloodGateDataStru[FLOOD_GATE_SUM_MAX];	/**/
OverlapDataStruct Record_OverlapDataStru[OVERLAP_SUM_MAX];/*参考保护区段动态数据*/
VirCIKeyDataStru Record_VirCIKeyDataStru[VIRTUAL_CI_MAX]= {0u};/*记录虚拟联锁关键数据*/
VirCIKeyDataStru newVirCIKeyDataStru[VIRTUAL_CI_MAX]= {0u};
SpksDataStruct Record_spksDataBuff[SPKS_SUM_MAX] = { 0u };
TrainInfoStru Record_TrainInfo[TRAIN_SUM_MAX] = { 0u };
CfpDataStru Record_CfpInfo[CUTOFF_POINT_SUM_MAX] = { 0u };
TsrDataStruct Record_TsrInfo[TSR_MAX_SUM] = { 0u };		/* 参考临时限速动态数据 */
OCStationIndicDataStru Record_OCStationIndicBuff[INDICATOR_SUM_MAX] = { 0u };
LogicalRouteDataStruct Record_LogicalRouteDataStru[ROUTE_LOGICAL_SUM_MAX] = { 0U };
NonAutoReturnDataStruct Record_NonReturnDataStru[NON_AUTO_RETURN_SUM_MAX] = { 0U };

UINT8 outString[1024*1024] = {0u};/*比较后的设备打印数据缓冲*/
extern QueueStruct logPrintfQue;    /*日志打印缓存队列*/
UINT16 logIndex = 0u;             /*日志缓存索引*/

#ifdef PLATFORM_LABVIEW_DEBUG

WORD hour=0u;/*全局变量，用于判断是否创建新文件*/
WORD day=0u;/*全局变量，用于判断是否创建新文件夹*/
const signed char LogPath[10]= "C:\\CI_Log"; /*日志打印存储目录*/
UINT8 str[50]=""; /*文件上层文件夹路径*/
UINT8 printFilePath[70]="";/*文件完全路径*/

/*
* 功能描述： 获取系统时间
* 参数说明： UINT8 flag   选择时间格式
*			 char *timeformat   时间结构体
* 返回值  ： void 
*/
SYSTEMTIME getcurrentTime(UINT8 flag, UINT8 *timeformat)
{
	UINT8 outstr[128];
	UINT8 strr1[30];
	
    SYSTEMTIME sys;
    GetLocalTime(&sys);
	
	memset(outstr,0x0,sizeof(outstr));
	
	if (flag==1)
	{
		sprintf(strr1,"%4d_",sys.wYear);
		strcat(outstr,strr1);
		sprintf(strr1,"%02d_",sys.wMonth);
		strcat(outstr,strr1);
		sprintf(strr1,"%02d",sys.wDay);
		strcat(outstr,strr1);
	}
	else if (flag==2)
	{
		sprintf(strr1,"%02d_",sys.wHour);
		strcat(outstr,strr1);
		sprintf(strr1,"%02d_",sys.wMinute);
		strcat(outstr,strr1);
		sprintf(strr1,"%02d",sys.wSecond);
		strcat(outstr,strr1);
	}
	else
	{
		sprintf(strr1,"%4d年",sys.wYear);
		strcat(outstr,strr1);
		sprintf(strr1,"%02d月",sys.wMonth);
		strcat(outstr,strr1);
		sprintf(strr1,"%02d日 ",sys.wDay);
		strcat(outstr,strr1);
		sprintf(strr1,"%02d:",sys.wHour);
		strcat(outstr,strr1);
		sprintf(strr1,"%02d:",sys.wMinute);
		strcat(outstr,strr1);
		sprintf(strr1,"%02d:",sys.wSecond);
		strcat(outstr,strr1);
        sprintf(strr1,"%02d",sys.wMilliseconds);
		strcat(outstr,strr1);
	}
	strcpy(timeformat,outstr);
	return sys;
}

/*
* 功能描述： 更新打印文件路径
* 参数说明： void
* 返回值  ： 0: 更新路径失败
*			 1: 更新路径成功
*/
UINT8 UpdatePrintFilePath(void)
{
	UINT8 timeformat[30];/*系统时间信息*/
	SYSTEMTIME currentTimeStruct;/*当前周期时间*/
    UINT8 ciIdChar[6];/*储存联锁ID转化后的字符串*/

	if (_access(LogPath,0)==-1)/*判断str指示的文件夹是否存在，-1为不存在*/
	{
		mkdir(LogPath);
	}
	currentTimeStruct = getcurrentTime(3,timeformat);/*生成当前时间结构体*/
	if (day!=currentTimeStruct.wDay)/*当前时间结构体中天与全局变量的天不同，或者全局变量为空，每天更新一个文件夹*/
	{
        /*以天位单位的路径*/
        strcpy(str,LogPath);
		strcat(str, "\\");
		getcurrentTime(1,timeformat);
		strcat(str,timeformat);

        if (_access(str,0)==-1)
        {
            mkdir(str);
		}

        /*以运行模式为单位的(C||SCADE)路径*/
        strcat(str, "\\");
        #ifdef SCADE_MODE
        strcat(str, "SCADE_MODE");
        #else
        strcat(str, "C_MODE");
        #endif

        if (_access(str,0)==-1)
        {
            mkdir(str);
		}

        /*以联锁站为单位的路径*/
        strcat(str,"\\");
        sprintf(ciIdChar, "CI_%d", GetSystemParaLocalCiId());
        strcat(str, ciIdChar);

		if (_access(str,0)==-1)
		{
			mkdir(str);
		}
		day=currentTimeStruct.wDay;
	}
	if (hour!=currentTimeStruct.wHour)/*每个小时更新一个文件*/
	{
        memset(printFilePath,0,70);
		strcpy(printFilePath,str);
		getcurrentTime(2,timeformat);
		strcat(printFilePath,"\\");
		strcat(printFilePath,timeformat);
		strcat(printFilePath,".txt");
		hour=currentTimeStruct.wHour;
	}
	else if (hour==currentTimeStruct.wHour)
	{
		
	}
	else
	{
        memset(printFilePath,0,70);
		return CI_ERROR;
	}

	return CI_SUCCESS;
}

/*
* 功能描述： 获取文件路径
* 参数说明： void
* 返回值  ： NULL: 获取文件路径失败
*			 非NULL: 获取文件路径成功
*/
UINT8* GetFileString(void)
{
    if (strlen(printFilePath) == 0)
    {
        return NULL;
    }
    else
    {
        return printFilePath;
    }
}

/*
* 功能描述： 打印数据队列函数 与平台打印一致
* 参数说明： const UINT8 printMode, 打印模式:10十进制,16十六进制,8八进制,2二进制,0字符串
*            UINT8 printData[], 打印数据队列
*            UINT32 printDataLen, 打印数据长度或标准输出的格式输出数值
* 返回值  ： 0:打印失败
*            1:打印成功
*/
UINT8 Out_Array_Buffer(const UINT8 printMode, UINT8 printData[], UINT32 printDataLen)
{
    FILE *fp = NULL;
    UINT16 ii = 0;
    UINT16 jj = 0;
    UINT16 insertIndex = printDataLen;
    UINT8 pData[RECORD_BUF_MAX] = {0};
    UINT8 tailD[RECORD_BUF_MAX] = {0};
    UINT8 decimal[10] = {0};

    if (printDataLen > RECORD_BUF_MAX)
    {/*打印数据长度过长*/

        return CI_ERROR;
    }
    else
    {/*打印数据合理*/

        if (printFilePath == NULL)
        {/*打印路径错误*/

            return CI_ERROR;
            
        }
        else
        {
            if ((fp = fopen(printFilePath,"a")) == NULL)
            {/*文件打开失败*/
                
                return CI_ERROR;
            }
            else
            {
                switch (printMode)
                {
                case 2:/*二进制打印*/
                    for (ii = 0; ii < printDataLen; ii++)
                    {
                        if (ii == 0)
                        {
                            fprintf(fp,"%08b",printData[ii]);
                        }
                        else
                        {
                            fprintf(fp,"-%08b",printData[ii]);
                        }                        
                    }
                    break;
                case 8:/*八进制打印*/
                    for (ii = 0; ii < printDataLen; ii++)
                    {
                        if (ii == 0)
                        {
                            fprintf(fp,"%03o",printData[ii]);
                        }
                        else
                        {
                            fprintf(fp,"-%03o",printData[ii]);
                        }                        
                    }
                    break;
                case 10:/*十进制打印*/
                    for (ii = 0; ii < printDataLen; ii++)
                    {
                        if (ii == 0)
                        {
                            fprintf(fp,"%d",printData[ii]);
                        }
                        else
                        {
                            fprintf(fp,"-%d",printData[ii]);
                        }                        
                    }
                    break;
                case 16:/*十六进制打印*/
                    for (ii = 0; ii < printDataLen; ii++)
                    {
                        if (ii == 0)
                        {
                            fprintf(fp,"%02x",printData[ii]);
                        }
                        else
                        {
                            fprintf(fp,"-%02x",printData[ii]);
                        }                        
                    }
                    break;
                case 0:/*0默认打印字符串*/
                    memset(pData,0,RECORD_BUF_MAX);
                    memset(tailD,0,RECORD_BUF_MAX);
                    memcpy(pData,printData,strlen(printData));

                    /*查找第一个%d||%x位置*/
                    for (ii = 0; ii < strlen(printData); ii++)
                    {
                        if ((pData[ii] == '%')
                            && (ii+1 < (UINT16)strlen(printData)))
                        {
                            if (pData[ii+1] == 'd')
                            {
                                insertIndex = ii;
                                ltoa(printDataLen,decimal,10);
                                break;
                            }
                            else if (pData[ii+1] == 'x')
                            {
                                insertIndex = ii;
                                ltoa(printDataLen,decimal,16);
                                break;
                            }
                            else
                            {
                            }

                        }
                    }

                    if ((insertIndex < strlen(printData)) && (strlen(decimal) > 0))
                    {/*存在进制转化*/

                        memcpy(tailD,&pData[insertIndex+2],strlen(printData)-insertIndex-2);
                        memcpy(&pData[insertIndex],decimal,strlen(decimal));
                        insertIndex+=strlen(decimal);
                        memcpy(&pData[insertIndex],tailD,strlen(tailD));
                    }
                    else
                    {
                        
                    }
                    fprintf(fp,"%s",pData);
                    
                    break;
                default:/*其他打印非法*/
                    fprintf(fp,"ERROR:printMode error %d\n",printMode);
                    return CI_ERROR;
                    break;
                }
            }
            
            fprintf(fp,"\n");
            fclose(fp);
        }
        
        
        return CI_SUCCESS;
    }
}

#endif

/*
* 功能描述： 继电器采集数据打印接口函数
* 参数说明： UINT8* thisString, 本周期数据
* 返回值  ： 0: 打印失败
*			 1: 打印成功		  
*/

UINT8 RecordCollectDataLog(UINT8* thisString)
{
	UINT8 returnValue = CI_SUCCESS;
	UINT8 chFunRtn = 0u;

	chFunRtn = RelayComPare(colString, thisString, 0u);

	if (0u != chFunRtn)
	{/*数据有变化*/
		returnValue = 1u;

#ifdef PLATFORM_2OO2
        
        debug_infor_printf((const)"\nRelayCollectData:%d",colStringLength);
		debug_out_array(0xAA, colString, colStringLength);
        
#endif
#ifdef PLATFORM_LABVIEW_DEBUG
        
        Out_Array_Buffer(0, "\nRelayCollectData:%d",colStringLength);
        Out_Array_Buffer(16,colString,colStringLength);
#endif
        
    }
    else
    {
        returnValue = CI_SUCCESS;
    }
    
    return returnValue;
}

/*
* 功能描述： 继电器驱动数据打印接口函数
* 参数说明： UINT8* thisString, 本周期数据
* 返回值  ： 0: 打印失败
*			 1: 打印成功	
*/

UINT8 RecordDriverDataLog(UINT8* thisString)
{
	UINT8 returnValue = CI_SUCCESS;
	UINT8 chFunRtn = 0u;

	chFunRtn = RelayComPare(drvString, thisString, 4u);

	if (0u != chFunRtn)
	{/*对比有变化*/
#ifdef PLATFORM_2OO2
        
        debug_infor_printf((const)"\nRelayDriveData:%d",drvStringLength);
		debug_out_array(0xAA, drvString, drvStringLength);
        
#endif
#ifdef PLATFORM_LABVIEW_DEBUG

        Out_Array_Buffer(0, "\nRelayDriveData:%d",drvStringLength);
        Out_Array_Buffer(16,drvString,drvStringLength);

#endif
	}
	else
	{
		returnValue = CI_SUCCESS;
	}


	return returnValue;
}

/*
* 功能描述： 设备状态数据打印接口函数
* 参数说明： UINT8 Flag, 打印标志
* 返回值  ： 0: 打印失败
*			 1: 打印成功
*/

UINT8 RecordDeviceDataLog(UINT8 Flag)
{	
    
    UINT16 outStringLength = 0u;
    UINT16 ii = 0U;
	UINT16 jj = 0U;
	UINT8 kk = 0U;
    UINT16 deviceId = 0u;
	UINT16 wTrainId = 0u;
    UINT8 returnValue = CI_SUCCESS;/*返回值*/
    UINT8 comparaResult = 0u;/*比较结果*/
	UINT16 floodGateTotalSum = 0u;/*防淹门总数量*/
	AxisSectionDataStruct* newAxisSecData = GetAxisSecData();
    SignalDataStruct* newSignalData = GetSignalData();
    SwitchDataStruct* newSwitchData = GetSwitchData();
    PhysicalSectionDataStruct* newPhysicalSectionData = GetPhySecData();
    RouteDataStruct* newRouteData = GetRouteData();
    NonRouteDataStruct* newNonRouteDataStru = GetNonRouteDataPtr();
    LogicSectionDataStruct* newLogicSecData = GetLogicSecData();
	WashMachineDataStruct* newWashMachineData = GetWashMachineData();
	PsdDataStruct * newPsdData = GetPsdData();
    GaragedoorDataStruct* newGaragedoorData = GetGaragedoorData();   /*获取车库门数据结构体*/
	FloodGateDataStruct *pNewFloodGateData = GetFloodGateData();		/*获取防淹门数据结构体*/
	OverlapDataStruct* newOverlapData = GetOverlapData();
	TrainInfoStru* pNewTrainInfoData = GetTrainInfoData();
	TsrDataStruct* pNewTsrInfo = GetTsrData();			/* 临时限速信息 */
	CfpDataStru * pNewCfpData = GetCfpData();
	SpksDataStruct* pNewSpksData = GetSpksData();
	OCStationIndicDataStru* pNewOCStationIndicData = GetOCStationIndicDataStru();
	EsbDataStruct* pNewEsbData = GetEsbData();
	LogicalRouteDataStruct* pNewLogicalRouteDataStru = GetLogicalRouteStr();
	UINT16 wCfpId = 0u;
	UINT8 chEnIndex = 0u;
	UINT8 chTrainIndex = 0u;
	UINT16 deviceNum = 0u; 
	UINT8 localCiType = 0u;
	UINT16 wNonAutoReturnCurSum = 0U;/*无人折返按钮当前总数*/
	NonAutoReturnDataStruct* pNonAutoReturnData = NULL;/*无人折返数据结构体指针*/


    /*************************************打印物理区段数据********************************************/
    /*打印区段数据*/
	deviceNum = GetTotalPhySecCurNum();
    for (ii = 0u; ii < deviceNum; ii++)/*本联锁和相邻联锁发送给本联锁的物理区段总数目*/
    {
        
        /*比较数据*/
        deviceId = GetPhySecId(ii);
        comparaResult = DeviceCompara((UINT8*)(&Record_PhysicalSectionDataStru[deviceId]), (UINT16)sizeof(PhysicalSectionDataStruct),
            (UINT8*)(&newPhysicalSectionData[deviceId]), (UINT16)sizeof(PhysicalSectionDataStruct));


        if(0u != comparaResult)
        {/*比较数据不一致*/

            if (CI_ERROR != Flag)
            {
				/**************打印数据信息****************/

				ShortToChar(newPhysicalSectionData[deviceId].PhysicalSectionId,&outString[outStringLength]);/*区段ID*/
				outStringLength += 2u;
				outString[outStringLength++] = newPhysicalSectionData[deviceId].SecUseState;/*征用状态*/
				ShortToChar(newPhysicalSectionData[deviceId].SecUseBelongRouteId,&outString[outStringLength]);/*征用所属进路ID*/
				outStringLength += 2u;
				ShortToChar(newPhysicalSectionData[deviceId].SecProUseBelongRouteId, &outString[outStringLength]);/*防护道岔征用所属进路ID*/
				outStringLength += 2u;
				outString[outStringLength++] = newPhysicalSectionData[deviceId].LockState;/*锁闭状态*/
				ShortToChar(newPhysicalSectionData[deviceId].RLockBelongRouteId,&outString[outStringLength]);/*锁闭所属进路ID*/
				outStringLength += 2u;
				ShortToChar(newPhysicalSectionData[deviceId].PLockBelongRouteId,&outString[outStringLength]);/*防护锁闭所属进路ID*/
				outStringLength += 2u;
				outString[outStringLength++] = newPhysicalSectionData[deviceId].LockDirection;/*锁闭方向*/
				outString[outStringLength++] = newPhysicalSectionData[deviceId].FLockState;/*封锁状态*/
				outString[outStringLength++] = newPhysicalSectionData[deviceId].PreOccupyState;/*之前采集状态*/
				outString[outStringLength++] = newPhysicalSectionData[deviceId].CurOccupyState;/*当前采集状态*/
				outString[outStringLength++] = newPhysicalSectionData[deviceId].PreMergeOccupyState;/*之前融合占用状态*/
				outString[outStringLength++] = newPhysicalSectionData[deviceId].CurMergeOccupyState;/*当前融合占用状态*/
				outString[outStringLength++] = newPhysicalSectionData[deviceId].PreAndMergeOccupyState;/*之前与占用融合占用状态*/
				outString[outStringLength++] = newPhysicalSectionData[deviceId].CurAndMergeOccupyState;/*当前与占用融合占用状态*/
				outString[outStringLength++] = newPhysicalSectionData[deviceId].SectionResetType;/*区段计轴复位类型*/
				LongToChar(newPhysicalSectionData[deviceId].SectionResetStartCycNum, &outString[outStringLength]);/*区段计轴复位开始周期*/
				outStringLength += 4u;
				outString[outStringLength++] = newPhysicalSectionData[deviceId].PhySecPreResetState;/*计轴预复位状态*/
				outString[outStringLength++] = newPhysicalSectionData[deviceId].chPreResetBack;/*预复位命令反馈*/
				outString[outStringLength++] = newPhysicalSectionData[deviceId].chDirectResetRst;/*直接复位结果*/
				outString[outStringLength++] = newPhysicalSectionData[deviceId].chDirectResetBack;/*直接复位命令反馈*/
				outString[outStringLength++] = newPhysicalSectionData[deviceId].StopSteadyFlag;/*停稳状态信息*/
                outString[outStringLength++] = newPhysicalSectionData[deviceId].ArbState;/*ARB状态*/
				outString[outStringLength++] = newPhysicalSectionData[deviceId].ProtectSecLockDelayTimeFlag;/*保护区段锁闭延时标志(动态字段)*/
				outString[outStringLength++] = newPhysicalSectionData[deviceId].StopCheckFlag;			   /*物理区段停止检查标志(未设置/设置) (动态字段)*/
				outString[outStringLength++] = newPhysicalSectionData[deviceId].JumpLockState;			   /*物理区段跳跃锁闭状态 (动态字段)*/
				outString[outStringLength++] = newPhysicalSectionData[deviceId].JumpLockDelayUnlockFlag;	/*物理区段跳跃锁闭延时解锁设置标志(动态字段)*/
				LongToChar(newPhysicalSectionData[deviceId].SecJumpDelayUnlockStartCycNum,&outString[outStringLength]);/*区段跳跃锁闭延时解锁开始周期 (动态字段)*/
				outStringLength += 4u;
				LongToChar(newPhysicalSectionData[deviceId].SecColOccupyStartCycNum, &outString[outStringLength]);/*区段采集占用开始周期*/
				outStringLength += 4u;
				LongToChar(newPhysicalSectionData[deviceId].SecCurOccupyStartCycNum,&outString[outStringLength]);/*区段当前占用开始周期*/
				outStringLength += 4u;
				LongToChar(newPhysicalSectionData[deviceId].SecOccuToClearStartCycNum,&outString[outStringLength]);/*区段占用变空闲开始周期*/
				outStringLength += 4u;
				LongToChar(newPhysicalSectionData[deviceId].AutoUnlockStartCycNum,&outString[outStringLength]);/*自动解锁延时开始周期*/
				outStringLength += 4u;
				LongToChar(newPhysicalSectionData[deviceId].FaultUnlockStartCycNum,&outString[outStringLength]);/*区故解解锁延时开始周期*/
				outStringLength += 4u;
				outString[outStringLength++] = newPhysicalSectionData[deviceId].FLockType;			   /*物理区段封锁产生的原因,SPKS或其他原因*/
				outString[outStringLength++] = newPhysicalSectionData[deviceId].UtOrCtOccFlag;		/*获取物理区段占用标志*/
				ShortToChar(newPhysicalSectionData[deviceId].SecProUseBelongRouteId,&outString[outStringLength]);/*征用所属进路ID*/
				outStringLength += 2u;
				ShortToChar(newPhysicalSectionData[deviceId].wPhyErrUnlockTime, &outString[outStringLength]);/*物理区段区故解延时时间*/
				outStringLength += 2u;
				outString[outStringLength++] = newPhysicalSectionData[deviceId].cAreaUrgentBrakeState;  /*物理区段区域紧急制动状态*/
				ShortToChar(newPhysicalSectionData[deviceId].StopSteadyTrainId, &outString[outStringLength]);/*物理区段区停稳关联列车ID*/
				outStringLength += 2u;
				outString[outStringLength++] = newPhysicalSectionData[deviceId].chABLTrainFlag;  /*物理区段ABL列车占用状态*/
				outString[outStringLength++] = newPhysicalSectionData[deviceId].chPreABLTrainFlag;  /*物理区段之前ABL列车占用状态*/
				outString[outStringLength++] = newPhysicalSectionData[deviceId].cPhySecInHumidRailFlag;  /*物理区段湿轨标志：0x55 无效；0xAA 有效*/
				LongToChar(newPhysicalSectionData[deviceId].UtOrCtOccuStartCycNum, &outString[outStringLength]);/*区段UT或CT占用起始周期号*/
				outStringLength += 4u;
            }
        }
    }

    if (0u == outStringLength)
    {
    }
    else
    {
        #ifdef PLATFORM_2OO2

        debug_infor_printf((const)"\nPhySectionData:%d\nPhysicalSectionId(2)-SecUseState-SecUseBelongRouteId(2)-LockState-RLockBelongRouteId(2)-PLockBelongRouteId(2)-LockDirection-FLockState-PreOccupyState-CurOccupyState-PreMergeOccupyState-CurMergeOccupyState-PreAndMergeOccupyState-CurAndMergeOccupyState-StopSteadyFlag-ArbState-ProtectSecLockDelayTimeFlag-StopCheckFlag-JumpLockState-JumpLockDelayUnlockFlag-SecJumpDelayUnlockStartCycNum(4)-SecCurOccupyStartCycNum(4)-SecOccuToClearStartCycNum(4)-AutoUnlockStartCycNum(4)-FaultUnlockStartCycNum(4)-SectionResetStartCycNum(4)-FLockType:%d",(UINT16)sizeof(PhysicalSectionDataStruct),outStringLength);

		debug_out_array(0xAA, outString, outStringLength);

        #endif


        #ifdef PLATFORM_LABVIEW_DEBUG

        Out_Array_Buffer(0,"\nPhySectionData:%d",(UINT16)sizeof(PhysicalSectionDataStruct));
        Out_Array_Buffer(0,"PhysicalSectionId(2)-SecUseState-SecUseBelongRouteId(2)-LockState-RLockBelongRouteId(2)-PLockBelongRouteId(2)-LockDirection-FLockState-PreOccupyState-CurOccupyState-PreMergeOccupyState-CurMergeOccupyState-StopSteadyFlag-SecCurOccupyStartCycNum(4)-SecOccuToClearStartCycNum(4)-AutoUnlockStartCycNum(4)-FaultUnlockStartCycNum(4)-SectionResetStartCycNum(4):%d",outStringLength);
        Out_Array_Buffer(16,outString,outStringLength);      
            
        #endif
            
        /*清空打印数据*/
        CleanString(outString);
        outStringLength = 0u;
    }

    
    /*************************************打印信号机数据********************************************/
    /*打印信号机数据*/
	deviceNum = GetTotalSignalCurNum();
    for (ii = 0u; ii < deviceNum; ii++)/*本联锁和相邻联锁发送给本联锁的信号机总数目*/
    {
        if (CI_SUCCESS != returnValue)
        {
            returnValue = CI_ERROR;
            break;
        }

        /*比较数据*/
        deviceId = GetSignalId(ii);
        comparaResult = DeviceCompara((UINT8*)(&Record_SignalDataStru[deviceId]), (UINT16)sizeof(SignalDataStruct),
            (UINT8*)(&newSignalData[deviceId]), (UINT16)sizeof(SignalDataStruct));

        if (0u==comparaResult)
        {/*比较数据一致*/

        }
        else if (1u==comparaResult )
        {/*比较数据不一致*/

            if (CI_ERROR != Flag)
            {
				/**************打印数据信息****************/

				ShortToChar(newSignalData[deviceId].SignalId,&outString[outStringLength]);/*信号机ID*/
				outStringLength += 2u;
				outString[outStringLength++] = newSignalData[deviceId].FLockState;/*封锁状态*/
				outString[outStringLength++] = newSignalData[deviceId].LightExtinctState;/*亮灭灯状态*/
				outString[outStringLength++] = newSignalData[deviceId].PreColor;/*之前显示颜色*/
				outString[outStringLength++] = newSignalData[deviceId].CurColor;/*当前显示颜色*/
				outString[outStringLength++] = newSignalData[deviceId].PreDriveColor;/*之前驱动颜色*/
				outString[outStringLength++] = newSignalData[deviceId].CurDriveColor;/*当前驱动颜色*/
				outString[outStringLength++] = newSignalData[deviceId].DsBreakFlag;/*灯丝断丝标志状态*/
				LongToChar(newSignalData[deviceId].DriveSigOpenStartCycNum,&outString[outStringLength]);/*驱动信号机开放起始周期*/
				outStringLength += 4u;
				LongToChar(newSignalData[deviceId].DriveSigCloseStartCycNum,&outString[outStringLength]);/*驱动信号机关闭起始周期*/
				outStringLength += 4u;
				LongToChar(newSignalData[deviceId].CollSigOpenStartCycNum,&outString[outStringLength]);  /*采集信号机开放起始周期*/
				outStringLength += 4u;
				outString[outStringLength++] = newSignalData[deviceId].SignalCrossState;/*信号机跨压状态*/
				outString[outStringLength++] = newSignalData[deviceId].SignalYLockOpenState;/*引导总锁信号开放状态*/
				outString[outStringLength++] = newSignalData[deviceId].AtsDetainFlag;/*Ats人工扣车标志*/
				outString[outStringLength++] = newSignalData[deviceId].AtsDetainFlagAuto;/*Ats自动扣车标志*/
				outString[outStringLength++] = newSignalData[deviceId].XiandiDetainFlag;/*现地扣车标志*/
				LongToChar(newSignalData[deviceId].RelayActaionStartCycNum,&outString[outStringLength]);/*信号机继电器动作开始周期*/
				outStringLength += 4u;
				outString[outStringLength++] = newSignalData[deviceId].PLockCommand;/*互联互通保护区段锁闭命令*/
				outString[outStringLength++] = newSignalData[deviceId].ProSecValid;/*互联互通保护区段有效性*/
				outString[outStringLength++] = newSignalData[deviceId].OldDriveColor;/*驱动信号机颜色变化之前,驱动信号机显示颜色 (动态字段) */
				LongToChar(newSignalData[deviceId].DriveNewSigStartCycNum, &outString[outStringLength]);/*信号机驱动新显示色开始周期*/  
				outStringLength += 4u;
				LongToChar(newSignalData[deviceId].SignalLightOnStateCycCount, &outString[outStringLength]); /*信号机收到强制点灯强制灭灯状态持续计数值*/
				outStringLength += 4u;
				outString[outStringLength++] = newSignalData[deviceId].RealyDetainFlag;/*硬线扣车标志*/
				outString[outStringLength++] = newSignalData[deviceId].RelayDetainCmd;/*硬线扣车标志*/
				outString[outStringLength++] = newSignalData[deviceId].NeighbourSignalDetainDrive; /*邻站信号机扣车驱动命令*/
				outString[outStringLength++] = newSignalData[deviceId].GreenDsBreakFlag;/*绿灯丝断丝标志状态*/
				outString[outStringLength++] = newSignalData[deviceId].YellowDsBreakFlag;/*黄灯丝断丝标志状态*/
				outString[outStringLength++] = newSignalData[deviceId].WhiteDsBreakFlag;/*白灯丝断丝标志状态*/
				outString[outStringLength++] = newSignalData[deviceId].BlueDsBreakFlag;/*蓝灯丝断丝标志状态*/
				outString[outStringLength++] = newSignalData[deviceId].RedYellowDsBreakFlag;/*红黄灯丝断丝标志状态*/
				outString[outStringLength++] = newSignalData[deviceId].RedWhiteDsBreakFlag;/*红白灯丝断丝标志状态*/
				outString[outStringLength++] = newSignalData[deviceId].GreenYellowDsBreakFlag;/*绿黄灯丝断丝标志状态*/
				outString[outStringLength++] = newSignalData[deviceId].DoubleGreenDsBreakFlag;/*双绿灯丝断丝标志状态*/
				outString[outStringLength++] = newSignalData[deviceId].DoubleYellowDsBreakFlag;/*双黄灯丝断丝标志状态*/
				outString[outStringLength++] = newSignalData[deviceId].MaintainLightState;/*信号机维修点灯状态*/

				if (MAX_SIGNAL_LIGHTUPLINK_NUM < newSignalData[deviceId].wSignalLightUpLinkIdSum)
				{
					/* 数量合法 */
					ShortToChar(0u, &outString[outStringLength]);/*信号机点灯link数量*/
					outStringLength += 2u;
				}
				else
				{
					/* 数量合法 */
					ShortToChar(newSignalData[deviceId].wSignalLightUpLinkIdSum, &outString[outStringLength]);/*信号机点灯link数量*/
					outStringLength += 2u;

					for (jj = 0u; jj < newSignalData[deviceId].wSignalLightUpLinkIdSum; jj++)
					{
						ShortToChar(newSignalData[deviceId].szSignalLightUpLinkIdBuf[jj], &outString[outStringLength]);/*信号机点灯link数量*/
						outStringLength += 2u;
					}
				}

				outString[outStringLength++] = newSignalData[deviceId].DetainBtnActivateFlag;   /*扣车按钮激活标志*/
				outString[outStringLength++] = newSignalData[deviceId].DetainBtnErrFlag;  /*扣车按钮故障标志*/
				outString[outStringLength++] = newSignalData[deviceId].CancelDetainBtnErrFlag;  /*取消扣车按钮故障标志*/
				outString[outStringLength++] = newSignalData[deviceId].CancelDetainBtnValidFlag;  /*取消扣车按钮有效标志*/
				outString[outStringLength++] = newSignalData[deviceId].CancelDetainRelayDownState;  /*取消扣车按钮采集继电器落下状态*/
				LongToChar(newSignalData[deviceId].DetainBtnPressCycNum, &outString[outStringLength]);  /*扣车按钮1按下周期*/
				outStringLength += 4u;
				LongToChar(newSignalData[deviceId].DetainSndBtnPressCycNum, &outString[outStringLength]);  /*扣车按钮2按下周期*/
				outStringLength += 4U;
				LongToChar(newSignalData[deviceId].CancelDetainBtnPressCycNum, &outString[outStringLength]); /*取消扣车按钮正常按下周期*/
				outStringLength += 4u;
				LongToChar(newSignalData[deviceId].CancelDetainErrTrigPressCycNum, &outString[outStringLength]); /*取消扣车按钮误触发按下周期*/
				outStringLength += 4u;
				ShortToChar(newSignalData[deviceId].wSignalLightUpTrainId, &outString[outStringLength]);/*信号机点灯区段接近列车ID*/
				outStringLength += 2u;
				outString[outStringLength++] = newSignalData[deviceId].cSleepTrainLightUpFlag;  /*休眠车点亮信号机标志：0x55 无效，0xAA 有效*/
				outString[outStringLength++] = newSignalData[deviceId].cInHumidRailFlag;  /*信号机湿轨标志：0x55 无效，0xAA 有效*/
				outString[outStringLength] = newSignalData[deviceId].cDetCutBtnState;  /*扣车旁路按钮状态：0x55-无效，0xAA-有效*/
				outStringLength++;
				LongToChar(newSignalData[deviceId].DetCutBtnPressCycNum, &outString[outStringLength]); /*扣车旁路按钮正常按下周期*/
				outStringLength += 4U;
				LongToChar(newSignalData[deviceId].DetCutBtnErrTrigPressCycNum, &outString[outStringLength]); /*扣车旁路按钮误触发按下周期*/
				outStringLength += 4U;
				outString[outStringLength] = newSignalData[deviceId].cDetCutBtnErrFlag;  /*扣车旁路按钮故障标志：0x55未故障，0xaa故障*/
				outStringLength++;
				outString[outStringLength] = newSignalData[deviceId].cDetCutBtnRelayDownState;  /*扣车旁路按钮采集继电器落下状态：0x55：正常采集落下，0xaa：通信异常落下*/
				outStringLength++;
            }
        }
        else
        {
            returnValue = CI_ERROR;
        }        
    }   
    
    if (0u == outStringLength)
    {
    }
    else
    {
        #ifdef PLATFORM_2OO2
        debug_infor_printf((const)"\nSignalData:%d\nSignalId(2)-FLockState-LightExtinctState-PreColor-CurColor-PreDriveColor-CurDriveColor-DsBreakFlag-DriveSigOpenStartCycNum(4)-DriveSigCloseStartCycNum(4)-CollSigOpenStartCycNum(4)-SignalCrossState-SignalYLockOpenState-AtsDetainFlag-XiandiDetainFlag-RelayActaionStartCycNum(4)-PLockCommand-ProSecValid-OldDriveColor-DriveNewSigStartCycNum(4)-SignalLightOnStateCycCount(4):%d",(UINT16)sizeof(SignalDataStruct),outStringLength);

		debug_out_array(0xAA, outString, outStringLength);
        #endif

        #ifdef PLATFORM_LABVIEW_DEBUG

        Out_Array_Buffer(0,"\nSignalData:%d",(UINT16)sizeof(SignalDataStruct));
        Out_Array_Buffer(0,"SignalId(2)-FLockState-LightExtinctState-PreColor-CurColor-PreDriveColor-CurDriveColor-DsBreakFlag-DriveSigOpenStartCycNum(4)-DriveSigCloseStartCycNum(4)-CollSigOpenStartCycNum(4)-SignalCrossState-SignalYLockOpenState-AtsDetainFlag-XiandiDetainFlag:%d",outStringLength);
        Out_Array_Buffer(16,outString,outStringLength);
        
        #endif
        
        /*清空打印数据*/
        CleanString(outString);
        outStringLength = 0u;
    }
    
	/*************************************打印ESB数据********************************************/
	/*打印ESB数据*/
	deviceNum = GetTotalEsbCurNum();
	for (ii = 0u; ii < deviceNum; ii++)/*本联锁和相邻联锁发送给本联锁的ESB总数目*/
	{
		if (CI_SUCCESS != returnValue)
		{
			returnValue = CI_ERROR;
			break;
		}

		/*比较数据*/
		deviceId = GetEsbId(ii);
		comparaResult = DeviceCompara((UINT8*)(&Record_EsbDataStru[deviceId]), (UINT16)sizeof(EsbDataStruct),
			(UINT8*)(&pNewEsbData[deviceId]), (UINT16)sizeof(EsbDataStruct));

		if (0u == comparaResult)
		{/*比较数据一致*/

		}
		else if (1u == comparaResult)
		{/*比较数据不一致*/

			if (CI_ERROR != Flag)
			{
				/**************打印数据信息****************/

				ShortToChar(pNewEsbData[deviceId].EsbId, &outString[outStringLength]);/*ESBID*/
				outStringLength += 2u;
				outString[outStringLength++] = pNewEsbData[deviceId].EsbState;/*紧急停车按钮状态 (动态字段)-ESS与PEP的融合状态*/
				outString[outStringLength++] = pNewEsbData[deviceId].EssState;/*Ess按钮状态 (动态字段)--虚拟属性才具备*/
				outString[outStringLength++] = pNewEsbData[deviceId].EsbActualState;/*ESB停车按钮状态--ATS抬起/按下状态（虚拟属性才具备）*/
				outString[outStringLength++] = pNewEsbData[deviceId].CutStatus;/*紧急停车按钮旁路状态*/
				outString[outStringLength++] = pNewEsbData[deviceId].EsbRelateRelayDriveState;/*紧急停车闪灯、稳灯和蜂鸣器继电器驱动状态机*/
				outString[outStringLength++] = pNewEsbData[deviceId].EssSteadyState;/*ESS稳灯状态（用于虚拟联锁向ATS反馈）--0x55 需要设置稳灯；0xaa不需要设置稳灯*/
				outString[outStringLength++] = pNewEsbData[deviceId].EssFlashState;/*ESS闪灯状态（用于虚拟联锁向ATS反馈）--0x55 需要设置闪灯；0xaa不需要设置闪灯*/
				outString[outStringLength++] = pNewEsbData[deviceId].EsbErrorFlag;/*自复式紧急停车按钮故障标志，0x55未故障，0xaa故障*/
				outString[outStringLength++] = pNewEsbData[deviceId].EsbRelayDownState;/*紧急关闭按钮采集继电器落下状态，0x55：正常采集落下，0xaa：通信异常落下*/
				outString[outStringLength++] = pNewEsbData[deviceId].CancelEsbErrorFlag;/*自复式取消紧急停车按钮故障标志，0x55未故障，0xaa故障*/
				outString[outStringLength++] = pNewEsbData[deviceId].CancelEsbValidFlag;/*取消紧急关闭按钮有效标志，0x55无效，0xaa有效*/
				outString[outStringLength++] = pNewEsbData[deviceId].CancelEsbRelayDownState;/*取消紧急关闭按钮采集继电器落下状态，0x55：正常采集落下，0xaa：通信异常落下*/
				LongToChar(pNewEsbData[deviceId].EsbPressCycNum, &outString[outStringLength]);/*紧急关闭按钮按下周期*/
				outStringLength += 4u;
				LongToChar(pNewEsbData[deviceId].CancelEsbPressCycNum, &outString[outStringLength]);/*取消紧急关闭按钮按下周期*/
				outStringLength += 4u;
				LongToChar(pNewEsbData[deviceId].CancelEsbErrTriggerPressCycNum, &outString[outStringLength]);/*取消紧急关闭按钮误触发按下周期*/
				outStringLength += 4U;
				outString[outStringLength++] = pNewEsbData[deviceId].EsbCutErrorFlag;  /*紧急关闭旁路按钮故障标志，0x55未故障，0xaa故障*/
				outString[outStringLength++] = pNewEsbData[deviceId].EsbCutRelayDownState;  /*紧急关闭旁路按钮采集继电器落下状态，0x55：正常采集落下，0xaa：通信异常落下*/
				LongToChar(pNewEsbData[deviceId].EsbCutPressCycNum, &outString[outStringLength]);  /*紧急关闭旁路按钮按下周期*/
				outStringLength += 4u;
				LongToChar(pNewEsbData[deviceId].EsbCutErrTriggerPressCycNum, &outString[outStringLength]);  /*紧急关闭旁路按钮误触发按下周期*/
				outStringLength += 4U;
			}
		}
		else
		{
			returnValue = CI_ERROR;
		}
	}

	if (0u == outStringLength)
	{
	}
	else
	{
#ifdef PLATFORM_2OO2
		debug_infor_printf((const)"\nEsbData:%d\nEsbId(2)-EsbState-EssState-EsbActualState-CutStatus-EsbRelateRelayDriveState-EssSteadyState-EssFlashState-CancelEsbErrorFlag-CancelEsbValidFlag-EsbPressCycNum(4)-CancelEsbPressCycNum(4):%d", (UINT16)sizeof(SignalDataStruct), outStringLength);

		debug_out_array(0xAA, outString, outStringLength);
#endif

#ifdef PLATFORM_LABVIEW_DEBUG

		Out_Array_Buffer(0, "\nSignalData:%d", (UINT16)sizeof(SignalDataStruct));
		Out_Array_Buffer(0, "SignalId(2)-FLockState-LightExtinctState-PreColor-CurColor-PreDriveColor-CurDriveColor-DsBreakFlag-DriveSigOpenStartCycNum(4)-DriveSigCloseStartCycNum(4)-CollSigOpenStartCycNum(4)-SignalCrossState-SignalYLockOpenState-AtsDetainFlag-XiandiDetainFlag:%d", outStringLength);
		Out_Array_Buffer(16, outString, outStringLength);

#endif

		/*清空打印数据*/
		CleanString(outString);
		outStringLength = 0u;
	}
    

    /*************************************打印道岔数据********************************************/
    /*打印道岔数据*/
	deviceNum = GetTotalSwitchCurNum();
    for (ii = 0u; ii < deviceNum; ii++)/*本联锁和相邻联锁发送给本联锁的道岔总数目*/
    {
        if (CI_SUCCESS != returnValue)
        {
            returnValue = CI_ERROR;
            break;
        }

        /*比较数据*/
        deviceId = GetSwitchId(ii);
        comparaResult = DeviceCompara((UINT8*)(&Record_SwitchDataStru[deviceId]), (UINT16)sizeof(SwitchDataStruct),
            (UINT8*)(&newSwitchData[deviceId]), (UINT16)sizeof(SwitchDataStruct));

        if (0u==comparaResult)
        {/*比较数据一致*/

        }
        else if (1u==comparaResult )
        {/*比较数据不一致*/

            if (CI_ERROR != Flag)
            {   
				/**************打印数据信息****************/

				ShortToChar(newSwitchData[deviceId].SwitchId,&outString[outStringLength]);/*道岔ID*/
				outStringLength += 2u;
				outString[outStringLength++] = newSwitchData[deviceId].YLockState;/*引导总锁状态*/
				outString[outStringLength++] = newSwitchData[deviceId].LockStatus;/*锁闭状态*/
				outString[outStringLength++] = newSwitchData[deviceId].FLockState;/*封锁状态*/
				outString[outStringLength++] = newSwitchData[deviceId].SwitchPrePosition;/*道岔之前位置*/
				outString[outStringLength++] = newSwitchData[deviceId].SwitchCurPosition;/*道岔当前位置*/
				outString[outStringLength++] = newSwitchData[deviceId].SingleSwitchCurPosition;/*单独道岔当前位置*/
				outString[outStringLength++] = newSwitchData[deviceId].SwitchDrivePos;/*道岔驱动位置*/
				outString[outStringLength++] = newSwitchData[deviceId].SwitchDanCaoPostition;/*道岔单操位置*/
				LongToChar(newSwitchData[deviceId].SwitMoveStartCycNum,&outString[outStringLength]);/*道岔动作起始周期号*/
				outStringLength += 4u;
				LongToChar(newSwitchData[deviceId].SwitDriveStartCycNum,&outString[outStringLength]);/*道岔驱动起始周期号*/
				outStringLength += 4u;
				outString[outStringLength++] = newSwitchData[deviceId].chSwitchDrivedFlag;/*道岔被驱动过标志*/
				outString[outStringLength++] = newSwitchData[deviceId].SwitchExpDrvPos;/*道岔期望驱动位置*/
				outString[outStringLength++] = newSwitchData[deviceId].switchPreExpDrvPos;/*道岔之前期望驱动位置*/
				outString[outStringLength++] = newSwitchData[deviceId].switchDrivingState;/*道岔驱动状态*/
				outString[outStringLength++] = newSwitchData[deviceId].switchDrivOvtmDrvPos;/*道岔驱动超时位置*/
				/* zt 删除单轨相关代码 2022-02-15 */
				outString[outStringLength++] = newSwitchData[deviceId].switchLastValidDrvPos;/*道岔最近的有效驱动状态*/
				LongToChar(newSwitchData[deviceId].switchLastValidDrvPosCycleNum,&outString[outStringLength]);/*道岔最近的有效驱动状态起始周期*/
				outStringLength += 4u;
				outString[outStringLength++] = newSwitchData[deviceId].cSwitchUsingState;   /*道岔征用状态：0x11：未征用，0x22：征用，0x44：申请征用，0x88：申请取消征用*/
				ShortToChar(newSwitchData[deviceId].UsingBelongOverlapId,&outString[outStringLength]);/*征用该道岔的保护区段ID*/
				outStringLength += 2u;
				outString[outStringLength++] = newSwitchData[deviceId].PLockedRouteNum;/*被防护锁闭的进路ID数量*/
				for (jj=0;jj<SWITCH_MAX_PROTECT_LOCKED_NUM;jj++)
				{
					ShortToChar(newSwitchData[deviceId].PLockedRouteIdArr[jj],&outString[outStringLength]);
					outStringLength += 2u;
				}
				outString[outStringLength++] = newSwitchData[deviceId].PLockedOverlapNum;/*被防护锁闭的保护区段*/
				for (jj=0;jj<SWITCH_MAX_PROTECT_LOCKED_NUM;jj++)
				{
					ShortToChar(newSwitchData[deviceId].PLockedOverlapIdArr[jj],&outString[outStringLength]);
					outStringLength += 2u;
				}
				outString[outStringLength++] = newSwitchData[deviceId].PLockedNonRouteNum;/*被防护锁闭的非进路*/
				for (jj=0;jj<SWITCH_MAX_PROTECT_LOCKED_NUM;jj++)
				{
					ShortToChar(newSwitchData[deviceId].PLockedNonRouteIdArr[jj],&outString[outStringLength]);
					outStringLength += 2u;
				}
				LongToChar(newSwitchData[deviceId].DFHRelayValidCycNum,&outString[outStringLength]);/*DFH继电器有效，DFH继电器吸起状态有效周期数*/
				outStringLength += 4u;
				LongToChar(newSwitchData[deviceId].SigleDFHRelayValidCycNum,&outString[outStringLength]);/*单独DFH继电器有效，DFH继电器吸起状态有效周期数*/
				outStringLength += 4u;
				LongToChar(newSwitchData[deviceId].YCRelayValidCycNum,&outString[outStringLength]);/*YC继电器有效，YC继电器吸起状态有效周期数*/
				outStringLength += 4u;
				LongToChar(newSwitchData[deviceId].SigleYCRelayValidCycNum,&outString[outStringLength]);/*单独YC继电器有效，YC继电器吸起状态有效周期数*/
				outStringLength += 4u;
				outString[outStringLength++] = newSwitchData[deviceId].ConnetSwitchDsState; /*联络线道岔单锁状态*/
				outString[outStringLength++] = newSwitchData[deviceId].SwitchByPassState;   /*道岔旁路状态*/
				outString[outStringLength++] = newSwitchData[deviceId].chSwitchJichaState;   /*道岔挤岔状态*/
				LongToChar(newSwitchData[deviceId].SwitchCollTolerateCycNum, &outString[outStringLength]);/*容忍周期号*/
				outStringLength += 4u;
            }
        }
        else
        {
            returnValue = CI_ERROR;
        }     
    }
    
    if (outStringLength == 0u)
    {
    }
    else
    {
        #ifdef PLATFORM_2OO2
        debug_infor_printf((const)"\nSwitchData:%d\nSwitchId(2)-YLockState-DLockState-FLockState-SwitchPrePosition-SwitchCurPosition-SwitchDrivePos-SwitchDanCaoPostition-SwitMoveStartCycNum(4)-SwitDriveStartCycNum(4)-SwitchExpDrvPos-switchPreExpDrvPos-switchDrivingState-switchDrivOvtmDrvPos-switchFaultState-switchApplyState-switchAuthorizeState-switchKRState-switchGrndCtrlApprState-switchLastValidDrvPos-switchLastValidDrvPosCycleNum(4)-UsingBelongOverlapId(2)-DFHRelayValidCycNum(4)-SigleDFHRelayValidCycNum(4)-YCRelayValidCycNum(4)-SigleYCRelayValidCycNum(4):%d",(UINT16)sizeof(SwitchDataStruct),outStringLength);

		debug_out_array(0xAA, outString, outStringLength);
        #endif

        #ifdef PLATFORM_LABVIEW_DEBUG

        Out_Array_Buffer(0,"\nSwitchData:%d",(UINT16)sizeof(SwitchDataStruct));
        Out_Array_Buffer(0,"SwitchId(2)-YLockState-DLockState-FLockState-SwitchPrePosition-SwitchCurPosition-SwitchDrivePos-SwitchDanCaoPostition-SwitMoveStartCycNum(4)-SwitDriveStartCycNum(4):%d",outStringLength);
        Out_Array_Buffer(16,outString,outStringLength);
        
        #endif
        
        /*清空打印数据*/
        CleanString(outString);
        outStringLength = 0u;
    }
    
    /*************************************打印进路数据********************************************/
    /*打印进路数据*/
	deviceNum =  GetRouteCurSum();
    for (ii = 0u; ii < deviceNum; ii++)/*本联锁和相邻联锁发送给本联锁的进路总数目*/
    {
        if (CI_SUCCESS != returnValue)
        {
            returnValue = CI_ERROR;
            break;
        }

        /*比较数据*/
        deviceId = GetRouteId(ii);
        comparaResult = DeviceCompara((UINT8*)(&Record_RouteDataStru[deviceId]), (UINT16)sizeof(RouteDataStruct),
            (UINT8*)(&newRouteData[deviceId]), (UINT16)sizeof(RouteDataStruct));

        if (0u==comparaResult)
        {/*比较数据一致*/
            
        }
        else if (1u==comparaResult )
        {/*比较数据不一致*/
            
            if (CI_ERROR != Flag)
            {
				/**************打印数据信息****************/

				ShortToChar(newRouteData[deviceId].RouteId,&outString[outStringLength]);/*进路ID*/
				outStringLength += 2u;
				outString[outStringLength++] = newRouteData[deviceId].RouteState;/*进路状态*/
				outString[outStringLength++] = newRouteData[deviceId].RouteLevel;/*进路监督级别*/
				outString[outStringLength++] = newRouteData[deviceId].ZongQuXiaoFlag;/*总取消标志*/
				outString[outStringLength++] = newRouteData[deviceId].ZongRenJieFlag;/*总人解标志*/
				outString[outStringLength++] = newRouteData[deviceId].RepeatOpenFlag;/*信号重开标志*/
				outString[outStringLength++] = newRouteData[deviceId].StopCheckFlag;/*停止检查标志*/
				ShortToChar(newRouteData[deviceId].AutoRouteId,&outString[outStringLength]);/*自动通过进路ID*/
				outStringLength += 2u;
				ShortToChar(newRouteData[deviceId].AutoReturnId,&outString[outStringLength]);/*自动折返进路ID*/
				outStringLength += 2u;
				ShortToChar(newRouteData[deviceId].BelongLongRouteId,&outString[outStringLength]);/*所属长调进路ID*/
				outStringLength += 2u;
				LongToChar(newRouteData[deviceId].XuanPaiStartCycNum,&outString[outStringLength]);/*选排起始周期号*/
				outStringLength += 4u;
				LongToChar(newRouteData[deviceId].RouteLockStartCycNum,&outString[outStringLength]);/*进路锁闭起始周期号*/
				outStringLength += 4u;
				LongToChar(newRouteData[deviceId].OverlapLockStartCycNum,&outString[outStringLength]);/*保护区段锁闭起始周期号*/
				outStringLength += 4u;
				LongToChar(newRouteData[deviceId].RouteOpenSigStatrtCycNum,&outString[outStringLength]);/*进路信号开放起始周期号*/
				outStringLength += 4u;
				LongToChar(newRouteData[deviceId].DelayUnlockStartCycNum,&outString[outStringLength]);/*进路延时解锁起始周期号*/
				outStringLength += 4u;
				LongToChar(newRouteData[deviceId].LeadFaultOpenStartCycNum,&outString[outStringLength]);/*信号内方第一区段故障引导信号开放起始周期号*/
				outStringLength += 4u;
				ShortToChar(newRouteData[deviceId].AllAutoReturnId,&outString[outStringLength]);/*全自动折返进路ID*/
				outStringLength += 2u;
				outString[outStringLength++] = newRouteData[deviceId].StopensureFlag;/*停车保证标志*/
				outString[outStringLength++] = newRouteData[deviceId].StopKeepCheckFlag; /* 保持时候用的停车保证标志 */
				outString[outStringLength++] = newRouteData[deviceId].RouteStateFlag;       /*进路状态标志（1：表示有效；0：表示无效）*/
				outString[outStringLength++] = newRouteData[deviceId].TrainEnterFlag;/*列车驶入标志*/
				outString[outStringLength++] = newRouteData[deviceId].ZongRenJieDelayType;/*总人解延时类型，分为：倒计时结束后立刻全部区段解锁，第一个占压的物理区段前变异常锁闭，所有的物理区段变异常锁闭*/
				outString[outStringLength++] = newRouteData[deviceId].RecoverOpenState;/*进路需要重开状态，用于处理PSD、SPKS、扣车恢复重开信号*/
				ShortToChar(newRouteData[deviceId].OverlapLockedId,&outString[outStringLength]);/*当前进路Overlap锁闭过OverlapId*/
				outStringLength += 2u;
				ShortToChar(newRouteData[deviceId].atsExptLkOverlapId,&outString[outStringLength]);/*ATS或现地期望锁闭的OverlapId*/
				outStringLength += 2u;
				ShortToChar(newRouteData[deviceId].OtherCIRouteOvlpUTUnlockCount,&outString[outStringLength]);/*其它联锁进路保护区段UT解锁周期数*/
				outStringLength += 2u;
				ShortToChar(newRouteData[deviceId].OtherCIRouteOvlpCTUnlockCount,&outString[outStringLength]);/*其它联锁进路保护区段CT解锁周期数*/
				outStringLength += 2u;
				outString[outStringLength++] = newRouteData[deviceId].NeedOpenNotTrueRepeatFlag;/*需开放重开标志*/
				LongToChar(newRouteData[deviceId].NeedOpenNotTrueRepeatStartCount,&outString[outStringLength]);/*需开放不满足时，重开起始周期*/
				outStringLength += 4u;
				outString[outStringLength++] = newRouteData[deviceId].DCQState;/*调车请求状态*/
				outString[outStringLength++] = newRouteData[deviceId].DCTYState;/*调车同意状态*/
				LongToChar(newRouteData[deviceId].dwDcAgreeBtnPressCycNum, &outString[outStringLength]);/*调车同意按钮按下起始周期*/
				outStringLength += 4u;
				outString[outStringLength++] = newRouteData[deviceId].chDcAgreeButtonErrState;/*调车同意按钮故障状态*/
				outString[outStringLength++] = newRouteData[deviceId].DCTYNotSatisfySignalReOpenFlag;/*调车同意不满足-信号重开标志*/
				LongToChar(newRouteData[deviceId].DCTYNotSatisfyStartCount,&outString[outStringLength]);/*调车同意不满足-起始周期*/
				outStringLength += 4u;
				outString[outStringLength++] = newRouteData[deviceId].CancleDelayflag; /*取消进路延时标志状态*/
				LongToChar(newRouteData[deviceId].RouteKeepSignalTolerateCycNum,&outString[outStringLength]);/*点式进路处于信号开放状态下，终端信号机亮灯状态检查不通过，信号保持容忍开放状态开始周期*/
				outStringLength += 4u;
				outString[outStringLength++] = newRouteData[deviceId].AutoSigCancleState;  /*其他联锁自动信号进路取消状态*/
                outString[outStringLength++] = newRouteData[deviceId].CancleAutoSigCmd;   /*相邻联锁自动信号取消命令标志*/
				outString[outStringLength++] = newRouteData[deviceId].AutoSigPropertyLoseEfficacyFlag;   /*自动信号属性失效标志（未设置/设置）*/
				outString[outStringLength++] = newRouteData[deviceId].OverlapNeedCIlockFlag;   /*保护区段需要CI锁闭标志*/
				outString[outStringLength++] = newRouteData[deviceId].OverlapLockProcFlag;     /*保护区段在锁闭过程中标志*/
				ShortToChar(newRouteData[deviceId].wStopEnsureTrainId, &outString[outStringLength]);/*进路停车保证列车ID*/
				outStringLength += 2u;
				LongToChar(newRouteData[deviceId].dwStopEnsureCyc, &outString[outStringLength]);/*停车保证询问周期号*/
				outStringLength += 4u;
				outString[outStringLength++] = newRouteData[deviceId].cResReqOtherCIId;   /*发送资源申请的联锁ID*/


				if (ROUTE_APPLY_RECD_TRAIN_SUM_MAX >= newRouteData[deviceId].chResReqTrainSum)
				{
					outString[outStringLength++] = newRouteData[deviceId].chResReqTrainSum;   /*发送资源申请的联锁ID*/
					for (jj = 0u; jj < newRouteData[deviceId].chResReqTrainSum; jj++)
					{
						ShortToChar(newRouteData[deviceId].wszResReqTrainId[jj], &outString[outStringLength]);/*发送资源申请的列车ID*/
						outStringLength += 2u;
					}
				}
				else
				{
					outString[outStringLength++] = 0u;   /*发送资源申请的联锁ID*/
				}

				if (ROUTE_APPLY_RECD_TRAIN_SUM_MAX >= newRouteData[deviceId].ITSRouteApplyTrainIdSum)
				{
					outString[outStringLength++] = newRouteData[deviceId].ITSRouteApplyTrainIdSum;   /*ITS申请路径命令的列车ID记录总数*/

					for (jj = 0u; jj < newRouteData[deviceId].ITSRouteApplyTrainIdSum; jj++)
					{
						ShortToChar(newRouteData[deviceId].ITSRouteApplyTrainIdBuf[jj], &outString[outStringLength]);/*通过ITS申请路径命令记录的列车ID数组*/
						outStringLength += 2u;
					}

				}
				else
				{
					outString[outStringLength++] = 0u;
				}

				/*可动道岔标志*/
				outString[outStringLength++] = newRouteData[deviceId].HalfRouteDataSt.HalfRouteSwitchMoveValid;
				
				if (MAX_ROUTE_IN_LT_NUM > newRouteData[deviceId].HalfRouteDataSt.RouteLockLgcSecNum)
				{
					/*部分锁闭逻辑区段数量*/
					outString[outStringLength++] = newRouteData[deviceId].HalfRouteDataSt.RouteLockLgcSecNum;   
					/*部分锁闭逻辑区段ID*/
					for (jj = 0u; jj < newRouteData[deviceId].HalfRouteDataSt.RouteLockLgcSecNum; jj++)
					{
						ShortToChar(newRouteData[deviceId].HalfRouteDataSt.RouteLockLgcSecIdBuf[jj], &outString[outStringLength]);/*通过ITS申请路径命令记录的列车ID数组*/
						outStringLength += 2u;
					}

				}
				else
				{
					outString[outStringLength++] = 0u;
				}
				/*部分锁闭列车ID*/
				ShortToChar(newRouteData[deviceId].HalfRouteDataSt.HalfResReqTrainId, &outString[outStringLength]);/*通过ITS申请路径命令记录的列车ID数组*/
				outStringLength += 2u;
		
				if (ROUTE_TRAIN_LOC_MAX_LGC_SUM >= newRouteData[deviceId].HalfRouteDataSt.TrainLocLgcSecNum)
				{
					/*部分锁闭列车身下资源数量*/
					outString[outStringLength++] = newRouteData[deviceId].HalfRouteDataSt.TrainLocLgcSecNum;  

					for (jj = 0u; jj < newRouteData[deviceId].HalfRouteDataSt.TrainLocLgcSecNum; jj++)
					{
						/*部分锁闭列车身下资源逻辑区段ID*/
						ShortToChar(newRouteData[deviceId].HalfRouteDataSt.TrainLocLgcSecIdBuf[jj], &outString[outStringLength]);/*通过ITS申请路径命令记录的列车ID数组*/
						outStringLength += 2u;
					}

				}
				else
				{
					outString[outStringLength++] = 0u;
				}
				LongToChar(newRouteData[deviceId].dwFirstElockStartCycNum, &outString[outStringLength]); /*进路第一个锁闭的逻辑区段延时设置区段故障起始周期号*/
				outStringLength += 4u;

				outString[outStringLength++] = newRouteData[deviceId].cRelZuHeRouteSGBJDelayFlag;  /*关联组合进路声光报警是否延时标志*/

				LongToChar(newRouteData[deviceId].dwDelayOpenStartCycNum, &outString[outStringLength]); /*声光报警进路延时开放延时起始周期*/
				outStringLength += 4u;

				outString[outStringLength++] = newRouteData[deviceId].cRouteNeedDriveSGBJFlag;  /*进路驱动声光报警标志*/

				outString[outStringLength++] = newRouteData[deviceId].cRouteDrivedSGBJFlag;  /*进路驱动声光报警标志：0x55 未驱动过；0xAA 已驱动过*/
				outString[outStringLength++] = newRouteData[deviceId].chRouteNearSecSearchState;  /*进路接近区段查询状态是否有故障车*/
				outString[outStringLength++] = newRouteData[deviceId].chRouteApplySwitchCheckFlag;  /*进路办理相邻控区道岔检查标志*/
            }
        }
		else
        {
            returnValue = CI_ERROR;
        }
    }

    if (outStringLength == 0u)
    {
    }
    else
    {
        #ifdef PLATFORM_2OO2
        debug_infor_printf((const)"\nRouteData:%d\nRouteId(2)-RouteState-RouteLevel-ZongQuXiaoFlag-ZongRenJieFlag-RepeatOpenFlag-StopCheckFlag-AutoRouteId(2)-AutoReturnId(2)-BelongLongRouteId(2)-XuanPaiStartCycNum(4)-RouteLockStartCycNum(4)-OverlapLockStartCycNum(4)-RouteOpenSigStatrtCycNum(4)-DelayUnlockStartCycNum(4)-LeadFaultOpenStartCycNum(4)-AllAutoReturnId(2)-StopensureFlag-StopKeepCheckFlag-RouteStateFlag-TrainEnterFlag-ZongRenJieDelayType-RecoverOpenState-OverlapLockedId-atsExptLkOverlapId:%d",(UINT16)sizeof(RouteDataStruct),outStringLength);

		debug_out_array(0xAA, outString, outStringLength);
        #endif

        #ifdef PLATFORM_LABVIEW_DEBUG

        Out_Array_Buffer(0,"\nRouteData:%d",(UINT16)sizeof(RouteDataStruct));
        Out_Array_Buffer(0,"RouteId(2)-RouteState-RouteLevel-ZongQuXiaoFlag-ZongRenJieFlag-RepeatOpenFlag-StopCheckFlag-AutoRouteId(2)-AutoReturnId(2)-BelongLongRouteId(2)-XuanPaiStartCycNum(4)-RouteLockStartCycNum(4)-OverlapLockStartCycNum(4)-RouteOpenSigStatrtCycNum(4)-DelayUnlockStartCycNum(4)-LeadFaultOpenStartCycNum(4)-AllAutoReturnId(2)-StopensureFlag:%d",outStringLength);
        Out_Array_Buffer(16,outString,outStringLength);        

        #endif
        /*清空打印数据*/
        CleanString(outString);
        outStringLength = 0u;
    }


	/*************************************打印非进路数据********************************************/
	/*打印非进路调车数据*/
	localCiType = GetLocalCiType();
	if (CI_TYPE_CLD == localCiType)
	{/*车辆段联锁*/

		if (CI_SUCCESS != returnValue)
		{
			returnValue = CI_ERROR;
			return returnValue;
		}

		for (ii=0u;ii<NONROUTE_ID_NUM_MAX;ii++ )
		{
			/*比较数据*/
			comparaResult = DeviceCompara((UINT8*)(Record_NonRouteDataStru+ii), (UINT16)(sizeof(NonRouteDataStruct)),
				(UINT8*)(newNonRouteDataStru+ii), (UINT16)(sizeof(NonRouteDataStruct)));

			if (0u==comparaResult)
			{/*比较数据一致*/

			}
			else if (1u==comparaResult )
			{/*比较数据不一致*/

				if (CI_ERROR==Flag)
				{/*不打印设备数据*/


				}
				else
				{
					/**************打印数据信息****************/
					outString[outStringLength++] = (newNonRouteDataStru+ii)->NonRouteId;/*非进路调车ID*/
					outString[outStringLength++] = (newNonRouteDataStru+ii)->NonRouteState;/*非进路调车状态*/
					outString[outStringLength++] = (newNonRouteDataStru+ii)->HaveCancelFlag;/*非进路调车取消过标志*/
					outString[outStringLength++] = (newNonRouteDataStru+ii)->CancelFlag;/*非进路调车取消标志*/
					outString[outStringLength++] = (newNonRouteDataStru+ii)->RunMode;/*非进路调车运行模式*/
					LongToChar((newNonRouteDataStru+ii)->XuanPaiStartCycleNum,&outString[outStringLength]);/*选排起始周期*/
					outStringLength += 4u;
					LongToChar((newNonRouteDataStru+ii)->SigOpenStartCycleNum,&outString[outStringLength]);/*信号开放起始周期*/
					outStringLength += 4u;
					LongToChar((newNonRouteDataStru+ii)->DelayUnlockStartCycleNum,&outString[outStringLength]);/*当前非进路解锁延时周期*/
					outStringLength += 4u;

				}



			}
			else
			{/*比较错误*/

				returnValue = CI_ERROR;
			}
		}

	}
	else
	{
		/*非车辆段联锁不打印*/
	}

    
    
    if (outStringLength == 0u)
    {
    }
    else
    {
        #ifdef PLATFORM_2OO2

        debug_infor_printf((const)"\nNonRouteData:%d\nNonRouteId-NonRouteState-HaveCancelFlag-CancelFlag-RunMode-XuanPaiStartCycleNum(4)-SigOpenStartCycleNum(4)-DelayUnlockStartCycleNum(4):%d",(UINT16)sizeof(NonRouteDataStruct),outStringLength);

		debug_out_array(0xAA, outString, outStringLength);

        #endif
        
        #ifdef PLATFORM_LABVIEW_DEBUG
        
        Out_Array_Buffer(0,"\nNonRouteData:%d",(UINT16)sizeof(NonRouteDataStruct));
        Out_Array_Buffer(0,"NonRouteId-NonRouteState-HaveCancelFlag-CancelFlag-RunMode-XuanPaiStartCycleNum(4)-SigOpenStartCycleNum(4)-DelayUnlockStartCycleNum(4):%d",outStringLength);
        Out_Array_Buffer(16,outString,outStringLength);   

        #endif

        /*清空打印数据*/
        CleanString(outString);
        outStringLength = 0u;
    }
    
    
    
    /*************************************打印逻辑区段数据********************************************/
    /*打印逻辑区段数据*/
	deviceNum = GetTotalLogSecCurNum();
    for (ii = 0u; ii < deviceNum; ii++)/*本联锁和相邻联锁发送给本联锁的逻辑区段总数目*/
    {
        if (CI_SUCCESS !=returnValue)
        {
            returnValue = CI_ERROR;
            break;
        }

        /*比较数据*/
        deviceId = GetLogicSecId(ii);
        comparaResult = DeviceCompara((UINT8*)(&Record_LogicSecDataStru[deviceId]), (UINT16)sizeof(LogicSectionDataStruct),
            (UINT8*)(&newLogicSecData[deviceId]), (UINT16)sizeof(LogicSectionDataStruct));

        if (0u==comparaResult)
        {/*比较数据一致*/
            
        }
        else if (1u==comparaResult )
        {/*比较数据不一致*/
            
            if (CI_ERROR==Flag)
            {/*不打印设备数据*/

            }
			else
			{
				/**************打印数据信息****************/

				ShortToChar(newLogicSecData[deviceId].LogicSectionId,&outString[outStringLength]);/*逻辑区段ID*/
				outStringLength += 2u;
				outString[outStringLength++] = newLogicSecData[deviceId].PreOccupyState;/*逻辑区段之前占用状态*/
				outString[outStringLength++] = newLogicSecData[deviceId].CurOccupyState;/*逻辑区段当前占用状态*/
				outString[outStringLength++] = newLogicSecData[deviceId].LinShiXianSuSetFlag;/*逻辑区段临时限速*/
				outString[outStringLength++] = newLogicSecData[deviceId].OccupyState;/*逻辑区段占用状态*/
				outString[outStringLength++] = newLogicSecData[deviceId].LogLockState;/*逻辑区段锁闭状态*/
				outString[outStringLength++] = newLogicSecData[deviceId].LogLockDir;/*逻辑区段锁闭方向*/
				outString[outStringLength++] = newLogicSecData[deviceId].chResShareFlag;/*逻辑区段共享标志 0x55共享 0xAA非共享*/
				ShortToChar(newLogicSecData[deviceId].LogLockBelongRoute,&outString[outStringLength]);/*逻辑锁闭所属进路*/
				outStringLength += 2u;
				LongToChar(newLogicSecData[deviceId].LogUnlockStartCycNum,&outString[outStringLength]);/*逻辑延时解锁周期号*/
				outStringLength += 4u;
				ShortToChar(newLogicSecData[deviceId].wPLockBelongRouteId, &outString[outStringLength]);/*防护锁闭的进路编号*/
				outStringLength += 2u;

				outString[outStringLength++] = newLogicSecData[deviceId].cResReqOtherCIId;/*发送资源请求的其他联锁ID*/
				ShortToChar(newLogicSecData[deviceId].wResReqTrainId, &outString[outStringLength]);/*发送资源请求的列车ID*/
				outStringLength += 2u;
				ShortToChar(newLogicSecData[deviceId].JumpLockTrainId, &outString[outStringLength]);/*申请或释放跳跃锁闭命令的列车ID*/
				outStringLength += 2u;
				outString[outStringLength++] = newLogicSecData[deviceId].LogJumpLockState;/*逻辑区段跳跃锁闭状态 0x55 未锁闭，0xAA 锁闭*/
				outString[outStringLength++] = newLogicSecData[deviceId].LogJumpLockDelayUnlockFlag;/*逻辑区段跳跃锁闭延时解锁设置标志 0x55 未设置，0xaa 设置*/
				LongToChar(newLogicSecData[deviceId].LogSecJumpDelayUnlockStartCyc, &outString[outStringLength]);/*逻辑区段跳跃锁闭延时解锁起始周期号*/
				outStringLength += 4u;
				outString[outStringLength++] = newLogicSecData[deviceId].LogSecJumpLockPermFlag;/*逻辑区段跳跃锁闭允许标志 0x55 允许，0xaa 禁止*/


				if (LOGIC_SECTION_RES_SUM_MAX < newLogicSecData[deviceId].chTrainInfoSum)
				{
					/* 数量不合法 */
					outString[outStringLength++] = 0u;/*逻辑区段资源数量*/
				}
				else
				{
					outString[outStringLength++] = newLogicSecData[deviceId].chTrainInfoSum;/*逻辑区段资源数量*/
					for (jj = 0u; jj < newLogicSecData[deviceId].chTrainInfoSum; jj++)
					{
						ShortToChar(newLogicSecData[deviceId].szTrainResData[jj].wTrainId, &outString[outStringLength]);/*列车ID*/
						outStringLength += 2u;

						outString[outStringLength++] = newLogicSecData[deviceId].szTrainResData[jj].chTrainApplyState;/*列车申请状态*/
						outString[outStringLength++] = newLogicSecData[deviceId].szTrainResData[jj].chLogicResUsable;/*列车资源状态*/
						outString[outStringLength++] = newLogicSecData[deviceId].szTrainResData[jj].chLogicReturnState;/*折返逻辑区段标志*/
						outString[outStringLength++] = newLogicSecData[deviceId].szTrainResData[jj].chLogicUnlockState;/*列车申请状态*/
						LongToChar(newLogicSecData[deviceId].szTrainResData[jj].dwRcvUnlockCmdCyc, &outString[outStringLength]);/*逻辑延时解锁周期号*/
						outStringLength += 4u;
					}
				}
				LongToChar(newLogicSecData[deviceId].LogErrlockStartCycNum, &outString[outStringLength]);/*逻辑区段延时设置故障锁闭起始周期号*/
				outStringLength += 4U;
				outString[outStringLength++] = newLogicSecData[deviceId].chLogicProResUsable;/*逻辑区段防护锁闭资源可用状态*/
				outString[outStringLength++] = newLogicSecData[deviceId].chLogicSpksFLockState;/*逻辑区段被SPKS封锁状态*/

				if (LOGSEC_RELATE_ROUTE_SUM_MAX >= newLogicSecData[deviceId].chLogSecLockBelLogRouteSum)
				{
					outString[outStringLength++] = newLogicSecData[deviceId].chLogSecLockBelLogRouteSum;  /*逻辑区段锁闭所属逻辑进路数量*/
					for (kk = 0U; kk < newLogicSecData[deviceId].chLogSecLockBelLogRouteSum; kk++)
					{
						ShortToChar(newLogicSecData[deviceId].szLogSecLockBelLogRouteData[kk].wLogSecLockBelLogRouteId, &outString[outStringLength]);  /*逻辑区段锁闭所属逻辑进路ID*/
						outStringLength += 2u;
						outString[outStringLength++] = newLogicSecData[deviceId].szLogSecLockBelLogRouteData[kk].chLogSecLockBelLogRouteState;  /*逻辑区段锁闭所属逻辑进路状态*/
						outString[outStringLength++] = newLogicSecData[deviceId].szLogSecLockBelLogRouteData[kk].wLogSecLockBelLogRouteDir;  /*逻辑区段被逻辑进路锁闭的方向ID*/
					}
				}
				else
				{
					outString[outStringLength++] = 0U;  /*逻辑区段锁闭所属逻辑进路数量超限，不解析*/
				}

				outString[outStringLength++] = newLogicSecData[deviceId].LogSecLogLockState;  /*逻辑区段逻辑锁闭状态*/
				outString[outStringLength++] = newLogicSecData[deviceId].LogSecLogLockDir;  /*逻辑区段逻辑锁闭方向*/
				outString[outStringLength++] = newLogicSecData[deviceId].chLinShiXianSuSetSpeed;  /*逻辑区段临时限速值*/
				outString[outStringLength++] = newLogicSecData[deviceId].chAblRelLogSecUsableFlag;  /*ABL列车关联逻辑区段允许使用标志*/
				outString[outStringLength++] = newLogicSecData[deviceId].cRouteLeaveLogFlag;  /*离去区段ABL列车检查标志*/
			}
        }
        else
        {
            returnValue = CI_ERROR;
        }
    }

    if (outStringLength == 0u)
    {
    }
    else
    {
        #ifdef PLATFORM_2OO2

        debug_infor_printf((const)"\nLogicSecData:%d\nLogicSectionId(2)-PreOccupyState-CurOccupyState-LinShiXianSuSetFlag:%d",(UINT16)sizeof(LogicSectionDataStruct),outStringLength);

		debug_out_array(0xAA, outString, outStringLength);
        
        #endif

        #ifdef PLATFORM_LABVIEW_DEBUG

        Out_Array_Buffer(0,"\nLogicSecData:%d",(UINT16)sizeof(LogicSectionDataStruct));
        Out_Array_Buffer(0,"LogicSectionId(2)-PreOccupyState-CurOccupyState:%d",outStringLength);
        Out_Array_Buffer(16,outString,outStringLength);    

        #endif

        /*清空打印数据*/
        CleanString(outString);
        outStringLength = 0u;
    }

	/*************************************打印洗车机数据********************************************/
	/*打印洗车机数据*/
	for (ii = 0u; ii < GetWashMachineSum(); ii++)
	{
		if (CI_SUCCESS != returnValue)
		{
			returnValue = CI_ERROR;
			break;
		}

		/*比较数据*/
		deviceId = GetWashMachineId(ii);
		comparaResult = DeviceCompara((UINT8*)(&Record_WashMachineDataStru[deviceId]), (UINT16)sizeof(WashMachineDataStruct),
			(UINT8*)(&newWashMachineData[deviceId]), (UINT16)sizeof(WashMachineDataStruct));

		if (0u==comparaResult)
		{/*比较数据一致*/

		}
		else if (1u==comparaResult )
		{/*比较数据不一致*/

			if (CI_ERROR==Flag)
			{/*不打印设备数据*/

			}
			else
			{
				/**************打印数据信息****************/

				ShortToChar(newWashMachineData[deviceId].WashMachineId,&outString[outStringLength]);/*洗车机ID*/
				outStringLength += 2u;
				outString[outStringLength++] = newWashMachineData[deviceId].WashMachineReadyState;/*洗车机就绪状态*/
				outString[outStringLength++] = newWashMachineData[deviceId].WashMachineRequestVerifyState;/*洗车机请求确认状态*/
				outString[outStringLength++] = newWashMachineData[deviceId].TrainEmergencyStopState;/*列车紧急停车状态*/
				outString[outStringLength++] = newWashMachineData[deviceId].HeadWashAllowState;/*允许车头清洗状态*/
				outString[outStringLength++] = newWashMachineData[deviceId].TailWashAllowState;/*允许车尾清洗状态*/
				outString[outStringLength++] = newWashMachineData[deviceId].WashTrainRequestDrvState;/*洗车请求驱动状态*/
				outString[outStringLength++] = newWashMachineData[deviceId].TrainHeadStopSteadyDrvState;/*车头停稳驱动状态*/
				outString[outStringLength++] = newWashMachineData[deviceId].TrainTailStopSteadyDrvState;/*车尾停稳驱动状态*/
				outString[outStringLength++] = newWashMachineData[deviceId].TrainOutWashTrainPortAllowState;/*允许出洗车库状态*/
				ShortToChar(newWashMachineData[deviceId].CurVobcId, &outString[outStringLength]);/*当前洗车的VOBC ID*/
				outStringLength += 2u;

				outString[outStringLength++] = newWashMachineData[deviceId].PauseTrainWashRequestDrvState;/*暂停洗车请求驱动状态(动态字段:驱动)*/
				outString[outStringLength++] = newWashMachineData[deviceId].PaseWashMachineRequesDrvtState;/*通过洗车机请求驱动状态(动态字段:驱动)*/

				outString[outStringLength++] = newWashMachineData[deviceId].WashmachineXTACurState;/*洗车同意按钮当前状态*/
				outString[outStringLength++] = newWashMachineData[deviceId].WashmachineXTAPreState;/*洗车同意按钮上周期状态*/
				outString[outStringLength++] = newWashMachineData[deviceId].WashmachineXTALogicState;/*洗车机按钮逻辑状态*/
				LongToChar(newWashMachineData[deviceId].WashmachineXTAPressDownCycle,&outString[outStringLength]);/*洗车机洗车同意按钮按下起始周期*/
				outStringLength += 4u;
				outString[outStringLength++] = newWashMachineData[deviceId].WashMachineWorkModeDrvtState;/*洗车机洗车模式驱动状态(动态字段:驱动)*/
				outString[outStringLength++] = newWashMachineData[deviceId].WashModeState;/*洗车机洗车模式采集状态*/
				outString[outStringLength++] = newWashMachineData[deviceId].chSetWashWorkModeBack;/*设置洗车机工作模式反馈*/
				outString[outStringLength++] = newWashMachineData[deviceId].chDownWashAllowState;/*降级模式洗车同意状态*/
				outString[outStringLength++] = newWashMachineData[deviceId].chDownWashAllowPassState;/*降级模式洗车同意通过状态*/
				LongToChar(newWashMachineData[deviceId].WashWorkModeRelayDrvCycle, &outString[outStringLength]);/*洗车模式继电器驱动起始周期号*/
				outStringLength += 4u;
			}

		}
		else
		{
			returnValue = CI_ERROR;
		}

	}
	if (outStringLength == 0u)
	{
	}
	else
	{
#ifdef PLATFORM_2OO2

		debug_infor_printf((const)"\nWashMechineData:%d\nWashMachineId(2)-WashMachineReadyState-WashMachineRequestVerifyState-TrainEmergencyStopState-HeadWashAllowState-TailWashAllowState-WashTrainRequestDrvState-TrainHeadStopSteadyDrvState-TrainTailStopSteadyDrvState-TrainOutWashTrainPortAllowState-CurVobcId(2):%d",(UINT16)sizeof(LogicSectionDataStruct),outStringLength);

		debug_out_array(0xAA, outString, outStringLength);

#endif

		/*清空打印数据*/
		CleanString(outString);
		outStringLength = 0u;
	}


	/*************************************打印PSD状态数据********************************************/
	/*打印状态数据*/
	deviceNum = GetTotalPsdCurNum();
	for (ii = 0u; ii < deviceNum; ii++)/*本联锁和相邻联锁发送给本联锁的Psd总数目*/
	{
		if (CI_SUCCESS != returnValue)
		{
			returnValue = CI_ERROR;
			break;
		}

		/*比较数据*/
		deviceId = GetPsdId(ii);
		comparaResult = DeviceCompara((UINT8*)(&Record_PsdDataStru[deviceId]), (UINT16)sizeof(PsdDataStruct),
			(UINT8*)(&newPsdData[deviceId]), (UINT16)sizeof(PsdDataStruct));

		if (0u==comparaResult)
		{/*比较数据一致*/

		}
		else if (1u==comparaResult )
		{/*比较数据不一致*/

			if (CI_ERROR==Flag)
			{/*不打印设备数据*/

			}
			else
			{
				/**************打印数据信息****************/

				ShortToChar(newPsdData[deviceId].PsdId,&outString[outStringLength]);/*PSD ID*/
				outStringLength += 2u;
				ShortToChar(newPsdData[deviceId].psdEditGroupInfo,&outString[outStringLength]);/*PSD 编组信息*/
				outStringLength += 2u;
				outString[outStringLength++] = newPsdData[deviceId].DoorButtonState;/*屏蔽门按钮状态*/
				outString[outStringLength++] = newPsdData[deviceId].MutualLockRemoveState;/*屏蔽门互锁解除状态*/
				outString[outStringLength++] = newPsdData[deviceId].PsdDriveState;/*屏蔽门驱动状态*/
				outString[outStringLength++] = newPsdData[deviceId].PsdState;/*屏蔽门屏蔽门状态*/
				ShortToChar(newPsdData[deviceId].SrcVobcId,&outString[outStringLength]);/*操作该屏蔽门的当前VOBC ID*/
				outStringLength += 2u;
				outString[outStringLength++] = newPsdData[deviceId].PsdCmd;/*操作屏蔽门的命令*/
				LongToChar(newPsdData[deviceId].CmdSetCycle,&outString[outStringLength]);/*命令设置周期*/
				outStringLength += 4u;
				LongToChar(newPsdData[deviceId].CmdSetCyclePsc,&outString[outStringLength]);/*psc状态设置周期*/
				outStringLength += 4u;
				outString[outStringLength++] = newPsdData[deviceId].doorOpenButtonState;/*站台开门按钮状态*/
				outString[outStringLength++] = newPsdData[deviceId].doorDepartButtonState;/*站台发车按钮状态*/
				outString[outStringLength++] = newPsdData[deviceId].PsdButtonPangluState;/*站台屏蔽门按钮旁路状态*/
				outString[outStringLength++] = newPsdData[deviceId].PsdRemoraState;/*屏蔽门障碍物状态*/
				outString[outStringLength++] = newPsdData[deviceId].JXTCMutualLockState;/*间隙探测互锁解除状态*/
				LongToChar(newPsdData[deviceId].StartDetectionCycNum,&outString[outStringLength]);/*开启探测周期*/
				outStringLength += 4u;
				outString[outStringLength++] = newPsdData[deviceId].StartDetectionState;/*启动探测状态*/
				outString[outStringLength++] = newPsdData[deviceId].StopDetectionState; /*停止探测状态*/
				outString[outStringLength++] = newPsdData[deviceId].VOBCDoorState;      /*VOBC车门状态*/
				LongToChar(newPsdData[deviceId].PCBPressCycNum,&outString[outStringLength]);/*PCB按下起始周期*/
				outStringLength += 4u;
				LongToChar(newPsdData[deviceId].POBPressCycNum,&outString[outStringLength]);/*POB按下起始周期*/
				outStringLength += 4u;
				LongToChar(newPsdData[deviceId].PSBPressCycNum,&outString[outStringLength]);/*PSB按下起始周期*/
				outStringLength += 4u;
				outString[outStringLength++] = newPsdData[deviceId].PscPlConfirmFlag;    /*设置ATS确认旁路标志*/
				outString[outStringLength++] = newPsdData[deviceId].JXTCStartState;      /*脉冲接口间隙探测启动所处状态步骤*/
				LongToChar(newPsdData[deviceId].JXTCStartCycNum,&outString[outStringLength]);/*脉冲接口间隙探测启动驱动开始周期*/
				outStringLength += 4u;
				outString[outStringLength++] = newPsdData[deviceId].JXTCStopState;    /*脉冲接口间隙探测停止所处状态步骤*/
				LongToChar(newPsdData[deviceId].JXTCStopCycNum,&outString[outStringLength]);/*脉冲接口间隙探测停止驱动开始周期*/
				outStringLength += 4u;
				outString[outStringLength++] = newPsdData[deviceId].JXTCStartFlag;     /*脉冲驱动启动标志*/
				outString[outStringLength++] = newPsdData[deviceId].JXTCStopFlag;      /*脉冲驱动停止标志*/

				LongToChar(newPsdData[deviceId].dwCleFarePCBPressCycNum, &outString[outStringLength]);/*清客确认箱关门按钮按下起始周期*/
				outStringLength += 4u;
				outString[outStringLength++] = newPsdData[deviceId].chCleFarePCBButtonState;     /*清客确认箱关门按钮状态*/
				outString[outStringLength++] = newPsdData[deviceId].chCleFarePCBButKeepState;     /*清客确认箱关门按钮记忆状态*/
				outString[outStringLength++] = newPsdData[deviceId].chCleFarePDBFlaLigFlag;     /*清客确认箱PDB按钮指示灯闪灯标志*/
				outString[outStringLength++] = newPsdData[deviceId].chVideoQkDriveState;       /*视频清客驱动状态*/
				ShortToChar(newPsdData[deviceId].wVideoQkRelateVobcId, &outString[outStringLength]);/*视频清客对应列车ID*/
				outStringLength += 2u;
				outString[outStringLength] = newPsdData[deviceId].cPsdExceptOpenState;  /*屏蔽门异常打开状态：0x55-异常打开，0xAA-未异常打开*/
				outStringLength++;
				LongToChar(newPsdData[deviceId].dwPsdRelayDownCycNum, &outString[outStringLength]);  /*PSD门关继电器落下起始周期*/
				outStringLength += 4U;
			}
		}
		else
		{
			returnValue = CI_ERROR;
		}
	}

	if (outStringLength == 0u)
	{
	}
	else
	{
#ifdef PLATFORM_2OO2

		debug_infor_printf((const)"\nPsdData:%d\nPsdId(2)-psdEditGroupInfo(2)-DoorButtonState-MutualLockRemoveState-PsdDriveState-PsdState-SrcVobcId(2)-PsdCmd-CmdSetCycle(4)-CmdSetCyclePsc(4)-doorOpenButtonState-doorDepartButtonState-PsdButtonPangluState-PsdRemoraState-JXTCMutualLockState-StartDetectionCycNum(4)-StartDetectionState-StopDetectionState-VOBCDoorState-PCBPressCycNum(4)-POBPressCycNum(4)-PSBPressCycNum(4):%d",(UINT16)sizeof(PsdDataStruct),outStringLength);

		debug_out_array(0xAA, outString, outStringLength);

#endif



		/*清空打印数据*/
		CleanString(outString);
		outStringLength = 0u;
	}

    /*************************************打印车库门数据********************************************/
    /*打印车库门数据*/
	deviceNum = GetGaragedoorSum();
    for (ii = 0u; ii < deviceNum; ii++)
    {
        if (CI_SUCCESS != returnValue)
        {
            returnValue = CI_ERROR;
            break;
        }

        /*比较数据*/
        deviceId = GetGaragedoorId(ii);
        comparaResult = DeviceCompara((UINT8*)(&Record_GaragedoorDataStru[deviceId]), (UINT16)sizeof(GaragedoorDataStruct),
            (UINT8*)(&newGaragedoorData[deviceId]), (UINT16)sizeof(GaragedoorDataStruct));

        if (0u==comparaResult)
        {/*比较数据一致*/

        }
        else if (1u==comparaResult )
        {/*比较数据不一致*/

            if (CI_ERROR==Flag)
            {/*不打印设备数据*/

            }
            else
            {
                /**************打印数据信息****************/

                ShortToChar(newGaragedoorData[deviceId].GaragedoorId,&outString[outStringLength]);/*车库门ID (初始化字段)*/
                outStringLength += 2u;
                outString[outStringLength++] = newGaragedoorData[deviceId].GaragedoorState;      /*车库门状态 (动态字段)*/
                outString[outStringLength++] = newGaragedoorData[deviceId].GaragedoorAllowCloseFlag; /*车库门允许关门标志ZC*/
				outString[outStringLength++] = newGaragedoorData[deviceId].GDAllowCloseFlagIVOC; /*车库门允许关门标志IVOC*/
                outString[outStringLength++] = newGaragedoorData[deviceId].GaragedoorModeState;       /*车库门模式状态*/
				outString[outStringLength++] = newGaragedoorData[deviceId].GaragedoorFaultState;	/*车库门故障状态*/
				outString[outStringLength++] = newGaragedoorData[deviceId].GaragedoorPangLuState;    /*车库门旁路状态*/;
                outString[outStringLength++] = newGaragedoorData[deviceId].drvDoorState;				/* 驱动车库门状态*/
                outString[outStringLength++] = newGaragedoorData[deviceId].cmdProcessState;			/* 命令处理状态 */
                LongToChar(newGaragedoorData[deviceId].waiteZCResponseStartCycNum,&outString[outStringLength]);/* 等待ZC反馈开始时间 */
                outStringLength += 4u; 
				LongToChar(newGaragedoorData[deviceId].waiteIVOCResponseStartCycNum, &outString[outStringLength]);/* 等待IVOC反馈开始时间 */
				outStringLength += 4u;
				LongToChar(newGaragedoorData[deviceId].GaragedoorOpenStartCycNum,&outString[outStringLength]);/* 车库门打开开始周期 */
				outStringLength += 4u; 
				LongToChar(newGaragedoorData[deviceId].GaragedoorCloseStartCycNum,&outString[outStringLength]);/* 车库门关闭开始周期 */
				outStringLength += 4u; 
            }

        }
        else
        {
            returnValue = CI_ERROR;
        }
    }

    if (outStringLength == 0u)
    {
    }
    else
    {
#ifdef PLATFORM_2OO2

        debug_infor_printf((const)"\nGaragedoorData:%d\nGaragedoorId(2)-GaragedoorState-GaragedoorAllowCloseFlag-GaragedoorModeState-drvDoorState-cmdProcessState-waiteZCResponseStartCycNum(4)-GaragedoorOpenStartCycNum(4)-GaragedoorCloseStartCycNum(4):%d",(UINT16)sizeof(GaragedoorDataStruct),outStringLength);

		debug_out_array(0xAA, outString, outStringLength);

#endif

        /*清空打印数据*/
        CleanString(outString);
        outStringLength = 0u;
    }


	/*************************************打印防淹门数据******************************************************/
	/*打印防淹门数据*/
	floodGateTotalSum = GetTotalFloodGateCurSum();
	for (ii = 0u; ii < floodGateTotalSum; ii++)
	{
		if (CI_SUCCESS != returnValue)
		{
			returnValue = CI_ERROR;
			break;
		}

		/*比较数据*/
		deviceId = GetFloodGateId(ii);
		comparaResult = DeviceCompara((UINT8*)(&Record_FloodGateDataStru[deviceId]), (UINT16)sizeof(FloodGateDataStruct),
			(UINT8*)(&pNewFloodGateData[deviceId]), (UINT16)sizeof(FloodGateDataStruct));

		if (0u==comparaResult  )
		{/*比较数据一致*/

		}
		else if (1u==comparaResult  )
		{/*比较数据不一致*/

			if (CI_ERROR==Flag  )
			{/*不打印设备数据*/

			}
			else
			{
				/**************打印数据信息****************/

				ShortToChar(pNewFloodGateData[deviceId].FloodGateId,&outString[outStringLength]);/*防淹门ID (初始化字段)*/
				outStringLength += 2u;
				outString[outStringLength++] = pNewFloodGateData[deviceId].CurOpenLockStateFromFYM;      /*当前开门且锁闭状态 (动态字段)*/
				outString[outStringLength++] = pNewFloodGateData[deviceId].CurCloseRequestStateFromFYM; /*当前关门请求状态*/
				
				outString[outStringLength++] = pNewFloodGateData[deviceId].CurAgreeCloseAckFromZC;	/*当前zc回复关门许可状态*/
				outString[outStringLength++] = pNewFloodGateData[deviceId].CurAgreeCloseStateIn;		/*当前同意关门采集状态*/;
				outString[outStringLength++] = pNewFloodGateData[deviceId].CurAgreeCloseStateOut;	/* 当前同意关门输出状态（动态字段）*/

				outString[outStringLength++] = pNewFloodGateData[deviceId].FloodGateCloseApplyIvocSum;		/*防淹门关门申请列车数量*/
				for (jj = 0u; jj < pNewFloodGateData[deviceId].FloodGateCloseApplyIvocSum; jj++)
				{
					ShortToChar(pNewFloodGateData[deviceId].FloodGateCloseApplyIvocId[jj], &outString[outStringLength]);/*防淹门关门申请列车ID*/
					outStringLength += 2u;
				}

				outString[outStringLength++] = pNewFloodGateData[deviceId].FloodGateCloseAnsIvocSum;		/*防淹门关门列车回复列车数量*/
				for (jj = 0u; jj < pNewFloodGateData[deviceId].FloodGateCloseAnsIvocSum; jj++)
				{
					ShortToChar(pNewFloodGateData[deviceId].FloodGateCloseFromIvocStru[jj].wTrainId, &outString[outStringLength]);/*列车同意防淹门关门请求列车ID*/
					outStringLength += 2u;
					outString[outStringLength++] = pNewFloodGateData[deviceId].FloodGateCloseFromIvocStru[jj].wFloodGateCloseIvocFlag;	/*列车同意防淹门关门请求状态*/
				}
			}

		}
		else
		{
			returnValue = CI_ERROR;
		}
	}

	if (outStringLength == 0u)
	{
	}
	else
	{
#ifdef PLATFORM_2OO2

		debug_infor_printf((const)"\nFloodGateData:%d\FloodGateId(2)-CurOpenLockState(1)-CurCloseRequest(1)-CurApplyCloseCmdToZC(1)-CurAgreeCloseAckFromZC(1)-CurAgreeCloseStateIn(1)- CurAgreeCloseStateOut(1):%d",(UINT16)sizeof(GaragedoorDataStruct),outStringLength);

		debug_out_array(0xAA, outString, outStringLength);

#endif

		/*清空打印数据*/
		CleanString(outString);
		outStringLength = 0u;
	}

	/*************************************打印保护区段数据********************************************/
	/*打印保护区段数据*/
	deviceNum =  GetOverlapCurSum();
	for (ii = 0u; ii < deviceNum; ii++)/*本联锁和相邻联锁发送给本联锁的保护区段总数目*/
	{
		if (CI_SUCCESS != returnValue)
		{
			returnValue = CI_ERROR;
			break;
		}

		/*比较数据*/
		deviceId = GetOverlapId(ii);
		comparaResult = DeviceCompara((UINT8*)(&Record_OverlapDataStru[deviceId]), (UINT16)sizeof(OverlapDataStruct),
			(UINT8*)(&newOverlapData[deviceId]), (UINT16)sizeof(OverlapDataStruct));

		if (0u==comparaResult)
		{/*比较数据一致*/

		}
		else if (1u==comparaResult )
		{/*比较数据不一致*/

			if (CI_ERROR != Flag)
			{
				/**************打印数据信息****************/

				ShortToChar(newOverlapData[deviceId].OverlapId,&outString[outStringLength]);/*保护区段ID*/
				outStringLength += 2u;
				ShortToChar(newOverlapData[deviceId].BelongRouteId,&outString[outStringLength]);/*所属进路ID*/
				outStringLength += 2u;
				LongToChar(newOverlapData[deviceId].UnlockStartCycNum,&outString[outStringLength]);/*保护区段解锁起始周期号*/
				outStringLength += 4u;
				LongToChar(newOverlapData[deviceId].XuanPaiStartCycNum,&outString[outStringLength]);/*保护区段选排开始周期号*/
				outStringLength += 4u;
				outString[outStringLength++] = newOverlapData[deviceId].OverlapUnlockApplyFlag;/*向ZC申请解锁保护区段解锁标志*/
				outString[outStringLength++] = newOverlapData[deviceId].OverlapCanLaborUnlockFlag;/*保护区段可以人工解锁标志*/
				outString[outStringLength++] = newOverlapData[deviceId].OverlapLaborUnlockSetState;/*保护区段人工解锁设置状态*/

				LongToChar(newOverlapData[deviceId].laborUnlockStartCycNum,&outString[outStringLength]);/*保护区段人工解锁周期号*/
				outStringLength += 4U;

				outString[outStringLength++] = newOverlapData[deviceId].atsOrlaborLockFlag;/*ATS或人工锁闭保护区段命令标志*/

				LongToChar(newOverlapData[deviceId].lockStartCycNum,&outString[outStringLength]);/*保护区段锁闭成功周期号*/
				outStringLength += 4U;

				ShortToChar(newOverlapData[deviceId].overlapUnlockTime,&outString[outStringLength]);/*倒计时*/
				outStringLength += 2U;
				outString[outStringLength++] = newOverlapData[deviceId].laborLockOverlapCmd;/*人工锁闭保护区段命令标志*/

				ShortToChar(newOverlapData[deviceId].wOverlapUnlockApplyTrainId, &outString[outStringLength]);/*申请解锁保护区段的列车ID*/
				outStringLength += 2U;

				LongToChar(newOverlapData[deviceId].dwReqIvocUnLockStartCycNum, &outString[outStringLength]);/*向车申请解锁保护区段起始周期号*/
				outStringLength += 4U;

				outString[outStringLength++] = newOverlapData[deviceId].cProSwitchCheckResultFlag;/*跨控区防护道岔检查结果标志（0xFF：默认值，0x55：失败，0xAA：成功）*/

				outString[outStringLength++] = newOverlapData[deviceId].cProSwitchCheckStartFlag;/*跨控区防护道岔检查开始标志（0x55：检查开始，0xAA：检查停止）*/
			}
		}
		else
		{
			returnValue = CI_ERROR;
		}
	}

	if (outStringLength == 0u)
	{
	}
	else
	{
#ifdef PLATFORM_2OO2
		debug_infor_printf((const)"\nOverlapData:%d\nOverlapId(2)-BelongRouteId(2)-UnlockStartCycNum(4)-XuanPaiStartCycNum(4)-OverlapUnlockApplyFlag:%d",(UINT16)sizeof(OverlapDataStruct),outStringLength);

		debug_out_array(0xAA, outString, outStringLength);
#endif

#ifdef PLATFORM_LABVIEW_DEBUG

		Out_Array_Buffer(0,"\nOverlapData:%d",(UINT16)sizeof(OverlapDataStruct));
		Out_Array_Buffer(0,"OverlapId(2)-BelongRouteId(2)-UnlockStartCycNum(4)-XuanPaiStartCycNum(4)-OverlapUnlockApplyFlag:%d",outStringLength);
		Out_Array_Buffer(16,outString,outStringLength);        

#endif
		/*清空打印数据*/
		CleanString(outString);
		outStringLength = 0u;
	}


	/*************************************打印VobcToCiDataStru数据********************************************/
	deviceNum = (UINT8)GetVobcToCiSum();

	if (0u < deviceNum)
	{	

		for (ii=0;ii<deviceNum;ii++)
		{
			ShortToChar(GetVobcIdByIndex(ii),&outString[outStringLength]);/*vobc id 2B*/
			outStringLength += 2u;

			outString[outStringLength++] = GetVobcEditGroupInfoByIndex(ii);/*vobc 索引 1B*/
		}
	
		debug_infor_printf((const)"\nVobcToCiDataStru:%d\n:%d",(UINT16)GetVobcToCiSum(),outStringLength);
		debug_out_array(0xAA, outString, outStringLength);
		CleanString(outString);
		outStringLength = 0u;
	}


	/*************************************打印计轴区段数据********************************************/
	/*打印计轴区段数据*/
	deviceNum = GetTotalAxisCurNum();
	for (ii = 0u; ii < deviceNum; ii++)/*本联锁和相邻联锁发送给本联锁的计轴区段总数目*/
	{
		if (CI_SUCCESS != returnValue)
		{
			returnValue = CI_ERROR;
			break;
		}

		/*比较数据*/
		deviceId = GetAxisSecId(ii);
		comparaResult = DeviceCompara((UINT8*)(&Record_AxisSecDataStru[deviceId]), (UINT16)sizeof(AxisSectionDataStruct),
			(UINT8*)(&newAxisSecData[deviceId]), (UINT16)sizeof(AxisSectionDataStruct));

		if (0u==comparaResult)
		{/*比较数据一致*/

		}
		else if (1u==comparaResult )
		{/*比较数据不一致*/

			if (CI_ERROR != Flag)
			{
				/**************打印数据信息****************/

				ShortToChar(newAxisSecData[deviceId].AxisSectionId,&outString[outStringLength]);/*计轴区段ID*/
				outStringLength += 2u;
				outString[outStringLength++] = newAxisSecData[deviceId].AxisArbState;/*计轴ARB状态 (动态字段)*/
				outString[outStringLength++] = newAxisSecData[deviceId].AxisJumpLockApplyFlag;/*跳跃锁闭申请标志*/
				outString[outStringLength++] = newAxisSecData[deviceId].AxisJumpLockCancelApplyFlag;/*跳跃锁闭取消申请标志*/
				LongToChar(newAxisSecData[deviceId].AxisJumpLockApplyCylce,&outString[outStringLength]);/*跳跃锁闭申请周期号*/
				outStringLength += 4u;
				outString[outStringLength++] = newAxisSecData[deviceId].AxisJumpLockState;/*跳跃锁闭状态*/	
				outString[outStringLength++] = newAxisSecData[deviceId].AxisOccStatus;/*计轴占用状态*/
				LongToChar(newAxisSecData[deviceId].dwAxisOccCycNum, &outString[outStringLength]);/*计轴占用起始周期*/
				outStringLength += 4u;
				LongToChar(newAxisSecData[deviceId].dwUtOccupyCycNum, &outString[outStringLength]);/*计轴最近坏车占用周期*/
				outStringLength += 4u;
				ShortToChar(newAxisSecData[deviceId].wPosMonitorTrainId, &outString[outStringLength]);  /*监督有效的列车ID*/
				outStringLength += 2u;
				outString[outStringLength] = newAxisSecData[deviceId].cAxisTXSafeLocFlag;  /*计轴区段列车安全位置覆盖标志：0x55-无效；0xAA-有效*/
				outStringLength++;
			}
		}
		else
		{
			returnValue = CI_ERROR;
		}        
	}




	if (outStringLength == 0u)
	{
	}
	else
	{
#ifdef PLATFORM_2OO2
		debug_infor_printf((const)"\nAxisSecData:%d\nAxisSectionId(2)-AxisArbState-AxisJumpLockApplyFlag-AxisJumpLockCancelApplyFlag-AxisJumpLockApplyCylce-AxisJumpLockState(4):%d",(UINT16)sizeof(SignalDataStruct),outStringLength);

		debug_out_array(0xAA, outString, outStringLength);
#endif



		/*清空打印数据*/
		CleanString(outString);
		outStringLength = 0u;
	}
	for (ii = 0u; ii < g_VirtualCIStructData.virtualCiNum; ii++)/*本联锁和相邻联锁发送给本联锁的计轴区段总数目*/
	{
		if (CI_SUCCESS != returnValue)
		{
			returnValue = CI_ERROR;
			break;
		}
	
		GetVirCIKeyDataStru();/*更新数据*/

		comparaResult = DeviceCompara((UINT8*)(&Record_VirCIKeyDataStru[ii]), (UINT16)sizeof(VirCIKeyDataStru),
			(UINT8*)(&newVirCIKeyDataStru[ii]), (UINT16)sizeof(VirCIKeyDataStru));

		if (0u==comparaResult)
		{/*比较数据一致*/

		}
		else if (1u==comparaResult )
		{/*比较数据不一致*/
		
			/**************打印数据信息****************/

			outString[outStringLength++] = newVirCIKeyDataStru[ii].virtualCiId;/*虚拟联锁编号*/
			outString[outStringLength++] = newVirCIKeyDataStru[ii].virAllSignalBrightFlag;/*全站点灯标志*/
			outString[outStringLength++] = newVirCIKeyDataStru[ii].virAllSwitchYLockFlag;/*引导总锁*/
			outString[outStringLength++] = newVirCIKeyDataStru[ii].virLabourCancelLinShiXianState;
			outString[outStringLength++] = newVirCIKeyDataStru[ii].cimode;
			outString[outStringLength++] = newVirCIKeyDataStru[ii].autoTriggerflag;
			outString[outStringLength++] = newVirCIKeyDataStru[ii].ZfwFlag;
			LongToChar(newVirCIKeyDataStru[ii].ZfwStartCycNum,&outString[outStringLength]);
			outStringLength +=4u;
			LongToChar(newVirCIKeyDataStru[ii].ZfwValidCycNum,&outString[outStringLength]);
			outStringLength +=4u;

			for (kk = 0U; kk < RTNINDICATOR_SUM_MAX; kk++)
			{
				outString[outStringLength++] = newVirCIKeyDataStru[ii].RtnIndicatorKeyData[kk].PrintVirCiIndicatorDevId;
				outString[outStringLength++] = newVirCIKeyDataStru[ii].RtnIndicatorKeyData[kk].PrintVirCiFlashState;
				outString[outStringLength++] = newVirCIKeyDataStru[ii].RtnIndicatorKeyData[kk].PrintVirCiSteadyState;
			}
			outString[outStringLength++] = newVirCIKeyDataStru[ii].ZfwjHunXianFLag;
		}
		else
		{
			returnValue = CI_ERROR;
		}  
	}


	if (outStringLength == 0u)
	{
	}
	else
	{
#ifdef PLATFORM_2OO2
		debug_infor_printf((const)"\nVirCIData:%d",g_VirtualCIStructData.virtualCiNum);

		debug_out_array(0xAA, outString, outStringLength);
#endif



		/*清空打印数据*/
		CleanString(outString);
		outStringLength = 0u;
	}

	deviceNum = GetSpksSum();
	for (ii = 0; ii < deviceNum; ii++)/*本联锁和相邻联锁发送给本联锁的SPKS总数目*/
	{
		if ((CI_SUCCESS != returnValue) || (NULL == pNewSpksData))
		{
			returnValue = CI_ERROR;
			break;
		}

		/*比较数据*/
		deviceId = GetSpksIdByIndex(ii);
		comparaResult = DeviceCompara((UINT8*)(&Record_spksDataBuff[deviceId]), (UINT16)sizeof(SpksDataStruct),
			(UINT8*)(&pNewSpksData[deviceId]), (UINT16)sizeof(SpksDataStruct));

		if (0u == comparaResult)
		{/*比较数据一致*/

		}
		else if (1u == comparaResult)
		{/*比较数据不一致*/

			if (CI_ERROR != Flag)
			{
				/**************打印数据信息****************/

				ShortToChar(pNewSpksData[deviceId].spksId, &outString[outStringLength]);
				outStringLength += 2U;
				outString[outStringLength++] = pNewSpksData[deviceId].status;
				outString[outStringLength++] = pNewSpksData[deviceId].cutStatus;
				LongToChar(pNewSpksData[deviceId].flockStartNum, &outString[outStringLength]);
				outStringLength += 4U;
				outString[outStringLength++] = pNewSpksData[deviceId].TotalSpksDriveOutDis;
				LongToChar(pNewSpksData[deviceId].dwSpksBtnPressCycNum, &outString[outStringLength]);  /*SPKS按钮按下起始周期号*/
				outStringLength += 4U;
			}
		}
		else
		{
			returnValue = CI_ERROR;
		}
	}




	if (0U == outStringLength)
	{
	}
	else
	{
#ifdef PLATFORM_2OO2
		debug_infor_printf((const)"\nSpksData:%d\nspksId(2)-status-cutStatus-flockStartNum(4)-TotalSpksDriveOutDis:%d", (UINT16)sizeof(SpksDataStruct), outStringLength);

		debug_out_array(0xAA, outString, outStringLength);
#endif		


		/*清空打印数据*/
		CleanString(outString);
		outStringLength = 0;
	}

	/*************************************打印列车数据********************************************/
	/*打印列车数据*/
	deviceNum = GetTrainSum();/* 获取列车数量 */
	for (ii = 0u; ii < deviceNum; ii++)
	{
		if (CI_SUCCESS != returnValue)
		{
			returnValue = CI_ERROR;
			break;
		}

		/*比较数据*/
		wTrainId = GetTrainId(ii);
		deviceId = GetTrainBufIndex(wTrainId);
		comparaResult = DeviceCompara((UINT8*)(&Record_TrainInfo[deviceId]), (UINT16)sizeof(TrainInfoStru),
			(UINT8*)(&pNewTrainInfoData[deviceId]), (UINT16)sizeof(TrainInfoStru));

		if (0u == comparaResult)
		{/*比较数据一致*/

		}
		else if (1u == comparaResult)
		{/*比较数据不一致*/

			if (CI_ERROR == Flag)
			{/*不打印设备数据*/

			}
			else
			{
				/**************打印数据信息****************/
				ShortToChar(pNewTrainInfoData[deviceId].wTrainId, &outString[outStringLength]);/*列车ID*/
				outStringLength += 2u;

				outString[outStringLength++] = pNewTrainInfoData[deviceId].chTrainInZone;/* 列车是否再本控区 */
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chTrainLevel;/* 列车运行级别 */
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chTrainModel; /*列车运行模式*/
				LongToChar(pNewTrainInfoData[deviceId].dwIvocCycle, &outString[outStringLength]);/*应用周期*/
				outStringLength += 4u;

				outString[outStringLength++] = pNewTrainInfoData[deviceId].chTrainDir_MaxHead;/* 列车运行方向 大前*/
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chTrainDir_MinHead;/* 列车运行方向 小前*/
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chTrainDir_MaxTail;/* 列车运行方向 大后*/
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chTrainDir;/* 列车运行方向 小后*/



				ShortToChar(pNewTrainInfoData[deviceId].wTrainMaxHeadLink, &outString[outStringLength]);/*列车最大安全前端所处link*/
				outStringLength += 2u;
				LongToChar(pNewTrainInfoData[deviceId].dwTrainMaxHeadOffset, &outString[outStringLength]);/*列车最大安全前偏移量*/
				outStringLength += 4u;
				ShortToChar(pNewTrainInfoData[deviceId].wTrainMinHeadLink, &outString[outStringLength]);/*列车最小安全前端所处link*/
				outStringLength += 2u;
				LongToChar(pNewTrainInfoData[deviceId].dwTrainMinHeadOffset, &outString[outStringLength]);/*列车最小安全前端偏移量*/
				outStringLength += 4u;

				ShortToChar(pNewTrainInfoData[deviceId].wTrainMaxTailLink, &outString[outStringLength]);/*列车最大安全后端所处Link*/
				outStringLength += 2u;
				LongToChar(pNewTrainInfoData[deviceId].dwTrainMaxTailOffset, &outString[outStringLength]);/*列车最大安全后端偏移量*/
				outStringLength += 4u;
				ShortToChar(pNewTrainInfoData[deviceId].wTrainMinTailLink, &outString[outStringLength]);/*列车最小安全后端所处link*/
				outStringLength += 2u;
				LongToChar(pNewTrainInfoData[deviceId].dwTrainMinTailOffset, &outString[outStringLength]);/*列车最小安全后端偏移量*/
				outStringLength += 4u;

				outString[outStringLength++] = pNewTrainInfoData[deviceId].chSpeedDir;/* 列车速度方向 */
				ShortToChar(pNewTrainInfoData[deviceId].wTrainSpeed, &outString[outStringLength]);/*列车速度*/
				outStringLength += 2u;

				outString[outStringLength++] = pNewTrainInfoData[deviceId].chTrainZeroState;/* 列车零速状态 */
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chTransmitStat;/* 与列车传输状态 */
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chHeadScreenStat;/* 列车前筛标志 */
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chTailScreenStat;/* 列车后筛标志 */

				ShortToChar(pNewTrainInfoData[deviceId].strSafeLoc.wHeadLink, &outString[outStringLength]);/*安全车头所处link*/
				outStringLength += 2u;
				LongToChar(pNewTrainInfoData[deviceId].strSafeLoc.dwHeadOffset, &outString[outStringLength]);/*安全车头所处link偏移量*/
				outStringLength += 4u;
				outString[outStringLength++] = pNewTrainInfoData[deviceId].strSafeLoc.chHeadDir;/* 安全车头方向 */
				ShortToChar(pNewTrainInfoData[deviceId].strSafeLoc.wTailLink, &outString[outStringLength]);/*安全车尾所处link*/
				outStringLength += 2u;
				LongToChar(pNewTrainInfoData[deviceId].strSafeLoc.dwTailOffset, &outString[outStringLength]);/*安全车尾所处link偏移量*/
				outStringLength += 4u;
				outString[outStringLength++] = pNewTrainInfoData[deviceId].strSafeLoc.chTailDir;/* 安全车尾方向 */
				outString[outStringLength++] = pNewTrainInfoData[deviceId].strSafeLoc.chHeadFlag;/* 安全车头所处岔区不连通且占用标志 */

				LongToChar(pNewTrainInfoData[deviceId].dwDelayTime, &outString[outStringLength]);/*消息延迟时间*/
				outStringLength += 4u;

				LongToChar(pNewTrainInfoData[deviceId].dwStartFlyCycNum, &outString[outStringLength]);/*列车飞车起始周期号*/
				outStringLength += 4U;

				ShortToChar(pNewTrainInfoData[deviceId].wGroupOtherTrainId, &outString[outStringLength]);/* 编组另一列车ID*/
				outStringLength += 2u;

				outString[outStringLength++] = pNewTrainInfoData[deviceId].chGroupRunState;/* 编组列车状态: 1非编组 2编组建立 3编组运行 4编组折返 5编组解耦*/
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chGroupTrainReat;/* 编组前后车关系: 0x55本车为编组前车 0xaa本车编组后车 0x5a非编组*/

				outString[outStringLength++] = pNewTrainInfoData[deviceId].chMsgFromTiocId;/*通信车消息来源TIOC编号*/

				outString[outStringLength++] = pNewTrainInfoData[deviceId].chSwState;/*列车休眠状态*/
				ShortToChar(pNewTrainInfoData[deviceId].wSleepLink, &outString[outStringLength]);/*列车休眠所处休眠轨link*/
				outStringLength += 2u;
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chWakeState;					/*列车唤醒状态*/
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chDynCmd;					/*动态测试命令*/
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chDynRpl;					/*动态测试回复*/
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chScreenApply;				/*筛选申请*/
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chTrainHeadScreenConfirm;	/*人工确认前筛*/
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chTrainTailScreenConfirm;	/*人工确认尾筛*/
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chAtsScreenConfirm;			/*远程筛选确认*/
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chStopSteadyState;			/*列车停准停稳状态*/
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chSleepCancleFlag;			/*清除休眠车标志*/

				LongToChar(pNewTrainInfoData[deviceId].dwTransBadCyc, &outString[outStringLength]);/*通信中断周期*/
				outStringLength += 4u;
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chEaNum;			/*通信列车回复的区间疏散数量*/
				for (jj = 0u; jj < pNewTrainInfoData[deviceId].chEaNum; jj++)
				{
					ShortToChar(pNewTrainInfoData[deviceId].strTrainEaInfo->wEaTrainId, &outString[outStringLength]);/*疏散列车ID*/
					outStringLength += 2u;
					outString[outStringLength++] = pNewTrainInfoData[deviceId].strTrainEaInfo->chAgreeState;					/*允许状态*/
					LongToChar(pNewTrainInfoData[deviceId].strTrainEaInfo->dwBuildCyc, &outString[outStringLength]);/*建立周期号*/
					outStringLength += 4u;
				}
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chEaCmd;			/*区间疏散命令*/
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chTrainCanUct;			/*列车包络可转为UCT标志，仅在休眠状态从休眠转为未休眠置为FLAG_SET，其余时间均为FLAG_UNSET*/
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chActive;			/*列车激活端*/
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chRrmRqst;			/*进入RRM申请*/
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chRrmState;			/*RRM授权状态*/
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chRrmReson;			/*不允许进入RRM的原因*/
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chRrmResonFromOtherRc;			/*其它RC不允许进入RRM的原因*/
				ShortToChar(pNewTrainInfoData[deviceId].wAtsLgcStation, &outString[outStringLength]);/*下一逻辑站台ID*/
				outStringLength += 2u;
				ShortToChar(pNewTrainInfoData[deviceId].wNextTioc, &outString[outStringLength]);/*下一TIOC编号，用作RRM*/
				outStringLength += 2u;
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chDerailment;			/*脱轨状态*/
				ShortToChar(pNewTrainInfoData[deviceId].wHeadAxisId, &outString[outStringLength]);/*前方计轴编号*/
				outStringLength += 2u;
				outString[outStringLength++] = pNewTrainInfoData[deviceId].wHeadITEResult;			/*前方ITE识别结果*/
				ShortToChar(pNewTrainInfoData[deviceId].wTailAxisId, &outString[outStringLength]);/*后方计轴编号*/
				outStringLength += 2u;
				outString[outStringLength++] = pNewTrainInfoData[deviceId].wTailITEResult;			/*后方ITE识别结果*/
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chNvramPosFlag;/* NVNAM位置标识*/

				LongToChar(pNewTrainInfoData[deviceId].strHeadTrainLocData.wHeadVobcId, &outString[outStringLength]);/*前车ID*/
				outStringLength += 4u;
				outString[outStringLength++] = pNewTrainInfoData[deviceId].strHeadTrainLocData.chHeadTrainLocFlag;	/*位置标识*/
				outString[outStringLength++] = pNewTrainInfoData[deviceId].strHeadTrainLocData.strHeadTrainAtpLoc.chTrainDir;/* 列车运行方向 小后*/
				ShortToChar(pNewTrainInfoData[deviceId].strHeadTrainLocData.strHeadTrainAtpLoc.wTrainMaxHeadLink, &outString[outStringLength]);/*列车最大安全前端所处link*/
				outStringLength += 2u;
				LongToChar(pNewTrainInfoData[deviceId].strHeadTrainLocData.strHeadTrainAtpLoc.dwTrainMaxHeadOffset, &outString[outStringLength]);/*列车最大安全前偏移量*/
				outStringLength += 4u;
				ShortToChar(pNewTrainInfoData[deviceId].strHeadTrainLocData.strHeadTrainAtpLoc.wTrainMinTailLink, &outString[outStringLength]);/*列车最小安全后端所处link*/
				outStringLength += 2u;
				LongToChar(pNewTrainInfoData[deviceId].strHeadTrainLocData.strHeadTrainAtpLoc.dwTrainMinTailOffset, &outString[outStringLength]);/*列车最小安全后端偏移量*/
				outStringLength += 4u;

				ShortToChar(pNewTrainInfoData[deviceId].strHeadTrainLocData.strHeadTrainIteLoc.wTrainMaxHeadLink, &outString[outStringLength]);/*列车最大安全前端所处link*/
				outStringLength += 2u;
				LongToChar(pNewTrainInfoData[deviceId].strHeadTrainLocData.strHeadTrainIteLoc.dwTrainMaxHeadOffset, &outString[outStringLength]);/*列车最大安全前偏移量*/
				outStringLength += 4u;
				ShortToChar(pNewTrainInfoData[deviceId].strHeadTrainLocData.strHeadTrainIteLoc.wTrainMinTailLink, &outString[outStringLength]);/*列车最小安全后端所处link*/
				outStringLength += 2u;
				LongToChar(pNewTrainInfoData[deviceId].strHeadTrainLocData.strHeadTrainIteLoc.dwTrainMinTailOffset, &outString[outStringLength]);/*列车最小安全后端偏移量*/
				outStringLength += 4u;

				outString[outStringLength++] = pNewTrainInfoData[deviceId].strHeadTrainLocData.strHeadTrainIteLoc.chTrainDir;/* 列车运行方向*/
				ShortToChar(pNewTrainInfoData[deviceId].strHeadTrainLocData.strHeadTrainIteLoc.wLocHeadLoss, &outString[outStringLength]);/*位置向前方向误差*/
				outStringLength += 2u;
				ShortToChar(pNewTrainInfoData[deviceId].strHeadTrainLocData.strHeadTrainIteLoc.wLocTailLoss, &outString[outStringLength]);/*位置向后方向误差*/
				outStringLength += 2u;

				ShortToChar(pNewTrainInfoData[deviceId].szTrainIteData[0].wTrainHeadLinkId, &outString[outStringLength]);/*列车最大安全前端所处link*/
				outStringLength += 2u;
				LongToChar(pNewTrainInfoData[deviceId].szTrainIteData[0].dwTrainHeadLinkOffset, &outString[outStringLength]);/*列车最大安全前偏移量*/
				outStringLength += 4u;
				ShortToChar(pNewTrainInfoData[deviceId].szTrainIteData[0].wTrainTailLinkId, &outString[outStringLength]);/*列车最小安全后端所处link*/
				outStringLength += 2u;
				LongToChar(pNewTrainInfoData[deviceId].szTrainIteData[0].dwTrainTailLinkOffset, &outString[outStringLength]);/*列车最小安全后端偏移量*/
				outStringLength += 4u;

				outString[outStringLength++] = pNewTrainInfoData[deviceId].szTrainIteData[0].cTrainDir;/* 列车运行方向*/
				ShortToChar(pNewTrainInfoData[deviceId].szTrainIteData[0].wForWardOffset, &outString[outStringLength]);/*位置向前方向误差*/
				outStringLength += 2u;
				ShortToChar(pNewTrainInfoData[deviceId].szTrainIteData[0].wBackOffset, &outString[outStringLength]);/*位置向后方向误差*/
				outStringLength += 2u;

				ShortToChar(pNewTrainInfoData[deviceId].szTrainIteData[1].wTrainHeadLinkId, &outString[outStringLength]);/*列车最大安全前端所处link*/
				outStringLength += 2u;
				LongToChar(pNewTrainInfoData[deviceId].szTrainIteData[1].dwTrainHeadLinkOffset, &outString[outStringLength]);/*列车最大安全前偏移量*/
				outStringLength += 4u;
				ShortToChar(pNewTrainInfoData[deviceId].szTrainIteData[1].wTrainTailLinkId, &outString[outStringLength]);/*列车最小安全后端所处link*/
				outStringLength += 2u;
				LongToChar(pNewTrainInfoData[deviceId].szTrainIteData[1].dwTrainTailLinkOffset, &outString[outStringLength]);/*列车最小安全后端偏移量*/
				outStringLength += 4u;

				outString[outStringLength++] = pNewTrainInfoData[deviceId].szTrainIteData[1].cTrainDir;/* 列车运行方向*/
				ShortToChar(pNewTrainInfoData[deviceId].szTrainIteData[1].wForWardOffset, &outString[outStringLength]);/*位置向前方向误差*/
				outStringLength += 2u;
				ShortToChar(pNewTrainInfoData[deviceId].szTrainIteData[1].wBackOffset, &outString[outStringLength]);/*位置向后方向误差*/
				outStringLength += 2u;
				ShortToChar(pNewTrainInfoData[deviceId].wTrainHeadSigId, &outString[outStringLength]);/*前车信号机ID*/
				outStringLength += 2u;
				ShortToChar(pNewTrainInfoData[deviceId].wTrainHeadTrainId, &outString[outStringLength]);/*前车ID*/
				outStringLength += 2u;
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chTrainLocReverseRouteFlag;/* 列车位置反向进路标志*/
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chAblTrainDir;/* ABL列车运行方向*/
				ShortToChar(pNewTrainInfoData[deviceId].wAblTrainMaxHeadLink, &outString[outStringLength]);/*ABL列车最大安全前端所处link*/
				outStringLength += 2u;
				LongToChar(pNewTrainInfoData[deviceId].dwAblTrainMaxHeadOffset, &outString[outStringLength]);/*ABL列车最大安全前偏移量*/
				outStringLength += 4u;
				ShortToChar(pNewTrainInfoData[deviceId].wAblTrainMinTailLink, &outString[outStringLength]);/*ABL列车最小安全后端所处link*/
				outStringLength += 2u;
				LongToChar(pNewTrainInfoData[deviceId].dwAblTrainMinTailOffset, &outString[outStringLength]);/*ABL列车最小安全后端偏移量*/
				outStringLength += 4u;
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chVirHeadScreenPassFlag;	/*虚拟前筛通过标志*/
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chVirTailScreenPassFlag;	/*虚拟后筛通过标志*/
				ShortToChar(pNewTrainInfoData[deviceId].wEnterLjkLinkId, &outString[outStringLength]);/*列车驶入列检库所在LINK*/
				outStringLength += 2u;
				LongToChar(pNewTrainInfoData[deviceId].dwTrainFullEnterLjkCycNum, &outString[outStringLength]);/*列车完全驶入列检库周期号*/
				outStringLength += 4u;

				outString[outStringLength++] = pNewTrainInfoData[deviceId].chTrainPosMonitorState;	/*列车位置监督状态：0x55 监督有效；0xAA 监督无效；0xCC 监督位置不一致*/
				ShortToChar(pNewTrainInfoData[deviceId].wTrainPosMonitorInLink, &outString[outStringLength]);  /*列车位置监督有效时所处link*/
				outStringLength += 2U;
				outString[outStringLength] = pNewTrainInfoData[deviceId].chTrainReportState;		/*列车汇报状态*/
				outStringLength++;
				outString[outStringLength++] = pNewTrainInfoData[deviceId].chEaCmdState;	/*区间疏散命令状态：0x55 有效；0xAA 无效*/
			}


		}
		else
		{
			returnValue = CI_ERROR;
		}
	}

	if (outStringLength == 0u)
	{
	}
	else
	{
#ifdef PLATFORM_2OO2
		debug_infor_printf((const)"\nTrainData:%d\nwTrainId(2)-chTrainInZone-chTrainLevel-chTrainModel-dwIvocCycle(4)-chTrainDir-wTrainMaxHeadLink(2)-dwTrainMaxHeadOffset(4)-wTrainMinHeadLink(2)-dwTrainMinHeadOffset(4)-wTrainMaxTailLink(2)-dwTrainMinTailOffset(4)-chSpeedDir-wTrainSpeed(2)-chTransmitStat-chHeadScreenStat-chTailScreenStat-wHeadLink(2)-dwHeadOffset(4)-chHeadDir-wTailLink(2):%d", (UINT16)sizeof(TrainInfoStru), outStringLength);

		debug_out_array(0xAA, outString, outStringLength);
#endif

		/*清空打印数据*/
		CleanString(outString);
		outStringLength = 0u;
	}

	/*************************************打印边界点数据********************************************/
	/*打印边界点数据*/
	deviceNum = GetCfpSum();/* 获取边界点数量 */
	for (ii = 0u; ii < deviceNum; ii++)
	{
		if (CI_SUCCESS != returnValue)
		{
			returnValue = CI_ERROR;
			break;
		}

		/*比较数据*/
		wCfpId = GetCfpId(ii);
		deviceId = GetCfpBufIndex(wCfpId);
		comparaResult = DeviceCompara((UINT8*)(&Record_CfpInfo[deviceId]), (UINT16)sizeof(CfpDataStru),
			(UINT8*)(&pNewCfpData[deviceId]), (UINT16)sizeof(CfpDataStru));

		if (0u == comparaResult)
		{/*比较数据一致*/

		}
		else if (1u == comparaResult)
		{/*比较数据不一致*/

			if (CI_ERROR == Flag)
			{/*不打印设备数据*/

			}
			else
			{
				/**************打印数据信息****************/
				ShortToChar(pNewCfpData[deviceId].wId, &outString[outStringLength]);/*边界点ID*/
				outStringLength += 2u;

				ShortToChar(pNewCfpData[deviceId].otherTiocTrainInfo.wTrainId, &outString[outStringLength]);/*边界点收到相邻TIOC列车ID*/
				outStringLength += 2u;

				outString[outStringLength++] = pNewCfpData[deviceId].otherTiocTrainInfo.chTrainLevel;/* 边界点收到相邻TIOC列车运行级别 */

				LongToChar(pNewCfpData[deviceId].otherTiocTrainInfo.dwDis, &outString[outStringLength]);/* 边界点收到相邻TIOC列车距离 */
				outStringLength += 4u;

				ShortToChar(pNewCfpData[deviceId].localTiocTrainInfo.wTrainId, &outString[outStringLength]);/*边界点发送给相邻TIOC列车ID*/
				outStringLength += 2u;

				outString[outStringLength++] = pNewCfpData[deviceId].localTiocTrainInfo.chTrainLevel;/* 边界点发送给相邻TIOC列车运行级别 */

				LongToChar(pNewCfpData[deviceId].localTiocTrainInfo.dwDis, &outString[outStringLength]);/* 边界点发送给相邻TIOC列车距离 */
				outStringLength += 4u;

				outString[outStringLength++] = pNewCfpData[deviceId].chLocalTiocEnvelopeNum;/* 边界点发送给相邻TIOC包络数量 */

				for (chEnIndex = 0u; chEnIndex < pNewCfpData[deviceId].chLocalTiocEnvelopeNum; chEnIndex++)
				{
					outString[outStringLength++] = pNewCfpData[deviceId].szLocalEnvelope[chEnIndex].envelopeType;/* 包络类型 */

					ShortToChar(pNewCfpData[deviceId].szLocalEnvelope[chEnIndex].headTrainID, &outString[outStringLength]);/*前车ID*/
					outStringLength += 2u;

					ShortToChar(pNewCfpData[deviceId].szLocalEnvelope[chEnIndex].tailTrainID, &outString[outStringLength]);/*后车ID*/
					outStringLength += 2u;

					ShortToChar(pNewCfpData[deviceId].szLocalEnvelope[chEnIndex].startPos.Lnk, &outString[outStringLength]);/*起点link*/
					outStringLength += 2u;

					LongToChar(pNewCfpData[deviceId].szLocalEnvelope[chEnIndex].startPos.Off, &outString[outStringLength]);/*起点偏移量*/
					outStringLength += 4u;

					outString[outStringLength++] = pNewCfpData[deviceId].szLocalEnvelope[chEnIndex].startPos.Dir;/* 起点方向 */

					ShortToChar(pNewCfpData[deviceId].szLocalEnvelope[chEnIndex].endPos.Lnk, &outString[outStringLength]);/*终点link*/
					outStringLength += 2u;

					LongToChar(pNewCfpData[deviceId].szLocalEnvelope[chEnIndex].endPos.Off, &outString[outStringLength]);/*终点偏移量*/
					outStringLength += 4u;

					outString[outStringLength++] = pNewCfpData[deviceId].szLocalEnvelope[chEnIndex].endPos.Dir;/* 终点方向 */

					outString[outStringLength++] = pNewCfpData[deviceId].szLocalEnvelope[chEnIndex].trianCnt;/* 包络包含的列车数量 */

					for (chTrainIndex = 0u; chTrainIndex < pNewCfpData[deviceId].szLocalEnvelope[chEnIndex].trianCnt; chTrainIndex++)
					{
						ShortToChar(pNewCfpData[deviceId].szLocalEnvelope[chEnIndex].trainID[chTrainIndex], &outString[outStringLength]);/*列车ID*/
						outStringLength += 2u;
					}
				}

				outString[outStringLength++] = pNewCfpData[deviceId].szCfpRRMData.cRrmSrcRcId;/* 分界点RRM源RC ID */

				ShortToChar(pNewCfpData[deviceId].szCfpRRMData.wRrmTrainId, &outString[outStringLength]);/*分界点RRM列车ID*/
				outStringLength += 2u;

				ShortToChar(pNewCfpData[deviceId].szCfpRRMData.wRrmTrainNextStaId, &outString[outStringLength]);/*分界点RRM站台ID*/
				outStringLength += 2u;

				outString[outStringLength++] = pNewCfpData[deviceId].szCfpRRMData.chRrmSrcApplyState;/* 分界点RRM源RC申请状态 */
				outString[outStringLength++] = pNewCfpData[deviceId].szCfpRRMData.chRrmDstAllowState;/* 分界点RRM目标RC允许状态 */

				outString[outStringLength] = pNewCfpData[deviceId].cSignalLightUpFlag;  /* 分界点信号机亮灯标志 */
				outStringLength++;
			}
		}
		else
		{
			returnValue = CI_ERROR;
		}
	}

	if (outStringLength == 0u)
	{
	}
	else
	{
#ifdef PLATFORM_2OO2
		debug_infor_printf((const)"\nCfpData:%d\nwCfpId(2)-RecvTrainId(2)-RecvTrainLevel-RecvTrainDis(4)-SendTrainId(2)-SendTrainLevel-SendTrainDis(4)-SendEnNum-SendEnInfo(n)-RecvEnNum-RecvEnInfo(n)-RrmSrcRcId-RrmTrainId(2)-RrmTrainNextStaId(2)-RrmSrcApplyState-chRrmDstAllowState:%d", (UINT16)sizeof(CfpDataStru), outStringLength);

		debug_out_array(0xAA, outString, outStringLength);
#endif

		/*清空打印数据*/
		CleanString(outString);
		outStringLength = 0u;
	}


	/*************************************打印临时限速信息********************************************/
	deviceNum = GetTsrSum();/* 获取临时限速信息 */
	for (ii = 0u; ii < deviceNum; ii++)
	{
		if (CI_SUCCESS != returnValue)
		{
			returnValue = CI_ERROR;
			break;
		}

		comparaResult = DeviceCompara((UINT8*)(&Record_TsrInfo[deviceId]), (UINT16)sizeof(TsrDataStruct),
			(UINT8*)(&pNewTsrInfo[deviceId]), (UINT16)sizeof(TsrDataStruct));

		if (0u == comparaResult)
		{/*比较数据一致*/

		}
		else if (1u == comparaResult)
		{/*比较数据不一致*/

			if (CI_ERROR == Flag)
			{/*不打印设备数据*/

			}
			else
			{
				/**************打印数据信息****************/
				outString[outStringLength] = (UINT8)deviceNum;	/* 临时限速数量 */
				outStringLength++;

				outString[outStringLength] = pNewTsrInfo[ii].cSpeed;	/* 速度 */
				outStringLength++;

				outString[outStringLength] = pNewTsrInfo[ii].cLogSecSum;	/* 逻辑区段数量 */
				outStringLength++;

				for (chEnIndex = 0u; chEnIndex <pNewTsrInfo[ii].cLogSecSum; chEnIndex++)
				{

					ShortToChar(pNewTsrInfo[ii].szLogSecId[chEnIndex], &outString[outStringLength]);/*逻辑区段ID*/
					outStringLength += 2u;
				}
			}


		}
		else
		{
			returnValue = CI_ERROR;
		}
	}

	if (outStringLength == 0u)
	{
	}
	else
	{
#ifdef PLATFORM_2OO2
		debug_infor_printf((const)"\nTsrData:%d\ncTsrSum(1)-cSpeed(1)-cLogSecSum(1)-wLogSecId(2n):%d", (UINT16)sizeof(CfpDataStru), outStringLength);

		debug_out_array(0xAA, outString, outStringLength);
#endif

		/*清空打印数据*/
		CleanString(outString);
		outStringLength = 0u;
	}

	for (ii = 0; ii < deviceNum; ii++)/*OC站指示灯数目*/
	{
		if ((CI_SUCCESS != returnValue) || (NULL == pNewSpksData))
		{
			returnValue = CI_ERROR;
			break;
		}

		/*比较数据*/
		comparaResult = DeviceCompara((UINT8*)(&Record_OCStationIndicBuff[ii]), (UINT16)sizeof(OCStationIndicDataStru),
			(UINT8*)(&pNewOCStationIndicData[ii]), (UINT16)sizeof(OCStationIndicDataStru));

		if (0u == comparaResult)
		{/*比较数据一致*/

		}
		else if (1u == comparaResult)
		{/*比较数据不一致*/

			if (CI_ERROR != Flag)
			{
				/**************打印数据信息****************/

				outString[outStringLength++] = pNewOCStationIndicData[ii].ocid;
				outString[outStringLength++] = pNewOCStationIndicData[ii].IndicatorId;
				outString[outStringLength++] = pNewOCStationIndicData[ii].IndicatorState;

			}
		}
		else
		{
			returnValue = CI_ERROR;
		}
	}

	if (0U == outStringLength)
	{
	}
	else
	{
#ifdef PLATFORM_2OO2
		debug_infor_printf((const)"\nOcStationIndic:%d,length:%d", (UINT16)sizeof(SpksDataStruct), outStringLength);

		debug_out_array(0xAA, outString, outStringLength);

#endif



		/*清空打印数据*/
		CleanString(outString);
		outStringLength = 0;
	}

	/*************************************打印逻辑进路信息********************************************/
	deviceNum = GetLogicalRouteSum();
	for (ii = 0U; ii < deviceNum; ii++)
	{
		if ((CI_SUCCESS != returnValue) || (NULL == pNewLogicalRouteDataStru))
		{
			returnValue = CI_ERROR;
			break;
		}

		/*比较数据*/
		comparaResult = DeviceCompara((UINT8*)(&Record_LogicalRouteDataStru[ii]), (UINT16)sizeof(LogicalRouteDataStruct),
			(UINT8*)(&pNewLogicalRouteDataStru[ii]), (UINT16)sizeof(LogicalRouteDataStruct));

		if (0U == comparaResult)
		{
			/*比较数据一致，不打印*/
		}
		else if (1U == comparaResult)
		{
			/*比较数据不一致，打印日志*/
			if (CI_ERROR != Flag)
			{
				/**************打印数据信息****************/
				ShortToChar(pNewLogicalRouteDataStru[ii].wLogRouteId, &outString[outStringLength]);  /*逻辑进路ID*/
				outStringLength += 2U;

				outString[outStringLength++] = pNewLogicalRouteDataStru[ii].chLogRouteDir;  /*逻辑进路方向（运营方向）*/
				outString[outStringLength++] = pNewLogicalRouteDataStru[ii].chLogicRouteState;  /*逻辑进路状态*/
				outString[outStringLength++] = pNewLogicalRouteDataStru[ii].chLogRouteLevel;  /*逻辑进路监督级别*/

				ShortToChar(pNewLogicalRouteDataStru[ii].wLogRouteRelateBeginSigId, &outString[outStringLength]);  /*逻辑进路关联始端信号机ID*/
				outStringLength += 2U;

				outString[outStringLength++] = pNewLogicalRouteDataStru[ii].chLogicRouteOpenColor;  /*逻辑进路开放颜色*/
				
				LongToChar(pNewLogicalRouteDataStru[ii].dwLogRouteChuXuanStartCycNum, &outString[outStringLength]);  /*逻辑进路初选起始周期号*/
				outStringLength += 4U;

				LongToChar(pNewLogicalRouteDataStru[ii].dwLogRouteXuanPaiStartCycNum, &outString[outStringLength]);  /*逻辑进路选排起始周期号*/
				outStringLength += 4U;

				LongToChar(pNewLogicalRouteDataStru[ii].dwLogRouteLockStartCycNum, &outString[outStringLength]);  /*逻辑进路锁闭起始周期号*/
				outStringLength += 4U;

				LongToChar(pNewLogicalRouteDataStru[ii].dwDelayErrLockStartCycNum, &outString[outStringLength]);  /*逻辑进路区故解延时解锁起始周期号*/
				outStringLength += 4U;

				outString[outStringLength++] = pNewLogicalRouteDataStru[ii].chLogRouteRecoverOpenState;  /*逻辑进路信号重开标志*/
				outString[outStringLength++] = pNewLogicalRouteDataStru[ii].chLogRouteSwitchMoveFlag;  /*逻辑进路是否可动道岔标志*/

				ShortToChar(pNewLogicalRouteDataStru[ii].szLogRouteApplyResTrainId, &outString[outStringLength]);  /*逻辑进路ATS请求资源列车ID*/
				outStringLength += 2U;

				if (MAX_ROUTE_IN_LT_NUM >= pNewLogicalRouteDataStru[ii].wLogRouteInLogSecSum)
				{
					outString[outStringLength++] = (UINT8)pNewLogicalRouteDataStru[ii].wLogRouteInLogSecSum;  /*逻辑进路包含的逻辑区段数量*/
					for (jj = 0U; jj < pNewLogicalRouteDataStru[ii].wLogRouteInLogSecSum; jj++)
					{
						ShortToChar(pNewLogicalRouteDataStru[ii].szLogRouteInLogSecIdBuf[jj], &outString[outStringLength]);  /*逻辑进路包含的逻辑区段ID*/
						outStringLength += 2U;
					}
				}
				else
				{
					outString[outStringLength++] = 0U;  /*逻辑进路包含的逻辑区段数量超限，不打印*/
				}

				if (MAX_ROUTE_IN_LT_NUM >= pNewLogicalRouteDataStru[ii].routeInSwitOtherPosLogSecSum)
				{
					outString[outStringLength++] = (UINT8)pNewLogicalRouteDataStru[ii].routeInSwitOtherPosLogSecSum;  /*逻辑进路内道岔关联的非进路内逻辑区段数量*/
					for (jj = 0U; jj < pNewLogicalRouteDataStru[ii].routeInSwitOtherPosLogSecSum; jj++)
					{
						ShortToChar(pNewLogicalRouteDataStru[ii].routeInSwitOtherPosLogSecIdBuf[jj], &outString[outStringLength]);  /*逻辑进路内道岔关联的非进路内逻辑区段ID*/
						outStringLength += 2U;
					}
				}
				else
				{
					outString[outStringLength++] = 0U;  /*逻辑进路内道岔关联的非进路内逻辑区段数量超限，不打印*/
				}

				if (MAX_ROUTE_IN_LT_NUM >= pNewLogicalRouteDataStru[ii].routeOutLogSecSum)
				{
					outString[outStringLength++] = (UINT8)pNewLogicalRouteDataStru[ii].routeOutLogSecSum;  /*逻辑进路包含物理区段关联的非进路内且非道岔关联的逻辑区段数量*/
					for (jj = 0U; jj < pNewLogicalRouteDataStru[ii].routeOutLogSecSum; jj++)
					{
						ShortToChar(pNewLogicalRouteDataStru[ii].routeOutLogSecSumIdBuf[jj], &outString[outStringLength]);  /*逻辑进路包含物理区段关联的非进路内且非道岔关联的逻辑区段ID*/
						outStringLength += 2U;
					}
				}
				else
				{
					outString[outStringLength++] = 0U;  /*逻辑进路包含物理区段关联的非进路内且非道岔关联的逻辑区段数量超限，不打印*/
				}

				if (MAX_ROUTE_IN_LT_NUM >= pNewLogicalRouteDataStru[ii].wLogRouteTrainLogSecSum)
				{
					outString[outStringLength++] = (UINT8)pNewLogicalRouteDataStru[ii].wLogRouteTrainLogSecSum;  /*逻辑进路列车脚下逻辑区段数量*/
					for (jj = 0U; jj < pNewLogicalRouteDataStru[ii].wLogRouteTrainLogSecSum; jj++)
					{
						ShortToChar(pNewLogicalRouteDataStru[ii].szLogRouteTrainLogSecIdBuf[jj], &outString[outStringLength]);  /*逻辑进路列车脚下逻辑区段ID*/
						outStringLength += 2U;
					}
				}
				else
				{
					outString[outStringLength++] = 0U;  /*逻辑进路列车脚下逻辑区段数量超限，不打印*/
				}
			}
		}
		else
		{
			returnValue = CI_ERROR;
		}
	}

	if (0U == outStringLength)
	{
	}
	else
	{
#ifdef PLATFORM_2OO2
		debug_infor_printf((const)"\nLogicalRouteData:%d, length:%d", (UINT16)sizeof(LogicalRouteDataStruct), outStringLength);

		debug_out_array(0xAA, outString, outStringLength);

#endif

		/*清空打印数据*/
		CleanString(outString);
		outStringLength = 0U;
	}

	/*************************************打印无人折返数据******************************************************/
	/*打印无人折返数据*/
	wNonAutoReturnCurSum = GetNonAutoReturnCurSum();
	for (ii = 0u; ii < wNonAutoReturnCurSum; ii++)
	{
		if (CI_SUCCESS != returnValue)
		{
			returnValue = CI_ERROR;
			break;
		}
		pNonAutoReturnData = GetNonReturnData();

		/*比较数据*/
		deviceId = GetNonReturnId(ii);
		comparaResult = DeviceCompara((UINT8*)(&Record_NonReturnDataStru[deviceId]), (UINT16)sizeof(NonAutoReturnDataStruct),
			(UINT8*)(&pNonAutoReturnData[deviceId]), (UINT16)sizeof(NonAutoReturnDataStruct));

		if (0u == comparaResult)
		{/*比较数据一致*/

		}
		else if (1u == comparaResult)
		{/*比较数据不一致*/

			if (CI_ERROR == Flag)
			{/*不打印设备数据*/

			}
			else
			{
				/**************打印数据信息****************/
				outString[outStringLength++] = pNonAutoReturnData[deviceId].IndicatorDevID;      /*指示灯设备ID*/
				ShortToChar(pNonAutoReturnData[deviceId].cmdSetTrainId, &outString[outStringLength]);/*命令列车ID*/
				outStringLength += 2u;
				outString[outStringLength++] = pNonAutoReturnData[deviceId].VobcToCIAutoRtnIndicFlashState; /*车载给联锁的无人折返指示灯闪灯状态*/
				outString[outStringLength++] = pNonAutoReturnData[deviceId].VobcToCIAutoRtnIndicSteadyState; /*车载给联锁的无人折返指示灯稳灯状态*/
				ShortToChar(pNonAutoReturnData[deviceId].RtnRelayAdhesionState.AdhesionRealyId, &outString[outStringLength]);/*粘连继电器ID*/
				outStringLength += 2u;
				outString[outStringLength++] = pNonAutoReturnData[deviceId].RtnRelayAdhesionState.AdhesionState;      /*继电器粘连状态*/
				LongToChar(pNonAutoReturnData[deviceId].RtnRelayAdhesionState.RelayUpCycNum, &outString[outStringLength]);  /*继电器吸起周期*/
				outStringLength += 4U;
				
			}

		}
		else
		{
			returnValue = CI_ERROR;
		}
	}

	if (outStringLength == 0u)
	{
	}
	else
	{
#ifdef PLATFORM_2OO2
		debug_infor_printf((const)"\nNonAutoReturnData:%d", (UINT16)sizeof(NonAutoReturnDataStruct), outStringLength);

		debug_out_array(0xAA, outString, outStringLength);

#endif

		/*清空打印数据*/
		CleanString(outString);
		outStringLength = 0u;
	}

    return returnValue;

}

/*
* 功能描述： 继电器比较
* 参数说明： const UINT8* lastString, 上一周期字符串
*			 const UINT8* thisString, 本周期字符串
*			 UINT8 rec, 0为采集，4为驱动
* 返回值  ： 0: 无变化
*            1: 有变化
*/
UINT8 RelayComPare(UINT8* lastString, const UINT8* thisString, UINT8 rec)
{
	UINT16 ii = 0u;
    UINT16 BoardSum = 0u;/*本联锁继电器板总数*/
    UINT16 boradDataLen = 0u;/*继电器板长度*/
    UINT8 comPareFlag = 0u;/*数据对比结果，默认无变化*/
	UINT8 retVal = 0u;
    if ((lastString == NULL) || (thisString == NULL))
    {/*指针为空不打印*/

        retVal = 0u;
    }
	else
	{
		switch (rec)
		{
			case 0:/*采集数据*/

				BoardSum = GetColRelayStructSum();/*采集板结构总数*/

				boradDataLen = BOARD_COLL_DATA_LEN + 1u;/*采集继电器每个地址2字节数据*/

				colStringLength = BoardSum * boradDataLen;
				break;
			case 4:/*驱动数据*/

				BoardSum = GetDrvRelayStructSum();/*驱动板结构总数*/

				boradDataLen = BOARD_DRV_DATA_LEN + 1u;/*驱动继电器每个地址2字节数据*/

				drvStringLength = BoardSum * boradDataLen;
				break;
			default:/*错误数据*/

				break;
		}

		for (ii = 0u; ii < BoardSum * boradDataLen; ii++)
		{
			if (thisString[ii] == lastString [ii])
			{
				/*数据相同*/
			}
			else
			{
				/*更新数据*/
				lastString[ii] = thisString[ii];

				comPareFlag = 1u;/*有变化*/

			}
		}

		if (comPareFlag == 0u)
		{/*数据无变化*/

			retVal = 0u;
		}
		else
		{/*数据有变化*/

			retVal = 1u;
		}	
	}
	return retVal;
}

/*
* 功能描述： 清空字符串
* 参数说明： UINT8* str
* 返回值  ： void
*/
void CleanString(UINT8* str)
{
	UINT16 ii = 0u;

	while (str[ii] != (UINT8)'\0')
	{
		str[ii++] = (UINT8)'\0';
	}
}

/*
* 功能描述： 对比设备数据
* 参数说明： UINT8* deviceStruAddr1, 设备1的结构数据首地址
*            const UINT16 deviceStruLen1, 设备1的结构数据长度
*            const UINT8* deviceStruAddr2, 设备2的结构数据首地址
*            const UINT16 deviceStruLen2, 设备2的结构数据长度
* 返回值  ： 0: 数据一致
*            1: 数据不一致
*            2: 结构类型不一致
*/
UINT8 DeviceCompara(UINT8* deviceStruAddr1, const UINT16 deviceStruLen1, 
                    const UINT8* deviceStruAddr2, const UINT16 deviceStruLen2)
{
    UINT16 ii = 0u;
    UINT8 returnValue = 0u;/*初始化返回数据一致*/

    if ((deviceStruAddr1 == NULL) || (deviceStruAddr2 == NULL))
    {/*地址为NULL*/

        returnValue = 0u;
    }
	else
	{
		if (deviceStruLen1 != deviceStruLen2)
		{
			/*数据结构不一致*/
			returnValue = 2u;
		}
		else
		{
			for (ii = 0u; ii < deviceStruLen1; ii++)
			{
				if (deviceStruAddr1[ii] != deviceStruAddr2[ii])
				{
					/*数据不一致*/
					returnValue = 1u;
					break;
				}
			}

			/*保存最新数据*/
			if (0u != returnValue)
			{
				for (ii = 0u; ii < deviceStruLen1; ii++)
				{
					deviceStruAddr1[ii] = deviceStruAddr2[ii];
				}
			}
		}

	}
    

    

    return returnValue;
}
/*
* 功能描述： 获取虚拟联锁关键数据
* 参数说明：无
* 返回值  ： 无
*/
void GetVirCIKeyDataStru(void)
{
	UINT8 ii = 0u;
	UINT8 jj = 0U;

	for(ii=0u;ii<g_VirtualCIStructData.virtualCiNum;ii++)
	{
		newVirCIKeyDataStru[ii].virtualCiId = g_VirtualCIStructData.virtualCi[ii].virtualCiId;
		newVirCIKeyDataStru[ii].virAllSignalBrightFlag = g_VirtualCIStructData.virtualCi[ii].chAllSignalBrightFlag;
		newVirCIKeyDataStru[ii].virAllSwitchYLockFlag = g_VirtualCIStructData.virtualCi[ii].chAllSwitchYLockFlag; 


		newVirCIKeyDataStru[ii].virLabourCancelLinShiXianState = g_VirtualCIStructData.virtualCi[ii].chLabourCancelLinShiXianState;
		newVirCIKeyDataStru[ii].cimode = g_VirtualCIStructData.virtualCi[ii].cimode; 

		newVirCIKeyDataStru[ii].autoTriggerflag = g_VirtualCIStructData.virtualCi[ii].autoTriggerflag;
		newVirCIKeyDataStru[ii].ZfwFlag = g_VirtualCIStructData.virtualCi[ii].ZfwFlag; 

		newVirCIKeyDataStru[ii].ZfwStartCycNum = g_VirtualCIStructData.virtualCi[ii].ZfwStartCycNum;
		newVirCIKeyDataStru[ii].ZfwValidCycNum = g_VirtualCIStructData.virtualCi[ii].ZfwValidCycNum; 

		
		for (jj = 0U; jj < RTNINDICATOR_SUM_MAX; jj++)
		{
			newVirCIKeyDataStru[ii].RtnIndicatorKeyData[jj].PrintVirCiIndicatorDevId = g_VirtualCIStructData.virtualCi[ii].VirCIRtnIndicatorStaData[jj].VirCiIndicatorDevId;
			newVirCIKeyDataStru[ii].RtnIndicatorKeyData[jj].PrintVirCiFlashState = g_VirtualCIStructData.virtualCi[ii].VirCIRtnIndicatorStaData[jj].VirCiFlashState;
			newVirCIKeyDataStru[ii].RtnIndicatorKeyData[jj].PrintVirCiSteadyState = g_VirtualCIStructData.virtualCi[ii].VirCIRtnIndicatorStaData[jj].VirCiSteadyState;
		}
		newVirCIKeyDataStru[ii].ZfwjHunXianFLag = g_VirtualCIStructData.virtualCi[ii].ZfwjHunXianFLag; 
	}
}
