Alarm tags - bits

Nothing wrong with that. In fact I keep all alarms at the PLC. Ignition monitors my alarms and logs them and sends email alerts accordingly. As far as a paper trail goes, there are still ways to have one controlled by the PLC.

[quote="Curlyandshemp"]
Ignition runs on a 'puter and last time I checked 'puters still lock up, freeze go to la la land.[/quote]
And batteries go bad in PLC's and memory can still get corrupted, and HMI's can do odd things. On the other hand I have robot installations that are at 7 years operation that are PC-based control. Let's try not to degenerate into the PLC's are better than PC's or vice-versa. Each have their place. The trick is knowing how to get the most out of both! :slight_smile:

[quote="Curlyandshemp"]
I've been doing this for 25 years now[/quote]
Ok! you win! I'm only at 21. :laughing: Sorry, just had to toss that one in. Sometimes, I'm surprised by how well we last!

All I'm saying here is that there is a paradigm shift when using Ignition. It can do so much more than SCADA or HMI that the possibilities are almost staggering. But it may also require us to adapt our programming behaviors.

Myself, I'm trying to get away from It's how I've always done it to How can I get new new guy to change this scheme for me... That one hasn't worked yet, but I can dream. :mrgreen:[/quote]

Well Grasshopper, your lesson is not complete.
Rule #1 in designing a control system, NEVER have a less reliable device control a more reliable device.
A good control design should be able to tolerate the SCADA unplugged with affecting production.

[quote=“Curlyandshemp”]
Well Grasshopper, your lesson is not complete.
Rule #1 in designing a control system, NEVER have a less reliable device control a more reliable device.
A good control design should be able to tolerate the SCADA unplugged with affecting production.[/quote]
I don’t see where that’s coming from, as I implied no such thing:[quote=“JordanCClark”]Nothing wrong with that. In fact I keep all alarms at the PLC. Ignition monitors my alarms and logs them and sends email alerts accordingly. As far as a paper trail goes, there are still ways to have one controlled by the PLC.[/quote][quote=“JordanCClark”] Let’s try not to degenerate into the PLC’s are better than PC’s or vice-versa. Each have their place. The trick is knowing how to get the most out of both![/quote][quote=“JordanCClark”]All I’m saying here is that there is a paradigm shift when using Ignition…[/quote]
The fact that I write some great stuff notwithstanding, what I’m seeing here is a minor inconvenience in setting up alarms compared to the benefits returned from using Ignition in the first place.

In the meantime, I’ll work on a solution to your line printer problem. :slight_smile:

I’m going to jump on this old thread and see if there have been any improvements. I have been developing for a few weeks and so far so good. Now I am trying to setup alarming. From what I can see I am not able to import alarm text. This is almost beyond belief, hopefully I’m missing something. Not having Import / Export that includes alarm text definitely limits where I could potentially use this software in the future. The systems I frequent have 2000 - 10000 alarms per PLC, manually entering the existing alarms would be very time consuming and open up the likelihood for errors.

What I’m doing is, that I export tags for alarms into xml file, then edit that file and copy paste the text for alarms from another source. Then import back that file to Ignition.
But I agree with you: it’s time consuming.

<Tags>
   <Tag name="Napake" path="" type="Folder"/>
   <Tag name="M105_7" path="Napake" type="OPC">
      <Property name="Value">false</Property>
      <Property name="DataType">6</Property>
      <Property name="OPCServer">Ignition OPC-UA Server</Property>
      <Property name="OPCItemPath">[s7_300]MX105.7</Property>
      <Alarms>
         <Alarm name="MAZALNE ŠOBE NA ODLAGALNI MIZI NISO ZGORAJ (M105.7)">
            <Property name="setpointA">1.0</Property>
            <Property name="ackMode">1</Property>
            <Property name="displayPath">Vozicek</Property>
         </Alarm>
      </Alarms>
   </Tag>
   <Tag name="M105_6" path="Napake" type="OPC">
      <Property name="Value">false</Property>
      <Property name="DataType">6</Property>
      <Property name="OPCServer">Ignition OPC-UA Server</Property>
      <Property name="OPCItemPath">[s7_300]MX105.6</Property>
      <Alarms>
         <Alarm name="MAZALNE ŠOBE NA ODLAGALNI MIZI NISO SPODAJ (M105.6)">
            <Property name="setpointA">1.0</Property>
            <Property name="ackMode">1</Property>
            <Property name="displayPath">Vozicek</Property>
         </Alarm>
      </Alarms>
   </Tag>

What I would like to see is some kind of text editor inside Ignition, which will support importing alarm texts from another source in predefined structure…

This, for example, is export from Siemens Simatic STEP7 symbols:

	M 100.0	M 100.0	MOTNJA POTRDITEV VKLOPA TRAČNI TRANSPORT
	M 100.1	M 100.1	MOTNJA POTRDITEV VKLOPA TRAČNI TRANSPORT
	M 100.2	M 100.2	MOTNJA POTRDITEV VKLOPA SITO ŽLINDRE -ET
	M 100.3	M 100.3	MOTNJA POTRDITEV VKLOPA DROBILNIK ŽLINDR
	M 100.4	M 100.4	MOTNJA POTRDITEV VKLOPA TRANSPORTER 1 PO
	M 100.5	M 100.5	MOTNJA POTRDITEV VKLOPA TRANSPORTER 2 PO
	M 100.6	M 100.6	MOTNJA POTRDITEV VKLOPA ODPIRANJE DOZIRN
	M 100.7	M 100.7	MOTNJA POTRDITEV VKLOPA ZAPIRANJE DOZIRN
	M 101.0	M 101.0	MOTNJA POTRDITEV VKLOPA MEŠALO 1 -ETH01A
	M 101.1	M 101.1	MOTNJA POTRDITEV VKLOPA VREČASTI FILTER 
	M 101.2	M 101.2	MOTNJA POTRDITEV VKLOPA ODPIRANJE DOZIRN
	M 101.3	M 101.3	MOTNJA POTRDITEV VKLOPA ZAPIRANJE DOZIRN
	M 101.4	M 101.4	MOTNJA POTRDITEV VKLOPA MEŠALO 2 -ETH02A
	M 101.5	M 101.5	MOTNJA POTRDITEV VKLOPA VREČASTI FILTER 
	M 101.6	M 101.6	MOTNJA POTRDITEV VKLOPA MEŠALO V REZERVO
	M 101.7	M 101.7	MOTNJA POTRDITEV VKLOPA ČRPALKA 1 UMAZAN
	M 102.0	M 102.0	MOTNJA POTRDITEV VKLOPA ČRPALKA 2 UMAZAN
	M 102.1	M 102.1	MOTNJA POTRDITEV VKLOPA PUHALO 1 -ETH07A
	M 102.2	M 102.2	MOTNJA POTRDITEV VKLOPA VENTILATOR PUHAL
	M 102.3	M 102.3	MOTNJA POTRDITEV VKLOPA PUHALO 2 -ETH07A

It’s simple text file…

1 Like

Exactly. Every scada system and every stand alone HMI interface I have worked with in the past 25 years has the ability to import /export alarms so a csv file so you can easily use Excel to manipulate the alarms and dump them back into the system. The csv tag export gives you all of the tags, however, the alarm text is missing.

+1 for bringing back .csv tag export WITH alarm texts… :slight_smile:
+1 for bringing back .csv tag export WITH alarm texts… :slight_smile:
+1 for bringing back .csv tag export WITH alarm texts… :slight_smile:
+1 for bringing back .csv tag export WITH alarm texts… :slight_smile:
+1 for bringing back .csv tag export WITH alarm texts… :slight_smile:
+1 for bringing back .csv tag export WITH alarm texts… :slight_smile:

if you are good with scripting you can easily use the ialabs scripting module to create your tags. basically create your own “csv” file that contains the information to create your tags like opc path, alarm text, description, etc, and then import that into a table. then use that table in your create tags script to run thru each row of data and create your new tag.

you could also use the editTag function to go edit existing tags. create a list of tags you want to update in one column, then put your text in another column. then write your script to run thru the table and update each tag in the first column with the new value you want in the alarm text property.

We definitely understand the desire, but it’s not like we can just “add it back in to CSV”. We need a completely different CSV mechanism.

Each tag supports N number of alarms, each alarm has X properties (core properties which change based on mode, extended properties based on which modules are installed, and “additional data” properties arbitrarily defined by the user). Anybody, feel free to propose a csv format that accommodates that.

The way it would probably work would be to have an almost “stack” based approach to the file:

#tag#, name, type, etc...
##, 'mytag', int, ...
#alarm#, name, mode, setpointA, customprop1, customprop2
##, 'Alarm1', 'NotEqual', 0, 'test', 'blah'
##, 'Alarm2', 'Equal', 1, 'test', 'blah'

At any particular point, only the properties defined in the type def ("#alarm#") would be set, and then the object would belong to the item above it.

Does that help anyone? It’s still not at all friendly for excel, but I guess it’s easier to look at than XML, which everyone seems to hate.

Regards,

Looks like you could try adding in XML into the export, similar to how the dataset attributes of a component have some XML embedded into the individual fields.

I have used this successfully to add new mappings and propagate the style changes (read: columnAttributesData property) across numerous columns of data by copying and pasting the data text:

(I added line breaks below for readability.)

"#NAMES"
"name","label","hidden","width","horizontalAlignment","verticalAlignment","numberFormat","dateFormat"
,"treatAsBoolean","translateMapColumn","translateMap","imageMapColumn","imageMap","prefix","suffix","treatAsProgressBar"
,"progressRange"
,"progressBackground","progressForeground","hideTextOverProgressbar","bgcolorMapColumn","bgcolorMap","fgcolorMapColumn","fgcolorMap","fontMapColumn"
,"fontMap"
,"editable","headerAlignment","sortable"
"#TYPES"
"str","str","B","i","i","i","str","str","B","str","str","str","str","str","str","B","str","clr","clr"
,"B","str","str","str","str","str","str","B","i","B"
"#ROWS","1"
"ABC-123","","false","100","-9","0","#,##0.##","MMM d, yyyy h:mm a"
,"false","",,"",,"","","false"
,"<doubledimension>
  <width>0.0</width>
  <height>100.0</height>
</doubledimension>"
,"#FFFFFF","#999D9E","false","",,"",,"TIME"
,"<list>
  <stringpair><key>PERIOD</key><value>Dialog, Bold, 12</value></stringpair>
  <stringpair><key>TOTALS</key><value>Dialog, Bold, 12</value></stringpair>
  <stringpair><key>BIHRLY</key><value>Dialog, Bold, 12</value></stringpair>
  <stringpair><key>TODAY AT 7AM</key><value>Dialog, Bold, 12</value></stringpair>
  <stringpair><key>YESTERDAY AT 7AM</key><value>Dialog, Bold, 12</value></stringpair>
  <stringpair><key>2 DAYS AGO AT 7AM</key><value>Dialog, Bold, 12</value></stringpair>
  <stringpair><key>3 DAYS AGO AT 7AM</key><value>Dialog, Bold, 12</value></stringpair>
</list>"
,"false","0","true"

[quote="Colby.Clegg"]... I guess it's easier to look at than XML, which everyone seems to hate.
[/quote]
There are XML editors out there that have a table view.

No longer true. PanelView Plus Terminals export alarms tags in XML.

[quote="zxcslo"]What I'm doing is, that I export tags for alarms into xml file, then edit that file and copy paste the text for alarms from another source. Then import back that file to Ignition.
But I agree with you: it's time consuming.

What I would like to see is some kind of text editor inside Ignition, which will support importing alarm texts from another source in predefined structure...

It's simple text file...[/quote]

Which brings me to the point of this post. If it's all "simple text", why aren't we doing our own automation? I firmly believe that we (the community) have enough talent to roll out our own solutions to problem like this.

So, in the spirit of excellence and rugged individualism, I'll supply the first one. I'd even likely help supply others, if y'all want to work with me. :wink:

This one pulls in information from a PV+ alarm export. I deliberately wrote it to work with only bit-type triggers (bits of a DINT), since that's all we really have here (no analog alarms). The resultant saved XML file may then be imported into any Ignition folder. The IALabs Scripting Module could have been used to create the tags directly, but creating the XML file gives a little more flexibility in where the import happens. :slight_smile:

Here's the code:

[code]import xml.etree.ElementTree as ET

originalDeviceName='[PLC]' #DeviceName set in the PV+

#Set OPC Sever and root path names
OPCServer='C489'
deviceName='[C489 Riveter]Global'

#Read in and parse the PV+ Alarms
readTree=ET.parse('c:\Alarms.xml')
readRoot=readTree.getroot()

Run through the PV+alarms

for topChild in readRoot:
for secondChild in topChild:
#Check to see which section we're in
if secondChild.tag=='triggers':
# Set up trigger dictionary. Defines relationships between trigger name set up in PV+ and the tag path.
triggerDict={}
for lastChild in secondChild:
if str(lastChild.attrib.get('type','None'))=='bit':
triggerElement=
triggerElement.append(str(lastChild.attrib.get('exp','None'))[1:-1].replace(originalDeviceName,deviceName+'.'))
triggerElement.append(str(lastChild.attrib.get('type','None')))
triggerID=str(lastChild.attrib.get('id','None'))
triggerDict[triggerID]=triggerElement
if secondChild.tag=='messages':
# Creates the Alarm List. Stores the tag path and the text of the alarm stores in the PV+
AlarmList=
for lastChild in secondChild:
trigger=triggerDict[lastChild.attrib.get('trigger','None')[1:]]
if trigger[1]=='bit':
bit=str(int(lastChild.attrib.get('trigger-value','None'))-1)
AlarmElement=
AlarmElement.append(trigger[0] + '.' + bit)
text=str(lastChild.attrib.get('text','None'))
if text.lower()=='spare':
text=trigger[0] + '.' + bit + ' Spare'
AlarmElement.append(text)
AlarmList.append(AlarmElement)

#Now that we have our alarm list, we can create our XML file for Ignition, complete with folder with alarms inside.

#Root
writeTree=ET.Element('Tags')
#Alarm Folder
alarmFolder=ET.SubElement(writeTree, 'Tag', {'name':'Alarms', 'path':'', 'type':'Folder'})
#Create a tag called '_Fault Enable'. I bind the enabled status of each alarm to this tag.
#That way, we don't accidentally trigger something upon import.
faultEnableTag=ET.SubElement(writeTree, 'Tag', {'name':'_Fault Enable', 'path':'Alarms', 'type':'DB'})
property=ET.SubElement(faultEnableTag, 'Property', {'name':'Value'})
property.text='false'
property=ET.SubElement(faultEnableTag, 'Property', {'name':'DataType'})
property.text='6'

#Create tag entries
for row in AlarmList:
#Set up tag name, type, path, etc.
tag=ET.SubElement(writeTree, 'Tag', {'name':row[1], 'path':'Alarms', '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=row[0]

#Set up alarm properties 
alarms=ET.SubElement(tag, 'Alarms')
alarm=ET.SubElement(alarms, 'Alarm',{'name':'Alarm 1'})
property=ET.SubElement(alarm, 'Property', {'name':'priority'})
property.text='1'
property=ET.SubElement(alarm, 'Property', {'name':'setpointA'})
property.text='1.0'
property=ET.SubElement(alarm, 'Property', {'name':'enabled', 'bindtype':'Tag'})
property.text='[.]_Fault Enable'

Prompt to save file.

path = system.file.saveFile(deviceName+".xml")
if path != None:
rough_string = ET.tostring(writeTree, 'utf-8')
system.file.writeFile(path,rough_string)
[/code]

If you want to edit the tags / alarms in a spredsheet, there is a simple solution for OpenOffice Calc: Use an XSL import/export filter to transform the XML. I don’t know about Excel, but since they also use a XML format, it should be also possible. In fact some other HMI’s i know provide an Excel Makro to import and export tags.
I attached my filter packet to this post. The resulting spreadsheet has two tables, one for the tags and properties and a second one with all alarms. I would not recommend using this in a production system without testing, there may be configurations that are not catched by the transformations.

@Colby: Instead of extending the csv format, maybe Igntion could offer something like import to/from Spreadsheet. It should be quite easy to apply an XSLT when exporting or importing tags.
[attachment=0]Calc.png[/attachment]

@JordanCClark
When I try to run your code I get this error (I have your PV+ Alarms.xml in root of my C:\ drive):
[attachment=0]Capture.PNG[/attachment]

@Chi
I tried your OpenOffice solution and it’s working. But in order to use that, one must already have the tags configured in Ignition and export them.
What I’m more interested in (I see that you are working with SIEMENS SIMATIC PLC’s) is how can you CREATE tags in Ignition from STEP7 Symbol table.
In Simatic manager Symbol Table editor you can export complete or selected Symbols to an ASC, SEQ, DIF and SDF file. I think, only ASC file is usable enough.
What I ‘want/need’ :slight_smile: is:
I select only tag/symbols in Symbol Table that represents alarms (in my case that’s merkers from M100.0 - M149.7) and export them into ASC file, which is normal text file.
Then in Ignition (or something else, Excel or open office,…) some script that would create XML file from that ASC file, and when I import that XML file in Ignition, I’ll have my tags with alarm texts.

I don’t know enough about java, python or XML to do that myself, but I see that there are people (in this community), that are very good in this stuff. :thumb_left: :prayer:

[quote=“zxcslo”]@JordanCClark
When I try to run your code I get this error (I have your PV+ Alarms.xml in root of my C:\ drive):
[/quote]

It looks like it’s not finding SAXParser. Bummer.

I seem to remember something about saxparser deprecation between Java 1.6 and 1.7 (I’m still using 1.6 here in my production environment.). I’ll check it out.

Secret option B would be to do it all through text manipulation. It was just that using ElementTree made it easier for my poor brain… :mrgreen:

OK, researching let me find this jython issue: http://bugs.jython.org/issue1537

But, looking at the location of the C:\Users[i][username][/i]\AppData\LocalLow\Sun\Java\Deployment\cache\FPMI\script_lib2\Lib\xml\parsers\expat.py file I see that the fix is there.

If you could do me a favor and run this script in the Script Playground:

[code]try:
import org.python.apache.xerces.parsers.SAXParser as parser1
print “Successfully imported org.python.apache.xerces.parsers.SAXParser”
except:
print “Failed to import org.python.apache.xerces.parsers.SAXParser”

try:
import org.apache.xerces.parsers.SAXParser as parser2
print “Successfully imported org.apache.xerces.parsers.SAXParser”
except:
print “Failed to import org.apache.xerces.parsers.SAXParser”[/code]

I’m looking to see if the actual imports are working correctly. (It only needs to be able to import one of them).

@JordanCClark

I’ve tried your two imports: the first one is success, the second one is failed.
[attachment=0]Capture.PNG[/attachment]

That’s what I get, as well. I’m thinking that’s a good thing!

So, my next thought is that perhaps one of the ClassLoaders is a bit off. Maybe a fresh install of the designer and re-downloading the local libraries is on order.

To do that, first uninstall whatever local webstart apps you may have:

javaws.exe -uninstall

Next, delete whatever is in the FPMI cache. I don’t know if it’s absolutely necessary, but it won’t hurt anything. Java and Ignition will replace anything that you take out.
Go to C:\Users[username]\AppData\LocalLow\Sun\Java\Deployment\cache (in your case it’ll be in C:\Users\zxc\AppData\LocalLow\Sun\Java\Deployment\cache) and delete (or rename) the FPMI folder.

Launch the designer and open a project.

Try the script again.

After that, I’m out of ideas. Anyone else wanna jump in?

@JordanCCLark

I deleted the cache and now it’s working. :slight_smile: :thumb_left:

Now I (we) need that for .csv file.
I export my Symbol table to Excel and save it to .csv file.
Could you rewrite your script so that input file is .csv and output is Ignition xml? :prayer:

OK, let me see if I have this right… It’s because I’m not a Siemens guy. :laughing:

You can export from the Siemens software directly as an Excel file? If so, are there any other formats available? I ask this so that we can perhaps skip a step.

EDIT: On second thought, Let’s skip over that for now. If you give me a csv file with a bit of an explanation of your columns, I can take it from there. After we get that process working, we can look at other methods. :wink:

Also it’s okay if it’s a full-column export. Meaning, you don’t have to remove any columns, just let me know which ones are in use. And also save an extra step. :slight_smile:

Thats not exactly true. I'm also using Calc to create tags from external sources. I usually create a template tag in Ignition, export as XML and then use Calc with some cell formulas and copy/paste or autofill to create additional tags. Then i reimport the new tags into Ignition. That's also the reason for the seperate alarms table, you can simply copy/paste your alarm texts there.
That's maybe a bit more work than you want to do, but it works perfectly for me and my co-worker which know how to use Excel/Calc but not how to write scripts in Ignition.
I attached a sample table to this post (Just delete the '.zip' from the filename, the forum software does not accept .ods files).