LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to ensure a signal always starts at zero?

Hey everyone,
 
 
I have my PC connected via USB to a BNC-2110 which is in turn connected to an oscilloscope via two coaxial cables, each output going to a different scope channel. The aim (using the vi posted below) is to have a pair of mirrors mounted on galvos scan a spot across a square area of a screen, which the code I have now does. Unfortunately, every time a scan is completed (regardless of whether I run a single, multiple or continuous scan) it will finish at a different point and pause for a second while the stop returns to the starting position. The two signals should be synchronized and I'm at a bit of a loss as to how to fix the problem, though my knowledge of LabVEIW isn't that extensive so my search for a component to add might have missed something suitable. Does anyone know how I can fix this?
 
 
Thanks in advance,
 
Ben
0 Kudos
Message 1 of 6
(2,940 Views)

Since you begin by adding an offset to the first element of your triagular waveform, it will not be 0 unless your offset is zero. 

If you know the array size, you can initialize the array (size) and place a 0 in element 0 (first element), then replace the other elements by proper indexing to the array.

OR..

You could simply add an element (value = 0) at index 0 after you have completed building the array.  The method above is more efficient.

RayR

0 Kudos
Message 2 of 6
(2,928 Views)
Sorry RayR, I wasn't clear enough explaining what happens when I run my program. The spot will always jump to the starting position (zero) on beginning a new scan, but when it finishes it will jump back to a seemingly random point before pausing and begining the scan from zero
 
Any idea why the scan wouldn't just finish in the corner?
0 Kudos
Message 3 of 6
(2,899 Views)
I figured that it'd be better to revive this thread than start a new one
 
I'm still having the same problem with my VI but after messing about with the scope I've got a clearer picture of what's up. Looking at a single scan on the screen with the X input and the Y input lined up on the screen, I can see that instead of finishing at the end of one "cycle" the sawtooth wave I'm creating is going through one full wave and starting a new one, which is going almost a quarter to the way through a new wave before it realises. As they're linked, the triangle wave I have on the other axis is doing the same thing, meaning my scan is over-running.
 
Does anyone know why this could be happening or how to fix it?
 
Thanks,
 
Ben
0 Kudos
Message 4 of 6
(2,845 Views)

Can you provide the vi names "Get Terminal Name with Device Prefix.vi"?

R

0 Kudos
Message 5 of 6
(2,830 Views)
Sorry, I'd forgotten I had problems with this one myself, here's the VI
0 Kudos
Message 6 of 6
(2,825 Views)