LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help: "writing" to simple ISA device

Hi,

We have an ISA card that has 19 8-bit analog outputs. It is an extremely
simple card. To use it you simply write to a particular address for one
of the analog output channels. The card itself consists of simple 74'
logic
and some DAC IC's.

The vendor of this device (it is part of a deformable mirror system
from www.OKOtech.com) even provided us with a C-program that
demonstrates
how to do this.

The problem is that the program is designed to be used in DOS, and we
use
windows NT, moreover we ideally want to use it in labview. Although the
vendors
have made a great piece of optics, they are not interested in (or don't
understand) the concept of making the device a usable product.

So now I am asking for some ad
vice or guidance in how to solve this
problem. The
following is the header of the essential part of the code; the part that
needs to
be translated. It is designed to be compiled by borland C++ 2.0. I would
like to
be able to do the following in labview or in C on a windows NT machine.

#include
#include
#include
#include
#include

/* board address: */
int base=0x300;

/* The thing I need to translate */
void set_dac( int some_voltage ) {
int some_address = 20;

outportb( base + some_address, some_voltage );
delay (1);
}


It appears the the only thing I need to find the equivalent of is
"outportb"
which is defined in dos.h in the Borland compiler. I think it is known
as
"outp" in the old microsoft C compiler.

Is there a way to do this in Labview or in an up-to-date compiler? Can
it even
be done in windows NT? Will it be a colossal hassle to do correctly?

Thanks,
-A.
0 Kudos
Message 1 of 11
(3,725 Views)
***************
This is a repeat of the previous message: Sorry about
the line breaks!!
***************


Hi,

We have an ISA card that has 19 8-bit analog outputs.
It is an extremely simple card. To use it you simply
write to a particular address for one of the analog
output channels. The card itself consists of simple 74'
logic and some DAC IC's.

The vendor of this device (it is part of a deformable
mirror system from www.OKOtech.com) even provided us
with a C-program that demonstrates how to do this.

The problem is that the program is designed to be used
in DOS, and we use windows NT, moreover we ideally want
to use it in labview. Although the vendors have made a
great piece of optics, they are not interested in (or don't
understand) the concept of making the de
vice a usable product.

So now I am asking for some advice or guidance in how to
solve this problem. The following is the header of the
essential part of the code; the part that needs to be translated.
It is designed to be compiled by borland C++ 2.0. I would like
to be able to do the following in labview or in C on a windows
NT machine.

#include
#include
#include
#include
#include

/* board address: */
int base=0x300;

/* The thing I need to translate */
void set_dac( int some_voltage ) {
int some_address = 20;

outportb( base + some_address, some_voltage );
delay (1);
}


It appears the the only thing I need to find the equivalent
of is "outportb" which is defined in dos.h in the Borland
compiler. I think it is known as "outp" in the old microsoft
C compiler.

Is there a way to do this in Labview or in an up-to-date
compiler? Can it even be done in windows NT? Will it be a
colossal hassle to do correctly?

Thanks,
-A.
0 Kudos
Message 2 of 11
(3,726 Views)
Under Windows 3.1, 95, or 98 you can use the the outport and inport vi's to
read and write to the card registers. These vi's don not function under
Windows NT because of the hardware abstraction layer. There have been some
work around dlls and such to allow the use of inport and outport methods
under NT.


>The problem is that the program is designed to be used
>in DOS, and we use windows NT, moreover we ideally want
>to use it in labview.
0 Kudos
Message 3 of 11
(3,726 Views)
B & C Duffey wrote in message

> [ .... ]
> There have been some
> work around dlls and such to allow the use of inport and outport
methods
> under NT.
>
>

Thanks to everyone that responded! I found exactly the right work-around
in the labview knowledge-base: document ID: 0SBF6I38

-A.
0 Kudos
Message 4 of 11
(3,727 Views)
I was directed to this thread by an associate helping me investigate a similar issue. Unfortunately, it looks like the knowledge base article referenced (0SBF6I38) is no longer on NI.com (at least a search couldn't find it). I am guessing that this is because this thread is so old, the archives must have been cleared or something. Is there anyone out there who can point me to where I can get these .dlls? Also, does the same problem exist in XP??

Thanks
Keith Brainard
Bloomy Controls
keith.brainard@bloomy.com
0 Kudos
Message 5 of 11
(3,705 Views)
Hi Keith,

The KnowledgeBase you are looking for has been assigned a new reference. You can access it here:

  • Using In Port and Out Port in on Windows NT/2000/ XP and Accessing Hardware Registers
  • - Philip Courtois, Thinkbot Solutions

    Thinkbot Solutions
    0 Kudos
    Message 6 of 11
    (3,687 Views)
    And as the KB article says, you only need to do this with LabVIEW 6.1 or lower. With LabVIEW 7 or above, you don't need the replacement In Port and Out Port functions.
    0 Kudos
    Message 7 of 11
    (3,685 Views)
    I saw that... so I must be doing something wrong here. I have Win2000 and LabVIEW 7.1, but don't seem to be getting the responses that I want. The documentation for the ISA card I am trying to talk to says to read (for example) 0x310. So that means I would wire in 0x310 to the address input of In Port.vi, right? Or is there some base address or something like that I need to know?

    Thanks for the help.

    Keith
    0 Kudos
    Message 8 of 11
    (3,677 Views)
    Hi Keith,

    As far as I remember, the Port VIs need the Base address of the installed card. You should be able to get this address from the Device Manager in Windows 2000 and XP. Notice that the Port VIs are polymorphic, so you have to specify the size of the data that you want to read/write by right-clicking and choosing "Select Type".

    Good luck!
    - Philip Courtois, Thinkbot Solutions

    Thinkbot Solutions
    0 Kudos
    Message 9 of 11
    (3,660 Views)
    ksbrain wrote:

    > I saw that... so I must be doing something wrong here. I have Win2000 and LabVIEW 7.1,
    > but don't seem to be getting the responses that I want. The documentation for the ISA
    > card I am trying to talk to says to read (for example) 0x310. So that means I would wire
    > in 0x310 to the address input of In Port.vi, right? Or is there some base address or
    > something like that I need to know?

    Also remember that ISA cards typically have jumpers which define the
    base address under which they react. They also typically require some
    sort of manual interaction in the Windows Plug&Play device manager to
    inform this instance about the presence of such a device, so that it can
    account for that and doesn't accidentially assign those resources to
    some P&P hardware.

    Can you verify with another software that the board is aproachable under
    the sugested address?

    Rolf Kalbermatter
    Rolf Kalbermatter  My Blog
    DEMO, Electronic and Mechanical Support department, room 36.LB00.390
    0 Kudos
    Message 10 of 11
    (3,641 Views)