01-08-2014 10:14 AM
Hi
I need to send the following data line by line to DAQ. So first I should send the first line and then the second line and finally the third line. To do this I have used a for loop and I create and close a task in each itearation. This makes my program very slow . Is there another way to configure DAQ outside.
P0.0 P0.1 P0.2 P0.3 P0.4
Line1 10 5 3 4 2
Line 2 3 1 3 4 2
Line 3 5 3 2 3 2
Solved! Go to Solution.
01-08-2014 10:31 AM
Don't close the task after every loop iteration. Open it once before your program starts, and again when your program shuts down. Also, you can probably use DAQmx Write N Channels single sample, and write the entire row at once.
01-08-2014 10:31 AM - edited 01-08-2014 10:31 AM
<double post>
01-08-2014 10:42 AM
I don't understand the multiple posts about the same issue. You were shown how to do it with U32 values and told what modifications to try with Booleans. Now, you are attempting something else with what looks like a digital waveform. Of course you don't attach any real code for someone to look at - just a partial image. What was wrong with the previous answers? What are you trying to do now?
01-08-2014 03:38 PM
Hi I don't think I can send it with N channels since I need to send the data line by line. I moved the close out of the loop and it is better now , however it is still so slow and the reason might be calculations before sending data. I have attached screen shot of my VI
so as you can see I have 16 DAQ channels and 7 lines of code and I need to send them line by line to daq channels.
My data is in that 2D table and I really don't know what is the best way to send it. As you can see first I convert it to digital waveform and I send the data and probabely that is the reason the VI is very slow.
Could you please help me to optimize this code
Thanks
01-08-2014 03:40 PM
Hi , Dennis. sorry for sending multiple posts . I tried N channel N sample but seems like I need to send it line by line. However I still have problem in sending the data to WriteDAQmx . The code works in the way it has been implemented write now. However, it is very slow
01-08-2014 03:45 PM
Why are you making up your own code instead of trying the example you were already given? Your new code just does not make any sense based on what you have asked for. You've also been told that a big reason for the slowness is you start and stop the task repeatedly. What version of LabVIEW are you using? Even if you can't load the snippet, duplicating it should be fairly straight-forward.
01-08-2014 03:56 PM
Please find attached my vi
01-08-2014 04:04 PM
I should send the following data to DAQ. I am not sure if I can use that method
01-08-2014 04:36 PM