I and trying to export project as PLCopenXML and import it again. In that process I loose the project information, even though I can see the information in XML file.
M.Schaber from scripting forum suggested that someone in this forum might be able to help, since this is a problem both when using script and using GUI. ( l viewtopic.php?f=18&t=4875 l )
Steps to reproduce:
1) Open project containing Company, Title, and Version in Project information
2) Projects -> Export PLCopenXML -> Select all
3) Verify that Project information is written to XML file
4) Close current project
5) New project -> Empty project
6) Projects -> Import PLCopenXML -> Choose exported file
7) Verify that Project information of original project is present under Additional information
8 ) See that Project information object is not created in project after import
Is this a known issue or maybe it is a general limitation?
Regards,
Frank
EDIT: Forgot to tell that CoDeSys is version 3.5 Patch 3
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It is known that the XML im- export is not as complete as the general im- export.
If you want to have all information I think you should use this method of im- and export.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried using export/import also, but using that method I cannot import anything at all. I have attached the files that I used for testing if you want to check them. When I test import function (either native or PLCopenXML) I create an empty project and tries to import either the .export or .xml.
I also cannot import your files, because I don't have the 3.5 P3 Control Win Device. Please always save your project as project archive.
When I export your project and import it again, it works (I use 3.5 P4) both with general as XML method.
With the XML method it creates a new device.
With the general method it asks you to overwrite the existing device.
PS, your declaration of the variable is not correct. Change it to e.g.:
PROGRAM POU
VAR
i : INT := 1;
END_VAR
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have created a new demo project now, with your correction to the program code. All files are in the attached zip-file - including the project archive, which I also uploaded in the first example.
This time the example is a library and I have installed V3.5 Patch 4, so there should be no problems loading it.
As you can see in the screenshots (in the attached file), I still have problems importing the project:
- When using Project Archive I can import Library Manager, POU, and Project Information objects. (no problems)
- When using PLCopenXML I can import Library Manager and POU objects. (some problems)
- When using Import/Export I cannot import because I get an "empty" dialog. (larger problems)
Could you provide me with the .export and .xml files that works fine for you?
I am almost sure that the reason it doesn't work is because you haven't selected where it needs to be inserted.
Please open your empty project and click on your project name (in your case demo2 or Untitled2 in the Devices View).
After this CoDeSys knows where you want to import the objects to.
In my case when I don't do this, I also get the same result as you.
When I select it, it works fine.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You are right about the empty dialog. Now I get the result you see in the attached screenshot.
Then how do you import the Project Information object?
The only way I can do that is by project archive; neither import nor import plcopenxml gives me that object. However, I can see that the information is available in the .export and .xml if I open them using a text editor.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
During the import you get a tab with additional information which gives you, amongst others, the project information.
Most of the time an import is only a partial project. In this case you don't want to overwrite the existing Project Information.
I can imagine that 3S-Software has decided that the Project Information is only informative, but isn't imported nor does it overwrite the existing information.
In my opinion this is a logical situation.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sadly, I am in the less common situation where I would like to import project information. The reason for that is that I am working on an auto-build environment, where a server creates libraries/projects and puts together code. The project information object is not yet accesible via script engine, but is needed especially to give libraries increasing version number. I was trying to use import function as a work-around. (see original post here: l viewtopic.php?f=18&t=4875 l )
I guess the best solution for me then is to wait for CDS-28415 (ScriptEngine: Script Interface for Project Information) to be planned and implemented.
Thanks for your time to clarify this matter.
Best regards,
Frank
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I and trying to export project as PLCopenXML and import it again. In that process I loose the project information, even though I can see the information in XML file.
M.Schaber from scripting forum suggested that someone in this forum might be able to help, since this is a problem both when using script and using GUI. ( l viewtopic.php?f=18&t=4875 l )
Steps to reproduce:
1) Open project containing Company, Title, and Version in Project information
2) Projects -> Export PLCopenXML -> Select all
3) Verify that Project information is written to XML file
4) Close current project
5) New project -> Empty project
6) Projects -> Import PLCopenXML -> Choose exported file
7) Verify that Project information of original project is present under Additional information
8 ) See that Project information object is not created in project after import
Is this a known issue or maybe it is a general limitation?
Regards,
Frank
EDIT: Forgot to tell that CoDeSys is version 3.5 Patch 3
No CoDeSys people that has any comments for this one?
It is known that the XML im- export is not as complete as the general im- export.
If you want to have all information I think you should use this method of im- and export.
Hi TimvH,
I tried using export/import also, but using that method I cannot import anything at all. I have attached the files that I used for testing if you want to check them. When I test import function (either native or PLCopenXML) I create an empty project and tries to import either the .export or .xml.
Best regards,
Frank
demo.zip [155.64 KiB]
I also cannot import your files, because I don't have the 3.5 P3 Control Win Device. Please always save your project as project archive.
When I export your project and import it again, it works (I use 3.5 P4) both with general as XML method.
With the XML method it creates a new device.
With the general method it asks you to overwrite the existing device.
PS, your declaration of the variable is not correct. Change it to e.g.:
PROGRAM POU
VAR
i : INT := 1;
END_VAR
I have created a new demo project now, with your correction to the program code. All files are in the attached zip-file - including the project archive, which I also uploaded in the first example.
This time the example is a library and I have installed V3.5 Patch 4, so there should be no problems loading it.
As you can see in the screenshots (in the attached file), I still have problems importing the project:
- When using Project Archive I can import Library Manager, POU, and Project Information objects. (no problems)
- When using PLCopenXML I can import Library Manager and POU objects. (some problems)
- When using Import/Export I cannot import because I get an "empty" dialog. (larger problems)
Could you provide me with the .export and .xml files that works fine for you?
Regards,
Frank
demo2.zip [734.63 KiB]
I am almost sure that the reason it doesn't work is because you haven't selected where it needs to be inserted.
Please open your empty project and click on your project name (in your case demo2 or Untitled2 in the Devices View).
After this CoDeSys knows where you want to import the objects to.
In my case when I don't do this, I also get the same result as you.
When I select it, it works fine.
You are right about the empty dialog. Now I get the result you see in the attached screenshot.
Then how do you import the Project Information object?
The only way I can do that is by project archive; neither import nor import plcopenxml gives me that object. However, I can see that the information is available in the .export and .xml if I open them using a text editor.
During the import you get a tab with additional information which gives you, amongst others, the project information.
Most of the time an import is only a partial project. In this case you don't want to overwrite the existing Project Information.
I can imagine that 3S-Software has decided that the Project Information is only informative, but isn't imported nor does it overwrite the existing information.
In my opinion this is a logical situation.
I can see your reasoning TimvH.
Sadly, I am in the less common situation where I would like to import project information. The reason for that is that I am working on an auto-build environment, where a server creates libraries/projects and puts together code. The project information object is not yet accesible via script engine, but is needed especially to give libraries increasing version number. I was trying to use import function as a work-around. (see original post here: l viewtopic.php?f=18&t=4875 l )
I guess the best solution for me then is to wait for CDS-28415 (ScriptEngine: Script Interface for Project Information) to be planned and implemented.
Thanks for your time to clarify this matter.
Best regards,
Frank