LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DIO Port Write/DIO Port Config

Hello;

 

I'm an absolute beginner at LabView, trying to bring an old VI (version 5.1.1) up to speed on another computer running Labview 8.5.

 

It's been mostly successful except for one thing: there is a subVI which uses the functions DIO Port Config and DIO Port Write. I have tried to replace them with what I can only assume are their equivalents: niHSDIO Write Script and niHSDIO Configure ???.

 

There are a lot of options for "Configure," none of which is an obvious fit.

 

I have seen other posts asking about these DIO Port files, and the suggestion there was to update the software to handle traditional DAQ so that the old DIO's would work. But I do not know how that could be done.

 

Thanks for any help you can lend.

 

-Ian

0 Kudos
Message 1 of 31
(12,682 Views)

Some years ago, NI did a total revamp of the NIDAQ drivers, the result was NIDAQ-MX.  By and large, it's faster and easier than the old NIDAQ (now called "Classic" or "Traditional" ) .

 

However, some boards got left behind, because they weren't being made any more. For those you have to use Classic, they're just not supported in NIDAQ-MX.

 

Since Classic hasn't been updated in some time, there are some newer boards which it will not support. 

 

You have to figure out:

1... If the board is supported under NIDAQ-MX, then you could upgrade all your code to run under MX.

2... If not, you could downgrade and install Classic NIDAQ, and run your code more or less as it is.

3... It's possible you have some boards which MX will not support and some that Classic will not support.  I don't know if, or how well, you can run both.  You might have to upgrade the boards in that case (I am not sure).

 

Message Edited by CoastalMaineBird on 03-19-2009 05:17 PM
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 2 of 31
(12,662 Views)
I know under DAQmx 8.8 (LabView v 8.6.1), you can install both DAQmx and Traditional DAQ.  Just did it yesterday.
-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 3 of 31
(12,646 Views)

Hello Ian,

 

There are no direct correlations to DIO Port Config and DIO Port Write.  Instead, the functionality of these two VIs has been bundled into other VIs that are more multifaceted.  The DIO Port Config functionality is included when you create a new virtual channel.  If you place down a new DAQmx Create Channel, change the label to Digital Input or Output.  This is where you set the line direction.  The will be an input node on this VI called, "line grouping".  Right click on this node and select Create»Constant and the constant created will give you two options.  "One channel for all lines" and "One channel for each line."  The first option allows you to reference a port with one channel, and the second will allow you to interface with individual lines.  The timing (scans/updates) can be configured using the DAQmx Timing VI.

 

The DIO Port Write is handled with the DAQmx Write VI. You will need to change the label under the DAQmx Write VI to select the appropriate instance that you need to use.  To change it, left click on the label, and select, Digital»<single or multiple channel>»<single or multiple sample>»and then the form you want to write the line.  Where the DIO Port Write looked for a U32 to write values to the port, with the DAQmx Write VI can be configured to accept a variety of inputs including simple Booleans or Digital Waveforms.  

 

To try to piece together how to use these, I recommend looking at the shipping examples as there is a lot of this already done.  You can just take the code from there and adapt it to your VI.  
ColeR
Field Engineer
Message 4 of 31
(12,615 Views)

Thanks to all of you for your replies. Hopefully I can figure things out. The first thing I'm going to try is installing traditional DAQ and seeing if it works with Labview 8.5 and if it gets rid of my problem. Once I've installed it, how do I switch over to it from DAQmx? I can't seem to find the way to do that in Labview's menus.

Thanks again!

-Ian

0 Kudos
Message 5 of 31
(12,577 Views)

Ian,

 

To replace one for the other you need to actually rebuild your VIs using the DAQmx VIs.  It will be your actual card that you must set to use either tDAQ or DAQmx and you do this in Measurement and Automation Explorer.

ColeR
Field Engineer
Message 6 of 31
(12,573 Views)

Okay, after fiddling with trying to update the code to litte effect, I've decided to at least *attempt* a different tack.

I've taken the DIO Port Write/Config files and upgraded them from LabVIEW 5.1.1 to 8.5 by using an intermediate version (7.0).

Now at least when I load my main VI I can see these subVIs in the block diagram. Now only one problem remains: they are not executable because:

 

DIO Port Config.vi
    - The CIN referenced from this VI uses an external subroutine. External subroutines are no longer supported in this version of LabVIEW.

 

Does anyone know, is there a way around this, or am I going to have to bite the bullet after all and completely update things?

 

 

0 Kudos
Message 7 of 31
(12,515 Views)
What version of traditional DAQ did you install? None of the most recent ones use a CIN. If you installed the driver that came with 5.1, that was a mistake. Install the traditional driver that came with 8.5. That should be 7.4.4.
Message 8 of 31
(12,509 Views)

I highly recommend switching from Traditional NI DAQ to DAQmx drivers.  So much easier to maintain and distribute your application with the transducer and DIO information being configured in MAX while your code focusses on consuming DAQmx tasks.

 

It may be a pain initially to recode the project you are working on, but it will bring a lot of bennefits especially in regards to maintainability in the long run.

0 Kudos
Message 9 of 31
(12,505 Views)
I would also recommend switching to DAQ mx, but I disagree with having the configuration maintained by Max.  If you're writing a one-off sort of thing that's going to stay on that machine, fine. But if you're writing a program that'll be used on more than one machine, I suggest making it more self contained, i.e. you carry around your own config files and not import/export them from Max.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 10 of 31
(12,503 Views)