Quick-Basic running in a Visual Basic compilation?

Quick-Basic running in a Visual Basic compilation?

Post by Bisho » Sat, 21 Feb 2004 20:06:21


Hi everybody,

I have a program, developed in Quick Basic under DOS, which are quite
complicated and I wish to translate into Visual Basic, since Basic is more
familiar for me than other languages.
The question is how to write Quick Basic code in a Visual Basic program. It
handles I/O commands and direct access to memory addresses for a A/D card.
I have to say that this program works fine in a DOS window under Win98, but
it's not the case for W2000/XP.
Any comment will be highly appreciated.
/

Bish
 
 
 

Quick-Basic running in a Visual Basic compilation?

Post by Dag Sund » Sat, 21 Feb 2004 21:09:37


It
but

I'll say you're in for a bit of work!

Your program must be completely re-structured.

VB is Event-driven, and doesn't like top-town and
procedural code at all.

THis, in it self isn't neccessarily a show-stopper, as long as your
QB code is reasonably structured, but the *big* problem here, is
the I/O and direct memory access.

This is a big NO NO in windows in general, and in win2k & XP in
particular. IO belongs to the system. Period.

This means that you need to get hold of, or write a device-driver
for your card. You might be lucky... The card-vendor might have drivers
for it.

If not, you have to write them yourself. That is *NOT* a task that can be
done in VB, but is usually the domain of C and or Assembly.

 
 
 

Quick-Basic running in a Visual Basic compilation?

Post by Bisho » Sat, 21 Feb 2004 21:34:12

Thank you very much for your fast answer!

This is a quite old card (ISA bus) and the vendor offered only DOS drivers,
actually libraries for Quick Basic, Pascal and C, however I did the work
without it.

I think it is better to buy a modern card with driver support for Win2k &
XP.
In such a case, could I write a Visual Basic program based on the QB code I
wrote. Just for the statistical treatment and other hard to rewrite
algorithms?
Or, on the contrary, the program must be completely re-structured?

Thanks again,
/
Bish
 
 
 

Quick-Basic running in a Visual Basic compilation?

Post by Duane Boza » Sat, 21 Feb 2004 22:20:26


Sadly, probably true...


You can translate/migrate the computational portion and simply
restructure it as a subroutine/function called by the event-driven UI.
You will, in essence, have restructured the entire code, but only by
replacing the UI that drives the guts of the computation...That assumes,
of course, that these portions of the original are separate enough in
implementation that they can be brought out as Sub/Function modules
independent of the present UI.
 
 
 

Quick-Basic running in a Visual Basic compilation?

Post by Bisho » Sat, 21 Feb 2004 23:38:23

Yes, the program is separated into a dozen of subroutines.
Then, I will try it writing a VB program.
Regards,
/
Bish
 
 
 

Quick-Basic running in a Visual Basic compilation?

Post by Duane Boza » Sat, 21 Feb 2004 23:59:19


Actually, I was going to note that I do something similar quite
frequently--I do quite a bit (a lot???) of data acq apps and tend to
write the signal processing code in Fortran for speed (and because I'm
more fluent in Fortran than VB for such type code owing to its array
syntax and native support for complex among other things) and simply
"drive" it with a VB (or Tcl/Tk) GUI...very similar organization as your
example where the algorithms are coming from your existing code.

One personal preference wrt to data acq cards--I almsot always <love>
the NI hardware, typically end up detesting the software---depending on
the application my opinions on what would be a choice A/D board would be
widely divergent so I'll hold off on a specific recommendation unless
you wish to post something regarding your target
requirements/needs/wants. I'll simply caution that if you need
moderate/high resolution, be very careful the board you select has
sufficient signal grounding/shielding to avoid PC-generated noise. This
is particularly a problem with some of the very inexpensive boards--I
had a CBI highspeed 16-bit board once that had a large spike impressed
on the sampled data every clock--the onboard timing circuit had spikes
that showed up on the input and were as large as the signal in some
instances--of course, these were low level inputs, but that was the
whole purpose of the subcontractor who selected the card going with the
high resolution of the 16-bit A/D...
 
 
 

Quick-Basic running in a Visual Basic compilation?

Post by erewho » Sun, 22 Feb 2004 00:12:17

On Fri, 20 Feb 2004 13:34:12 +0100, "Bishop" < XXXX@XXXXX.COM >



Not necessarily, although it might be a good idea to re-structure it

It is possible to write purely procedural Apps in VB

A pure QuickBasic App is actually event driven
- even if it only takes Keyboard Events
 
 
 

Quick-Basic running in a Visual Basic compilation?

Post by Bisho » Sun, 22 Feb 2004 01:57:12

I agree with you about the power of Fortran in this case. Fortran was my
first programming language, but I used a Fortran 77 compiler in a VAX-11
computer. Now things are different...
Also LabView is a wonderful tool, if not the best, for these proposes.
Well, I need to be familiar with VB and then I'll try what you say, perhaps
with a module in Fortran.
About the noise, my old 30ksps12bit-A/D card also detects some noise from
the PC, but I have implemented software filters and frequency cut-off.
However, the best result was enabling the "Spread-Spectrum" option in the
BIOS, to reduce the clock spikes.

Thank you very much for your opinions.
/
Bish