03-23-2014 09:33 PM
Hi Lynn,
my txt file contains just one column of trajectory data with no references to time. My idea was to take one datum per iteration of the while loop and "set" the speed of the process by varying the time delay of the loop with the vi "wait". Conceptually this must be works, is it right?
Today I'm trying to use "simulate arbitrary signal" instead of "read from measurement file" but the first tests were not so promising
Thanks again for the support
03-24-2014 04:26 PM - edited 03-24-2014 04:26 PM
OK. Now we know what you are doing in enough detail to make some progress.
Thw while loop timing is driven by two factors. One is the DAQ timing. That will always take 100 ms or slightly more. (100 samples at 1000 samples/second = 0.1 second.) The second is the Wait (ms) function. It is also set to 100 ms. It essentially runs in parallel to the other code, which is dominated by the DAQ timing. So shortening the 100 ms wait has no effect because the DAQ always takes at least 100 ms. If you lengthen the wait to values greater than 100 ms, you should see a slowdown effect.
Note that this is what crossrulz was suggesting in his initial reply.
If you want to run somewhat faster, follow the suggestions crossrulz gave in his reply to your original post in this thread. If you try to go faster than ~50-100 iterations per second, you may begin to see jitter and timing error due to OS latencies.
Lynn
03-24-2014 07:41 PM
Hi Lynn,
I tryed to follow the suggestion of crossrulz but nothing happened; using the continuous sampling I had a slight improvement of the speed but not as I want (as the simulate signal does). Anyway this morning I tryed again: I remove the wait vi (in order to remove some possible conflict), I put in the DAQs 10 samples at 1000 samples/second = 0.01 second, is it right? In this way I should have a perceptible increasing of the speed but nothing happens yet. Please correct me if I'm misunderstanding your advices...
03-24-2014 08:37 PM
Yes, that should make the loop iterate faster. Wire an indicator to the "i" terminal of the loop. That will give you a direct indication of how fast the loop is iterating. If you do not see a substantial difference, then something else is limiting the speed of the loop.
Lynn
03-25-2014 04:07 AM
Hi there,
finally I have got the solution. The main problem was that at each iteration the txt file was loaded entirely and after was taken just the needed value (this is because I cannot saw strange behavior in the signal with the use of the grapg). The solution was to put out of the while loop the DDT and maintaining inside the loop the "index array". At last, the way to manage the speed of the process was, as suggested by crossrulz and Lynn, by varying the values inside the DAQs.
Thanks to all,
Flavio