CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Wed Dec 19, 2018 4:53 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Dynamic Alarm Message
PostPosted: Sat Oct 27, 2018 3:42 pm 
Offline

Joined: Mon Apr 30, 2018 8:14 am
Posts: 9
Hi There,

I am wondering if it possible to configure an alarm message string dynamically.
What I mean by this is in the alarm configuration, I want to have the message display a string from a text list dynamically at runtime.
Does anyone know how to achieve this?

Attachment:
Untitled.jpg


Cheers,

Louis.


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Mon Oct 29, 2018 9:55 am 
Offline

Joined: Mon Nov 03, 2014 7:15 am
Posts: 42
Hi Louis!

I don't know, if there is a way directly in the alarmmanager. I would solve it with a short piece of program, like this:
Code:
VAR
   asMessageText:      ARRAY[0..8]OF STRING := ['No Message', 'Message 1', 'Message 2',
                                     'Message 3', 'Message 4', 'Message 5',
                                     'Message 6', 'Message 7', 'Message 8'];
   sAlarmMessage:      STRING;
END_VAR

IF byPowerPackEStopDiag <> 0 THEN
   sAlarmMessage:= asMessageText[byPowerPackEStopDiag];
END_IF


In the Alarmconfiguration you can use <LATCH1> as a placeholder for the text:
Attachment:
Alarm.png


Maybe this helps?

Good luck

Alfred


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Wed Oct 31, 2018 5:00 pm 
Offline

Joined: Mon Apr 30, 2018 8:14 am
Posts: 9
Hi,

Thanks for the reply,
Yes I ended up doing this (something very similar), In theory it should work fine as the documentation says you can define a STRING as a latch variable. I tried it in the simulation but it would not display the STRING value. I also tried a unicode WSTRING with no success. I will try this method once I have some hardware in front of me to try it on.

Thanks for your help.

Regards,

Louis.


Top
   
PostPosted: Wed Oct 31, 2018 9:48 pm 
Offline

Joined: Wed Dec 28, 2016 11:00 pm
Posts: 66
Dear poster,

I tried the of the dynamic string alarm texts via <Latch1> and it works wonderful in v3.5.11.50 based hardware.

Thanks for sharing!


Top
   
PostPosted: Wed Nov 07, 2018 3:20 pm 
Offline

Joined: Mon Apr 30, 2018 8:14 am
Posts: 9
Hi Hermsen,

Much appreciated!

Regards,
Louis.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 5 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited