Running the attached python script for building one CODESYS project which includes a visualization manager and at least a visualization, launched using the command line as:
Build:Error:C0:Internalerror:System.ArgumentOutOfRangeException:Lengthcannotbelessthanzero.Parametername:length  atSystem.String.Substring(Int32startIndex,Int32length)  at_3S.CoDeSys.VisualObject.Utilities.GetGlobalTextListFilePath(StringstFile,BooleanbCheckCompilerVersion,BooleanbUseEnvironmentVariable)  at_3S.CoDeSys.VisualObject.VisualManagerObject.InstantiationObject.DetermineTextListPaths(String&stTextListPath,String&stTextListPathRelative,String&stTextListFileNameWithoutDirectory)  at_3S.CoDeSys.VisualObject.VisualManagerObject.InstantiationObject.CreateTextListBody(BooleanbRegister)  at_3S.CoDeSys.VisualObject.VisualManagerObject.InstantiationObject.get_InitCode()  at_3S.CoDeSys.VisualObject.VisualManagerObject.InstantiateImagePoolsAndTextlists(DeclarationHelperdeclDest,List`1alTypes,List`1initCodes,List`1exitCodes,BooleanbBeforCompile,VisualConstraintCheckerCachecache,IAvailableTargetConstraintsProvider2provider,INamespacesMappingTableoptNamespacesTable)  at_3S.CoDeSys.VisualObject.VisualManagerObject.FillBeforeCompileLanguageModel(LanguageModelMixturelmmixture,ILibraryIdentifiersidents,Int64lNecessaryProfileId,BooleanbForIntegratedVisu)  at_3S.CoDeSys.VisualObject.VisualManagerObject.GetStructuredLanguageModel(ILanguageModelBuilderlmbuilder)  at_3S.CoDeSys.LanguageModelManager.LanguageModelManager.PutLanguageModel(ILanguageModelProviderlanmodprov,BooleanbShowSyntaxErrors,BooleanforceCompleteLanguageModel)  at_3S.CoDeSys.LanguageModelManager.LanguageModelManager.PutLanguageModel(ILanguageModelProviderlanmodprov,BooleanbShowSyntaxErrors)  at_3S.CoDeSys.VisualObject.VisualObjectEventWatcher.OnLanguageModelMgr_BeforeCompile(Objectsender,CompileEventArgse)  at_3S.CoDeSys.Core.LanguageModel.CompileEventHandler.Invoke(Objectsender,CompileEventArgse)  at_3S.CoDeSys.LanguageModelManager.LanguageModelManager.OnBeforeCompile(CompileEventArgse)  at_3S.CoDeSys.LanguageModelManager.LanguageModelManager.RaiseAndCheckBeforeCompile(GuidguidApplication,IMessageCategorycmc)  at_3S.CoDeSys.LanguageModelManager.Compiler35100.Compiler.(_IPreCompileContext,Guid,Boolean,Boolean,Boolean,Boolean&,_ICompileContext&,_ICompileContext&,IProgressCallback,Boolean,Boolean)  at_3S.CoDeSys.LanguageModelManager.Compiler35100.Compiler.(Guid,Boolean,Boolean,Boolean,IOnlineChangeDetails&,IMessage[]&,IMessage[]&)Build:Text:C0:Buildcomplete-- 1 errors, 0 warnings : no download possible!List[Guid]([<System.Guid object at 0x000000000000006C [194b48a9-ab51-43ae-b9a9-51d3edaaddf3]>,<System.Guidobjectat0x000000000000006D[97f48d64-a2a3-4856-b640-75c046e37ea9]>])Array[str](('------ Build started: Application: Device.Application -------','Internal error:System.ArgumentOutOfRangeException: Length cannot be less than zero.\r\nParameter name: length\r\n  at System.String.Substring(Int32 startIndex, Int32 length)\r\n  at _3S.CoDeSys.VisualObject.Utilities.GetGlobalTextListFilePath(String stFile, Boolean bCheckCompilerVersion, Boolean bUseEnvironmentVariable)\r\n  at _3S.CoDeSys.VisualObject.VisualManagerObject.InstantiationObject.DetermineTextListPaths(String& stTextListPath, String& stTextListPathRelative, String& stTextListFileNameWithoutDirectory)\r\n  at _3S.CoDeSys.VisualObject.VisualManagerObject.InstantiationObject.CreateTextListBody(Boolean bRegister)\r\n  at _3S.CoDeSys.VisualObject.VisualManagerObject.InstantiationObject.get_InitCode()\r\n  at _3S.CoDeSys.VisualObject.VisualManagerObject.InstantiateImagePoolsAndTextlists(DeclarationHelper declDest, List`1 alTypes, List`1 initCodes, List`1 exitCodes, Boolean bBeforCompile, VisualConstraintCheckerCache cache, IAvailableTargetConstraintsProvider2 provider, INamespacesMappingTable optNamespacesTable)\r\n  at _3S.CoDeSys.VisualObject.VisualManagerObject.FillBeforeCompileLanguageModel(LanguageModelMixture lmmixture, ILibraryIdentifiers idents, Int64 lNecessaryProfileId, Boolean bForIntegratedVisu)\r\n  at _3S.CoDeSys.VisualObject.VisualManagerObject.GetStructuredLanguageModel(ILanguageModelBuilder lmbuilder)\r\n  at _3S.CoDeSys.LanguageModelManager.LanguageModelManager.PutLanguageModel(ILanguageModelProvider lanmodprov, Boolean bShowSyntaxErrors, Boolean forceCompleteLanguageModel)\r\n  at _3S.CoDeSys.LanguageModelManager.LanguageModelManager.PutLanguageModel(ILanguageModelProvider lanmodprov, Boolean bShowSyntaxErrors)\r\n  at _3S.CoDeSys.VisualObject.VisualObjectEventWatcher.OnLanguageModelMgr_BeforeCompile(Object sender, CompileEventArgs e)\r\n  at _3S.CoDeSys.Core.LanguageModel.CompileEventHandler.Invoke(Object sender, CompileEventArgs e)\r\n  at _3S.CoDeSys.LanguageModelManager.LanguageModelManager.OnBeforeCompile(CompileEventArgs e)\r\n  at _3S.CoDeSys.LanguageModelManager.LanguageModelManager.RaiseAndCheckBeforeCompile(Guid guidApplication, IMessageCategory cmc)\r\n  at _3S.CoDeSys.LanguageModelManager.Compiler35100.Compiler.\x01(_IPreCompileContext \x02, Guid \x03, Boolean \x04, Boolean \x05, Boolean \x06, Boolean& \x07, _ICompileContext& \x08, _ICompileContext& \x0e, IProgressCallback \x0f, Boolean \x10, Boolean \x11)\r\n  at _3S.CoDeSys.LanguageModelManager.Compiler35100.Compiler.\x01(Guid \x02, Boolean \x03, Boolean \x04, Boolean \x05, IOnlineChangeDetails& \x06, IMessage[]& \x07, IMessage[]& \x08)','Build complete -- 1 errors, 0 warnings : no download possible!'))
Using the same command within the IDE environment doesn't return any error and the download on the target is allowed.
Is there a way to solve the error?
Thank you
Environment:
CODESYS version: 3.5 SP 10 patch 5
MS Windows 7 64 bit
Running the attached python script for building one CODESYS project which includes a visualization manager and at least a visualization, launched using the command line as:
The following error is obtained:
Using the same command within the IDE environment doesn't return any error and the download on the target is allowed.
Is there a way to solve the error?
Thank you
Environment:
CODESYS version: 3.5 SP 10 patch 5
MS Windows 7 64 bit
BuildCodesys.py [1.31 KiB]
Hi,
I know it's been a long time, but did you manage to solve the internal error issue?
I'm having the same error here.