LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Piezo imaging

Hello All,

 

I am using Mad City Labs Nano-Drive piezo table and a time-tagging device. The goal is to integrate the two in the LabView environment. Being relatively new to LabView and hardware synchronization, I find it difficult to begin the work. I have a XY Saw-Scan written for the piezo, which is sending out a TLL pulse to the time-tagger and it works. The next steps are: 

- create a virtual front panel joystick that enables the user to click on it and move the piezo in the XY plane. 

- create a visual representation of the scan on the front panel - for each piezo position (pixel) the time-tagger will receive pulses from 4 wavelength channels. The data needs to be represented as an 3D array (X_positions x Y_positions x 4). The user should be able to see the images from different channels. 

I cannot connect the 4 input channels yet, so I am thinking about a way to simulate the results, display them and save them as an image.

Any help would be highly appreciated. 

 

Kind regards,

Stanislaw Okwiet

0 Kudos
Message 1 of 10
(1,298 Views)

Hi Stanislaw


Your project seems to be very interesting. In order to help us help you, can you be more specific on what areas you are in need of help ? 

what have you coded so far ? Can you share the code (save for lv2020) ?

I noticed that from the website,  MadCity labs has labVIEW example, have you looked into it  ? 

 

Labview does not have a "joystick" type so you need to improvise, one solution would be to use a Horizontal Slide and a Vertical Slide, as Integer and move from 0 to 2 to act as imput for x aFor the 3D labVIEW has something called 3D surface , check the Examples for 3D. 

LVNinja_0-1688561649153.png

For the 3D labVIEW has something called 3D surface , check the Examples for 3D. 

LVNinja_1-1688561689362.png

 

 

 

Message 2 of 10
(1,282 Views)

Hello, Stanislaw.  Welcome to the LabVIEW Forums (notice the capitalization -- LabVIEW is an acronym for Laboratory Virtual Instrument Engineering Workbench, or LabVIEW).  For us to help you better, particularly once you start coding, you should tell us about your LabVIEW setup (what version, whether 32- or 64-bit, what Operating System) and to include VIs (or entire LabVIEW Projects) that are giving you problems.  Note that if you are a new LabVIEW user, you are probably using "the latest version", but old-timers (which sometimes means "experienced Users") are probably 2 or 3 versions behind, so you might want to "Save for Previous Version" (on the File Menu) and choose something like LabVIEW 2019 or 2021.

 

Here's an Input and an Output question for you.  You are scanning in the XY plane, and getting 4 "wavelength" channels of information back, which you describe as a "pixel".  Is it your goal to "paint a picture" where the 4 (8-bit?) Pixel data get represented by a 32-bit "color" setting, or do you want 4 3-D graphs of "image intensity at XX nm wavelength" for the 4 wavelength channels?  The first you'd do as a "Picture", the second as 4 3D graphs.

 

Another question -- why (for now) are you complicating things by trying to "manually drive" the scan beam?  Why not set a scan to start at the upper left, scan (at a fixed speed consistent with your equipment) the first row, then "scan backwards" on the second row, forward on the third, etc. until you are done?  You don't miss any data points (assuming nobody bumps into the scanning table), and you don't need to "drive carefully" to get all the points.

 

Do you have colleagues who know LabVIEW and can help you "get started" in learning how to develop VIs and use the LabVIEW tools and functions?  Have you availed yourself of the tutorials mentioned on the first page of this Forum?

 

Bob Schor

0 Kudos
Message 3 of 10
(1,280 Views)

Thank you for taking interest in the topic.

Some additional information: I am programming in LabVIEW 2016 on a lab PC, which is offline. Indeed, Mad City Labs provided us with a great library of examples.  I completed their 100+ pages long LabView tutorial, however my project is quite complex. As far as I know anything, the files I am using would not be executable by you (also, the code uses piezo's madlib.dll). However, if there is any point in sharing these files, I will certainly do so. For a quick-fix, I made photos of the current state of things. 

 

Currently I am using their X-Y scan, which also sends out 3 synchronizing pulses (pixel clk on each X move, line clk on each Y move and a frame clk at the beggining and at the end of the scan. I added a functionality so that the user can also set the Z position.

The first while loop allows the user to see whether the Z (constant 3 represents Z, 10 is the millisecond delay of execution) axis has been properly set (the piezo returns its Z position on the indicator). Ramp subVI's generate arrays of positions along which the piezo moves during the scan. The rest, I believe, is quite self-explainatory, just taking out array elements and commanding the piezo to move + sending synch pulses. 

 

I will certainly look into the 3D imaging for tests, however my supervisior mentioned about saving these scans as HSV files (this would take care of 3 channels). Now I am trying to create an array of appropriate size (depending on the scan X-Y area, always 4 in depth) and fill it in a predicable way so I can test data flow. 

 

Kind regards,

Stanislaw

 

 

0 Kudos
Message 4 of 10
(1,244 Views)

Hello Bob,

 

I am using 32-bit 2016 LabVIEW on a lab PC, so exporting the data is quite a pain. The project is in early development, there is nothing to show beyond the photos. The joystick should be there to allow the user to put the piezo in a certain position, then one should pick a scan x-y size and the rest should be automatic. These are microscopic images, each pixel will just represent a number of photons counted. I want to display them as an image, not sure how, but later it should be converted to HSV. I had some brief experience with LabVIEW before, so I have some intuitions. Unfortunately there is nobody that can help me, we're doing research but someone has to create the setup first 🙂 Please find the pics attached. 

Sorry if anything is still unclear, I am clearly out of my depth.  

 

Kind regards,

Stanislaw

IMG_8705.jpg

IMG_8704.jpg

0 Kudos
Message 5 of 10
(1,236 Views)

IMG_8705.jpg

IMG_8704.jpg

  

0 Kudos
Message 6 of 10
(1,235 Views)

OK, I won't even look at those pictures!  I cannot see the detail I need, I cannot "open" anything by clicking on it, I can't check wiring, I certainly can't edit or attempt to "run" the program ...

 

Since you are using LabVIEW 2016, I'll have no difficulty opening your VI.  So please attach your VI(s).  Note if you are developing with a LabVIEW Project file (.lvproj), and all your VIs and TypeDefs are in a single folder, the best is to compress the Folder (select Folder, right-click, "Send to:", "Compressed (zipped) Folder") and attach the compressed .zip file.

 

will look at your VIs when I get them as VIs.

 

Bob Schor

0 Kudos
Message 7 of 10
(1,206 Views)

Okay, hopefully you will be able to run these files! The VI from the photos is my_scan. This is a very early stage of development, I've just added the z-axis regulation the the pre-existing MCL VI's. Now wondering what to do next not to end up in a mess 🙂 Please find the VI's attached. 

 

Kind regards,

Stanislaw

0 Kudos
Message 8 of 10
(1,183 Views)

I am sorry to say that I cannot figure out what you are trying to do.

 

When I started learning LabVIEW, I already had several years of experience with different Programming Languages, including the "old" standbys, Fortran (not too bad) and Pascal (my favorite "Text" language), with a few odd sidelines (like all four "M" (as in Mathematics) languages, even PostScript.  So learning the mechanics of LabVIEW were not too difficult (fortunately there were Graduate Students around who explained to me that if you hold down the Shift key while using the arrows to move an object on the Block Diagram, it moves 8 times faster!  Who knew?).

 

So learning LabVIEW programming wasn't so difficult, but my early code was very awkward and tedious. Then I read "The LabVIEW Style Book" (by Peter Blume, several times, cover-to-cover) and got clued in to LabVIEW "Style".

 

So here are some "Style Rules" for you.

  • Create a LabVIEW Project environment for your LabVIEW Project.  Initially, you can do this from the "Getting Started" screen when LabVIEW opens (say "New Project").  For beginners, I recommend "One (LabVIEW) Project per (real) Project", with all the VIs inside physical folders (on disk) that "match" the Virtual Folders in the Project.
  • Every VI (with extremely rare exceptions) uses the 4-2-2-4 Connection pattern (the Default).
  • Every VI uses a 32 x 32 pixel Icon.  Every VI has Error In and Error Out in the lower corners. VIs running "in series" have their Error Out connected to the next VI's Error In.
  • Wires are kept as straight as possible.
  • Every VI needs an "Icon", which can be as simple as 2-4 lines of text.
  • Every VI fits on a single Laptop screen!!  If you need more space, then you need more sub-VIs.  A row of 20 functions that work together to do "one thing" can be made into a subVI called "Do One Thing".
  • Never use a Frame sequence.
    • One exception is with some Time functions, but there are probably better ways.
    • The real use is for FPGA coding, but that's about 3-4 years of experience later.
  • Never ever use "Stacked sequences".  [I can't think of any exceptions to this rule.
  • For every sub-VI, write Description, saying briefly "Why" (or "What it does"), Inputs, and Outputs.

This will slow you down a little bit, but will pay off in the long run.  For now, my best advice for you is to find a colleague/mentor who knows LabVIEW and get some hands-on help.  I suspect an ocean divides us (and I have other responsibilities), so I regret I can offer more pointed help (largely because I can't grasp the Project nor understand the code that you did, thoughtfully, provide).

 

Bob Schor 

Message 9 of 10
(1,166 Views)

Thank you, thats a lot of useful trips! I will to do my best to rewrite the whole thing following this advice. I understand that in this stage there is no point in giving me any specific advice, since there is stil a lot of basics to learn. Again, thanks for covering this case. 

Kind regards,

Stanislaw 

0 Kudos
Message 10 of 10
(1,152 Views)