08-13-2015 06:40 AM
Hello!
I tried to build a trigger that fires a True value every 1000 miliseconds(starting from the first True );
that True commands the case structure to sample a value from the randomNrGen and place it in an array;
but I would like to USE that array and I cannot do that beacause I cannot get it out of the case structure.
AND:
the while loop skips samples; if you run the vi and look at the rate at which the array is filling, ypu notice it is not periodical: the first few elements are inserted at 1 second intervals but then it skips one;
could it be because of the 1ms waiting time?
1-How can I create a structure that does this:
IF it receives True, it samples a value from the random Gen. and puts it in the array
ELSE it does NOTHING, no zeros sent out to the array just wait for the next True and only the values sampled at True remain in the array?
2-How can I prevent it from skipping samples (multiples of 1000 in my case)?
In conclusion: I need to be able to take the samples out of the sample generator and store them in a 3d array in a zig-zag manner (1.jpg) but to even think about that, we need to get past the two issues stated above.
Please ignore the counter.
Please help me!
Solved! Go to Solution.
08-13-2015 07:00 AM
Hi TibiG,
I attach a VI that does what you're asking.
Good luck.
08-13-2015 07:04 AM - edited 08-13-2015 07:04 AM
1. Instead of a feedback node, use a shift register.
2. Use the Elasped Time VI. It does all of the timing counting work for you. You will still want the Wait (ms) in there though.
08-13-2015 07:17 AM
Thank you for the quick reply !
I was unable to open your vi because I have LabView 2012 and it is 2014 (vi version 14.0 newer than labview version 12.0).
Is there a way to open it in LV2012 ?
08-13-2015 07:52 AM - edited 08-13-2015 07:53 AM
Thank you, Crossrulz!
This does not skip any values and it works fine.
Is there a way to get information out of case without making use of the big while loop ?
My program is going to become very complex (I need to synchronize a magnetometer and a stepper motor to make a 3d map of a magnet's magnetic field) and I want to do everything as simple as possible so,
if there is a way to get information out of a case structure, other tnan by using shift registers on the big while loop, and you know it, please show me.
Thank you!
08-13-2015 07:57 AM
@TibiG wrote:
Thank you, Crossrulz!
This does not skip any values and it works fine.
Is there a way to get information out of case without making use of the big while loop ?
My program is going to become very complex (I need to synchronize a magnetometer and a stepper motor to make a 3d map of a magnet's magnetic field) and I want to do everything as simple as possible so,
if there is a way to get information out of a case structure, other tnan by using shift registers on the big while loop, and you know it, please show me.
Thank you!
You could also use a Feedback Node, just keep it ouside of the case structure.
08-13-2015 08:11 AM
a refference to cop movies comes to mind : "God damn it!" it was that simple.
Good thing I didn't lose half a day with this :).
Thank you very much, crossrulz !