Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

digital output hardware or software?

I'm using a pxi-6534 to do a digital output.  I'm hoping to use is as a sort of serializer (set values in software, and spit them out the DIO serially).  It also needs to by synchronized with an external clock and trigger. 
 
1) In my code, it appears to be synchronized with my external signals and running on it's own at the loop.  Is this looping in hardware or software at this point?  For example if i decided to run other processing heavy Labview vi's during this loop, will my sychronization be off, or will it skip trigger pulses?
 
2) If it is indeed hardware, is there an easy way to start this loop, and have it continue, without actually using the while loop.  The loop stops when the vi finishes wether the DAQmx Stop Task is there or not. 
 
3)It appears to hang up, or slow down at the DAQmx subvi.  It takes 10 to 20 seconds to get through it.  My test clock is 1MHz and the trigger is every 200 counts, so the delay shouldn't be from my timing.  Any ideas why?
 
Thanks,
 
Matt
 
 
0 Kudos
Message 1 of 5
(3,159 Views)

Hi Matt,

1. Your While Loop rate is software, (controlled by the 50ms wait you added) but the 6534 is generating based on the clock you provide. It is regenerating your data from onboard memory, so any other loops/processes within LabVIEW should not affect performance. You will not miss external clock pulses as long as they are within the sampling rates of the boards.

2. You don't need the loop - you're not currently doing anything that is effecting the card. As long as you wait until the end of the program to stop and clear your task, your generation with continue. You will need to use datalow programming to ensure that all of your other code executes before you stop, but that should just be a matter of wiring things through.

3. Which subvi? - your program has 7 Smiley Happy but I can't see a case where any of them would cause a 10-20s delay. Are you looking at this with highlight execution enabled?

Hope this helps, feel free to post with additional questions.

Andrew S

National Instruments

0 Kudos
Message 2 of 5
(3,140 Views)
Thanks, that answers the most important of my questions.  For question 2, Is there a way to start this program and get my digital output to continue repeating after the Labview vi is finished.  For example, I can use the DIO to set bit 2 on port 0 to high or low, and it stays in that state until I change it, or reset the card.  I'm only using the loop in this program as a delay.  The digital output continues to repeat itself after the DAQmx Write, but the digital output always stops when the vi completes.
For question 3, I meant the delay comes during the DAQmx Write subvi.  When the program is running normally ( no light bulb), I see a delay from when the program starts to when the digital output starts.  When I use the light bulb, the delay appears to be at the DAQmx Write.  This isnt' too critical, i'm just curious.
 
Thanks again for the help.
 
-Matt
0 Kudos
Message 3 of 5
(3,133 Views)

Hi Matt,

The line states should not change after you exit LabVIEW. So if you set a write out a single value, and exit LabVIEW, the value should stay on the lines until you exit. If you are writing a waveform, it will stop on the last value generated. In order to continue writing the generated waveform, you need to continue running the vi.

For your delay, you may want to consider disabling the autostart - you're starting again right after it. You may also want to take a look at this Forum Post. It may be a case where you can lower your buffer size so it's not writing out to all of your memory.

Hope this helps,

Andrew S

0 Kudos
Message 4 of 5
(3,119 Views)

The post you suggested helped.  Changing the buffer size took out the delay i was seeing.

Thanks for you help.

-matt

0 Kudos
Message 5 of 5
(3,112 Views)