Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Exhausting voltage states

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

John Passiak
0 Kudos
Message 11 of 20
(2,013 Views)

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

 

Message Edited by SteveP on 09-11-2009 10:16 AM
0 Kudos
Message 12 of 20
(1,985 Views)

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

John Passiak
0 Kudos
Message 13 of 20
(1,980 Views)

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.

0 Kudos
Message 14 of 20
(1,977 Views)

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

John Passiak
0 Kudos
Message 15 of 20
(1,962 Views)

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

0 Kudos
Message 16 of 20
(1,956 Views)

Hey Steve,

 

Good catch--I fixed the behavior byadding the correct number of samples to the X array so it is not coerced.

 

-John

John Passiak
0 Kudos
Message 17 of 20
(1,934 Views)

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

0 Kudos
Message 18 of 20
(1,929 Views)

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

John Passiak
0 Kudos
Message 19 of 20
(1,924 Views)
if was looking at the sub-VI.  The latest version looks fine.
0 Kudos
Message 20 of 20
(1,921 Views)