09-03-2009 10:16 AM
Hi jm,
From your follow up on the other forum it looks like you've got what you need--if you have any questions don't hesitate to post back!
Best Regards,
John
09-11-2009 09:12 AM - edited 09-11-2009 09:16 AM
John,
It looks like the last cycle of your raster has extra points on it - as many extra as the number of Y steps. For the X scan, these are being generated by the outer For Loop's Index counter auto-indexed at the top right of that outer For Loop. I did not see how or why they were being generated for the Y scan, so I modified the code for my use by simply extracting a sub-set of the array that is (X Number of Steps * Y Number of Steps) long. This results in the last point of the Y raster being at Y Minimum (and only one such point at its end that is that value) and the last X point remaining at the X Maximum (instead of ramping down to X Minimum). Is there an intended reason these extra points are there ?
Steve
09-11-2009 10:20 AM
Hi Steve,
Thanks for the feedback! The extra points were intended to "reset" the scanner back to the original position. I didn't want to instantly transition from the maximum to minimum value since this could be problematic when interacting with actual hardware. This code was written for a specific application so more likely than not some modifications will need to be made depending on your exact requirements. I hope it at least provided a good starting point for your application!
Best Regards,
John
09-11-2009 10:27 AM
Could you point out where in the code the extra points are being added to the Y raster ? I could then eliminate them there rather than after they have been generated by using an array subset.
Thanks - yes - it is a good starting point.
09-11-2009
04:50 PM
- last edited on
04-29-2024
02:47 PM
by
Content Cleaner
Hi Steve,
I modified the code a bit so there's now a front panel button to enable/disable the reset at the end of the scan. Here's the link again for your convenience:
Generate 2D Raster Pattern in LabVIEW
-John
09-11-2009 06:49 PM
John,
A subtle note is that enabling Reset Y at End of Scan? results in the Y array size being larger than X. When they are combined with Build Array, the end of the X array is filled with a value of 0. If X Minimum was set to something other than 0, that results in those extra points having a different value than the last X point in the raster.
Steve
09-14-2009 09:34 AM
Hey Steve,
Good catch--I fixed the behavior byadding the correct number of samples to the X array so it is not coerced.
-John
09-14-2009 10:08 AM
John,
Now the Reset button has been removed as well as the plot. Is X being filled with 0 instead of being filled with X Minimum ?
Steve
09-14-2009
10:42 AM
- last edited on
04-29-2024
02:48 PM
by
Content Cleaner
Hi Steve,
Did you download the new version here? It seems to work fine on my end. X is being filled with 0 initially, but X_Min is added to the entire array after this takes place so X will remain at X_Min at the end of the generation.
-John
09-14-2009 10:45 AM