LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to setup DAQ to send data line by line

Solved!
Go to solution

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

 

 

0 Kudos
Message 1 of 19
(3,327 Views)

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.

0 Kudos
Message 2 of 19
(3,318 Views)

<double post>

0 Kudos
Message 3 of 19
(3,318 Views)

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? 

0 Kudos
Message 4 of 19
(3,306 Views)

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

 

 

0 Kudos
Message 5 of 19
(3,271 Views)

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

0 Kudos
Message 6 of 19
(3,268 Views)

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.

0 Kudos
Message 7 of 19
(3,264 Views)

Please find attached my vi

 

 

 

0 Kudos
Message 8 of 19
(3,252 Views)

I should send the following data to DAQ. I am not sure if I can use that method

0 Kudos
Message 9 of 19
(3,248 Views)
I simply do not understand you now. The pattern is completely different from your first post and this last Patten does not make any sense to me. In your first post, you had each digital line either 1 or 0 for a write. Now you are specifying line states that make no sense. How can the state of a single digital line in a single write have a value of 5? Your use of a 2D array is just wrong.
0 Kudos
Message 10 of 19
(3,235 Views)