320 likes | 335 Views
Learn how to generate CiCode functions for control modules in the physical layer using XML. Customize the format of the exported XML file and transform it into a text file with required format using nxslt.exe utility and a stylesheet.
E N D
Unity Application Generator How Can I… Generate CiCode for a control module using XML
Issue • I want to generate a the CiCode function for each control module in the physical layer • I should be able to select different variables from my Control module.
How to do..Basic explanation • UAG supports exporting of project using XML and text format. • The format of the exported file with XML can be customized using style sheet. • Generation of the a text file can be done by: • Exporting the project in XML format. • By using standard tool for transforming the XML file into text file with pre defined format can be done by using standard software utilities like nxslt.exe. • Using this utility and style sheet, the exported file from UAG can be transformed into text file with required format.
How to do..In Windows • Create a file named “conv” on the “C:” root • Copy “nxslt.exe” and “Extract_CiCode_CiExp.xsl” from powerpoint into the folder “conv”. • Create an “transformPAL.cmd shortcut” on the desktop. This command file is available in the powerpoint. • Using an UAG export File with CiExp variable • Modify the stylesheet
In Windows, on “c” drive, please create a folder “conv” How to do..In Windows
How to do..In Windows • Copy these files : • “nxslt.exe”, • “Extract_CiCode_CiExp.xsl” • “transformPAL.cmd” Into the folder “conv” Note: In this style sheet, we are extracting variables “Stat1, Stat2”. Please open the style sheet with any editor to have more details
How to do..In Windows • Create a shortcut of a “tranformPAL.cmd” in desktop of your computer
How to do..On the style sheet • This stylesheet is used to transform an UAG xml file in CiCode txt file • The usedCiCode is “CheckAccumFunc” • The format written to the txt file is : • To simplify this things You can write : • CheckAccumFunc(ParentPath\FullvariableNames_1, ParentPath\FullvariableNames_2)
How to do..On the style sheet Here, the header of the Style, This part can be modified :
How to do..On the style sheet Change the name of highlighted variable below in blue. This ones will be search on the XML export files. We have to make sure that variables is available on the XML files Now the Style sheet is ready to work, we can do the manipulation to transform your XML files in CiCode txt file…
How to do..In UAG There are two possibilities : • First possibility We already have the CiExp SCODE on your UAG Process, in this case you can go to the slide 24 • Second possibility you don’t have it, go to the next slide and follow the procedure.
Open the Scod Editor, open “UAGProcessLibVCV2.0.osl”: Usually the path is : C:\Program Files\Schneider Electric\Unity Application Generator\Db How to do..In SCOD Editor
We have this windows We can see all SCoDs in the library We are going to create a new SCoDe with CiExp How to do..In SCOD Editor
We Copy/past the SCoDe “MOT1D1S_P20” How to do..In SCOD Editor
We have a new SCoDe It name is SCoD1, so we have to remane it. (For example : MOT1D1S.RiT) How to do..In SCOD Editor
To rename this variable, the procedure is : Rigth click on SCoD1 => Properties Modify the name How to do..In SCOD Editor
The result is… How to do..In SCOD Editor
Now we creat a new variable It name is “CiExp How to do..In SCOD Editor • To create a new variable the procedure is : • Right click on variable • Chose new variable
Fill the case like below And Click “OK” How to do..In SCOD Editor • Now we have a new variable. • You have to add a property
Goes to the properties tab How to do..In SCOD Editor • To create a new property the procedure is : • Right click on property • Chose new SCoD property • In general tab • Follow the animation • In position tab • Follow the animation
Goes to the properties tab How to do..In SCOD Editor • To create a new property the procedure is : • Right click on property • Chose new SCoD property Click • In general tab • Follow the animation • In position tab • Follow the animation
How to do..In UAG • We created a new SCoD on the process Library, but it can not be used on UAG. To make the SCoD available we are going to validate the new scod. • Open the project in UAG. There will be a message to update the customization. • Use the new SCoD • Check the variables created, • Properties etc.
How to do..In UAG • We create a new project on UAG with our updated Process Library as Below
How to do..In UAG • Export the project ..
How to do..In UAG • …on the “conv” document • Chose an export file name for example PALexport
How to do..In UAG • After a success export…
How to do..In UAG • …file was created in a “conv” document here
How to do..In UAG • In the CONV folder, drag the exported file and..
How to do..In UAG • … and drop on the shortcut “transformPAL”
How to do..In UAG • A windows appear, the conversion work • When its done press a key
How to do..In UAG • A new file is created on the conv file here • When its done press a key
How to do..In UAG • The file should look like this: • NOTE: The path and the name of exported file can be modified by: • Right Click on the cmd file (transformPAL.cmd) • Change words in BOLD on the command line : “nxslt.exe %1 PALInitialvalues.xsl -o c:\conv\PALUAG.txt”