Message Scrolling Code

Can_Farm

Member
Join Date
Oct 2021
Location
South Carolina
Posts
4
New to the forum and looking for a bit of advice or a nudge in the right direction.

I am currently working with the Beckhoff Twincat system and an "AdvancedHMI" HMI. I am looking for some help in writing some code.

Currently, I use the PLC to send a one line text message to the HMI to display any type of alarm or fault to help the operator understand what is happening with the equipment.

In the event that more than one of the bits that trigger these messages go high at the same time, I would like to be able to scroll through the multiple messages on the HMI for a certain time period, on an endless loop.

Thanks in advance for any help offered...
 
Here's something I've just tested to give you one idea. Needs some work to clear the alarm message if there is no alarm.


Code:
//test data
#abAlarms[55]:=True;
#asAlarms[55]:='Bert55';
#abAlarms[77]:=True;
#asAlarms[77]:='Ernie77';

CASE #iState OF
    #INIT:
        #DisplayTime(IN := false,
                     PT := t#3s);
        #iState := #SCAN;
    #SCAN:
           
     IF #abAlarms[#iIndex] THEN
         #iCurrentAlarm := #iIndex;
         #sCurrentAlarm := #asAlarms[#iIndex];
         #iState := #SCROLLDELAY;
     END_IF;
     #iIndex:=#iIndex+1;
     IF #iIndex > #NUMBEROFALARMS THEN
         #iIndex := 1;
     END_IF;
 
        
    #SCROLLDELAY:
        #DisplayTime(IN := True,
                     PT := t#3s);
        IF #DisplayTime.Q THEN
            #iState := #INIT;
        END_IF;
END_CASE;
 
Here's something I've just tested to give you one idea. Needs some work to clear the alarm message if there is no alarm.


Code:
//test data
#abAlarms[55]:=True;
#asAlarms[55]:='Bert55';
#abAlarms[77]:=True;
#asAlarms[77]:='Ernie77';

CASE #iState OF
    #INIT:
        #DisplayTime(IN := false,
                     PT := t#3s);
        #iState := #SCAN;
    #SCAN:
           
     IF #abAlarms[#iIndex] THEN
         #iCurrentAlarm := #iIndex;
         #sCurrentAlarm := #asAlarms[#iIndex];
         #iState := #SCROLLDELAY;
     END_IF;
     #iIndex:=#iIndex+1;
     IF #iIndex > #NUMBEROFALARMS THEN
         #iIndex := 1;
     END_IF;
 
        
    #SCROLLDELAY:
        #DisplayTime(IN := True,
                     PT := t#3s);
        IF #DisplayTime.Q THEN
            #iState := #INIT;
        END_IF;
END_CASE;


Thank you!

One question. Please excuse my ignorance. When it comes to ST, I am a novice at best.

Looking in your code, can you give me a quick explanation of what #INIT and #SCAN are?

Are these declared variables or symbolic constants?
 
I created the variables and assigned them each a different number. Still getting the same error. Can you see where the problem is before I pull my hair out?

I attached picture of code.

:unsure::unsure::unsure:

Scroll Code.PNG
 
Hopefully attached is a 3 rung ladder circuit for an alarm banner . It is written for a Micrologix ML1000 in RS Logix 500 . Please note the routine includes a jump to the start of the same rung and if you have a large number of alarms the program scan time may be exceeded . In this case the alarms will need splitting into more than 1 scan .

Sample.png
 
Last edited:

Similar Topics

Hi all, I just wondering if somebody know how to make scrolling message display on the panelview. I have make a simple program using RSLogix500...
Replies
10
Views
10,060
ebilly
E
hi everyone, i have problem regarding Audit in FTV ver 12,In audit message "service disruption:<HMI server name>:<SERVICE NAME>" message logged,i...
Replies
1
Views
46
Is there a way to add a local message display to Studio 5000 View Designer? If its there, I’m not finding it. I have used them in older versions...
Replies
11
Views
411
Hello, I made a change in alarm setup in factory view studio, where I changed a alarm message text. After that I made a run application and...
Replies
0
Views
141
I have a safety PLC AB that is stuck trying to charge the capacitor and will not do anything. No communication or anything can be done. Is there...
Replies
0
Views
76
Back
Top Bottom