Den konfiguration, som du gennemfører manuelt i Project Builder, kan du også importere fra en XML-fil. Derved forkorter du konfigurationsprocessen.
XML-filen skal indeholde bestemte strukturelementer, sådan at den kan importeres.
Basis-strukturelementer | Betydning |
---|---|
|
Kendetegner XML-filen som konfigurationsfil. Alle oplysninger skal befinde sig i dette strukturelement. |
|
Kendetegner den blok, der indeholder oplysningerne om alle konfigurationsvariabler. |
|
Indeholder værdien for en bestemt konfigurationsvariabel. Som navn indtastes den nøjagtige betegnelse for konfigurationsvariablen. |
Strukturelementer til instanser | Betydning |
---|---|
|
Kendetegner den blok, der indeholder oplysningerne om alle instanser til et element, der skal konfigureres. Som navn indtastes den nøjagtige betegnelse for det element, der skal konfigureres. |
|
Kendetegner den blok, der indeholder oplysningerne om alle konfigurationsvariabler til en instans. |
Her ser du opbygningen af den XML-fil, som du kan anvende til at konfigurere konfiguratoren 'Generate sample project with variants' fra 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>
Eksempel: Struktur af en XML-fil til konfiguration af instanser
Her ser du opbygningen af en XML-fil, som du skal følge ved konfigurationen af 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>
Forudsætninger
- Du har åbnet dialogboksen Project Builder og har åbnet det bibliotek, der indeholder den konfigurator, som du gerne vil konfigurere.
- Du har valgt et målprojekt og har åbnet konfiguratoren.
- Du har valgt det af konfiguratorens elementer, hvortil du ønsker at importere en konfiguration.
Importer XML-fil
- Klik på trykknappen Importer ved siden af visningen af målprojektet.
- Systemdialogboksen Åbn fil vises.
- Vælg den XML-fil, der indeholder konfigurationen til det element, som du har åbnet i Project Builder. Klik efterfølgende på Åbn.
- Konfiguratoren forsynes med oplysningerne fra XML-filen. Det er ikke længere nødvendigt at foretage et manuelt valg af individuelle værdier.
Anvisninger
- Oplysninger om en konfigurationsvariabels betegnelse, type og værdi i XML-filen skal passe nøjagtigt til elementerne i konfiguratoren. Hvis oplysningerne ikke stemmer overens, får du en fejlmeddelelse til den berørte variabel, og importen afbrydes.
- Du har adgang til XML-importen fra og med det versionsrelaterede modul Advanced.