Blog

Easy Alarm Generation in RSLogix and FactoryTalk View Studio ME

Easy Alarm Generation in RSLogix and FactoryTalk View Studio ME

Manually adding alarms in FactoryTalk View can be tedious. When you have a system with lots and lots of devices, as DMC often does, this can become nearly impossible. That’s why during one of our annual FedEx days, DMC engineers built a custom Windows application to do all the grunt work for us.

Quick Summary

This tool takes in a CSV file of the controller tags, which is easy to generate in RSLogix (Tools -> Export -> Tags and Logic Comments). In this example, we will use any bit with Alarm in the title as a trigger value. The tool then generates an alarm message for each trigger, using the tag’s Description text as the alarm message. We then export the alarm messages to an XML file and import it into FactoryTalk, ready to use.

Illustrating How the Tool Works

To demonstrate how the tool works, consider an example project that contains 10 Allen-Bradley PowerFlex drives. Similar to how DMC organizes data in the Siemens Open Library, we'll create a data type (udtHMI_VFD_PFlex753) to hold all of our data for each drive. Part of that UDT will be an error structure, where each error will have its own boolean tag. 

Alarm bits for VFD

Next, we'll make a tag for each of the motors of type udtHMI_VFD_PFlex735 in the controller tags. At DMC, we like to store our alarms in arrays of DINTs because it makes it easy to see if any alarms are active, or if any new alarms have become active since we last checked. So for this project, we'll add an array of 3 DINTs called Alarm

Alarm controller tags

Since our Alarm Generation Tool uses the tag description as the alarm text, we need to add the descriptions to each bit in the DINT. Adding descriptions can be done quickly and easily in Microsoft Excel. 

Excel's concatenation and macro features can be extremely useful when doing this for large numbers of alarms. We'll add a row of type COMMENT for each bit in the alarm, following the correct syntax shown below. 

Commented alarm tags in excel

Import this file back into RSLogix (Tools -> Import -> Tags and Logic Comments), being sure to select "Overwrite Existing Tags" so that the comments get added. 

Next, we need to make some ladder code to copy each of the alarms from the UDT to our Alarm DINT.

We can again do this very quickly using Microsoft Excel and RSLogix's text-based ladder editing. The command XIC Motor1.Error.bFeedbackStillActive OTE Alarm[0].0 will set Alarm[0].0 to match the value of XIC Motor1.Error.bFeedbackStillActive.

Generate alarm code in excel

Highlight all of the "code" cells and copy them. Back in RSLogix, double click on a blank rung number ("0" highlighted below) and paste, creating the mapping between the UDT and the Alarms DINT.

Alarm linking routine

Importing into FactoryTalk

Now that the alarm bits are written to, all that is left is to generate the XML file to import into FactoryTalk. Using the tag CSV file created above, we can load it into the Alarm Generation tool, and it'll do the rest of the work for us. 

Alarm generation tool xml conversion

If we import the generated XML file into FactoryTalk, we'll see that the alarm triggers and messages are all set up and ready to use! Now whenever the alarm bits trigger in the PLC code, the operators will be notified on the HMI so they can fix the problem. 

Alarms imported into factorytalk

Conclusion

This alarm generation tool is just one of the many internal tools we use at DMC to make our programming accurate, fast, and flexible. If you need help with alarm generation or any other Allen-Bradley expertise, DMC is happy to help!

Learn more about DMC's Allen-Bradley or .NET Development services. 

Comments

There are currently no comments, be the first to post one.

Post a comment

Name (required)

Email (required)

CAPTCHA image
Enter the code shown above:

Related Blog Posts