As part of my build I am testing the scriptengine. As a first test I am trying to compile a template project from the project wizard for a WinControlV3 device. When I build the project from the same machine I generated the project I dont have a problem.
Script
# encoding:utf-8from__future__importprint_functionimportargparseimportosparser=argparse.ArgumentParser()parser.add_argument("project",help="Path to Codesys Project")args=vars(parser.parse_args())ifnotos.path.isfile(args["project"]):raiseValueError(args["project"]+' is not a file!')proj=projects.open(args["project"])application=proj.active_applicationapplication.generate_code()proj.close()
However, in my build server with CODESYS v3.5.16.0 I run the same script and I get the following:
Both development and build computer have CODESYS v3.5 SP16 (3.5.16.0) installed. What I also noticed is that the libraries are not detected correctly if I create the project directly from the project Wizard. I have to delete the library manager,create it again and add the libraries IoStandard, Standard and CAA Device Diagnosis otherwise I get the following error before the last one I mentioned above:
Build:Text:C0:------Buildstarted:Application:Device.Application-------Build:Text:C0:Typifycode...Build:Warning:C100:LibraryStandardhasnotbeenaddedtotheLibraryManager,ornovalidlicensecouldbefoundBuild:Warning:C100:LibraryBreakpointLogginghasnotbeenaddedtotheLibraryManager,ornovalidlicensecouldbefoundBuild:Error:C32:Cannotconverttype'Unknown type: 'concat('License for ',strComponent)''totype'STRING'Build:Error:C46:Identifier'concat'notdefinedBuild:Error:C35:Programname,functionorfunctionblockinstanceexpectedinsteadof'concat'Build:Error:C32:Cannotconverttype'Unknown type: 'concat(str,' not installed.')''totype'STRING'Build:Error:C46:Identifier'concat'notdefinedBuild:Error:C35:Programname,functionorfunctionblockinstanceexpectedinsteadof'concat'Build:Error:C32:Cannotconverttype'Unknown type: 'concat('Demo mode for ',strComponent)''totype'STRING'Build:Error:C46:Identifier'concat'notdefinedBuild:Error:C35:Programname,functionorfunctionblockinstanceexpectedinsteadof'concat'Build:Error:C32:Cannotconverttype'Unknown type: 'concat(str,' expired. Feature stopped!')''totype'STRING'Build:Error:C46:Identifier'concat'notdefinedBuild:Error:C35:Programname,functionorfunctionblockinstanceexpectedinsteadof'concat'Build:Error:C32:Cannotconverttype'Unknown type: 'CONCAT('L',myUDINT_TO_STRING(udi:=udi))''totype'STRING'Build:Error:C46:Identifier'CONCAT'notdefinedBuild:Error:C35:Programname,functionorfunctionblockinstanceexpectedinsteadof'CONCAT'Build:Error:C32:Cannotconverttype'Unknown type: 'concat('Demo mode for ',strComponent)''totype'STRING'Build:Error:C46:Identifier'concat'notdefinedBuild:Error:C35:Programname,functionorfunctionblockinstanceexpectedinsteadof'concat'Build:Error:C32:Cannotconverttype'Unknown type: 'concat(str,' started. Will expire and stop!')''totype'STRING'Build:Error:C46:Identifier'concat'notdefinedBuild:Error:C35:Programname,functionorfunctionblockinstanceexpectedinsteadof'concat'Build:Error:C32:Cannotconverttype'Unknown type: 'len(str)''totype'INT'Build:Error:C46:Identifier'len'notdefinedBuild:Error:C35:Programname,functionorfunctionblockinstanceexpectedinsteadof'len'Build:Error:C32:Cannotconverttype'Unknown type: 'LEN(str)''totype'INT'Build:Error:C46:Identifier'LEN'notdefinedBuild:Error:C35:Programname,functionorfunctionblockinstanceexpectedinsteadof'LEN'Build:Error:C32:Cannotconverttype'Unknown type: 'FIND(str,'=')''totype'INT'Build:Error:C46:Identifier'FIND'notdefinedBuild:Error:C35:Programname,functionorfunctionblockinstanceexpectedinsteadof'FIND'Build:Error:C231:Expressionoftype'BOOL'expectedinthisplaceBuild:Error:C77:Unknowntype:'left(str, (j - 1))'Build:Error:C46:Identifier'left'notdefinedBuild:Error:C35:Programname,functionorfunctionblockinstanceexpectedinsteadof'left'Build:Error:C32:Cannotconverttype'Unknown type: 'MID(str,((UINT_TO_INT(uiEndOfLine)-j)-INT#1),(j+INT#1))''totype'STRING'Build:Error:C46:Identifier'MID'notdefinedBuild:Error:C35:Programname,functionorfunctionblockinstanceexpectedinsteadof'MID'Build:Error:C32:Cannotconverttype'Unknown type: 'right(str,(len(str)-UINT_TO_INT(uiEndOfLine)))''totype'STRING'Build:Error:C46:Identifier'right'notdefinedBuild:Error:C35:Programname,functionorfunctionblockinstanceexpectedinsteadof'right'Build:Error:C77:Unknowntype:'len(str)'Build:Error:C46:Identifier'len'notdefinedBuild:Error:C35:Programname,functionorfunctionblockinstanceexpectedinsteadof'len'Build:Text:C0:Compilecomplete--43errors,2warningsBuild:Text:C0:Buildcomplete--43errors,2warnings:Nodownloadpossible
Any help or guidance on this issue is appreciated as I would expect that the project I create in another computer with the same software would be able to be opened and compiled but there seems to be something that I am missing. As I am not an expert on the Codesys Toolchain maybe someone who has more experience could shed some light on the matter.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As part of my build I am testing the scriptengine. As a first test I am trying to compile a template project from the project wizard for a WinControlV3 device. When I build the project from the same machine I generated the project I dont have a problem.
Script
However, in my build server with CODESYS v3.5.16.0 I run the same script and I get the following:
Both development and build computer have CODESYS v3.5 SP16 (3.5.16.0) installed. What I also noticed is that the libraries are not detected correctly if I create the project directly from the project Wizard. I have to delete the library manager,create it again and add the libraries IoStandard, Standard and CAA Device Diagnosis otherwise I get the following error before the last one I mentioned above:
Any help or guidance on this issue is appreciated as I would expect that the project I create in another computer with the same software would be able to be opened and compiled but there seems to be something that I am missing. As I am not an expert on the Codesys Toolchain maybe someone who has more experience could shed some light on the matter.
more posts ...
Attached is the project sample
Hello. I am facing the same issue with "Error: C46: Identifier 'concat' not defined" in my code. @vcbz, Did you find a solution?
Hello @szyo I suggested a temporal solution as discussed here
https://forge.codesys.com/tol/codesys-4-linux/tickets/6/
Hope it helps.