Re: [foxboro] parse alarm info of a block into a shell script

  • From: "Nelson, Timothy R." <Timothy.Nelson@xxxxxxxxxxxxxxxxxx>
  • To: <foxboro@xxxxxxxxxxxxx>
  • Date: Tue, 30 Nov 2010 12:18:44 -0600

Venu:

Here is one of the scripts I have written to interact with IA blocks. You can
set or retrieve any of the parameters of the IA blocks via omset or omget. I
been told omsetimp and omgetimp are better commands to use so I have since
revised the included file. The commands you use in your script depends on what
shell you write it in. Some routines are better in one shell versus the other
shell. I like the ksh but also use the csh depending on what I want to do. You
can search the internet to get almost any info on any script command out there
or for any unix command. Good luck.

#!/bin/ksh

SHOME=/usr/custom/script/SteamPre
VSET=/opt/fox/bin/tools/omsetimp
VGET=/opt/fox/bin/tools/omgetimp
CBHOME=/opt/fox/ciocfg/STEAMPREDICT/
FNAME=/opt/fox/ciocfg/STEAMPREDICT/DISPATCHER
LOG=${SHOME}/log.txt
cp /dev/null $LOG 2>$1
echo "Starting:" >> $LOG
date >> $LOG 2>$1
sed -e 's!/! !' ${SHOME}/brewtimes.txt | sed -e 's!/! !' | sed -e 's!:! !' | sed
-e 's!:! !' | sort +5 +6 +8 +9 > ${SHOME}/brew1.txt

j=0
k=1
f=1
z=25
c=0

$VSET -b T STEAMPREDICT:DISPATCHER.BI0001
check=`$VGET -v STEAMPREDICT:DISPATCHER.BO0001 | cut -d" " -f3`
while [ "$check" = FALSE ]
do
        sleep 1
        check=`$VGET -v STEAMPREDICT:DISPATCHER.BO0001 | cut -d" " -f3`
done

for i in `cat $SHOME/brew1.txt`
 do
(( j = j + 1 ))
file[$j]=$i

if [ $j = 10 ]
 then

                l=1
                $VSET -i ${file[$l]} STEAMPREDICT:DISPATCHER.II0001
                m=2
                l=2
                $VSET -i ${file[$l]} STEAMPREDICT:DISPATCHER.II000$m
                (( m=m+1 ))
                l=6
                $VSET -i ${file[$l]} STEAMPREDICT:DISPATCHER.II000$m
                (( m=m+1 ))
                l=8
                $VSET -i ${file[$l]} STEAMPREDICT:DISPATCHER.II000$m
                (( m=m+1 ))
                l=9
                (( m=m+1 ))
                $VSET -i `date +\%d` STEAMPREDICT:DISPATCHER.II000$m
                (( m=m+1 ))
                $VSET -i `date +\%H` STEAMPREDICT:DISPATCHER.II000$m
                (( m=m+1 ))
                $VSET -i `date +\%M` STEAMPREDICT:DISPATCHER.II000$m
                m=1
                l=3
                $VSET -i ${file[$l]} STEAMPREDICT:DISPATCHER.RI000$m
                $VSET -b T STEAMPREDICT:DISPATCHER.BI0002
                check=`$VGET -v STEAMPREDICT:DISPATCHER.BO0002 | cut -d" " -f3` 
                while [ "$check" = FALSE ]
                do
                        sleep 1
                        check=`$VGET -v STEAMPREDICT:DISPATCHER.BO0002 | cut -d"
" -f3`  
                done
                $VSET -b F STEAMPREDICT:DISPATCHER.BI0002
                check=`$VGET -v STEAMPREDICT:DISPATCHER.BO0002 | cut -d" " -f3`
                while [ "$check" = TRUE ]
                do
                        sleep 1
                        check=`$VGET -v STEAMPREDICT:DISPATCHER.BO0002 | cut -d"
" -f3`  
                done
                j=0             

fi
done
$VSET -b F STEAMPREDICT:DISPATCHER.BI0001
check=`$VGET -v STEAMPREDICT:DISPATCHER.BO0001 | cut -d" " -f3`
while [ "$check" = TRUE ]
do
        sleep 1
        check=`$VGET -v STEAMPREDICT:DISPATCHER.BO0001 | cut -d" " -f3`
done

$VSET -i 0 STEAMPREDICT:DISPATCHER.II0001
$VSET -i 0 STEAMPREDICT:DISPATCHER.II0002
$VSET -i 0 STEAMPREDICT:DISPATCHER.II0003
$VSET -i 0 STEAMPREDICT:DISPATCHER.II0004
$VSET -i 0 STEAMPREDICT:DISPATCHER.II0005
$VSET -i 0 STEAMPREDICT:DISPATCHER.II0006
$VSET -i 0 STEAMPREDICT:DISPATCHER.II0007
$VSET -i 0 STEAMPREDICT:DISPATCHER.II0008
$VSET -i 0 STEAMPREDICT:DISPATCHER.RI0001
echo "Ending:" >> $LOG
date >> $LOG 2>$1



Tim Nelson
St. Louis Utilities
314-577-4537
314-713-8030
Nextel #699
 
 
-----Original Message-----
From: foxboro-bounce@xxxxxxxxxxxxx [mailto:foxboro-bounce@xxxxxxxxxxxxx] On
Behalf Of Venu Navuluri
Sent: Tuesday, November 30, 2010 11:52 AM
To: foxboro@xxxxxxxxxxxxx
Subject: Re: [foxboro] parse alarm info of a block into a shell script

Tadeo,
          is there a pdf on these commands.............
Regards
Venu
On Tue, Nov 30, 2010 at 11:12 AM, Tadeo Armenta <tadeoarmenta@xxxxxxxxx>wrote:

> You can execute omget in a shell script on the variable you are looking for
> Regards
>
>
> ________________________________
> De: Venu Navuluri <venunavuluri@xxxxxxxxx>
> Para: foxboro@xxxxxxxxxxxxx
> Enviado: mar, noviembre 30, 2010 11:42:29 AM
> Asunto: [foxboro] parse alarm info of a block into a shell script
>
> Hello All ,
>              can anyone share their experience of parsing an alarm of a
> block into a shell script, or is there a dmcmd command that can be executed
> in a shell script to get the current alarm of a tag .
> Thanks
> Venu
>
>
>
>
> _______________________________________________________________________
> 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:            //www.freelists.org/list/foxboro
> to subscribe:         mailto:foxboro-request@xxxxxxxxxxxxx?subject=join
> to unsubscribe:      mailto:foxboro-request@xxxxxxxxxxxxx?subject=leave
>
>
>
>
>
> _______________________________________________________________________
> 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:             //www.freelists.org/list/foxboro
> to subscribe:         mailto:foxboro-request@xxxxxxxxxxxxx?subject=join
> to unsubscribe:      mailto:foxboro-request@xxxxxxxxxxxxx?subject=leave
>
>


 
 
_______________________________________________________________________
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:             //www.freelists.org/list/foxboro
to subscribe:         mailto:foxboro-request@xxxxxxxxxxxxx?subject=join
to unsubscribe:      mailto:foxboro-request@xxxxxxxxxxxxx?subject=leave
 

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Anheuser-Busch InBev Email Disclaimer www.ab-inbev.com
 
 
_______________________________________________________________________
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:             //www.freelists.org/list/foxboro
to subscribe:         mailto:foxboro-request@xxxxxxxxxxxxx?subject=join
to unsubscribe:      mailto:foxboro-request@xxxxxxxxxxxxx?subject=leave
 

Other related posts: