Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.basic.visual.misc > #726

Re: How to tell when an ocx method call is finished?

From mike <spamme9@gmail.com>
Newsgroups comp.lang.basic.visual.misc
Subject Re: How to tell when an ocx method call is finished?
Date 2012-01-26 11:02 -0800
Organization A noiseless patient Spider
Message-ID <jfs83l$tnn$1@dont-email.me> (permalink)
References <jfmopc$j7g$1@dont-email.me> <jfq9ml$kp8$1@speranza.aioe.org>

Show all headers | View raw


On 1/25/2012 5:19 PM, Farnsworth wrote:
> "mike"<spamme9@gmail.com>  wrote in message
> news:jfmopc$j7g$1@dont-email.me...
>> I'm trying to make the Softmark USB to GPIB converter work.
>> The vendor is unwilling to supply any documentation of sample programs
>> or ANYTHING other than a crippled demo program.
>> I've fixed the hardware, but the firmware doesn't support my fix.
>> I've been experimenting, trying to reverse engineer the .ocx file that
>> came with it.
>>
>> Doing a GPIB handshake for every byte in visual basic is excruciatingly
>> slow, but I'd like to use this turkey for something.
>>
>> Problem is that there's an ocx method to write the ports.
>> But it can take as much as 300ms for it to happen.
>> And there's no feedback, so I have to poll the registers,
>> which ain't valid for up to 300ms.
>>
>> So, is there a way to tell when the method has finished?
>> I've used wait for single object to call programs
>> using the shell.  Is there something similar that I can
>> use on an unknown "black box" call thru an ocx?
>
> The method is "done" when the call returns. Well made stuff should have an
> event to trigger when the work was actually done. Try pressing F2 to bring
> up the Object Browser, select the OCX, and see if it provides any events.
>
>
Here's the symptom I'm trying to fix:

for i = 0 to 255
write i to the port using the ocx method.
delay
read j from the port using the ocx method.
print i,j
next i

it prints
0,0
1,0
2,0
3,0
4,1
5,1
6,4
......

If I make the delay longer, it doesn't get as far behind.
But it takes about half a second delay to make it work right.
The ocx writes using USB1.1.

I want to read a string from GPIB.  The Softmark USB/GPIB adapter 
doesn't work.  It fails to detect DAV, but I've patched the hardware.
I can read the control lines, so I should be able to tell when the data
is valid so I can read it.  But reads to that control port have the 
symptom described above.
Seems that VB is not waiting for one method to complete before executing 
another..
I can't trust what I read until half a second after I've stopped messing
with the USB port.  And if I wait too long, the talker times out.

There's no documentation and I can't find anything in the Object Browser
that suggests there might be an indication that the ocx command is complete.

Unless there's something I can access in the USB driver (not the ocx), I 
seem to be outa luck.
Waitforsingleobject does the thing I want for shell programs.

Yes, I understand the concept of diminishing returns.  I've already
spent more on electricity to run the debugging system than I spent on 
the interface.
I've taken it on as a challenge.  I just want to make it work...and 
learn something in
the process.

Back to comp.lang.basic.visual.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

How to tell when an ocx method call is finished? mike <spamme9@gmail.com> - 2012-01-24 09:10 -0800
  Re: How to tell when an ocx method call is finished? "Auric__" <not.my.real@email.address> - 2012-01-24 17:52 +0000
  Re: How to tell when an ocx method call is finished? ralph <nt_consulting64@yahoo.net> - 2012-01-24 12:18 -0600
    Re: How to tell when an ocx method call is finished? mike <spamme9@gmail.com> - 2012-01-24 23:29 -0800
  Re: How to tell when an ocx method call is finished? "Farnsworth" <nospam@nospam.com> - 2012-01-25 20:19 -0500
    Re: How to tell when an ocx method call is finished? mike <spamme9@gmail.com> - 2012-01-26 11:02 -0800
      Re: How to tell when an ocx method call is finished? "Farnsworth" <nospam@nospam.com> - 2012-01-28 14:25 -0500
        Re: How to tell when an ocx method call is finished? mike <spamme9@gmail.com> - 2012-01-28 15:01 -0800
          Re: How to tell when an ocx method call is finished? "Farnsworth" <nospam@nospam.com> - 2012-01-29 22:42 -0500

csiph-web