Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

USB6009 limitation in a while loop

Solved!
Go to solution

Dear labview colleages,

 

Good morning, 
I have some trouble with the hardware device USB6009 and the width time of a analog voltage output.

The algorithm (see picture) are included in a while loop and can generate a pulse during about 50ms without problem. My problem occured when I choose to decrease the time (length) of the pulse (<50ms). In this case the number of peaks (voltage pulse) become episodic and no pulse appear if I select 10ms.

If I delete all other additional calculations in the while loop (e.g. only the pulse algorithm is used for calculation) pulses of 4ms can be observed. 

I think that the problem is due to the time to calculate each while loop. I mean that the interrogation to check if the time has elapsed is performed at each loop itteration. So the pulse can not appear if the lenght of pulse is lower than one loop iteration.

 

My question is how to create a controlled-length pulse lower than one while loop iteration (50ms)?

I tested using event structure but the result is currently not good.

 

Please, if you have any idea don't hesitate to write a comment or a suggestion. 

Thank you in advance for your help,
Best regards, 

0 Kudos
Message 1 of 5
(5,517 Views)

Build up a waveform and write the waveform to your Analog Output.  By passing the entire waveform to the driver, the driver will put the data in a hardware buffer and the DAQ can then output based on a hardware timed clock, which is a lot more accurate than a software timed output.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 5
(5,491 Views)

The USB-6009 has only software-timed AO so the approach suggested by crossrulz will not work. 

 

As you have discovered software timing becomes increasingly unreliable as the times get shorter. You will always have some timing jitter and it maybe severe at times below a few tens of milliseconds.

 

It looks like any changes in the timing are driven by changes made by the user on the front panel. The best you will able to do would probably be to calculate the timing in a parallel loop and do only the writes in a DAQ loop. There is some overhead in the DAQ Assistant. You might gain a slight advantage by switching to the standard DAQmx VIs with only DAQmx Write inside the loop.

 

Lynn

Message 3 of 5
(5,485 Views)

Thank you for your message I will try to create a new version according to your suggestion 

If I can success I will post a picture for the other user.

Thank again for you help 

0 Kudos
Message 4 of 5
(5,464 Views)
Solution
Accepted by topic author matriax

Just for the other users,

I tested the solution purposed by johnsold. The gain in speed is very small and is about 1ms.
If the frequency is not the most important parameter, addition of simple hardware module to cut off the width of the signals send after the USB6009 could partially solve the problem.

 

0 Kudos
Message 5 of 5
(5,433 Views)