File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -110,3 +110,19 @@ def ErrorHandler(err):
110
110
except Exception as err :
111
111
ErrorHandler (err )
112
112
113
+ # Export the Project Configuration as JSON from the Kepware Server instance. Provides the same information as saving the
114
+ # project file as JSON in the Configuration UI locally.
115
+ projectJson = server .export_project_configuration ()
116
+ try :
117
+ print ("{} - {}" .format ("Here is the full Project Configuration as JSON" , json .dumps (projectJson , indent = 4 )))
118
+ except Exception as err :
119
+ ErrorHandler (err )
120
+
121
+ # Import the Project Configuration from JSON. This service acts like a FILE->OPEN action and
122
+ # stop communications while the new project replaces the current project in the Kepware runtime.
123
+ try :
124
+ r = server .import_project_configuration (projectJson )
125
+ print ("{} - {}" .format ("Executing Project Import service" , r ))
126
+ print ('{} - {}' .format ("Read Service Status" , server .service_status (r )))
127
+ except Exception as err :
128
+ ErrorHandler (err )
You can’t perform that action at this time.
0 commit comments