LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronizing analog output and input for imaging

Solved!
Go to solution

It's so frustrating that no one else in my lab knows LabVIEW well. 

 

So, it'll be your turn to wear the halo soon...

 

 

 

Actually, I didn't use any of the SIGNAL ROUTING vis  (Once upon a time, I did).  You can set the properties and the connections will happen behind the scenes.

 

I have a PID system where I have to read signals, compute a response, and set the outputs, all at 100 Hz.

 

Rather than try to make all the computations deterministic, I simple hardwired the delay in, so that the response came out exactly  1 clock tick later.  I then don't care if the computations take 0.1 mSec or 9.9 mSec - the output happens at the same time.

 

I did that by setting the SAMPCLK.SRC of the AO task to the SAMPLE CLOCK of the AI task.

 

"RTEC" is just the name of the board, as defined in MAX).

 

This means that the outputs update at the exact same time (a few nSec later) from the input.

 

If they're on the same board, this is easy.  If not,  well there used to be a RTSI cable that would connect boards together, I don't know if that's still around.

 

AO Clock.PNG

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 11 of 23
(1,193 Views)

Hi,

 

I am working on a project where I have to scan the sample in raster manner, using dual axis galvano mirrors,

I made a VI for the same approach but it is not working in a right way, so have seen your post and looks like a same project.

 

so I wanted to know how to make a VI which can scan in raster manner using dual axis mirrors and DAQ.

0 Kudos
Message 12 of 23
(679 Views)

Sorry, but I don't know what you mean by "using galvanic mirrors".

Please explain what you're trying to accomplish, what code you have tried, and what goes wrong.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 13 of 23
(677 Views)

Hi,

 

I am working on a project where I have to scan the sample in a raster manner using dual axis Galvano mirrors.

 

I am using Galvano mirrors and they rotates at specific angle according to the applied input voltage like MEMS mirrors.

Small beam Galvano mirrors from thorlab which can scan in two direction according to applied input voltage range.

https://www.thorlabs.de/newgrouppage9.cfm?objectgroup_ID=3770

 

I made VI for the raster scanning, but it is not working in a right way and not scanning in raster pattern I have attached the video in which you can see that how it is working.

 

so I am searching for the solution by which I can scan the sample in raster manner.

 

if you know other solution than attached two VIs than it also be helpful.

 

Mirrors will rotate 1 degree when I applied 0.8V

 

I am using sawtooth wave at 100Hz

 

 

 

 

 

0 Kudos
Message 14 of 23
(675 Views)

It looks like your raster generator is working OK.

If I set NSTEPS = 11, and MAX = 100, then I get steps at 0,10,20...100 for X while Y = 0, and then 0,10,20...100 for X while Y = 10, and so on, looks right.

 

What I don't understand is why you run that X-axis signal into a Sine wave generator.  Do you need to drive the mirrors with AC?  If so, that's not working.  The FUNCTION GENERATOR you're using takes a single number as its amplitude and generates a series of samples at that amplitude and frequency.  You can't put in a waveform signal and get sine waves at various amplitudes from that single call.  If you need to modulate the AC signal with the raster drive, you'll need to generate the AC signal FOR EACH STEP of the raster, and then concat them all.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 15 of 23
(667 Views)

Hi,

 

As I am new in Labview many time I do not understand the small things.

 

Yes you are right,but the problem is I do not know how to give varying amplitude values to the both X and Y function generators so they can scan the sample in raster pattern or how to generate with diff values and concat them.

 

As per my project requirement I have to detect the cells onto the sample, have to draw the bounding box onto the detected cells and then I have to scan the bounded area using dual axis galvano mirrors. 

 

after detecting the cells I will get the pixel values of the Rect left, right, top, botttom.

 

so, if you point me out how to make mirrors to scan in raster pattern then it will be very helpful..

Download All
0 Kudos
Message 16 of 23
(664 Views)

Please stop posting the same questions with large attachments into multiple threads at once, especially when you haven't waited even an hour to see if you get a reply.

 

To get detailed help, you're going to need to give a much more careful and detailed description of your problem.  I tried to help some (a bit clumsily until I understood more of what you needed) in a thread a few weeks ago, and I see very little progress in your code related to taking advice on establishing AO/AI sync.  And that's a pretty small part of your overall needs.

 

Looking over some of your other threads, I think you've been given an assignment before being equipped to complete it on your own.   It's either gonna take an investment of money to hire some help or a substantial investment of time for you to learn enough about LabVIEW and the equipment technology to do it yourself.

 

You can get some good technical help from experts here on the forums, but you can't expect those experts to do your whole project for free.  My suggestions to get the best quality help here:

- Break down your overall app into many separate small problems to solve.  Syncing AO with AI is one of those.  How to generate distinct waveforms on two AO channels is another.  Identifying ROI rectangles is another.  Converting ROI coords to a desired set of AO waveforms is another. Etc.

- Make an attempt to solve those problems on your own.

- Be very specific and detailed when you ask questions.  Provide a lot of context -- sometimes an expert will be able to discern the *better* question you *should* be asking.  That's part of what's valuable about the help here.

- Please don't cross-post the same question(s) to multiple threads.  Well-defined and well-posed questions will get attention here, I can almost guarantee it.

- When you get suggestions and advice, be sure to try to follow it before reverting to asking the original question again.

- Don't assume folks here know the particulars of your field of work.  You've frequently mentioned the need to do "scanning in a raster pattern."   I for one do not know exactly what *you* mean by that phrase.  It probably involves a coordinated pair of AO waveforms.  You also seem to want a synced AI measurement.  But I don't know the realms of galvo mirrors, imaging, raster scanning, etc. well enough to be sure I know how to interpret you.   The more you spell things out in detail, the more you'll expand the field of people who can potentially help you.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW?

(Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).



Message 17 of 23
(655 Views)

Thank you very much for reply,

As I am new in Labview and technically sounds not good at many factors, so I need to learn more in Labview  but I do not know where I can get more options to learn more.

 

So if you know online courses or anything else which can be helpful then please share.

 

Now, I breakdown my whole task in to subparts and try to finish more as I can.

 

Really very sorry for the mistake.

 

0 Kudos
Message 18 of 23
(644 Views)

If I have understood your needs correctly (and that's not at all certain), here is a piece of code that could turn your DC steps into AC for driving your mirrors.

 

I've left it as an image, not posted a VI, so that you can judge if it's what you need, and so you can learn by recreating it.

SigGen.PNG

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 19 of 23
(641 Views)

mi,

 

Just so you know, my goal wasn't to make you feel bad and apologize, it was to help you find a productive path forward.   

 

Much of the help offered up on the forum comes from volunteers who have limited spare time for offering help.  Everything you can do to make it easier for them to help you is going to make things better for *everyone*.  That's what most of my recommendations were about.

 

Up at the top of this LabVIEW support forum are some links to training resources.  These will mostly help to build a broad base of general competence.   For specific questions and problems, these forums contain a wealth of information and often yield good answers with enough diligent searching.  However, it's also not always easy to know exactly what search terms to use.

 

Let me suggest that the first 2 things you focus on might be:

- converting ROI rectangle corner coordinates into meaningful corresponding parameters for your X and Y galvo mirrors.  (I'm still not clear on whether a fixed galvo position is controlled by setting 2 constant DC voltages or 2 amplitudes for AC sine waves).

- defining a time history of your X and Y galvo control signals that will sweep through the rectangle defined by those coordinates.  When working this problem, be sure to think it through first to carefully understand how to vary X and Y in relation to one another.  Then put together code that generates such signal data and graphs it.  Be sure to get this much right before focusing on the DAQmx tasks.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW?

(Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).



Message 20 of 23
(629 Views)