Word changing... bit 3s up

The only reason I asked was :-

L #Temp_Alarm_Status //Load Alarm Bits into Accum 1
T DBB [#Byte_Offset] //Transfer Current Alarm Status to Alarm Reference (Last Scan)

L #Alarm_Mask //The variable Alarm_Mask passed to the function is copied to a local
T #Temp_Alarm_Mask_DB //variable and the Alarm Mask Data Block is opened.
OPN DB [#Temp_Alarm_Mask_DB]

L DBB [#Byte_Offset] //The alarm mask is loaded into the accumulator along with the alarm status and a
L #Temp_Alarm_Status //logical AND'd is done to identify whether the alarm is required to trigger the klaxon. A 1 in the
AW //mask will trigger the klaxon.

L #XOR_Result //The XOR_Result and the result of the (alarm_status AND alarm_mask) word is AND'd
AW //together to test whether a positve change has occurred that is a new alarm has been triggerred.
L 0 //This will cause a non zero result when true which will set the New_Alarm flag
<>I
S #New_Alarm

L #Loop_Count //The Loop_Count is loaded into Accum 1 and if greater than zero the loop is repeated.
LOOP NEXT // and the accumulator is decremented
 
It looks like you got it. The code I used was developed some time ago (by others but the idea utilised myself on a few occassions) for HMI interface where the work was done in the PLC.

It was found to be easier to on the system to work with words rather than lots and lots of binary instructions.

The basic is the following:

SingleAlarm.JPG


The following is a bit more involved as it includes memory latches and acknowledge memory.

multAl_Lad.JPG


The following using words, I've identified which bits belong to which ladder rung. At the end I've included a search for unacknowledged alarms where you can alert the operator.

multAl_STL.JPG
 
heyhey

all very usefull information,

much thanks to you all, you guys on this forum is a superadvantage of PLC programmers who have probs

thanks

thanks

a lot
 
Peter Nachtwey said:
ChangedBits := NewBits and not OldBits;
OldBits := NewBits;

No XOR necessary.

Thats another word (16 bits) per alarm word. In the systems we had it would have mean't another (unecessary) 200/16 words.

Of course wouldn't use this nowadays as HMI's tend to do the work.
 
My way needs double ! I like to have a mask DB so that I can select which alarms are valid , or mask alarms out of a byte where they are not valid . This method doesn't care what data is in the alarm DB , a mixture of byte , bit and words , just so long as the mask and the storage DB are images of the alarm DB .
 
Hey

A double ...

I tried this, but the AL_4 never comes 1 when DW4 changes??:

L #DW_4
L #PREV_CY_4
XOD
L #DW_4
T #PREV_CY_4
AD
L 0
<>I
S #AL_4
 
To 10BaseT.

Maybe this will help:

Check_ALM_w_mask.gif


...but it would probably make sense to have one DB made local (in stead of all three global)...

Edit: Forgot to 'L 0' between 'XOD' and '<>D'
 
Last edited:
Not bad , not bad !

Petes comment is important though .
I still like 3 DBs - If I want to add any alarms , it takes a few seconds - but there is no reason why you can't munch them into one.
 
Yep, PeterW is right (again)!

Remove the 'XOD' and implement what Peter Nachtwey proposed, and negative edges will no longer trigger the alarm bit.
 
10BaseT.,

It's OK to use 3 separate DB's, but what I meant was: You can open one global DB and one local DB at the same time (will improve cycle time, less 'OPN' instructions).
 

Similar Topics

Hi all, i have a panelview plus terminal 2711P-T12W22D9P terminal with different user names and passwords. Everyone seems to know the maintenance...
Replies
3
Views
809
I have been asked to find out if there is a way to change the different user passwords for the HMI through the PLC. We use FactoryTalk View Studio...
Replies
12
Views
3,608
Hello. I have not found any documentation on this matter. I want the user to be able to change their password back to a previously used...
Replies
3
Views
1,893
hi, Is there a way to choose with %MW you use depending on the value of %SW49? For example, i have 7 %MW: -%MW4 that needs to be active when %SW49...
Replies
0
Views
1,204
Hi, I am using FactoryTalk View v6.10 and I am updating from an old PV1000 (with panel builder 32) to a new PV Plus 1250. The old project had a...
Replies
3
Views
1,605
Back
Top Bottom