FactoryTalk ME –PLC Watchdog

NJC123

Member
Join Date
Aug 2009
Location
various
Posts
38
Hi, I’m after a bit of advice on how to setup PLC watchdog alarm in FactoryTalk ME.
I would like to monitor a register and alarm on if it doesn’t change over a time period.
My intention was to run a macro every 1sec, that moves the PLC register to an internal register, at increments Counter (internal register). When the counter reaches 5, compare the values if they are the same set alarm.
This should be easy but can’t see how to do it.
Any advice would be great.
Thanks
 
Last edited:
I think we need a bit more clarity on what you mean
for example a "PLC watchdog" is a term usually where the PLC will shut down should it detect an error i.e. watchdog for scan time or for a divide by zero error (unless programmed not to shut down).
As for "resistor" what do you mean by this a physical resistor ? i.e. connecting it to some analogue input & monitoring the current through it ?.
or is it a typo, did you mean register ?. i.e. monitor a register and if it does not change after x scans at a given time base then alarm.
 
Hi Parky, It was a typo register not resistor.
I would like to put an alarm on the HMI to indicate a register in the PLC hasn't changed in 5sec.
 
I'm afraid I'm a little rusty on ME scripting perhaps someone else could help, personally I would do it in the PLC for example use a timer to trigger on a one shot to compare the actual with the last stored value, if different then move that value into the last stored and reset the count, if not then increment a count, on the count reaching 5 then set an alarm bit.
From what you are saying, you want to store the last 5 values and if they are the same as the current value then set an alarm. what if only 2 or 3 are the same do you reset the values & count i.e. 5 consecutive values the same.
In a way this is like having a 5 second timer and if the value has not changed then alarm.
Assuming you want to check over a period of 5 seconds if the value has changed then instead of an array you just need to check the value tag against what the last value was and if different reset the counter but if it is the same increment the counter.
For example
in VB (sort of)
Function called by time event
---------------------------------
If My_Var <> Last_Stored_Var then //if not same
Reset Count
else
Increment count // it is the same so increment the count
ENDIF
Last_Stored_Var = My_Var //update the stored variable
If Count >= 5 then set Alarm // if the count is 5 or greater then set the
alarm
end script
I have no idea how you reference the variables in ME
but also you need to have a way of resetting the alarm & reset the count perhaps via a button on the HMI.
This could also be done in the PLC, just create a timer & one shot to run some code that compares the last stored value with the current, if it's changed then reset the count etc. just like in a script.
Caveats:
I have assumed that if there is a change then you reset the count i.e. even if a count of 4 is reached then the value has changed then reset the count and you want only 5 consecutive same values (not changed).
 
Put this in the PLC; Counter.DN is the alarm; Counter.PRE is the alarm limit.

Code:
 {Assume a value is loaded into tag New here}

    ____________     Timer.DN
---[EQU         ]------]/[------[TON Timer]---
   [SourceA  New]
   [SourceB  Old]
    ------------

  Timer.DN   Counter.DN      ___________
-----] [--------]/[---------[CTU Counter]----
                            [Preset    5]
                             -----------

    ____________       Counter
---[NEQ         ]---+----(RES)----------+---
   [SourceA  New]   |    ___________    |
   [SourceB  Old]   +---[MOV        ]---+
    ------------        [Source  Old]
                        [Dest    New]
                         -----------
It could be done more simply without the counter,

  • with [ADD Count 1 COUNT] instead of [CTU ...],
  • and with [LES Count 5] instead of [XIO Counter.DN]
  • and with [MOV 0 Count] instead of [RES Counter].
but this is cleaner to read (maybe).


Or perhaps
Code:
    ____________      nEQUo
---[EQU         ]------( )----
   [SourceA  New]
   [SourceB  Old]
    ------------

  nEQQo     Timer.DN
---] [------]/[------[TON Timer]---

  Timer.DN   Counter.DN      ___________
-----] [--------]/[---------[CTU Counter]----
                            [Preset    5]
                             -----------

  nEQUo      Counter
---]/[---+----(RES)----------+---
         |    ___________    |
         +---[MOV        ]---+
             [Source  Old]
             [Dest    New]
              -----------
 
Oakie, the OP is not talking about PLC watchdog, I thought that at first, however, the OP's question was worded wrong, he meant a watchdog on a value changing (I presume it may be something to do with perhaps level from an analogue or count or something like that).
He apparently wants to do it in the HMI (ME) on a script, I am not that familiar with Scripts in ME, been many years since I did one in ME.
I also suggested to do it in the PLC, but showed a simple type of script used in VBA, if he intends to do it in ME then he needs to find how to reference tags.
 

Similar Topics

Hi I have an old panel builder 32 that I’m replacing for a factory talk me hmi . In the plc for the old panel builder there is a coms bit for the...
Replies
0
Views
76
Hi all, I'm having an issue with connecting View Studio emulation to a real PLC. I am running View Studio 8.01 on a Hyper-V virtual machine...
Replies
0
Views
265
I am trying to evaluate the differences between using FactoryTalk Security and the Service Edition of Rockwell software to limit access to edit...
Replies
3
Views
2,240
Hello everyone, hoping someone here has experience with doing something like this. I am wanting to transfer a string of the currently logged in...
Replies
11
Views
3,691
Heya Given lead times on a new PanelView Performance which we'd plan to deploy and connect to 2 x PLC's, we're in a bit of a pickle. Can we use...
Replies
3
Views
1,183
Back
Top Bottom