📄 101e3568af5f001d1289bbda6de18a35
字号:
(diErrorCode := CILE_ErrorCodes.DivByZero, iPartCount := 1, stPart1 := 'Division by Zero'), (diErrorCode := CILE_ErrorCodes.TooManyPous, iPartCount := 1, stPart1 := 'Too many pous used concurrently.'), (diErrorCode := CILE_ErrorCodes.SignatureNotFound, iPartCount := 2, stPart1 := 'The signature $'', stPart2 := '$' was not found.'), (diErrorCode := CILE_ErrorCodes.CompiledPouNotFound, iPartCount := 2, stPart1 := 'No pou exists for the name $'', stPart2 := '$'. It will be created'), (diErrorCode := CILE_ErrorCodes.Watchdog, iPartCount := 2, stPart1 := 'The watchdog for the execution has expired after ', stPart2 := 'ms'), (diErrorCode := CILE_ErrorCodes.InvalidJump, iPartCount := 2, stPart1 := 'A jump to the invalid address ', stPart2 := ' happened'), (diErrorCode := CILE_ErrorCodes.InvalidAccuType, iPartCount := 1, stPart1 := 'The current type of the accu register is wrong'), (diErrorCode := CILE_ErrorCodes.UnknownPou, iPartCount := 2, stPart1 := 'The pou $'', stPart2 := '$' is not registered within the pouorganizer'), (diErrorCode := CILE_ErrorCodes.WriteError, iPartCount := 2, stPart1 := 'A problem occurred during saving the pou'), (diErrorCode := CILE_ErrorCodes.TooLargeCodeLine, iPartCount := 1, stPart1 := 'A line of code in the source that is to load was too long.'), (diErrorCode := CILE_ErrorCodes.NoMemoryOperandOperator, iPartCount := 3, stPart1 := 'The operator $'', stPart2 := '$' does not allow the memory operand $'', stPart3 := '$''), (diErrorCode := CILE_ErrorCodes.NoMemoryBitOperandOperator, iPartCount := 3, stPart1 := 'The operator $'', stPart2 := '$' does not allow the memory-bit operand $'', stPart3 := '$''), (diErrorCode := CILE_ErrorCodes.NoLiteralBitOperandOperator, iPartCount := 3, stPart1 := 'The operator $'', stPart2 := '$' does not allow the literal bit-operand $'', stPart3 := '$''), (diErrorCode := CILE_ErrorCodes.NoLiteralNumericOperandOperator, iPartCount := 3, stPart1 := 'The operator $'', stPart2 := '$' does not allow the literal numeric operand $'', stPart3 := '$''), (diErrorCode := CILE_ErrorCodes.TwoSubsequentNetworkNumbers, iPartCount := 1, stPart1 := 'Two subsequent networknumbers'), (diErrorCode := CILE_ErrorCodes.TwoSubsequentComments, iPartCount := 1, stPart1 := 'Two subsequent comments'), (diErrorCode := CILE_ErrorCodes.TooManyComments, iPartCount := 1, stPart1 := 'Too many comments'), (diErrorCode := CILE_ErrorCodes.TooManyNetworks, iPartCount := 1, stPart1 := 'Too many networks'), (diErrorCode := CILE_ErrorCodes.MissingOperator, iPartCount := 1, stPart1 := 'There is no operator'), (diErrorCode := CILE_ErrorCodes.InternalCodeGenError, iPartCount := 1, stPart1 := 'An internal error occurred during code generation'), (diErrorCode := CILE_ErrorCodes.BitAccessOnlyOnBitOperands, iPartCount := 1, stPart1 := 'A bit access is only allowed on bit direct addresses (%*X)'), (diErrorCode := CILE_ErrorCodes.BitOperandWithoutBitAccess, iPartCount := 1, stPart1 := 'A bit direct access (%*X) must have a bit index'), (diErrorCode := CILE_ErrorCodes.InvalidPouAccessOperand, iPartCount := 1, stPart1 := 'An operand for accessing a pou is invalid'), (diErrorCode := CILE_ErrorCodes.NoLdInParentheses, iPartCount := 1, stPart1 := 'LD is not allowed in parentheses'), (diErrorCode := CILE_ErrorCodes.ExpressionTooNested, iPartCount := 1, stPart1 := 'Expression is too nested'), (diErrorCode := CILE_ErrorCodes.CloseParentheseWithoutOpen, iPartCount := 1, stPart1 := 'Closing parenthese found without an open one'), (diErrorCode := CILE_ErrorCodes.STWithWrongType, iPartCount := 1, stPart1 := 'The type of the operand of ST does not match the current accu'), (diErrorCode := CILE_ErrorCodes.NoCodeMemory, iPartCount := 1, stPart1 := 'There is no more memory for code available'), (diErrorCode := CILE_ErrorCodes.AddressNotResolved, iPartCount := 1, stPart1 := 'Internal: The address has not been resolved'), (diErrorCode := CILE_ErrorCodes.SROnlyInBitMode, iPartCount := 1, stPart1 := 'The operators S/R are only allowed with a boolean accumulator'), (diErrorCode := CILE_ErrorCodes.SROnlyWithBitMemoryOperand, iPartCount := 1, stPart1 := 'The operators S/R are only allowed with destinations of type bit'), (diErrorCode := CILE_ErrorCodes.NoMemoryNumericOperandOperator, iPartCount := 3, stPart1 := 'The operator $'', stPart2 := '$' does not allow the numeric operand $'', stPart3 := '$'.'), (diErrorCode := CILE_ErrorCodes.InvalidLabelPosition, iPartCount := 1, stPart1 := 'The label is located at an invalid position'), (diErrorCode := CILE_ErrorCodes.TooManyLabels, iPartCount := 1, stPart1 := 'Too many labels are used in the current pou'), (diErrorCode := CILE_ErrorCodes.DuplicateLabel, iPartCount := 1, stPart1 := 'The label occurs more than once'), (diErrorCode := CILE_ErrorCodes.InvalidLabel, iPartCount := 2, stPart1 := 'The label $'', stPart2 := '$' is not valid'), (diErrorCode := CILE_ErrorCodes.LabelNotDefined, iPartCount := 2, stPart1 := 'The label $'', stPart2 := '$' is not defined'), (diErrorCode := CILE_ErrorCodes.TooManyLabelReferences, iPartCount := 1, stPart1 := 'The label is referenced too often'), (diErrorCode := CILE_ErrorCodes.ComparisonOnlyWithNumericAccu, iPartCount := 1, stPart1 := 'Numeric comparisons must not be done with a boolean result'), (diErrorCode := CILE_ErrorCodes.ComparisonOnlyWithNumericOperand, iPartCount := 1, stPart1 := 'Numeric comparisons must not be done with a boolean operand'), (diErrorCode := CILE_ErrorCodes.ConditionalStmtOnlyInBoolMode, iPartCount := 1, stPart1 := 'Conditional statements must only be used with a boolean result'), (diErrorCode := CILE_ErrorCodes.NoOperandExpected, iPartCount := 2, stPart1 := 'No operand expected for the operator $'', stPart2 := '$''), (diErrorCode := CILE_ErrorCodes.NoCallWithCompoAccess, iPartCount := 1, stPart1 := 'A call is not allowed with access to components'), (diErrorCode := CILE_ErrorCodes.PouAccessOnlyCompoAccess, iPartCount := 2, stPart1 := 'The operator $'', stPart2 := '$' needs an access to a component'), (diErrorCode := CILE_ErrorCodes.InvalidComponentOfPou, iPartCount := 3, stPart1 := 'The operand $'', stPart2 := '$' accesses an invalid component of the type $'', stPart3 := '$''), (diErrorCode := CILE_ErrorCodes.PouIndexOutOfBounds, iPartCount := 3, stPart1 := 'The operand $'', stPart2 := '$' accesses an invalid index of the iec-pou-type $'', stPart3 := '$''), (diErrorCode := CILE_ErrorCodes.InvalidIecPou, iPartCount := 2, stPart1 := 'The operand $'', stPart2 := '$' accesses an invalid iec pou'), (diErrorCode := CILE_ErrorCodes.ConversionWrongAccuType, iPartCount := 2, stPart1 := 'The source type of the conversion $'', stPart2 := '$' does not match the current type'), (diErrorCode := CILE_ErrorCodes.OperatorOnlyWithByteOperand, iPartCount := 2, stPart1 := 'The operator $'', stPart2 := '$' is only allowed with operands of type BYTE'), (diErrorCode := CILE_ErrorCodes.NumericOperationsOnlyWithNumericAccu, iPartCount := 2, stPart1 := 'The operator $'', stPart2 := '$' is only allowed with a numeric accu'), (diErrorCode := CILE_ErrorCodes.TypeMismatchAccuOperand, iPartCount := 3, stPart1 := 'The type $'', stPart2 := '$' of the accu does not match the type $'', stPart3 := '$' of the operand'), (diErrorCode := CILE_ErrorCodes.MissingLD, iPartCount := 1, stPart1 := 'The pou does not start with LD'), (diErrorCode := CILE_ErrorCodes.MissingCloseParenthese, iPartCount := 1, stPart1 := 'A closing parenthese $')$' is missing') ]; switch (GetNumOfParams(Struct1.pCompileErrors[0].ErrorNr)){ case 0: // error = GetErrorText(Struct1.pCompileErrors[0].ErrorNr); case 1: // error = GetErrorText1Param(Struct1.pCompileErrors[0].ErrorNr, Struct1.pCompileErrors[0].stParam1); case 2: // error = GetErrorText2Param(Struct1.pCompileErrors[0].ErrorNr, Struct1.pCompileErrors[0].stParam1,Struct1.pCompileErrors[0].stParam2);}#endifsprintf(CompileOut,"%u",(unsigned int)Struct1.pCompileErrors[0].ErrorNr);TRT_SetValues(TRT_cid2,"CILECOMPILE", TRT_ATT_TEXT,CompileOut,NULL);} // error = GetErrorText1Param(Struct1.pCompileErrors[0].ErrorNr, Struct1.pCompileErrors[0].stParam1); case 2: // error = GetErrorText2Param(Struct1.pCompileErrors[0].ErrorNr, Struct1.pCompileErrors[0].stParam1,Struct1.pCompileErrors[0].stParam2);}#endifsprintf(CompileOut,"%u",(unsigned int)Struct1.pCompileErrors[0].ErrorNr);TRT_SetValues(TRT_cid2,"CILECOMPILE", TRT_ATT_TEXT,CompileOut,NULL);}/*F*//*************************************************************************
** >AUTHOR : Jiang** FUNCTION NAME : ** ** >DESCRIPTION: Get POU Number** ** >NOTES: Test Ncs_Ilc_CILEGetNumOfPous(...)** ** >PARAMETER:** ** >RETURN VALUE:** ** >INCLUDES:** */EXPORT void Dab_h_GetPouNumber(void){ unsigned long PouNumber; char Numberbuffer[4];int returnValue;/*Call this function to get POU numbers*/returnValue=Ncs_Ilc_CILEGetNumOfPous(&PouNumber); sprintf(Numberbuffer,"%lu",PouNumber); TRT_SetValues(TRT_cid2,"POUTOTAL", TRT_ATT_TEXT,Numberbuffer,NULL);} /*F*//************************************************************************
** >AUTHOR : Jiang** FUNCTION NAME : ** ** >DESCRIPTION: Get Boot Application Name** ** >NOTES: Test Ncs_Ilc_CILEGetBootApplicationName(...)** ** >PARAMETER:** ** >RETURN VALUE:** ** >INCLUDES:** */EXPORT void Dab_h_GetBootApplicationName(void){ /*Use this buffer to save POU number*/ unsigned long Size=20; char BootAppName[20]; int returnValue; /*Call this function to get Boot Application name*/ returnValue=Ncs_Ilc_CILEGetBootApplicationName(BootAppName,&Size); TRT_SetValues(TRT_cid2,"BOOTNAME", TRT_ATT_TEXT,BootAppName,NULL); } /*F*//*************************************************************************
** >AUTHOR : Jiang** FUNCTION NAME : ** ** >DESCRIPTION: Get Monitoring Value ** ** >NOTES: Test Ncs_Ilc_CILEGetMonitoringValue(...)** ** >PARAMETER:** ** >RETURN VALUE:** ** >INCLUDES:** */EXPORT void Dab_h_GetMonitorValue(void){ char ValueName[10]; char tempbuffer[10]; char tempbuffer1[10]; unsigned short ReturnType = 0; unsigned long ReturnValue = 0; int returnValue; TRT_GetValues(TRT_cid2,"MONIVAL", TRT_ATT_TEXT,ValueName, NULL); /*Get value name */ returnValue=Ncs_Ilc_CILEGetMonitoringValue(ValueName, &ReturnType, &ReturnValue); /*Get return value */ sprintf(tempbuffer,"%lu",ReturnValue); sprintf(tempbuffer1,"%u",ReturnType); TRT_SetValues(TRT_cid2,"MONIVALUE", TRT_ATT_TEXT,tempbuffer, NULL); TRT_SetValues(TRT_cid2,"MONITYPE", TRT_ATT_TEXT,tempbuffer1, NULL);}/*F*//*************************************************************************** >AUTHOR : Jiang** FUNCTION NAME : ** ** >DESCRIPTION: Free Complied Code** ** >NOTES: Test Ncs_Ilc_CILEFreeCompiledCode(...)** ** >PARAMETER:** ** >RETURN VALUE:** ** >INCLUDES:** */ EXPORT void Dab_h_FreeCompliedCode(void){ char Success[]="CompiledCode have been free!"; char Error[]="CompiledCode failed!"; /*After a successful compile Handle will be returned*/ if(Ncs_Ilc_CILEFreeCompiledCode(HandelCompiled)) TRT_SetValues(TRT_cid2,"CILECOMPILE", TRT_ATT_TEXT,Success,NULL); /*If free the compiled code correctly.*/ else TRT_SetValues(TRT_cid2,"CILECOMPILE", TRT_ATT_TEXT,Error,NULL); }/*F*//*************************************************************************** >AUTHOR : Jiang** FUNCTION NAME : ** ** >DESCRIPTION: ** ** >NOTES:** ** >PARAMETER:** ** >RETURN VALUE:** ** >INCLUDES:** */ EXPORT void Dab_h_ReadPOUInfo(void){ char Pbuffer1[10]; Ncs_CILE_PouInf_t Infobuffer; long int returnValue; unsigned long POUid; char buffer1[10]; char buffer2[10]; char* buffer3[4]={ "Invalid", "Loaded", "Running", "Error" }; char buffer4[10]; char buffer5[10]; struct NameNr{ int POUno; char* POUname; }; struct NameNr MyPLC[3]= { {0,"TestPou1"}, {1,"TestPou2"}, {2,"TestPOu3"} }; TRT_GetValues(TRT_cid2,"POUNO", TRT_ATT_TEXT,&Pbuffer1, NULL); returnValue=strtol(Pbuffer1,(char**)NULL,10); // You can get POU info by Nr.or by name.by one button. //Get POU id by Number Ncs_Ilc_CILEGetIdOfPouByNr(returnValue,&POUid); //Get POU info by name Ncs_Ilc_CILEGetPouInfoByName(MyPLC[returnValue].POUname,&Infobuffer); sprintf(POUNamebuffer,"%s",Infobuffer.szPouName); sprintf(buffer1,"%s",Infobuffer.szPouName); sprintf(buffer2,"%ld",POUid); sprintf(buffer4,"%lu",Infobuffer.udiStructSize); sprintf(buffer5,"%lu",Infobuffer.udiErrorCode); TRT_SetValues(TRT_cid2,"INF1", TRT_ATT_TEXT,buffer1,NULL); TRT_SetValues(TRT_cid2,"INF2", TRT_ATT_TEXT,buffer2,NULL); TRT_SetValues(TRT_cid2,"INF3", TRT_ATT_TEXT,buffer3[Infobuffer.uiState],NULL); TRT_SetValues(TRT_cid2,"INF4", TRT_ATT_TEXT,buffer4,NULL); TRT_SetValues(TRT_cid2,"INF5", TRT_ATT_TEXT,buffer5,NULL);}/*F*//*======================================================================** detailed documentation of the history** of this file. the numbers of the paragraphs must correspond** to the numbers of the history-comments within the fileheader**----------------------------------------------------------------------*//* ausgecheckte Revision: /main/NC_V0_integration/1** Autor: abdeaity Datum: Apr 17 2008** eingecheckte Revision: /main/NC_V0_integration/2** Date: Apr 17 17:31:27 2008** CQ-Pr: ** Pflichtenheft-Nr/Name: ** Kommentar: Test Machine Clone and Restore** ---------------------------------------------------------------------*//* ausgecheckte Revision: /main/NC_V0_integration/2** Autor: abdeaity Datum: Apr 18 2008** eingecheckte Revision: /main/NC_V0_integration/3** Date: Apr 18 16:50:35 2008** CQ-Pr: ** Pflichtenheft-Nr/Name: ** Kommentar: change name of language files** ---------------------------------------------------------------------*//* ausgecheckte Revision: /main/NC_V0_integration/3** Autor: abdeaity Datum: May 20 2008** eingecheckte Revision: /main/NC_V0_integration/4** Date: May 21 16:6:10 2008** CQ-Pr: ** Pflichtenheft-Nr/Name: ** Kommentar: Include Example of CIL Edior** ---------------------------------------------------------------------*//* ausgecheckte Revision: /main/NC_V0_integration/4** Autor: abdeaity Datum: Jun 13 2008** eingecheckte Revision: /main/NC_V0_integration/5** Date: Jun 16 11:52:55 2008** CQ-Pr: ** Pflichtenheft-Nr/Name: ** Kommentar: 2 new function to get and set Networkconfig** ---------------------------------------------------------------------*//* ausgecheckte Revision: /main/NC_V0_integration/5** Autor: abdeaity Datum: Jun 26 2008** eingecheckte $Revision$ $Date$** CQ-Pr: ** Pflichtenheft-Nr/Name: ** Kommentar: Added Jian functions for CIL example** ---------------------------------------------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -