Here’s the first crack at making an XML file from a Siemens .asc file. Should be locale agnostic, meaning it should pop in the correct decimal point for your locale. At least, that was the plan! 
[code]import xml.etree.ElementTree as ET
import locale
decimalPoint=locale.localeconv()[‘decimal_point’]
thousandsSep=locale.localeconv()[‘thousands_sep’]
OPCServer=‘Ignition OPC-UA Server’
deviceName=’[s7_300]’
alarmFolderName=‘Napake’
pathIn=system.file.openFile(‘asc’)
if pathIn != None:
txt = system.gui.inputBox(“OPC Server:”, OPCServer)
if txt != None:
OPCServer=txt
txt = system.gui.inputBox(“Device Name:”, deviceName)
if txt != None:
deviceName=txt
txt = system.gui.inputBox(“Alarm Folder Name:”, alarmFolderName)
if txt != None:
alarmFolderName=txt
fileIn=open(pathIn)
#Root
writeTree=ET.Element('Tags')
#Alarm Folder
alarmFolder=ET.SubElement(writeTree, 'Tag', {'name':alarmFolderName, 'path':'', 'type':'Folder'})
for line in fileIn:
bit=line[line.find(',')+1:25].strip().replace(' ','X')
tagname=bit.replace('X','').replace('.','_')
desc=line[50:].strip()+' ('+bit.replace('X','')+')'
tag=ET.SubElement(writeTree, 'Tag', {'name':tagname, 'path':alarmFolderName, 'type':'OPC'})
property=ET.SubElement(tag, 'Property', {'name':'Value'})
property.text='false'
property=ET.SubElement(tag, 'Property', {'name':'DataType'})
property.text='6'
property=ET.SubElement(tag, 'Property', {'name':'OPCServer'})
property.text=OPCServer
property=ET.SubElement(tag, 'Property', {'name':'OPCItemPath'})
property.text=deviceName+bit
#Set up alarm properties
alarms=ET.SubElement(tag, 'Alarms')
alarm=ET.SubElement(alarms, 'Alarm',{'name':desc})
property=ET.SubElement(alarm, 'Property', {'name':'priority'})
property.text='1'
property=ET.SubElement(alarm, 'Property', {'name':'setpointA'})
property.text='1'+decimalPoint+'0'
property=ET.SubElement(alarm, 'Property', {'name':'ackMode'})
property.text='1'
fileIn.close()
path = system.file.saveFile(deviceName.replace('[','').replace(']','')+".xml")
if path != None:
rough_string = ET.tostring(writeTree, 'utf-8')
system.file.writeFile(path,rough_string)
[/code]