LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI DAQmx 6534 pattern generation

The NI 6534 card lets one load a pattern to its onboard memory and then it
can continually output the data independently, and let the cpu do something
else. I believe later 653x cards also do this.

In our lab, we are using the 6534 to output a pattern that flashes some
LEDs. I have this working using CVI and Traditional DAQ, but we would like
to convert this to DAQmx to be able to use newer 653x boards which are not
supported by Traditional DAQ. I am using CVI 8.5 and DAQmx 8.9.5 (I think)

on Windows XP.


I have tried unsuccessfully to convert my old program to DAQmx. The new
program compiles and runs, but produces no output. It was difficult to
write this program. I have not found any documentation that clearly
explains the steps necessary to do continual pattern generation in CVI. I
have also not found any CVI example programs. There is an example using
Labview on the NI website.
I was able to look at how it was done there, and attempted to convert the
labview commands to their corresponding C functions. However, I don't
understand labview very well and no doubt made a mistake at some point.

My requests to the forum are:

1. Does anyone know of any CVI examples? There must be some examples from
   NI! Or maybe you have working code you would be willing to share?

2. Do you know of any documentation that clearly explains the steps
   required to do continual pattern generation with the 653x?

3. As a last resort, I plan to attach a zip file containing two short
   programs, 6534_patgen.c that uses Traditional DAQ and DOES produce
   output, and mx_patgen.c that uses DAQmx and does not work. If you feel
   like it, please take a look and tell me what I'm doing wrong. (If you
   actually go insane and try to run my programs, there is another file in
   the zip archive called Std2Region.pat. It contains the pattern we load
   into the 6534.)

4. Any other suggestions?

Many thanks in advance.

0 Kudos
Message 1 of 6
(3,672 Views)

lomed,

 

NI DAQmx should have installed several examples that can be found through the CVI Example Finder (Help>>Find Examples). Look in the Hardware Input and Output/DAQmx directory. Specifically the examples on Digital Generation or Generating Digital Pulses may be relevant to your project. They can at least show you what the architecture of a DAQmx application in CVI looks like. Keep in mind that it does have a different program flow than the LabVIEW examples you have been looking at.

National Instruments
Message 2 of 6
(3,660 Views)

Thanks for your reply, D Biel.

 

I looked over the examples, but didn't see anything dealing with continuous regeneration of

data from the onboard memory.

 

 

0 Kudos
Message 3 of 6
(3,646 Views)

The ContWriteDigPort-ExtClk.prj example is almost identical to the LabVIEW example you linked. The only difference is that the CVI one does not specify to use onboard memory. You can do this with the following line of code:

 

DAQmxErrChk (DAQmxSetChanAttribute (gTaskHandle, "", DAQmx_DO_UseOnlyOnBrdMem, 1, NULL));   

 

National Instruments
0 Kudos
Message 4 of 6
(3,635 Views)

Is that the equivalent of

                DAQmxSetDOUseOnlyOnBrdMem(Task, Chan, 1);

If so, it is already in there. Anyway, I tried doing it your way and the program

still didn't work.

 

If you have the time, please take a look at  mx_patgen.c in the zip file I attached above.

Maybe you'll see what I'm doing wrong.

 

Thanks,

     Lomed

 

 

 

0 Kudos
Message 5 of 6
(3,629 Views)

Hi lomed,

 

The 6534 is an older HSDIO board. For newer applications we're actually recommending the PCIe-6536/7 (just throwing that bit of information out there). The 6534 is an HSDIO board, but it does not use the HSDIO driver, it actually uses the daqmx driver. Examples for it can be found at the location that D Biel sent you to. The only examples that I know of for the continous pattern generation would be in that digitial generation folder that he sent you to. 

 

I've opened up your mx_patgen.c file and am starting to look through it. Are you getting a specific error with this? (A screenshot would be best here), or is it just not generating anything? If it's generating an error, try searching our KnowledgeBase for that error and post a screenshot of it here. If it's not generating anything, can you post a picture of your plot? Is it at least giving you noise?  Maybe we can use a stepthrough debugging meathod to narrow down where the issue is happening. Then we can troubleshoot much more directly from there.

 

Are you able to use any of these generation examples even to generate a non-continuous pattern?

 

In regards to documentation for transitioning to daqmx, check out the DevelopmentZone article on transitioning to DAQmx from Traditional NI-DAQ. The related links will bring you to parts two, three, and four of this. Additionally there is a tutorial for using NI-DAQmx in LabWindows/CVI. 

 

Hope this helps!

 

 

Lea D.
Applications Engineering
National Instruments
0 Kudos
Message 6 of 6
(3,609 Views)