Hi Alan,
I do this all the time, starting scripts from sequence code that is :-))
Here is a snippet of sequence code:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
SUBROUTINE INFO( IN time : R
p1 : I
INOUT flag : B
alarm : B )
VARIABLES
STATEMENTS
flag := FALSE;
SENDMSG("/opt/c1/ia/script/event.scr ", p1) TO MSGGR1;
WAIT UNTIL flag AFTER time GOTO NEXT_INFO;
<<NEXT_INFO>>
IF (NOT flag) THEN
{Alarm no coms with INFORMIX}
alarm := TRUE;
ELSE
alarm := FALSE;
ENDIF;
ENDSUBROUTINE
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
But there is more to this.
In the BLOCK you have to setup the MSGGRx. In our case: MSGGR1 = 2
In the COMPOUND you have to setup the "device group". In our case : GR2DV1=EXE_MSG1
In the AP you have to have running /opt/foxind/cpShell/exe/cpShell -id EXE_MSG1
The id could be any name you fancy as long as it is consistent throughout your system.
Make sure that you touch /opt/foxind/cpShell/status/EXE_MSG1 or whatever id you use.
The script on its turn starts a C program with embedded sql which record the event
sent by seq. code.
Once processed it sets a boolean in the sequence code to let it know it has been
processed.
This all to get real time events (well close to it) to Level4 for synchronous
production between plants.
I can find hundreds of pieces of sequence code on our systems that utilise the above
structure
and they all work a gem.
That's about all, I think.
Cheers,
Frits Schouten
BHP-NZSteel.
> -----Original Message-----
> From: Alan J Schaff [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, 22 March 2000 09:26
> To: Foxboro DCS Mail List
> Subject: Script Execution
>
> Does anyone have any experience with running a script triggered by an event in a
> CP? Ideally I want to trigger a script to run from sequence code or when a CIN
> block goes true.
>
> Thanks,
> Alan Schaff
> BASF Corp.
>
>
>
>
>
>
-----------------------------------------------------------------------
This list is neither sponsored nor endorsed by the Foxboro Company. All
postings from this list are the work of list subscribers and no warranty
is made or implied as to the accuracy of any information disseminated
through this medium. By subscribing to this list you agree to hold the
list sponsor(s) blameless for any and all mishaps which might occur due to
your application of information received from this mailing list.
To be removed from this list, send mail to
[EMAIL PROTECTED]
with "unsubscribe foxboro" in the Subject. Or, send any mail to
[EMAIL PROTECTED]