Konfigurationen som du genomför manuellt i Project Builder kan du även importera från en XML-fil. Därmed förkortar du konfigurationsprocessen.
XML-filen måste innehålla vissa strukturelement för att den ska kunna importeras.
Grundstrukturelement | Betydelse |
---|---|
|
Betecknar XML-filen som konfigurationsfil. Alla uppgifter måste finnas inom detta strukturelement. |
|
Betecknar blocket som innehåller uppgifterna för alla konfigurationsvariabler. |
|
Innehåller värdet för en viss konfigurationsvariabel. Konfigurationsvariabelns exakta benämning måste matas in som namn. |
Strukturelement för instanser | Betydelse |
---|---|
|
Betecknar blocket som innehåller uppgifterna för alla instanser för ett element som ska konfigureras. Den exakta benämningen på elementet som ska konfigureras måste matas in som namn. |
|
Betecknar blocket som innehåller uppgifterna för alla konfigurationsvariabler för en instans. |
Här ser du strukturen på XML-filen som du kan använda för konfiguration av konfiguratorn 'Generate sample project with variants' i biblioteket 'ESS_Sample_Macros':
<Configuration typical="XML_IMPORT">
<ConfigurationVariables>
<ConfigurationVariable name="OP_Measuring_Transformer">true</ConfigurationVariable>
<ConfigurationVariable name="SE_Light_power">true</ConfigurationVariable>
<ConfigurationVariable name="SE_Receptacles_power">2</ConfigurationVariable>
<ConfigurationVariable name="SE_Light_control">true</ConfigurationVariable>
<ConfigurationVariable name="SE_Receptacles_control">2</ConfigurationVariable>
<ConfigurationVariable name="OP_Control_panel">false</ConfigurationVariable>
<ConfigurationVariable name="OP_Panel_Enclosure">true</ConfigurationVariable>
<ConfigurationVariable name="OP_Panel_Control">false</ConfigurationVariable>
<ConfigurationVariable name="SE_Drive_Transport">Frequency Control</ConfigurationVariable>
<ConfigurationVariable name="SE_Method">Electric</ConfigurationVariable>
</ConfigurationVariables>
</Configuration>
Exempel: struktur på en XML-fil för konfiguration av instanser
Här ser du strukturen på en XML-fil som du måste följa för konfiguration av instanser:
<Configuration typical="XML_IMPORT">
<TypicalInstance name="Conveyor" >
<Instance>
<ConfigurationVariables>
<ConfigurationVariable name="parameter1">some string .... 1</ConfigurationVariable>
<ConfigurationVariable name="parameter2">1234</ConfigurationVariable>
</ConfigurationVariables>
</Instance>
<Instance>
<ConfigurationVariables>
<ConfigurationVariable name="parameter1">some string .... 2</ConfigurationVariable>
<ConfigurationVariable name="parameter2">5678</ConfigurationVariable>
</ConfigurationVariables>
</Instance>
<Instance>
<ConfigurationVariables>
<ConfigurationVariable name="parameter1">some string .... 3</ConfigurationVariable>
<ConfigurationVariable name="parameter2">9012</ConfigurationVariable>
</ConfigurationVariables>
</Instance>
<Instance>
<ConfigurationVariables>
<ConfigurationVariable name="parameter1">some string .... 4</ConfigurationVariable>
<ConfigurationVariable name="parameter2">3456</ConfigurationVariable>
</ConfigurationVariables>
</Instance>
</TypicalInstance>
<TypicalInstance name="Enclosure" >
...
</TypicalInstance>
</Configuration>
Förutsättningar
- Du har öppnat dialogen Project Builder och biblioteket som innehåller konfiguratorn som du vill konfigurera.
- Du har valt ett målprojekt och öppnat konfiguratorn.
- Du har valt konfiguratorns element som du vill importera en konfiguration i.
Importera XML-fil
- Klicka på knappen Importera bredvid målprojektets visning.
- Systemdialogen Öppna fil visas.
- Välj XML-filen som innehåller konfigurationen för elementet som du har öppnat i Project Builder. Klicka sedan på Öppna.
- Konfiguratorn kompletteras med uppgifterna i XML-filen. Det manuella valet av enskilda värden är inte längre nödvändigt.
Anvisningar
- Uppgifter om benämning, typ och värde för en konfigurationsvariabel i XML-filen måste passa exakt till elementen i konfiguratorn. Om uppgifterna inte stämmer överens får du ett felmeddelande om respektive variabel och importen avbryts.
- XML-importen står till förfogande fr.o.m. modulpaketet Advanced.