Your approach looks fine. Could avoid the whole DMCFG thing just by using the = /usr/fox/wp/data/dmnames file which your machine creates at bootup based = on the dmcfg file. -----Original Message----- From: foxboro-bounce@xxxxxxxxxxxxx [mailto:foxboro-bounce@xxxxxxxxxxxxx] = On Behalf Of IQUEIROLOO@xxxxxxxxxxxxx Sent: Tuesday, August 08, 2006 6:54 AM To: foxboro@xxxxxxxxxxxxx Subject: [foxboro] Object visibility with environment Hi list, =20 I need to drive the visibility property of an object with the = environment that I am using on a DM. What I did was create shared = variables with the "omcrt" command to tie the visibility. The names of = the variables are coincident with the DM names in the station. The = following steps are what I did: =20 1) I checked the space variables with the "show_params" command to know = if I have limitations to create shared variables. =20 2) I wrote a script to create the variables. The script looks like: -------------------------------------------------------------------------= ------------------------------------------------------ #!/bin/sh # @(#)go_OMCREATE 0.1 04/07/06 # =20 # Document the script here. =20 #************************************************************ # Setup necessary shell variables OMTOOLS=3D/opt/fox/bin/tools DMCFG=3D/usr/fox/customer/hi/dmcfg LOCALHOST=3D`uname -n` =20 #************************************************************ # Put all operating command here DMNAMES=3D`cat $DMCFG | grep -w "NAME" | awk '$2 ~ /'"$LOCALHOST"'/ = {print $3}'` for DM in $DMNAMES do $OMTOOLS/omcrt -i $DM >/dev/null 2>&1 done -------------------------------------------------------------------------= ------------------------------------------------------ =20 This script can be run from the user_apps.dat to create the variables at = the start up. Each box in the system will have one variable for each DM = name. The type of the variables is integer. =20 3) I added a line to each file environment to set the value of the = variables with the "omset" command each time I change the environment. = The files are the Operator_env and Engineer_env: =20 ::::::::::::::::::: Operator_env ::::::::::::::::::: ... dmcmd run /opt/tools/scripts/setvis 0 $DMNAME (this is the last line) =20 ::::::::::::::::::: Engineer_env ::::::::::::::::::: ... dmcmd run /opt/tools/scripts/setvis 1 $DMNAME (this is the last line) =20 The setvis script looks like: -------------------------------------------------------------------------= ------------------------------------------------------ #!/bin/sh # @(#)setvis 0.1 04/07/06 # =20 # Document the script here. =20 # Setup necessary shell variables OMTOOLS=3D/opt/fox/bin/tools =20 # Put all operating command here $OMTOOLS/omset -i $1 $2 -------------------------------------------------------------------------= ------------------------------------------------------ =20 4) Finally, I configured the display file to drive the object visibility = with these variables. The configuration involves: =20 In the line where you put the variables which is the path, I wrote = $DMNAME. Lowest State: 0 Number of a States: 2 State : Invis 0 Vis 1 0 0 1 1 =20 I would like to hear your comment about this. May be there is a better = solution or the steps above have something that could be a problem with = other things in the system. I have been using this for about three weeks = and I haven't found problems. =20 Thanks in advance for the comments you can send me. =20 Ignacio Queirolo Olivera Control Avanzado Complejo Industrial Ensenada Repsol YPF - Qu=EDmica Tel.: 54 221 429-8400 ext. 26481 Fax: 54 221 429-8400 ext. 26209 iqueiroloo@xxxxxxxxxxxxx <mailto:iqueiroloo@xxxxxxxxxxxxx>=20 =20 AVISO LEGAL: Esta informaci=F3n es privada y confidencial y est=E1 dirigida = =FAnicamente a su destinatario. Si usted no es el destinatario original = de este mensaje y por este medio pudo acceder a dicha informaci=F3n por = favor elimine el mensaje. La distribuci=F3n o copia de este mensaje = est=E1 estrictamente prohibida. Esta comunicaci=F3n es s=F3lo para = prop=F3sitos de informaci=F3n y no debe ser considerada como propuesta, = aceptaci=F3n ni como una declaraci=F3n de voluntad oficial de REPSOL YPF = S.A. y/o subsidiarias y/o afiliadas. La transmisi=F3n de e-mails no = garantiza que el correo electr=F3nico sea seguro o libre de error. Por = consiguiente, no manifestamos que esta informaci=F3n sea completa o = precisa. Toda informaci=F3n est=E1 sujeta a alterarse sin previo aviso.=20 This information is private and confidential and intended for the = recipient only. If you are not the intended recipient of this message = you are hereby notified that any review, dissemination, distribution or = copying of this message is strictly prohibited. This communication is = for information purposes only and shall not be regarded neither as a = proposal, acceptance nor as a statement of will or official statement = from REPSOL YPF S.A. and/or subsidiaries and/or affiliates. Email = transmission cannot be guaranteed to be secure or error-free. Therefore, = we do not represent that this information is complete or accurate and it = should not be relied upon as such. All information is subject to change = without notice. =20 =20 _______________________________________________________________________ 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 =20 foxboro mailing list: //www.freelists.org/list/foxboro to subscribe: = mailto:foxboro-request@xxxxxxxxxxxxx?subject=3Djoin to unsubscribe: = mailto:foxboro-request@xxxxxxxxxxxxx?subject=3Dleave =20 _______________________________________________________________________ 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