Hi, I have a project which monitors the status of some conveyors. The Step7 PLC has a double word which handles the alarms for each conveyor. Each bit of the double word relates to a specific alarm.
I realise this is probably not best way to do it, but at the moment we have a label for each alarm and the visibility of each label is set by the alarm bit.
This works fine in the majority of cases, but every now and then we could have 2 or more alarms active for the conveyor and the labels overlap each other making it impossible to read them.
I am trying to make a loop involving a timer so that each active alarm label is shown for a few seconds.
The conveyor section has 30 possible alarms with a label for each. I have a timer with a delay of 3000, stepping by 1 with a bound of 30. So the labels are now visible if their bit ==1 and the timer value == bit index.
This loops through every label whether the alarm is active or not, meaning there can be very long pauses between visible labels. I am struggling to think of a way to loop through only active alarm labels.
Would anybody be able to give some advice on this please?
Thanks in advance,
Leigh
Do you have room for only one alarm to be displayed at a time, or is this just a work around to avoid labels overlapping ?
How are you getting the alarms status ? Are you using system.alarm.queryStatus
, system.alarm.queryJournal
, or some other method ?
I'd probably do one of those:
- build a list of active alarms and display them with a template repeater
- build a queue of active alarms and use that in a timed loop
Consider defining the individual bits as tags of their own, and configuring actual Ignition alarms? Then use Ignition's own alarm components to display them?
@pascal.fragnoud @pturmel Thank you both for your replies.
There is only room to show one alarm at a time, and most of the time, I would only expect one alarm to be active. However there are occasions where multiple alarms can be active.
The alarms are stored in OPC byte array tags. Each bit of the byte being an individual alarm for that section of conveyor.
After starting down my original rabbit hole and posting the question on the forum, rubber duck debugging kicked in and I had a mini brain wave.
When the alarm tag is activated I start the timer running. Each time the timer value changes, I update a dataset tag with the active alarm bits. The timer value is the row to check within the dataset and the length of the dataset is the max value of the timer. I then update another memory tag with the corresponding bit from the dataset.
Example:
- the dataset has three active bits stored [20,23,25]
- the timer max value is set to 3 as there are 3 active bits
- the current timer value is 1, so 23 (the bit at index 1 in the dataset) is written to a memory tag.
The label is then visible if OPC bit 23 = 1 and the memory tag = 23. If that makes any sense to anyone but me?
Can you share a screenshot of what it looks like? I would normally have an alarm icon shown if any alarm in the device is active. Click that and it opens a popup which has an alarm status table filtered to that device.
@nminchin
Ours is just set up to be a simple indicator just to run in the background with no input required. For shift leaders to see at a glance if a conveyor is running or not. It's essentially a remote copy of the HMI local to the conveyor control panel, which can be viewed from any PC on the network.
If an alarm bit is active, the multistate indicator color and text changes to show the alarm status of that conveyor. We then have a label with a description of what causes the alarm bit to be activated.
There are around 30 possible alarms for each conveyor, so we can't fit all the labels on the screen at once and this is just on display in an office with no user input. Scrolling through the active messages seemed like a good way to do it, just took a little thought to get it working.
Ah, ok, like a dashboard overview. I'd consider adding the count of alarms, and the index of what is being currently shown, in that case as well. Then they know there are multiple active, and what index they're looking at currently. Whether that's displayed as numbers or a barchart perhaps, not sure
@nminchin thanks for the advice. I have implemented the count of alarms and am now displaying the number of active alarms along with which alarm is currently displayed.
Thanks for all the help.