comp.lang.ada
 help / color / mirror / Atom feed
From: dd24fan <d3v3r4@gmail.com>
Subject: Re: .h header file in ObjectAda 8.2.2 source code?
Date: Mon, 22 Jul 2013 12:06:08 -0700 (PDT)
Date: 2013-07-22T12:06:08-07:00	[thread overview]
Message-ID: <932e538e-bfe4-48e9-8d5b-a506eae365fc@googlegroups.com> (raw)
In-Reply-To: <ksd7uk$1dg$1@loke.gir.dk>

Thanks for the insight. My latest debugging efforts have pointed me to the Initialization of the device.  I do have a compare of what the C code is doing because the vendor has software in a analyzer/simulator that i was able to run.

Here is the snippet of the C code:

==============
.
.
.
    S16BIT    s16Result = 0x0000;
    S16BIT    s16DevNum = LOGICAL_DEVICE_NUMBER;
.
.
    /* Initialize device */
    s16Result = Initialize(s16DevNum, ACCESS_CARD, MODE, 0, 0, 0);
.
.
==============
ACCESS_CARD is defined as 16BIT
MODE is U16BIT
The last 3 parameters are defined U32BIT

so in my latest ada code i have this:
==============
.
.
   function Initialize (DevNum : S16Bit_Type;
                            wAccess: S16Bit_Type;   
                            Mode : U16Bit_Type;
                            Mem_Wrd_Size : U32Bit_Type;
                            Reg_Addr : U32Bit_Type;
                            Mem_Addr : U32Bit_Type
                            ) return S16Bit_Type;
   pragma Import (Stdcall, Initialize, "Initialize");
.
.
   procedure Open (Device_Num : in S16Bit_Type;
                   Is_Open : in out Boolean;
                   Good : out Boolean) is

      Result : S16Bit_Type;

      ACCESS_CARD : U16Bit_Type := 16#0000#;
      MODE : 16Bit_Type := 1;
.
.

   begin
      Good := False;
      
      Results := Gb.Msgbox(Text    => "procedure Open begin",
                           Caption => "procedure Open begin",
                           Style   => 4,
                           Handle  => Gb.Handle(Form));	      
      
      --    Initialize device
      
               Result := Initialize (S16Bit_Type (Device_Num),
                               ACCESS_CARD,
                               MODE,
                               16#00000000#,
                               16#00000000#,
                               16#00000000#);

         Print (Device_Num, "Initialize => ", Result);
	 
         Results := Gb.Msgbox(Text    => "Initialized?",
                                          Caption => "Initialized?",
                                          Style   => 4,
                                          Handle  => Gb.Handle(Form));	 
.
.
.
==============
Some notes: Device_Num is originally defined as an integer elsewhere in the code so I type cast it.  



  reply	other threads:[~2013-07-22 19:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-19 11:47 .h header file in ObjectAda 8.2.2 source code? dd24fan
2013-07-19 13:02 ` Niklas Holsti
2013-07-19 15:36 ` dd24fan
2013-07-20  5:41   ` Randy Brukardt
2013-07-22 19:06     ` dd24fan [this message]
2013-07-22 19:08     ` dd24fan
2013-07-22 20:04       ` Niklas Holsti
2013-07-23 12:05         ` dd24fan
2013-07-22 19:50     ` dd24fan
2013-07-20  8:07   ` Niklas Holsti
2013-08-01 15:03     ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox