Re: [foxboro] set_confirm for boolean

  • From: "Heath, Graham" <gheath@xxxxxxxxxxx>
  • To: "'foxboro@xxxxxxxxxxxxx'" <foxboro@xxxxxxxxxxxxx>
  • Date: Tue, 25 Jun 2002 04:23:08 -0400

Sorry alex

I tried both setting to TRUE and FALSE. with the variable set to 1 or 0.
this weas a success.

I agree the issue is in the data format thats why I went to writing from a
char variable this seemed easier than than bit twiddling from an integer

rgds

Graham

PS with the code I threw together setting x2 to anything other than zero
will set the value TRUE

so without worrying too much how or why the example prsesented worked.
Which in the end is whats required!!  :<).


regds



-----Original Message-----
From: Johnson, Alex (Foxboro) [mailto:ajohnson@xxxxxxxxxxx]
Sent: 24 June 2002 21:18
To: foxboro@xxxxxxxxxxxxx
Subject: Re: [foxboro] set_confirm for boolean



Ronny,


The issue is the data format.

If you look at the om_udat.h header file and think about what it is telling
you you will come to realize that 


a Boolean true is:


0x1000


and a Boolean FALSE is


0x0000


Graham's example works because he is setting the variable to false.


Yours fails because you want true.



So, be sure that the correct bit is set on your input to the setval
function.


If you pass and integer (as I usually do), set it to 0x1000 for TRUE and
0x0000 for FALSE. You can also use -1 for TRUE since it also sets the
correct bit.


Hope this helps.



Regards,

Alex Johnson
Invensys
10707 Haddington
Houston, TX 77063
713.722.2859 (office)
713.722.2700 (switchboard)
713.932.0222 (fax)
ajohnson@xxxxxxxxxxx <mailto:ajohnson@xxxxxxxxxxx> 
Come to the Invensys Showcase: http://www.invensysshowcase.com/
<http://www.invensysshowcase.com/> 


        -----Original Message-----
        From:   De Maeyer Ronny [SMTP:Ronny.DeMaeyer@xxxxxxxxxx]
        Sent:   Monday, June 24, 2002 2:16 PM
        To:     'foxboro@xxxxxxxxxxxxx'
        Subject:        [foxboro] set_confirm for boolean


        Hi all,

        I am trying to set a boolean from whitin a c-program.
        I use the following code : (part of the programm)

        data_len=4;
        strcpy(temp,"UCM4:CHECKSAP.IN");
        x2=1;
        status=OM_BOOL;

        rtn=set_confirm(temp,VARIABLE,0,&x2,&status,&data_len);

        My problem : whatever I use for x2 (0,1, true,T, false,F) the input
of the
        bloc does not change.
        when I use 0 or 1 I declare x2 as an integer, for Trur,T,False or F
I
        declare x2 as char.
        In the manual (BO193BC) page 19 under set_confirm they say for
OM_BOOL is a
        byte with True/False values only.

        Can somebody explain what I am doing wrong ?

        Thanks in advance,

        Ronny

        > Ronny De Maeyer
        > 
        > Fluxys n.v. 
        > LNG TERMINAL ZEEBRUGGE
        > H.V. Wolvensstraat 3, Kaai 615 
        > B - 8380 ZEEBRUGGE
        > Tel.: (++32) (0)50 36 66 24 (direct)
        > Tel.: (++32) (0)50 36 66 11 (central)
        > 
        > mailto:ronny.demaeyer@xxxxxxxxxx
        > http://www.fluxys.net
        > 
        > 
        > 
        > 
        
**************************************************************************
        This e-mail and any attachments thereto may contain information
which is
        confidential and/or protected by intellectual property rights and
are
        intended for the sole use of the recipient(s) named above.Any use of
the
        information contained herein (including, but not limited to, total
or
        partial reproduction, communication or distribution in any form) by
persons
        other than the designated recipient(s) is prohibited.Any liability
for the
        correct and complete transmission of the information or for any
delay or
        interruption of the transmission or for damages arising from the use
of
        reliance of the information shall be disclaimed.If you have received
this
        e-mail in error, please notify the sender either by telephone or by
e-mail
        and delete the material from any computer.
        Thank you for your cooperation
        
**************************************************************************
         
         
        
_______________________________________________________________________
        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
 

Other related posts: