Re: [foxboro] dmcmd csa

I'm sure Tim was typing this in haste <g>, but to get compound name 
emitted from getpars I believe one would use 'CMPNM' rather than 'CPNMN'.

This is an interesting topic.  I haven't actually hacked any scripts yet 
that need it, but I will soon have a need to look up/use compound and 
block names for things other than calling up detail displays.  I was 
considering both the getpars route, and using iccprt to generate a 
configuration printout that I would then put into a database that any 
manner of scripts could use.  Or maybe there is something I haven't 
thought of yet, or already (hastily) ruled out.  I'd like to hear from 
others who have implemented such systems what the pros/cons are to the 
different approaches.


Corey Clingo
BASF Corporation






"Lowell, Tim:" <Tim.C.Lowell@xxxxxxxxxxxxxxxxxx> 
Sent by: foxboro-bounce@xxxxxxxxxxxxx
08/14/2006 11:26 AM
Please respond to
foxboro@xxxxxxxxxxxxx


To
<foxboro@xxxxxxxxxxxxx>
cc

Subject
Re: [foxboro] dmcmd csa






Pedro,

I'm sure Alex was typing this in haste, but there are a couple of
problems with these four steps.

First of all, the DM command to execute a detail display is actually:=20

dmcmd stddisp $P1

Second of all, you must type in the full COMPOUND:BLOCK address in the
data entry box to get any results.

I'm assuming anybody who is trying to find anything on your system
doesn't have the first clue what the compound is or what the term
"compound" even means.  If they did, they would probably just use
FoxSelect or the Select button.  Most likely, they only know the block
name.

For our console guys, I built a display similar to the one Alex is
suggesting, except I use getpars to periodically create a text file list
of all compounds and blocks in the system.  It's a pretty short command
that runs relatively quickly.  It goes like this:

/opt/fox/bin/tools/getpars -mCPNMN:%-12.12s

You can redirect that to a file, and copy that file to all your
consoles.  You can set it up as a cron job to run every night if you
want.  Obviously, it won't catch any blocks you just added, unless you
run it manually.

Next you create a script that queries that text file using whatever is
typed into $P1, which we are assuming will be a block name.

My script looks like this:

getdetail.sh

#!/bin/sh
GCLBUG=3D$1
BLOCK=3D$2
PATH=3D$PATH:/opt/fox/bin/tools
BLKCMP=3D`cat /opt/<your directoryname>/getpars.txt|grep $BLOCK`
BLKCBP=3D`echo $BLKCMP|awk '{print $2 ":" $1}'`
pref -$GCLBUG dmcmd "stddisp $BLKCBP"

The fifth line performs the file lookup to ascertain the compound name,
the sixth line appends the compound name to the block with the ":", and
the last line displays the detail display of whatever block is typed
into the data entry box to whatever DM/FV invoked the program.  You can
run this script with a wp_applic or applic command from the display.
The display command would be:=20

applic /opt/<your directoryname>/get_detail.sh $DMNAME $P1

You would connect this to a button on the display that says something
like "Find Block"

One major problem with this scheme is that if you have multiple blocks
with the same name in your system, the script will display the first one
it encounters in the getpars file.  I suppose I could do some
programming to get around that, but I never bothered.  It works 99% of
the time for us.

Does anybody have a better method for doing this?

Tim Lowell
Control Systems Engineer
ConocoPhillips Trainer Refinery
(610) 364-8362
tim.c.lowell@xxxxxxxxxxxxxxxxxx







 
 
_______________________________________________________________________
This mailing list is neither sponsored nor endorsed by Invensys Process
Systems (formerly The Foxboro Company). Use the info you obtain here at
your own risks. Read http://www.thecassandraproject.org/disclaimer.html
 
foxboro mailing list:             http://www.freelists.org/list/foxboro
to subscribe:         mailto:foxboro-request@xxxxxxxxxxxxx?subject=join
to unsubscribe:      mailto:foxboro-request@xxxxxxxxxxxxx?subject=leave
 

Other related posts: