From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

simultaneo​us analog output with USB-6353

Hallo,

 

I have 3 different waveforms (different length). I want to send them simultaneously to the analog ouput.

I want to adjust a propertys (like rate, samples) seperately for each channel.

My first trial is shown in the attachement, but it just works when all waveforms are identical.

 

Is there an other way?

 

0 Kudos
Message 1 of 8
(2,600 Views)

Hi,

 

I have had a little look at the VI you provided and it looks like you are trying to write different samples to each channel within one task. This is possible but if you want separate timing information for each channel you would need a separate DAQmx task for each channel.

 

You can set them to all start simultaneously with separate clock settings.

 

You will end up with 3 DAQmx write VIs with the data for each channel individually wired to each.

 

Let me know if this helps.

Nick
0 Kudos
Message 2 of 8
(2,593 Views)

I created an additional task for the other channel. An error occured which said "Buffer is to small", so I added an function to set the buffer size. Next error occured.

 

I this the right way to parse data simultaneously at all, or is it better to use a different structure and which structe am I supposed to use?

 

Great thanks

0 Kudos
Message 3 of 8
(2,588 Views)

Hi again,

 

I would say the structure is ok, some things appear to be unneeded but without knowing your final application and desired results I can't really say.

 

Setting the buffer size shouldn't be required. I think some of your problems are because you are setting the DAQmx Write VI to the wrong type.

From the drop down menu select, Analogue --> Single Channel --> Multiple Samples --> Waveform.

 

You will need to set auto-start to false also.

 

Let me know how you get on.

Nick
0 Kudos
Message 4 of 8
(2,581 Views)

Hi,

 

I adujsted the setting you have said (DAQmx-write VI) but when I start this subvi I get an error message that the ressource is already reserved (error code 50103).

0 Kudos
Message 5 of 8
(2,574 Views)

Hello, good morning,

 

I do apologise but reading back through the posts I realise I have made a slight error. The device you are using has only 1 analogue output hardware timing engine. Therefore you cannot set different sample clocks for different analogue outputs on the same device.

 

Depending on how fast you need to sample, one option could be to time the output in software if you definitely require different sample rates, maybe looking at the 'Gen Mult Volt Updates-SW Timed.vi' in the example finder as a starting point.

 

Otherwise the approach you used before should be ok but remembering that the input buffer will be read at the same rate by all the channels.

 

As I say, sorry again and let me know how you get on.

Nick
0 Kudos
Message 6 of 8
(2,552 Views)

Hi again,

 

so I worked on my Subvi again. Maybe I should tell a bit more about my purpose on this project. I want to output 3 diffent waveforms (all of them have a frequency at about 125kHz), I fixed the sample rate to all of them equally. 

When I start this Subvi, I dont get any error's but it still doesn't work the way it should. When I connetc a scope to the analogue output the waveform on the first channel where the DAQ-mx-timing is connected to is ok. The second one is wrong, the signal-frequency is about 60Hz.

I dont have any idea's what else I can do?

Thanks for your help.

0 Kudos
Message 7 of 8
(2,537 Views)

Hi again,

 

Only when using 'use waveform' timing type will the task look at the waveform timing information to decide when to output a sample. As you are using sample clock mode this will simply output the next data value in the waveform on each sample clock. Therefore the frequency of the waveform will depend on the number of samples in each period. You have set the sample clock to the same frequency as the sample rate in the first wave so this one will be correct. 

 

You may need to adjust how you create the waveforms in the first place to ensure you get the frequencies you want.

 

 

Nick
0 Kudos
Message 8 of 8
(2,487 Views)