LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Waveform output error mystery

Hello,

 

For a microscope system, we use Thorlabs galvo scan mirrors controlled by a larger program. I have the excerpt code from the main program and it's dependency subVI's attached.

 

We are having a strange error where on the older computer, using a PCI 6110 board and a BNC 2110 output and LabVIEW 14, can generate and output the correct waveform to the galvo mirrors. However, a different computer, using a PCI 6115 board and a BNC 2110 output and LabVIEW 15, generates the right waveform in the program, but does not send the correct output through the BNC output. I've tried swapping physical cables around with no change. When I move the "Clear task" command outside of the while loop, the waveform output is corrected, but I'm not sure why this is. I'm not sure whether this is simply an error arising from the different versions of LabVIEW on the two computers, or some subtle difference between the PCI boards. 

 

Any clarification or insight you can offer me is appreciated. Thanks! 

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

Try to leave only the Write function in the loop. All other functions are located outside the loop (before or after).
There is no reason to create the task each iteration, and then delete it.
Also use delay function.

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

Hi, thanks for the reply.

 

Normally many of the constants given here in the program are created elsewhere in the much larger microscope control program, of which this is only an excerpt. That's why some of these commands have to made over and over again, because if the user changes the scan rate setting, or the number of pixels in the image, the task parameters have to alter to match those new settings. I did find that moving the end task out of the loop helped. I'll try recreating fewer parts of the task in the loop, though I can't remove all of it. 

 

I still don't understand why this set up works on the old computer, but not on the new one, with the only difference being a slightly different PCI board and one year difference in LabVIEW versions. 

0 Kudos
Message 3 of 6
(3,890 Views)

I haven't dev now, so can't test, but I think that you don't change settings while task is running
You can check it like here.

May be your error is just old settings with new wave

 

test.png
Also describe, what type of wave errors you get on new PC.

0 Kudos
Message 4 of 6
(3,852 Views)

The errors I get on the new computer are that rather than outputting a continuous waveform to the mirrors, I only get sporadic movements from the mirrors about every three seconds or so. The outputs aren't consistent either. It's a jerky, spastic movement, instead of the continuous one I should get. 

 

When I move the "close task" outside of the loop, the mirrors work, but the overall program, of which this is only an excerpt, crashes. 

0 Kudos
Message 5 of 6
(3,813 Views)

You reall should move your setup to before the loop and the closing to be after the loop.  You can then perform the Write inside of the loop all you want.  Otherwise you are just creating and destroying references and these take a lot of time.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 6
(3,796 Views)