11-04-2009 01:36 PM
You are getting the error message when you try to iterate your loop more than once because you create your tasks inside the loop, but don't clear them until after the loop is finished executing. Create your tasks outside the loop. Run them inside the loop. Stop and clear them outside the loop.
BTW, what is that empty sequence structure for?
11-04-2009 01:37 PM
Yes, and no.
That was part of the code, which was to loop my array. And that part is solved in that thread.
However, when I combine it with the rest of the code (in the vi attached) i get an
error, so I though that instead of putting the code all inside the For Loop I could use the
value of each iteration (not possible according to answers in this tread) and place the rest of the code outside of the For Loop.
So I'm back with the code inside the For Loop. Getting an error 200010... I think it's a buffer problem.
Just don't quite get out to fix it.
Hope I have not reposted.
Cheers.
11-04-2009 01:38 PM
11-04-2009 01:41 PM
The empty structure, I used from examples that I got by searching the forum. But
if it's unnecessary, than I will remove it.
By the way, the "write" and "read" vi's should be inside the loop, only the tasks created (DO,DO, AI) stay on
the outside, correct?
Rsilva
11-04-2009 01:48 PM
aeastet i'm using version 8.5.
could you upload it again, please?
cheers
11-04-2009 01:59 PM
11-04-2009 06:01 PM
I believe this is it.
Not sure about the AI Read being out of the cycle because I need to read 16x14 measurements
but it's close enough, since my doubts were about the For Loop.
I might need to read more about arrays and loops.
Anyway, thank you aeastest and DianeS
Cheers!
11-04-2009 09:15 PM
Ah, may I ask a question with regards to your analog acquisition? (apologies for chiming back in late, I've been onsite for a client all day...and sorry for missing this on the first go 'round)
Your sample clock specifies that you want to collect 1000 samples, at a rate of 1kHz.
Your "Read analog input" function is set to "N channels 1 sample".
That means you're only reading one sample per channel. Not 1000, as your clock configuration would indicate.
If you want to read 1000 samples per channel, you need to use "N channels N samples". Your output will be a 2D array, containing 1000 samples for each channel.
If you're only reading one sample per channel, what do you need a sample clock for? Stick the "Read analog input N channels 1 sample" inside your FOR loop, but get rid of your sample clock configuration. You don't need hardware timing to read a single sample.
In other words, if you really only want one sample per channel and you want your analog input read to be synchronized with your digital output, do it as shown in the attached VI.
Sorry if this is irrelevant, but you did express a concern with having those acquistions synched with your digital write.
11-05-2009 09:29 AM
No need to apologize DianeS! I'm thankfull to you for taking the time to clear my doubts.
I have one request. Could your upload to version 8.5?
Thanks you.
RSilva
11-05-2009 10:35 AM
Sure, here you go.