Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Computer generated lag when using NI USB-6215

Hello all,

 

I'm having a kind of annoying problem that due to my not-so-advanced programming skills I can't solve. The story goes like this. I'm controlling a stepper motor through the NI USB-6215 board by using one of the output digital pins as a frequency counter. Each time I want the stepper to move, I send out a train of pulses using a DAQmx task. I have it configured in retriggerable so that with a set of digital out & digital in pins I can trigger it whenever I want. So far it's working fine.

 

Now, the problem I'm having is the following: the stepper drives a linear belt, and I want to know how many steps are needed to move the belt along its entire range. For this, I have a basic "move one step" function, which I loop until I hit the end. Again, this scheme works fine. However, while I'm in this loop, I am having a lot of "interference" from the PC, particularly the graphics card (I assume). Mainly, if I change the active window on my screen (such as popping up Google Chrome on top of my VI's front panel) I can very clearly see that the stepper stops for a little while. My guess is that there is some sort of resource battle in my PC and while switching windows the LabView VI I'm running stops receiving attention.

 

My question is, do any of you guys know how to fix this, or at least how to mitigate the effect of parallel PC activities on the execution of a VI? I'm guessing that it's not something completely new, but I really don't know where to start looking for answers.

 

Thanks a lot!

 

Hugo

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

Hi Hugo,

 

The description that you gave from your program seems logical to me, I have one question, are you using a counter to generate the pulse train? If so, are you using a DAQmx timing VI in your program?

 

It seems to me that your program is software timed so you are depending on the resources from your computer to set the timer for your application, the DAQmx timing VI will help you use the hardware timing instead.

 

Please refer to the daqmx example located here: Open the NI Example Finder and go to Hardware Input and Output » DAQmx » Generating Dig Pulse Train-Buff-Implicit-Cont.

 

Regards,

steve.bm
AE | NI
0 Kudos
Message 2 of 6
(3,171 Views)

Hi Steve,

 

I'm doing something similar to what is suggested in the LabView example, though not entirely. I've attached my VI to make it clearer. I'm not using this PWM function or writing to the output channel.

 

Are there any errors in what I'm currently doing? To make sure it's clear: what I need is to generate a clock-like signal of 10kHz but only at 10 pulses at a time. Each set of 10 pulses is written to the output whenever I trigger the task externally

 

 

 

PS: I was just looking around and realized that the VI I built (by pure chance) looks a lot like the Gen Dig Pulse Train-Finit-Retriggerable.vi from the LabView examples, in case it helps

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

Hi Hugo,

 

I would make two different suggestions to your code, remove the DAQmx  Control Task vi, and add the rest of the code that goes after the DAQmx Start Task VI. So far the retriggerable feature is not working because the VI runs only once, so you need the while loop. You also need the clear task vi to remove all references and release the resources.

 

Regards,

steve.bm
AE | NI
0 Kudos
Message 4 of 6
(3,160 Views)

Hi Steve,

 

I'll remove the Control Task VI, but regarding the other features, I do have them though in other VIs (i.e. there is a initialization VI, a triggering VI, and a stop VI, which has the clear task, etc.).

 

To give you an idea of what the basic testing VI works: I initialize the DAQmx task with the VI I sent; then I have a loop in which I generate the triggering pulse through a set of digital input/output pins; and finally (outside the loop) I stop and clear the task. The triggering VI already includes a waiting time to make sure that the pulse generation is completed succesfully before triggering a new train of pulses.

 

This is the basic structure that seems to be affected by non-LabView processes on the PC (mainly graphic card related?)

 

Any suggestions?

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

Hi Hugo,

 

I still believe that the problem is the configuration of your task. Have you tried everything in the same VI?

 

The graphic card might be causing the problem as you mentioned, try turning off any hadware acceleration that you have (windows aero, themes, etc), try to monitor your system use, and the services and programs running, also try to run your antivirus, you never know if there is a virus in your system using resources.

 

Regards,

steve.bm
AE | NI
0 Kudos
Message 6 of 6
(3,153 Views)