07-20-2012 09:13 AM
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
07-23-2012 02:29 AM
nobody can help me?
07-23-2012 11:31 AM
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!
07-24-2012 06:32 AM - edited 07-24-2012 06:36 AM
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. (
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.
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 😉
07-24-2012 11:38 AM
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'.
07-24-2012 09:08 PM
I know that...
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
07-24-2012 09:46 PM
07-24-2012 10:20 PM - edited 07-24-2012 10:23 PM
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?
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
07-25-2012 10:47 AM
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.