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: 

multiple daqmx read iterations not executing properly

Solved!
Go to solution

Hello all,

 

I am having trouble getting my new VI to run the way I want it to. The objective of the sub-VI is to measure the voltage drop across a component when a pulse is supplied for a user-defined time and then wait for a user-defined time afterwards. It completes this task exactly how I want it to; however, I need to set up a series of pulses with differently timed pulse lengths, wait times, voltages, etc. So right now I have a basic model of just executing this twice. When it starts the second iteration, it does a strange jump like maybe the second pulse is overwriting some of the ending values of the first pulse. Even more strangely, after the second pulse completes, it seems to re-run the first pulse. These behaviors are pretty clearly laid out in the graphs. I'm assuming the problem is in my Pulse sub-VI, but I'm not having much luck trying to debug this. I am using an NI 9264 for the pulse generation and an NI 9205 for data aquisition. Thanks in advance for the assistance.

 

Bradley

Download All
0 Kudos
Message 1 of 4
(2,341 Views)
Solution
Accepted by topic author riemer.j

Where is the second iteration happening? It is not clear from the code you have attached. Do you mean the second frame of the flat sequence? Why not place things in a loop? Now you only need once instace of the subVI.

 

First of all, your subVI Is extremely inefficient. To create the pulse data, you need to use a FOR loop and use autoindexing at the output tunnel instead of building the array element by element using insert into array. You could even use "pulse pattern" Instead.

 

I am not sure what the purpose of the single iteration FOR loop is. Currently it just acts as a glorified sequence frame.

 

All your DAQ configurations need to be done exactly once at the start of the program, and not every time from scratch inside the subVI. It would also seem more appropriate to use the same clock for the AI and AO. Currently there is no guarantee they are synchronized.

 

 

 

 

 

Message 2 of 4
(2,332 Views)

Yes, I was just meaning the second frame.

 

Hmmmmm. I think I see what you are saying. Maybe I could place all of the user defined values into arrays and then call them when necessary to create a single waveform instead of repeatedly iterating the whole program?

 

Alright, I'll change it to a for look and look into using the pulse pattern. This seems like a good lead. I noticed that it was taking quite a while to execute, but it was working so I was afraid to mess with it.

 

Should I change my for loop to a sequence frame and just put all of my daq configurations before it? As for the timing though, I figured they would both be the same since it is using the waveform timing. If that isn't the case though, how can I use the same clock for two different tasks?

 

By the way, this is a lot of help. Thanks a lot. 

0 Kudos
Message 3 of 4
(2,328 Views)

Great suggestions. I got it to work exactly how I want it to now. Everything runs much more smoothly now as well. Thanks for the help altenbach!

0 Kudos
Message 4 of 4
(2,306 Views)