LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Traditional DIO VI inputs

So I'm trying to update this very old application that uses Traditional DAQ.  I open a couple of VIs and have DIO Port Config, Read, Write, etc. to update.

I know (more or less) how to use DAQmx to accomplish the same, but I don't remember what input goes where, the traditional DIO Port Write accepts pattern to write and mask, but which one is which?  All I have is question mark block and no input/output names?  Cant' seem to find the info with Google or searching the forums, but it must be somewhere (and no I'm not going to try to install it on a Win7/64 bit machine just to find out.)

And obviously the code (which I have no interest in understanding) uses pattern and mask programmatically all over the place, and there's no direct DAQmx functionality for that without decoupling the writes...

0 Kudos
Message 1 of 8
(4,428 Views)

Look in http://www.ni.com/pdf/manuals/320997d.pdf page 16-2 and see if that information helps.

0 Kudos
Message 2 of 8
(4,411 Views)

Doesn't seem to be the ones I'm looking for.  That is for something that may be called Dig Port ..., the one I'm looking for is DIO Write, DIO Read, DIO Port Config.  DIO Write seems to have a task id, pattern, mask and error in on the left inputs, but that's a guess, it could be just as well be task id, mask, patter, error ...

Going though http://www.ni.com/manuals/ but it ain't easy.

0 Kudos
Message 3 of 8
(4,393 Views)

Hi instrumento,

 

Transitions from NI DAQ to NI DAQmx is interesting because not all the functions have an exact match between the two set of drivers, you can read this tutorial to understand more aspects of your transition.

 

In your case I would recommend you to open the examples that comes with NI-DAQmx and find an example that works as your code was working and use it as a reference, you can also go to ni.com/code for examples that we have online.

 

 

Regards,

steve.bm
AE | NI
0 Kudos
Message 4 of 8
(4,353 Views)

I've done several conversions from DAQ to DAQmx, so I'm familiar with the concepts. What's bugging me is that I don't have Traditional DAQ installed anywhere and when I open the code I see this(after I ask LV to show me the label):

dio-port-write.vi.jpg

 

where the top lines are task ids in/out, the bottom lines are error in/out, and the other two are value to be written (top) and mask (bottom), OR ...  is it the other way around?

 

So the question was more where are the help files for whatever version of Traditional DAQ included a VI called DIO Port Write.vi so I can figure out what is what.  There have to be around somewhere short of going back to a an old 32 bit machine and install some old LV and DAQ!

 

As far as this particular old code, there are several instances where the mask is used like the above, and that makes it interesting in converting as "mask functionality" is nowhere to be found.  I'm writting a wrapper that does a for loop on the bits and task IDs, not sure if that's the best way to achieve single bit manipulation with DAQmx or not.

 

And the next step is to convert a bunch of calls to external DLLs that call C code that eventually were linked to nidaq32.dll 🙂  Ah, the fun

 

 

0 Kudos
Message 5 of 8
(4,349 Views)

Look at http://www.ni.com/white-paper/4342/en especially figure 5.  It shows the data to write to be closer to the top of the VI.  It doesn't show the mask input, nor talk anything about, perhaps it is there and is towards the lower part of the VI.  If it is there and unwired, I can only assume it is masked that allows all bits to be written.  (I'm also assuming the purpose of the mask it to cause some of the bits or digital output lines to not be changed no matter what the data is going in.)

 

If that is the case, maybe what you need to do is rewrite that bit of code so that it goes through the individual lines in a loop writing out an output depending on the setting of the mask instead of trying to write the entire port in a single VI that the old DAQ functios appears to do.

0 Kudos
Message 6 of 8
(4,331 Views)

 Transitions from NI DAQ to NI DAQmx is interesting because not all the functions have an exact match between the two set of drivers, you can read this tutorial to understand more aspects of your transition.

And is there a tutorial anywhere to help people convert C code that called nidaq32.dll exported functions like, e.g. Get_DAQ_Device_Info, DIG_Port_Config, DIG_In_Port, DIG_Out_port and Get_NI_DAQ_Version to whatever replaces it in NIDAQmx.dll?  I know I could probably do all of that in LABview, but then I'd have to convert all the remaining C code in the DLL I'm trying to interface to, and that calls nidaq32.dll functions...

0 Kudos
Message 7 of 8
(4,330 Views)

I've seen that, and as you I'm assuming the mask is a left input below the data to write input, which is not shown in that paper but that LV shows (unnamed) when I open the code.

I just wanted to make sure before I try this on, as I don't want to fry anything in the board I'm talking to.  And yes, I've already broken up the code into a loop...

0 Kudos
Message 8 of 8
(4,327 Views)