Instrument Control (GPIB, Serial, VISA, IVI)

Showing results for 
Search instead for 
Did you mean: 

Problems in acquiring the data from the Agilent 86142B OSA and controlling Newport Modular Controller Model 8008 laser diodes

I´ll already have tried to do that, but th plot dosent work, the output data looks like would be an 64 real array, I dont know if this would be the cause of wont work, or what would I be doing wrong.
0 Kudos
Message 21 of 30
Hi Jose,

Could you tell me what happens when you try to plot the data on the graph? You say it doesn't work, but more specific detail about what doesn't work will be helpful. A viReal64 datatype is essentially a double in LabVIEW, so you shouldn't be having problems with it.  Thanks!

Ebele O.
National Instruments
0 Kudos
Message 22 of 30
i am not really sure whats your problem and dont have any experience with this particular OSA, but i worked with other and can give you an example how it would work for Anritsu MS9710
in the picture, the function 'read data' returns (as you might have guessed) data points and also measurements conditions like start/stop wavelength and number of sampling points
in your particular case it may be necessary to use separate block to read those conditions, this depends only on the strucure of your driver
data is 1D array represented by orange thick wire, conditions is a cluster so in my case i had unbundle it to get to the values i needed
in your case those conditions may be returned eg as an array, i dont know
then, an array is created using those conditions, which is then used to format your X-axis
i use XY graph so i need to bundle the two arrays (X-values and data) into a cluster
its possible to use waveform graph (as i learnt recently from Dennis) but i find XY graph more intutive
finally, notice that graph properties are also set using conditions and labels you like
it maybe in your case that you have to run a 'measure' function before you can read any data
if you graph is still not working check in highlight mode if you 'data' array is really populated with sensible values (place a probe on the wire)
please note that this is not a full vi, you need to include 'initialize' function, probably 'sweep' and 'close' at the end
also route error cluster and refnum from block to block
0 Kudos
Message 23 of 30
Hi Jose,
I am actually writing a program with the same OSA and driver that you are using. My program doesnt require me to show the graph on the front panel, but it is not difficult to add. The example that I have attached will allow you to set the start and stop wavelength (if you don't want to set them, simply use the driver vi's that return these values and replace them in my vi), and once you set the number of trace points (I use 1000 just for a nice amount of data), you can run the scan on the OSA and then download the trace and display it on the graph. I am not entirely sure what your program is supposed to do, when you say that you need to show the trace on your vi, are you just doing a single scan and displaying that? Or are you using the Repeat Scan and Average Trace function to reduce noise? If you are using the second one, do you want your vi to show the trace as it is updated? Or is it sufficient to just show the final trace? The example program I have attached averages a user defined number of traces and displays the final resulting trace on the graph (but does not continuously update) Please clarify, so I can post a more exact vi to solve your problem.  I assumed that you wanted the x axis to represent the wavelength instead of time (since the download trace function doesnt return the wavelength), so I took the start wavelength, the end wavelength, and the number of data points to calculate the step between points, which I input into the graph to make the x-axis wavelength. I hope this helps solve your problem, if this is not your problem, please post a larger description of the problem you are having, and I will try and help you with it. Sorry I did not reply earlier, but I only started working with the OSA yesterday, I've been working on the rest of my program previously. 
Hopefully this will solve your problem

Using Labview 7 Express
Message 24 of 30

Ebele O.


Thank you very much by your support,  it was really nice of you and it help me to understand more the use of the plot function.




Also thank you very much by your help, like Jeff your vi help me a lot, maybe where not as specific like he’s by the use of different instrument’s but also help me to understand Lab View and the way it works,  thank you very much it was really nice of you.




I truly appreciate your helpful example, until now I’ll prove it and it work perfectly, and seeing it help me a lot in order to understand better the use of the download traces vi and the other vi´s and the way of the OSA works.  I kind believe you are a genius, lol  thank you very mucho, I hope don’t butter you if I continue asking you questions of your example and the driver or OSA.



Let me try to explain better about my project, and sorry about my English, I have a GPIB/LAN Gateway directly connected to de OSA, so using LabView VISA tcp/ip port to have connection with the OSA using the LAN, the main object of my project is to represent the principal functions of the OSA in LabView, in order that someone can control it  and make simple measurements in other room or area, so until now I can send some basic functions, but I need to make a button that when  I push it  retrieves the plot of the measured trace, also I will like to download to the computer the array in .xls or .txt or something like that in order to analyse the trace or see the main points of it. This is the vi that I’m trying to do.


Jeff I copied your plot in order to gave you a mayor idea of what I´am trying to do, when I press the button that says “ Plot trace” the vi plot the trace that is in that moment appearing in the OSA, also with the button that says “ download trace” the points of the array will appear in a specific path and name of the computer. You could see that I’m just begging with this, and also I’m new in the use of the Lab View.



0 Kudos
Message 25 of 30
With the code you have, you would at least need to have a while loop around everything in order for the program to run and monitor the Booleans. You should not be running in continuous mode. Better than a simple while loop, though, is an event structure. I've done a simple mod to show what I think you should be doing. Instead of a Boolean and a single numeric, I used a numeric for each setting and value change event. This is a much more efficient way to run the program. From this, you should be able to modify the rest in order to operate on value change events of the front panel Booleans. You should label all of those Booleans as well.
There are many resources available for learning LabVIEW on-line check out:
0 Kudos
Message 26 of 30

Hi everyone}

I have a big question referent to the Driver for the OSA 86143B, someone know how to put a marker in a specific place using this driver, I can only put it in highesth peak , next highesth peak, lowest pit... only in peak or pit an so on. could anybody know how ?

0 Kudos
Message 27 of 30
Hi Jose, I am no longer working with the OSA so I can not test any code. Have you tried looking in the help files that came with the driver? Specifically look at the VIs that affect markers, because it would seem to me like you are using the wrong VI to move the marker if it is only selecting peaks. What VI are you using to select peaks?

Message Edited by jrpe on 04-21-2007 01:48 PM


Using Labview 7 Express
0 Kudos
Message 28 of 30

Hi jrpe, yes I already had searched in the help file, and seem theres not a VI that can do it, only a VI named "ag8614x_markerPosition" , The description of this VI its down, I also tried to send a query using other VI, but in the programing guide of the instrument also only let put the marker in a peak or in a pit, but not in a specific place eventhough where not  be a peak or pit , or in the center of the Wavelenght, the only thing I can do, is to start te WL in the specific place less one, stop the WL plus one, and then put the marker in the center of the WL and then return the WL start and stop to its original sites, but this acomplish a lot of time and instrument procesor, for a simple task. 





ViStatus _VI_FUNC ag8614x_markerPosition(ViSession instrumentHandle, ViInt16 marker, ViInt16 marksetting);

Places the marker under one of the following conditions: On the highest point of the trace. On the next peak located at a shorter  wavelength than the current  marker wavelength position. On the next highest peak from the current marker amplitude. On the next peak located at a longer  wavelength than the current marker wavelength position. On the lowest point of the trace. On the next pit located at a shorter wavelength than the current marker wavelength position. On the next lowest pit from the current marker amplitude. On the next pit located at a longer wavelength than the current marker wavelength position.

Agilent Technologies AG8614xB Instrument Driver Help




ViStatus _VI_FUNC ag8614x_markerToCenterWavelength(ViSession instrumentHandle, ViInt16 marker);




0 Kudos
Message 29 of 30
what exactly are you trying to use the marker for? because there might be a different way of doing. Please provide more detail about the need for a marker. Thanks

Using Labview 7 Express
0 Kudos
Message 30 of 30