Want to read 600 Siemens tags without individual tag configuration

I have 600 boolean tags and each tag will represent a particular fault description. What is the easiest way to get all these tags in Ignition without having to configure each tags individually.
If any of the bit out these 600 tags is high, we need to show the fault description of that tag

Create a .csv file with all tags addresses and alarm definitions and import that file with a custom script…
(you asked for the easiest way… :upside_down_face:)

EDIT: OK, joke aside…

I always create a .csv file like this (from Excel):

Summary
M500.0;AKTIVIRAN E-STOP (GLAVNI PULT)
M500.1;AKTIVIRAN E-STOP (VOZIČKI)
M500.2;AKTIVIRAN E-STOP (KONTROLA)
M500.3;AKTIVIRAN E-STOP (VRATA 1)
M500.4;AKTIVIRAN E-STOP (VRATA 2)
M500.5;AKTIVIRAN E-STOP (ROBOT 1)
M500.6;AKTIVIRAN E-STOP (ROBOT 2)
M500.7;AKTIVIRAN E-STOP (ROBOT 3)
M501.0;ODPRTA VRATA 1
M501.1;ODPRTA VRATA 2
M501.2;NAPAKA EUCHNER MODULA VRATA 1
M501.3;NAPAKA EUCHNER MODULA VRATA 2
M501.4;VARNOSTNI KRMILNIK SICK - PREKINJENA KOMUNIKACIJA 
M501.5;PREKINJENA KOMUNIKACIJA FREKVENČNI REGULATOR ŠČETKANJE
M501.6;PAC3200 - PREKINJENA KOMUNIKACIJA
M501.7;PREKINJENA KOMUNIKACIJA ACF (ROTO REZKAR)
M502.0;ROLO VRATA 1 - FREK. REGULATOR - NI KOMUNIKACIJE
M502.1;ROLO VRATA 1 - FREK. REGULATOR - FAULT
M502.2;
M502.3;ROLO VRATA 1 - VRATA NISO ODPRTA
M502.4;ROLO VRATA 1 - VRATA NISO ZAPRTA
M502.5;ROLO VRATA 1 - PREKINJENA VARNOSTNA FOTOCELICA V NOTRANJOSTI ROLO VRAT
M502.6;ROLO VRATA 1 - ODPIRANJE/ZAPIRANJE TRAJA PREDOLGO
M502.7;
M503.0;ZAKLEP VOZIČKA 1 - NI VKLOPLJEN
M503.1;ZAKLEP VOZIČKA 1 - NI IZKLOPLJEN
M503.2;ZAKLEP VOZIČKA 1 - NI SIGNALA ZA PRISOTNOST VOZIČKA LEVO
M503.3;ZAKLEP VOZIČKA 1 - NI SIGNALA ZA PRISOTNOST VOZIČKA DESNO
M503.4;
M503.5;
M503.6;
M503.7;
M504.0;ROLO VRATA 2 - FREK. REGULATOR - NI KOMUNIKACIJE
M504.1;ROLO VRATA 2 - FREK. REGULATOR - FAULT
M504.2;
M504.3;ROLO VRATA 2 - VRATA NISO ODPRTA
M504.4;ROLO VRATA 2 - VRATA NISO ZAPRTA
M504.5;ROLO VARTA 2 - PREKINJENA VARNOSTNA FOTOCELICA V NOTRANJOSTI ROLO VRAT
M504.6;ROLO VRATA 2 - ODPIRANJE/ZAPIRANJE TRAJA PREDOLGO
M504.7;
M505.0;ZAKLEP VOZIČKA 2 - NI VKLOPLJEN
M505.1;ZAKLEP VOZIČKA 2 - NI IZKLOPLJEN
M505.2;ZAKLEP VOZIČKA 2 - NI SIGNALA ZA PRISOTNOST VOZIČKA LEVO
M505.3;ZAKLEP VOZIČKA 2 - NI SIGNALA ZA PRISOTNOST VOZIČKA DESNO
M505.4;
M505.5;
M505.6;BRUŠENJE - NAPAKA FREKVENČNI REGULATOR ROTO REZKAR
M505.7;BRUŠENJE - NAPAKA HLADILNIK ROTO REZKAR (HYDAC)
M506.0;BRUŠENJE - NAPAKA POLOŽAJ ROTO REZKAR (ACF) MED OBDELAVO
M506.1;BRUŠENJE - NAPAKA ROTO REZKAR (ACF) NI V ZGORNJEM POLOŽAJU
M506.2;BRUŠENJE - NAPAKA ODSTOPANJE HITROSTI ROTO REZKAR
M506.3;
M506.4;
M506.5;ŠČETKANJE - NAPAKA FREKVENČNI REGULATOR
M506.6;ŠČETKANJE - NAPAKA ODSTOPANJE HITROSTI ŠČETKE
M506.7;ŠČETKANJE - NAPAKA MERITEV POLOŽAJA ŠČETKE
M507.0;ŠČETKANJE - NAPAKA ŠČETKA NI V ZGORNJEM POLOŽAJU
M507.1;ŠČETKANJE - NAPAKA POLOŽAJ ŠČETKE (PREMAJHEN POMIK ŠČETKE)
M507.2;
M507.3;
M507.4;BARKODNI ČITALEC - PREKINJENA KOMUNIKACIJA
M507.5;BARKODNI ČITALEC - BRANJE BARKODE VOZIČEK 1 NEUSPEŠNO
M507.6;BARKODNI ČITALEC - BRANJE BARKODE VOZIČEK 2 NEUSPEŠNO
M507.7;
M508.0;CELICA JE NEDEJAVNA
M508.1;
M508.2;KONTROLA - PREDAL NI ZAPRT
M508.3;
M508.4;
M508.5;
M508.6;SLABI KOSI - PREDAL NI ZAPRT
M508.7;
M509.0;ROBOT 1 - PREKINJENA KOMUNIKACIJA
M509.1;ROBOT 1 - NAPAKA NA ROBOTU
M509.2;ROBOT 1 - NI IZVEN OBMOČJA VOZIČKA 1
M509.3;ROBOT 1 - NI IZVEN OBMOČJA VOZIČKA 2
M509.4;ROBOT 1 - PRIJEMALO NI IZKLOPLJENO
M509.5;ROBOT 1 - PRIJEMALO NI VKLOPLJENO
M509.6;ROBOT 1 - NI OBROČA V PRIJEMALU
M509.7;ROBOT 1 -
M510.0;ROBOT 1 - OBROČ NAROBE OBRNJEN
M510.1;SENZOR RAZDALJE NA ROBOTU 1 - NAPAKA MERJENJA VIŠINE STOLPCA
M510.2;SENZOR RAZDALJE NA ROBOTU 1 - SIGNAL IZVEN OBSEGA
M510.3;ROBOT 1 - 
M510.4;ROBOT 1 - 
M510.5;ROBOT 1 - 
M510.6;ROBOT 1 - 
M510.7;ROBOT 1 - 
M511.0;ROBOT 2 - PREKINJENA KOMUNIKACIJA
M511.1;ROBOT 2 - NAPAKA NA ROBOTU
M511.2;ROBOT 2 - PRIJEMALO NI IZKLOPLJENO
M511.3;ROBOT 2 - PRIJEMALO NI VKLOPLJENO
M511.4;ROBOT 2 - NI OBROČA V PRIJEMALU
M511.5;ROBOT 2 - OBROČ NAROBE OBRNJEN
M511.6;ROBOT 2 - V OBMOČJU GNEZDA 1
M511.7;ROBOT 2 - V OBMOČJU GNEZDA 2
M512.0;ROBOT 2 - V OBMOČJU BRUŠENJA
M512.1;ROBOT 2 - V OBMOČJU ŠČETKANJA
M512.2;ROBOT 2 - 
M512.3;ROBOT 2 - 
M512.4;ROBOT 2 - 
M512.5;ROBOT 2 - 
M512.6;ROBOT 2 - 
M512.7;ROBOT 2 - 
M513.0;ROBOT 3 - PREKINJENA KOMUNIKACIJA
M513.1;ROBOT 3 - NAPAKA NA ROBOTU
M513.2;ROBOT 3 - PRIJEMALO NI IZKLOPLJENO
M513.3;ROBOT 3 - PRIJEMALO NI VKLOPLJENO
M513.4;ROBOT 3 - NI OBROČA V PRIJEMALU
M513.5;ROBOT 3 - OBROČ NAROBE OBRNJEN
M513.6;ROBOT 3 - V OBMOČJU GNEZDA 1
M513.7;ROBOT 3 - V OBMOČJU GNEZDA 2
M514.0;ROBOT 3 - V OBMOČJU BRUŠENJA
M514.1;ROBOT 3 - V OBMOČJU ŠČETKANJA
M514.2;ROBOT 3 - 
M514.3;ROBOT 3 - 
M514.4;ROBOT 3 - 
M514.5;ROBOT 3 - 
M514.6;ROBOT 3 - 
M514.7;ROBOT 3 - 
M515.0;OBRAČANJE KOSOV - PRIJEMALO NI ODPRTO
M515.1;OBRAČANJE KOSOV - PRIJEMALO NI ZAPRTO
M515.2;OBRAČANJE KOSOV - NI V ROTACIJI 0°
M515.3;OBRAČANJE KOSOV - NI V ROTACIJI 180°
M515.4;OBRAČANJE KOSOV - NI KOSA V PRIJEMALU
M515.5;OBRAČANJE KOSOV - PREVERITE PODATKE IN ORIENTACIJO KOSA
M515.6;OBRAČANJE KOSOV - 
M515.7;OBRAČANJE KOSOV - 

Then I have this script to import/add tags (you can run this in script console):

Summary
#V Execel-u shrani kot .csv (ANSI)
#V Notepad++ pretvori v UTF-8

OPCServer='Ignition OPC-UA Server'
deviceName='[s7_1500_cno]'	#what name you have in Ignition/Config/Devices website
alarmFolderName=u"klscno/Alarms"	#In which folder in Tag Browser in the designer you want to put your alarms
scanClass='Alarms 1s'	#which scanclass should your alarms tags run under
pathIn=system.file.openFile('csv')	#choose your .csv file
priority=2	#priority of the alarm:0-Diagnostic, 1-Low (warnings), 2-Medium (alarms), 3-High, 4-Critical

if pathIn != None:
    txt = system.gui.inputBox("OPC Server:", OPCServer)	#show/input OPCServer
    if txt != None:
        OPCServer=txt   
    txt = system.gui.inputBox("Device Name:", deviceName)	#show/input deviceName
    if txt != None:
        deviceName=txt   
    txt = system.gui.inputBox("Alarm Folder Name:", alarmFolderName)	#show/input alarmFolderName
    if txt != None:
        alarmFolderName=txt   
    fileIn=open(pathIn)	#open .csv file
    xx = 0	#za alarme postavi na 0, za warnings pa na naslednjo stotico od alarmov
    for line in fileIn:	#read line by line
    	xx += 1 #for numbering the alarms, so that they are sequenced
    	bitname=line[line.find(';')-line.find(';'):line.find(';')].strip().replace(' ','') #for adding at the end of alarm text
    	print "bitname= ", bitname
        bit=line[line.find(';')-line.find(';'):line.find(';')].strip().replace('M','MX') #in Ignition M is MX; for adding in OPCItemPath
        print "bit: ", bit
        tagname=line[line.find(';')-line.find(';'):line.find(';')].strip().replace('.','_')	#name of the tag visible in Tag Browser in the Designer
        print "tagname=",tagname
        alarmtext = unicode(line[line.find(';')+1:].strip())	#alarm text
        if alarmtext == '':
        	alarmtext = 'Rezerva'
        #alarmtext = str(xx) + ". " + alarmtext + " (" + bitname + ")"	#alarm nr. + alarm text + bitname
        alarmtext = str(xx) + ". " + alarmtext + " (" + bitname + ")"	#alarm text + bitname
        print "alarmtext=",alarmtext
        displaypath = u''	#displayPath of the Tag; for grouping tags in groups, if you need it
        #print displaypath
        #print "xx= ", xx
        
        system.tag.addTag(parentPath=alarmFolderName, 
        			name=tagname, 
        			tagType="OPC", 
        			dataType="Boolean", 
        			attributes={"OPCServer":OPCServer, 
        				"OPCItemPath":deviceName+bit, 
        				"ScanClass":scanClass}, 
        			alarmConfig={alarmtext:[["name", "Value", alarmtext],
        			 				["priority","Value", priority], 
        							["displayPath","Value", displaypath], 
        							["label", "Value", alarmtext],
        							["setpointA","Value", 1.0], 
        							["ackMode", "Value", 1]]
        					}
        		)
        
        

    fileIn.close()

You will need to adapt the script to your needs…

And this is how my excel file looks…

Summary

And you can copy/paste from TIA portal all alarm tags to Excel…

Summary

2 Likes

Hi,
Thank you for the reply, I tried using the method but I’m getting the following error :-

bitname= DB311,DBX332.0
bit: DB311,X332.0
tagname1= DB311,DBX332_0
tagname= DB311_DBX332_0
alarmtext= 1. Kollisionsgefahr Station 2_ 0-Position Kipp-Achse fehlt und Hub-Achse zu niedrig (DB311,DBX332.0)
Java Traceback:
Traceback (most recent call last):
File “”, line 46, in
at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.newGatewayException(GatewayInterface.java:351)

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:325)

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:278)

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.invoke(GatewayInterface.java:945)

at com.inductiveautomation.ignition.client.script.LegacyClientTagUtilities.addTagImpl(LegacyClientTagUtilities.java:59)

at com.inductiveautomation.ignition.common.script.builtin.LegacyTagUtilities.addTag(LegacyTagUtilities.java:76)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.base/java.lang.reflect.Method.invoke(Unknown Source)

com.inductiveautomation.ignition.client.gateway_interface.GatewayException: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: Invalid characters found in tag name ‘DB311_DBX332_0’

at org.python.core.Py.JavaError(Py.java:547)

at org.python.core.Py.JavaError(Py.java:538)

at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:192)

at com.inductiveautomation.ignition.common.script.ScriptManager$ReflectedInstanceFunction.__call__(ScriptManager.java:541)

at org.python.core.PyObject.__call__(PyObject.java:400)

at org.python.pycode._pyx44.f$0(<input>:23)

at org.python.pycode._pyx44.call_function(<input>)

at org.python.core.PyTableCode.call(PyTableCode.java:173)

at org.python.core.PyCode.call(PyCode.java:18)

at org.python.core.Py.runCode(Py.java:1687)

at org.python.core.Py.exec(Py.java:1731)

at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:277)

at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java:130)

at com.inductiveautomation.ignition.designer.gui.tools.jythonconsole.JythonConsole$ConsoleWorker.doInBackground(JythonConsole.java:611)

at com.inductiveautomation.ignition.designer.gui.tools.jythonconsole.JythonConsole$ConsoleWorker.doInBackground(JythonConsole.java:599)

at java.desktop/javax.swing.SwingWorker$1.call(Unknown Source)

at java.base/java.util.concurrent.FutureTask.run(Unknown Source)

at java.desktop/javax.swing.SwingWorker.run(Unknown Source)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.base/java.lang.Thread.run(Unknown Source)

Caused by: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: Invalid characters found in tag name ‘DB311_DBX332_0’

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.newGatewayException(GatewayInterface.java:351)

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:325)

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:278)

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.invoke(GatewayInterface.java:945)

at com.inductiveautomation.ignition.client.script.LegacyClientTagUtilities.addTagImpl(LegacyClientTagUtilities.java:59)

at com.inductiveautomation.ignition.common.script.builtin.LegacyTagUtilities.addTag(LegacyTagUtilities.java:76)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.base/java.lang.reflect.Method.invoke(Unknown Source)

at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:190)

... 18 more

Caused by: java.lang.Exception: Invalid characters found in tag name ‘DB311_DBX332_0’

at com.inductiveautomation.ignition.gateway.script.LegacyGatewayTagUtilities.buildEditsForAddTag(LegacyGatewayTagUtilities.java:606)

at com.inductiveautomation.ignition.gateway.script.LegacyGatewayTagUtilities.addTagImpl(LegacyGatewayTagUtilities.java:138)

at com.inductiveautomation.ignition.common.script.builtin.LegacyTagUtilities.addTag(LegacyTagUtilities.java:76)

at com.inductiveautomation.ignition.gateway.servlets.gateway.functions.IALabs.addTag(IALabs.java:181)

at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(null)

at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(null)

at java.lang.reflect.Method.invoke(null)

at com.inductiveautomation.ignition.gateway.servlets.gateway.AbstractGatewayFunction.invoke(AbstractGatewayFunction.java:228)

at com.inductiveautomation.ignition.gateway.servlets.Gateway.doPost(Gateway.java:431)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

at com.inductiveautomation.ignition.gateway.bootstrap.MapServlet.service(MapServlet.java:86)

at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1450)

at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)

at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1631)

at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)

at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)

at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)

at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)

at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)

at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440)

at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)

at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)

at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)

at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)

at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)

at com.inductiveautomation.catapult.handlers.RemoteHostNameLookupHandler.handle(RemoteHostNameLookupHandler.java:121)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)

at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:322)

at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:59)

at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)

at org.eclipse.jetty.server.Server.handle(Server.java:516)

at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)

at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)

at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)

at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)

at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)

at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)

at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:555)

at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:410)

at org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:164)

at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)

at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)

at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)

at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)

at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)

at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)

at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)

at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)

at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)

at java.lang.Thread.run(null)

Traceback (most recent call last):
File “”, line 46, in
at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.newGatewayException(GatewayInterface.java:351)

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:325)

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:278)

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.invoke(GatewayInterface.java:945)

at com.inductiveautomation.ignition.client.script.LegacyClientTagUtilities.addTagImpl(LegacyClientTagUtilities.java:59)

at com.inductiveautomation.ignition.common.script.builtin.LegacyTagUtilities.addTag(LegacyTagUtilities.java:76)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.base/java.lang.reflect.Method.invoke(Unknown Source)

com.inductiveautomation.ignition.client.gateway_interface.GatewayException: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: Invalid characters found in tag name ‘DB311_DBX332_0’

This is the CSV file

DB311,DBX332.0;Kollisionsgefahr Station 2_ 0-Position Kipp-Achse fehlt und Hub-Achse zu niedrig
DB311,DBX310.5;Fehler Sicherheits-SPS_ Fehler Ruckfuhrkreis Steuerung EIN 201-K1_201-K2
DB311,DBX301.4;Storung Shuttle_ Gleichzeitige Roboteranforderungen Station 1
DB311,DBX320.5;Station 1 Brenner Handschweissgerat nicht in Position und Roboter oder Shuttle in Station
DB311,DBX282.0;Roboter 1 melden einen Alarm
DB311,DBX314.7;Storung Schmierung 1 X-Achse Shuttle
DB311,DBX343.7;520
DB311,DBX316.0;Storung Schmierung Fuhrungen Positionierer Station 2
DB311,DBX351.5;582
DB311,DBX281.0;NOT-HALT-Taster an der Vorquittierbox der Einlegerlichtschranke Station 2 rechts ist betatigt
DB311,DBX345.5;534
DB311,DBX336.7;480
DB311,DBX323.1;354
DB311,DBX318.1;Schmierung Spindel Positionierer Station 1 ist leer
DB311,DBX333.1;434
DB311,DBX287.0;Systemjob der Robotersteuerung 2 Roboter 2 lauft nicht _ Systemjob uberprufen or Robotersteuerung aus- und wieder einschalten
DB311,DBX288.3;Kollisionsgefahr_ Shuttle in Station 1 und Wender nicht in Cube fur Entnahme
DB311,DBX303.4;197
DB311,DBX349.0;Station 2_ Fehler ASi - Slave ist ausgefallen Fehler vom ASi-Master
DB311,DBX351.0;577
DB311,DBX289.0;Shuttle melden einen Alarm
DB311,DBX344.4;Storung Endlage unten von Schweissdusenpruffer 1 nicht erreicht
DB311,DBX291.4;Storung Profinet_ Device 11 ET200S - Greifer Roboter 1 ist gestort oder ausgefallen
DB311,DBX281.7;NOT-HALT-Taster am Kettenforderer ist betatigt
DB311,DBX349.5;Station 2_ Konfiguration abgebrochen ASi-Master antwortet nicht
DB311,DBX316.6;319
DB311,DBX308.4;Storung_ Dusenreiniger 4
DB311,DBX335.5;454
DB311,DBX334.1;458
DB311,DBX346.3;Station 1_ Konfiguration abgebrochen ASi-Master antwortet nicht
DB311,DBX281.3;NOT-HALT-Taster an der Startbox Station 2 links ist betatigt
DB311,DBX316.3;316
DB311,DBX296.2;155
DB311,DBX329.3;Storung_ uberspannungsschutz hat ausgelost
DB311,DBX290.1;Storung Profinet_ Device 31 ET200S - Hauptbedienbox ist gestort oder ausgefallen
DB311,DBX284.7;64
DB311,DBX338.7;496
DB311,DBX302.2;203
DB311,DBX336.1;474
DB311,DBX311.5;262
DB311,DBX314.2;299
DB311,DBX337.0;Storung Pufferplatz_ Teilekontrolle weiterhin ein or Kabine wurde aber abgeholt U-Job Abhilfe_ Teilekontrollen uberprufen und Fehler rucksetzen Menu Fehler TK Handling_
DB311,DBX296.6;159
DB311,DBX351.3;580
DB311,DBX321.6;343
DB311,DBX299.6;Storung Roboter 1_ Ruckmeldung der Spannernummer ist ungleich der angeforderten Spannernummer Station 2
DB311,DBX310.0;Storung Roboter 2_ Laufzeituberschreitung Schweisdusenprufer AUForAB
DB311,DBX326.4;397
DB311,DBX299.0;Storung Roboter 1_ Gleichzeitige Roboteranforderungen Station 1
DB311,DBX338.3;492
DB311,DBX280.0;NOT-HALT-Taster am Schaltschrank des Vorrichtungswechselsystems ist betatigt
DB311,DBX318.4;Schmierung Fuhrungen Positionierer Station 2 ist leer
DB311,DBX322.4;Station 1 Schalter Medien permanent ist betatigt

… but your CSV file says DB311,DBX332.0;.
Where is the ‘,’ and ‘.’ getting converted to ‘_’?

The one marked in BOLD is where I’m converting the Tag name :-

  for line in fileIn:	#read line by line
    	xx += 1 #for numbering the alarms, so that they are sequenced
    	bitname=line[line.find(';')-line.find(';'):line.find(';')].strip().replace(' ','') #for adding at the end of alarm text
    	print "bitname= ", bitname
        bit=line[line.find(';')-line.find(';'):line.find(';')].strip().replace('DBX','X') #in Ignition M is MX; for adding in OPCItemPath
        print "bit: ", bit
        tagname1=line[line.find(';')-line.find(';'):line.find(';')].strip().replace('.','_')	#name of the tag visible in Tag Browser in the Designer
        print "tagname1=",tagname1
        tagname=tagname1.strip().replace(',','_')	#name of the tag visible in Tag Browser in the Designer
        print "tagname=",tagname
        alarmtext = unicode(line[line.find(';')+1:].strip())	#alarm text
        if alarmtext == '':
        	alarmtext = 'Rezerva'
        #alarmtext = str(xx) + ". " + alarmtext + " (" + bitname + ")"	#alarm nr. + alarm text + bitname
        alarmtext = str(xx) + ". " + alarmtext + " (" + bitname + ")"	#alarm text + bitname
        print "alarmtext=",alarmtext
        displaypath = u''	#displayPath of the Tag; for grouping tags in groups, if you need it
        #print displaypath
        #print "xx= ", xx
for line in fileIn:	#read line by line
    	xx += 1 #for numbering the alarms, so that they are sequenced
    	bitname=line[line.find(';')-line.find(';'):line.find(';')].strip().replace(' ','') #for adding at the end of alarm text
    	print "bitname= ", bitname
        bit=line[line.find(';')-line.find(';'):line.find(';')].strip().replace('DBX','X') #in Ignition M is MX; for adding in OPCItemPath
        print "bit: ", bit
        tagname1=line[line.find(';')-line.find(';'):line.find(';')].strip().replace('.','_')	#name of the tag visible in Tag Browser in the Designer
        print "tagname1=",tagname1
        tagname=tagname1.strip().replace(',','_')	#name of the tag visible in Tag Browser in the Designer
        print "tagname=",tagname
        alarmtext = unicode(line[line.find(';')+1:].strip())	#alarm text
        if alarmtext == '':
        	alarmtext = 'Rezerva'
        #alarmtext = str(xx) + ". " + alarmtext + " (" + bitname + ")"	#alarm nr. + alarm text + bitname
        alarmtext = str(xx) + ". " + alarmtext + " (" + bitname + ")"	#alarm text + bitname
        print "alarmtext=",alarmtext
        displaypath = u''	#displayPath of the Tag; for grouping tags in groups, if you need it
        #print displaypath
        #print "xx= ", xx

For me the problem doesn’t come from your code but when reading a csv file within ignition the first line line alaways contains weird character **‘**DB311_DBX332_0’ i don’t know why we get this. i would make a replace of those character also and try to run your code again.

Open your .csv file in Notepad++ and convert it to UTF-8.


Now it’s with BOM… UTF-8-BOM…

From Excel save your .csv as ANSI and then convert it with Notepad++ to UTF-8.

1 Like

Thank you. It worked!