From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to control the wave time for scanning?

Solved!
Go to solution

Hi all,

 

I hope to use triangle wave and a step to make galvo mirrors do a x-y scanning, I usea a timer to inspect the scanning time for an image. The shown time is different from its theory time, e.g, if I use a 1 HZ triangle wave as x signal to do a 128x 10(row x column), the theory time should be 1x10=10s, while the shown time from the labview program is only 456 ms. Can any one explain this and help me correct the program?

 

The test vi is attached.

 

Thanks,

Mei

0 Kudos
Message 1 of 7
(2,132 Views)

What do you mean by the "time shown by the LabVIEW program"?  Do you mean the difference in time between the two timer functions?  That only measures how long the middle frame of your code takes to run to create the waveforms and start the DAQ process.  It has nothing to to with the duration of your waveforms.

 

But you do wind up stopping the acquisition right after you have started it.  You should put in a wait until done DAQmx function then stop it after that.

0 Kudos
Message 2 of 7
(2,105 Views)

Hi RavensFan,

 

Thanks. 'time shown by the LabVIEW program' means the measured time shown in the time indicator. The time difference means the measured time in Labview and the real time I expected (e.g 1s for one row, so 10s for 10 rows X 128 column).   Yes, I want to measure the duration of the waveforms.  What should I do? put a wait in?

 

Thanks,

Mei 

0 Kudos
Message 3 of 7
(2,095 Views)
Solution
Accepted by topic author M.Mei

Do what I said in my message.

 

See attached.

0 Kudos
Message 4 of 7
(2,091 Views)

 Hi RavensFan,

 

Thanks and sorry for the reply. I found the problem why I cannot get the same time from the program and the theory-- something wrong with the wave generating. I test the output wave with an oscilloscope, when I set the wave (for x signal) frequency 1HZ in the program, the frequency getting from the oscilloscope is 5HZ .  And I cannot get signal from Y axis's output. Can you help me about this?

 

Thanks,

Mei

0 Kudos
Message 5 of 7
(2,077 Views)

Your upper For Loop doesn't seem to take the sample rate into consideration.

 

Maybe it does and it is built into one of the constants, but maybe it doesn't.

0 Kudos
Message 6 of 7
(2,073 Views)

Hi RavensFan,

 

Thanks, but I still do not solve the problem, so I open a new post for this question.

 

Thanks,

Mei

0 Kudos
Message 7 of 7
(2,050 Views)