Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

analog output with digital output

Hello there,

 

I have a while loop in which contains an analog output for one channel with n samples. The application is basically the example 'cont gen voltage wfm-int-clk-non-regeneration'.

Now... I want to add a digital output for n channels with n samples which should be ideally a boolean array. The boolean value for each channel per sample is dependent if my analog output sample has a positive or negative number.

 

I know how to do it for only one sample because I can actually output a boolean array but with n samples i only can output a bit array. Is that basically the same?

 

To give you the bigger picture the whole software should drive an AC actuator which needs a true or false in order to tell in which direction it should go. it does not know negative values.

 

Thank you guys!!

 

Cheers

0 Kudos
Message 1 of 9
(3,408 Views)

nobody can help me? Smiley Sad

0 Kudos
Message 2 of 9
(3,398 Views)

Hello Deus,

 

I imagine that you’re using one of our examples for digital generation. Can you please tell me which one are you using? And if no, can you please post an image of your code? Are you trying to write the boolean array using the analog task?

 

Have a good day!

0 Kudos
Message 3 of 9
(3,386 Views)

hello amezam,

thanks for your help. i attached a simplification of my code.

 

the first picture is basically what i can do already, but it is a fixed input array. I can not change the array on the fly. ( 

 

 

1.jpg

But this is what I really want to do... I only do not know how to output boolean array for n samples. Look where the ??? are. The code below should do basically the same thing but you can change values during the system is running.

 

 

1 - Copy.jpg

 

I hope this all makes sense... 

 

If you have any questions let me know... I can try to explain it better.

 

Cheers 

 

PS: I am not a pro in labview but i try my best 😉

0 Kudos
Message 4 of 9
(3,376 Views)

For your first example, simply click on the input of the DAQmx Write and select 'Create>Control'. You could have also clicked on either of your constants and selected 'Change to Control'.

0 Kudos
Message 5 of 9
(3,370 Views)

I know that... Smiley Wink

 

my problem is a different one. The first example I understand and I know how I can process 1 sample at a time. In contrast, in the second example I do not know how to connect it to the digital output (see question mark in pic) in the right way to make it work for n samples. The second example should be analog to the first example (but processing n samples)

 

It would be great if somebody could help me out.

 

cheers

 

 

 

0 Kudos
Message 6 of 9
(3,358 Views)
For the second example, you chose to output a 2D array of U8. So, you can use that as a control or change the DAQmx write to output a 2D Boolean array.

Your analog write in the second example is goofy. You generate a waveform data type and then convert it. Why not just use the DAQmx write to output a waveform?
0 Kudos
Message 7 of 9
(3,355 Views)

Thanks for your answer Dennis. I wired it all up and I am wondering if this version would work. Does this example guarantee that the analog and digital output write the array at the same time. For exapmle: Is the 21th analog output sample of N-samples written at the same time to the actuator than the 21th digital output sample for the seven lines?

 

 

sol.jpg

 

I know that the conversion is goofy in this reduced application. It would make more sense to you when you would see the whole program. I have some ramp up/down functions which force me to use the DAQmx write to output an array.

 

Thanks for your help.

 

Cheers

0 Kudos
Message 8 of 9
(3,353 Views)

So what you are asking about is really synchronization and has nothing to do with the problem in your first post.

 

No, the image you attached would not be synched at all. I am not 100% sure but the digital output (assuming it supports it) would have to use the same clock as the analog output. I cannot find an example of synched ao and digital but there is Multi-Function-Synch AI-Read Dig Chan that might be similar enough.

0 Kudos
Message 9 of 9
(3,347 Views)