LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to increment a Optical Power Meter Attenuation.

I am talking to an Optical Power meter. I need to increment the Optical Attenuation. Currently I am communicating with the equipment thru a VISA write and read. The Code I am using  to set the attenuation is ATT:DB 10, where 10 can be any number. Now this is a command and I basically need to sweep the attenuation from 10 to 20 dB. And I dont know how can I be able to do so.
Thanks
0 Kudos
Message 1 of 3
(2,702 Views)

You would just need a loop to write out your values from 10 to 20 in whatever increments you want.  Put a wait MS function in that matches the period you want for each step change.  The loop could be either a while loop that keeps track of the current value and increments each iteration, when it hits the max value it stops the loop.  Or it could be  For loop that basically does the same thing, but you set the # of iterations in to the N terminal.

Or you could put all of your steps in an array that feeds into the loop, and turn on auto indexing of the For loop.  Then it takes each value and concatenates it with the rest of your serial command to write out.

Don't forget to open your VISA resource before the loop and close it after the loop.  You don't want to constantly open and close it from within the loop.

0 Kudos
Message 2 of 3
(2,687 Views)
Thanks, It was very useful your information I tried all different ways you described. I finally got it sweeping the attenuation. Thanks
0 Kudos
Message 3 of 3
(2,668 Views)