03-19-2009 04:07 PM
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
03-19-2009 05:16 PM - edited 03-19-2009 05:17 PM
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).
Blog for (mostly LabVIEW) programmers: Tips And Tricks
03-19-2009 08:05 PM
03-20-2009 11:32 AM
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.
03-27-2009 01:45 PM
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
03-27-2009 02:00 PM
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.
04-03-2009 12:28 PM
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?
04-03-2009 12:46 PM
04-03-2009 12:58 PM
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.
04-03-2009 01:04 PM
Blog for (mostly LabVIEW) programmers: Tips And Tricks