If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2012-03-19
Originally created by: M.Schaber
Hi,
Lohr_DCIA-EHE1 hat geschrieben:
I want to export the properties of the function block (FB) named "MX_DirectVarAxis".
The function block has properties and methods.
The following script does not work:
But the the properties and methods of the function block are missing. If I try to find a property and to export it as XML-File an error message of the reporter shows, that the property is not exportable.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2012-03-20
Originally created by: M.Schaber
Lohr_DCIA-EHE1 hat geschrieben:
The export-file has been created.
But the the properties and methods of the function block are missing. If I try to find a property and to export it as XML-File an error message of the reporter shows, that the property is not exportable.
Properties alone are not exportable, as properties cannot exist without their parents. If you export manually (via the project menu "Export PLCOpenXML..." command), you cannot select a property without the parent node being selected.
However, POUs should be exported with all their properties etc. if the "recursive" parameter is set to True. In our internal test cases, it works(the PLCOpenXML files contain the properties).
If it is not working for you, it's best if you contact me via our support department, giving detailed steps to repeat (possibly including an example project archive).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I want to export the properties of the function block (FB) named "MX_DirectVarAxis".
The function block has properties and methods.
The following script does not work:
import sys
str_PathXmlFile = "C:\TestScripts\TestExp.xml"
# create the export reporter
class Reporter(ExportReporter):
def error(self, message):
system.write_message(Severity.Error, message)
def warning(self, message):
system.write_message(Severity.Warning, message)
def nonexportable(self):
print("non exportable")
@property
def aborting(self):
return False
# create the exporter instance.
reporter = Reporter()
proj = projects.primary
obj = proj.find("MX_DirectVarAxis", True)[0]
print obj.get_name()
obj.export_xml(reporter, str_PathXmlFile, True)
The script showed the following messages:
...
reporter = Reporter()
proj = projects.primary
obj = proj.find("MX_DirectVarAxis", True)[0]
print obj.get_name()
MX_DirectVarAxis
obj.export_xml(reporter, str_PathXmlFile, True)
calling(self: IronPython.NewTypes.System.Object#IExportReporter_1$1)
def aborting(self:)
return False
...
Originally created by: M.Schaber
Hi,
As far as I can see, the script looks fine.
That looks like a trace of a successfull run of the script.
Did you get any error messages or exceptions? Was the TestExp.xml file created?
The export-file has been created.
But the the properties and methods of the function block are missing. If I try to find a property and to export it as XML-File an error message of the reporter shows, that the property is not exportable.
Originally created by: M.Schaber
Properties alone are not exportable, as properties cannot exist without their parents. If you export manually (via the project menu "Export PLCOpenXML..." command), you cannot select a property without the parent node being selected.
However, POUs should be exported with all their properties etc. if the "recursive" parameter is set to True. In our internal test cases, it works(the PLCOpenXML files contain the properties).
If it is not working for you, it's best if you contact me via our support department, giving detailed steps to repeat (possibly including an example project archive).