WonderWare Quickfunctions

cootr

Member
Join Date
Sep 2015
Location
Louisiana
Posts
4
I have 25 monitors in the field and I have a heartbeat and want to run a snip of code for each one to have a loss of comm bit if WW stops seeing the heartbeat transitioning. I'm trying to minimize replicated code by using a quickfunction, but it doesn't seem to work the way I think it should.

I have the following:
Function:WATCHDOG

Arguments:
Code:
CommCount (integer)
LastComm (discrete)
HeartBeat (discrete)
CommOK (discrete)

Code:
Code:
IF CommCount < 10 AND LastComm == HeartBeat THEN
	CommCount = CommCount + 1;
ENDIF;

IF LastComm <> HeartBeat THEN
	CommOK = 1;       
	CommCount =  0;
ENDIF;

IF CommCount >= 10 THEN
	CommOK = 0;  
ENDIF;

LastComm = HeartBeat;

I use the following to call the QuickFunction:
Code:
CALL WATCHDOG(AT0034S_COMMCOUNT, AT0034S_LASTCOMM, AT0034S_MISC_ARRAY.00, AT0034S_COMM_OK);

I tried calling the function in application script every second. I've also tried calling it using a button. I can't get anything to work. I've even tried simplifying the code to a simple IF HeartBeat Then CommCount = CommCount +1. It works if I put code into a button to test, but my QuickFunction doesn't do it. I've swapped the MISC_ARRAY bit with a memory discrete to see if it didn't like the array bit, and it wasn't that either.

Any ideas on what I'm doing wrong, or am I going about this the wrong way? I've goolged and read the help files and don't see what I'm missing.


edit: I also tried to RETURN the CommOK status by using AT0034S_COMM_OK = CALL WATCHDOG(parameters) and returning just the CommOk because that's all I care about.
 
Last edited:
There is no "PLC", it's just 25 air quality monitors being pulled into one WonderWare application. It has a set modbus mapping, and one piece of information mapped is a bit array with one of the bits being a blinking watchdog/heartbeat bit. I want to have one piece of code that gets called for each monitor and checks that that bit is still transitioning. I've used QuickFunctions to parse total seconds into HH:MM:SS before, but I can't seem to get it to work again here.

Thanks!
 
I was able to get it to work, but not quite as efficient as I had hoped. I had to have a piece of code to determine the CommCount and return that value, then run some code to determine CommOK and return that value. Then I'd set the heartbeat equal to my LastComm compare tag.

Called this in application script every second:
Code:
AT0034S_COMM_COUNT = CALL COMMCOUNT(AT0034S_COMM_COUNT, AT0034S_LAST_COMM, AT0034S_MISC_ARRAY.00);
AT0034S_COMM_OK = CALL COMMOK(AT0034S_COMM_COUNT, AT0034S_LAST_COMM, AT0034S_MISC_ARRAY.00, AT0034S_COMM_OK);
AT0034S_LAST_COMM = AT0034S_MISC_ARRAY.00;

which would first call this and give me my CommCount:
Code:
IF CommCount < 10 AND LastComm == HeartBeat THEN
    CommCount = CommCount + 1;
ENDIF;

IF LastComm <> HeartBeat THEN
    CommCount =  0;
ENDIF;

RETURN CommCount;

then call this to determine if my CommOK is good or not:
Code:
IF LastComm <> HeartBeat THEN
	CommOK = 1;       
ENDIF;

IF CommCount >= 10 THEN
	CommOK = 0;  
ENDIF;

RETURN CommOK;


Eh, it works and it's more efficient than having the full code for each monitor. Reduces 11 lines of repeated code to 3 calls for code.

If anyone has any ideas on why I couldn't do what I wanted to do in the first post, I'd still love to hear it.

Thanks!
 

Similar Topics

Hi guys, I have experience with PLC to Excel etc...just starting on using intouch scada screens. I have an Excel sheet that uses mainly...
Replies
1
Views
137
Hello everyone, Recently, my Archestra IDE shut down while I was editing. After restarting the IDE, I noticed warning symbols under my opened...
Replies
1
Views
101
Good morning all. I'm working on a rehab where they had a standalone InTouch 2014 HMI that they called a SCADA, but it's really basic stuff. The...
Replies
4
Views
181
Hi, We are setting up an Aveva Plant SCADA node with the intention to connect it to a Wonderware Historian node. Everywhere I look online I see...
Replies
1
Views
171
Hola chicos. Tengo un problema con el driver de comucicacion dasabcip 5, y un plc controllogix v34, ya realice la comunicacion pero en ciertos...
Replies
2
Views
151
Back
Top Bottom