LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XY scan and Dynamic data

Solved!
Go to solution

Hello,

   I am new to Labview.

    I am scanning an electron beam across a surface while counting a signal. I have Labview programs which acquire an XY Graph (X = time, and Y = counts) keeping beam position constant, but I now wish to acquire an image which shows the counts at each point in a raster scan. I am displaying two images in the attached file, one is a dummy and seems to work. However, the dynamic data output from the DAQ seems to cause a series of horizontal lines in the image. I suspect I am not fully understanding how dynamic data works.

Thanks in advance

Chris

0 Kudos
Message 1 of 6
(3,232 Views)

Yo.u talk about a Scan and an electron beam -- I'm guessing that the beam "scans" at a constant rate, and the values that you get represent data taken at equally-spaced time intervals.  This is usually called a Waveform (LabVIEW-ese for a Time Series) with a fixed sampling interval ("dt"), and is usually plotted on a Chart (since all time intervals are the same, there is only one "real" variable, the data ("Y").

 

You now talk about a Raster Scan, which I assume means "The beam sweeps left-to-right, returning a Time Series of data, then drops down a bit in Y and does it again, and again, until it has swept out a rectangular area (not unlike how old TVs worked)."

 

Is this what you are talking about?  Just thinking about the data, let's say a sweep gives you 640 8-bit values, and the beam can take on 480 different sweep "heights".  What you'll have is a 640x480 set of data, each representing an 8-bit value.  Let's assign the value (numbering 0 .. 255) to a shade of grey, with 0 being black and 255 being white.  Let's call the 640x480 measurements "Pixels".  Yep, you have just created a Grey-scale Image (provided you color each Pixel by its 8-bit value).

 

Is this what you are doing?

 

So what is the DAQ device?  I see the Dreaded DAQ Assistant (and its Evil Twin, the Dynamic Data Wire), but don't understand why they are there.

 

I think to get meaningful help, you need to give a better explanation of what you are trying to do, including something about the instruments (one of which uses VISA) you use for acquisition and something about the nature of the data they return.  If I'm way off in my guesses above, please clarify.

 

Bob Schor

 

P.S. -- to get back to the Subject of your Post, the best way to handle Dynamic Data (and probably particularly true in your case) is to never use it (which means banning the DAQ Assistant -- trust me, there are "much better ways").

0 Kudos
Message 2 of 6
(3,204 Views)

Hi slimwalker,

 

there is a lot to improve with your VI…

 

See this:

check.png

- No need to wire a value twice into a loop using two input tunnels… (I forgot to also rewire the read/write booleans.)

- See the simplification for those FormatIntoString functions? No need to call ConcatString twice afterwards. (Also not the display style indicator at the format string constants!)

- The DAQAssistent is set to read just one value on demand: immediatly convert the DDT wire to that scalar value. No need to convert to an array and sum up that array…

Further improvements:

- Learn to use clusters to bundle all those serial port settings into just one (1) wire!

- After doing so your subVI can be changed to have its inputs ALL on the left side of the connector pane…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 6
(3,199 Views)

Dear Bob,

   Thanks for your advice. I am doing what you describe. I should have given more detail. The DAQ device is acquiring counts from pulses arriving from an electron detector called a channeltron. The VISA VI is sending signals via USB to RS232 to an electron beam controller called PU-EQ 22/35 made by SPECS GmbH. 

Anyway, thanks to your help and the other reply I have managed to get the VI to work. The principal problem was that I needed to step the STOP input on the DAQ to true. 

I will look into replacing the DAQ assistant - I have partially inherited some code - to get me started.

Thanks again.

Chris

0 Kudos
Message 4 of 6
(3,185 Views)
Solution
Accepted by topic author slimwalker

Dear Gerd,

   Thanks for your suggestions. I have tidied up the VI according to your advice. Together with the advice of the other responder I have managed to get the VI to work. I have attached the functioning VI in case it should prove useful to anyone else and an image I acquired using the VI.

 

Best Wishes

Chris

Download All
0 Kudos
Message 5 of 6
(3,182 Views)

Hi slimwalker,

 

even more improvements:

- there is a "+1" function, no need for "1" constants

- when creating a cluster it most often makes sense to wire that cluster into the subVI! That way you don't need to unbundle two times in your mainVI - the unbundle takes place in the subVI! (Can't show that in the image because of missung subVI.)

- Use UnbundleByName instead of plain Unbundle to improve readability of your code. This works best once you create typedefinitions from your clusters!

- I recommend to separate serial port parameters from serial port VISA reference: don't put the VISA reference into the cluster. (Personal reference, just a recommendation.)

- There is a ramp function to create an array of ramp values:

check.png

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(3,177 Views)