I'm not familiar with the details in Matlab, but possibly your PC has used a different path for the VXI drivers. You could check to see in which folder this file was installed: hp816x_32.dll Most often it is here: C:\Program Files\IVI Foundation\VISA\WinNT\Bin
Maybe it even helps to reboot the PC after installing the driver, if the PATH is not being recognized.
My code is working perfectly fine now and I want to thank you guys for your help, really appreciate it!!
Although I wanted to know, is there a way to set the sweepspeed of the lambdascan? i was looking at the different function and I determined that there SHOULD be a way by using setsweepspeed in the group "multiframelambdascan" but for some reason it doesnt work on me....the sweepspeed still stay at the highest possible speed (40nm/s). Could someone please tell me why?
Hi Ralph, Thanks for the update and good news. And that is a good question about the sweep speed command that is not well explained in the help file! It's good to get it addressed here.
The sweep speed command, hp816x_setSweepSpeed(ViSession ihandle, ViInt32 Sweep_Speed), expects an integer input as parameter value and this is an index for the sweep speed. This is fairly obvious when programming with the front panels, like in VEE but otherwise pretty unclear. So I include the values below. So I think your chosen speed would be obtained by using the value '4'.
Let us know if that's enough to solve this. Your program looked ok at a glance.
My name is Miguel. I am trying to use the Photonics Suite for controlling a 81682A, similar to what Ralph went through. Nevertheless, my structures have very high quality factors, so I need to have very small stepsizes. I read the documentation and found that stepSize>=0.5 pm.
However, correct me if I'm wrong, but I think the 81682A is capable of steps down to 0.1 pm (I have used such step size in the past). Is it then possible to enter a value of 0.1 or 0.2 pm?
Is there a way to control the integration time arbitrarily? I want to be able to set the integration time to a fixed value, e.g. 10 us, 1 ms, etc.
Thanks for asking. This is an older model laser than we have been testing with recently, but as far as I know the 0.1pm steps should work ok. The easiest software for you to try this should be the free IL Engine package from the N7700A software suite. Is that what you are trying? What power meter are you using? It should let you set the step down to 0.1pm. Since this creates a high density of points you can only measure a limited sweep range, depending on the number of memory size of the power meter. For example the 81635A power meter will allow logging up to 20k samples. Because there is some padding at the start and stop of the sweep, you'll need to set the range a bit shorter, like 1.9nm.
To achieve the short sampling intervals, the laser will need to use the shortest sweep speed of 0.5nm/s. In the above program, which is based on the 816x VXI Plug&Play driver MFLambdascan function, you can set the speed to AUTO and the software will choose this speed and the fastest available sampling from the power meter, usually 100µs but faster with some models. If you set the speed to 0.5nm/s manually, then the software will optimize the averaging time to this speed and set it to 200 µs.
If you want still more direct control of the parameter settings, then you could try a swept variation of the programming described in this topic, but that is probably not necessary. view
Thanks for your prompt reply. I will try the configuration you suggested. I am indeed using the N7700A Photonic Application suite, but not the IL engine. I am using matlab at the moment, as I need to post-process the information. I'll check the documentation for the IL engine you mentioned, but could you tell me right away whether it can easily export data to matlab, labview, etc.?
My hardware is: 8164A mainframe, 81682A TLS and indeed, an 81635A dual Photodetector. Due to the small FSR of my resonant structures, 1.9 nm is more than enough for me to cover several resonances of my devices. I assume that if I need a longer spectral range I can concatenate measurements, maybe ignoring overlaps between measurements or averaging them in post processing.
Right now I am using Matlab for the scripting (communicating via GIB), and using the commands I found in the programming guide for Agilent N4150A, N4151A, used by some colleagues in the past, from whom I inherited a particular-case-focused code that is rather inflexible and I am trying to make general so I can change parameters at will.
However, these commands (at least in the aforementioned programmer's guide) seem to have a syntax meant for LabView only (or something other than Matlab). Some of them work for commanding the laser (as used before by my colleagues), but the ones used for querying the laser and get parameters out of the laser, produce errors. Specifically, after setting the parameters, I want to read what is the integration time set by the system, but when I try to use an instruction such as
I just played a bit with the IL engine, it does indeed take considerably shorter time to run than my old matlab GPIB "by hand" script. I checked the integration times with manual override on the mainframe. As you mentioned, they are 200 us and 100 us, when in option 4 (0.5 nm/s) and 5 (auto), respectively.
I naively updated the versions of the IL and the suite... and then a warning about the IL engine requirements showed up. With "buyers remorse", I am now trying to update the rest of the software. It takes a long time (I wonder if it is really progressing...) I'll let you know when I finish updating, or whether I have to roll back to the previous version I had.
In any case, the remaining problem is how to get the data to Matlab and how to get the averaging times by code. The little Matlab button is supposed to export things to matlab, but unfortunately it just opens a matlab engine window without exporting anything, and it seems to execute a command called "OMRDisplayObject(data)" that does nothing, and does not exist in the Matlab libraries. I wonder if it is an internal command of the suite.
I will check the thread you suggested regarding the manipulation of parameters, and try to redo things when the new version is installed and (hopefully) working again.
Once again, thanks in advance for your time and help.
Hi Miguel, There are several layers of software involved here, so I'll give a quick review:
The swept-wavelength measurements we've discussed here are based on the 816x VXI Plug&Play driver, which has the advanced function MFlambdascan for coordinating the tunable laser and power meters.
Your machine apparently also has an installation of the N4150A Photonic Foundation Library, which assists the programming of more advanced operations like rapid repetitions of sweeps or including the 8169A polarization controller to make PDL measurements with the Mueller Matrix method. This software layer also uses the 816x PnP driver functions.
I'm not sure that this N4150A layer is really assisting your current measurements and you might find it simpler to program directly with the functions of the PnP driver. That is what was discussed above in this topic. Possibly the example posted by John can help you start with that.
The N7700A IL engine is a user interface program that also uses the PnP MFlambdascan functions. So again, if your goal is automation with your own program, then you could skip using the IL Engine and program directly with the driver. But the performance from the IL engine can be used to confirm for example that the driver allows the 0.1pm steps.
Installing the N7700A software including the main package has also installed the N7700A User Guide, which is accessible from the Windows Start menu. On page 40 is a short description that might help you get the data linked into your Matlab environment. I'm not familiar with this.
I don't know where the problem is that your program won't read the MFlambdascan parameters, but maybe there is some mixing of the PFL and the 816x functions. From the help files for these you can see these corresponding syntaxes:
After a long wait and having to restart three times the download of the 816x driver manually, I managed to upgrade the suite and make it work, but the upgrading proved futile: the "export to Matlab" button still does nothing except for opening a Matlab command window and nothing else happens. It is, I assume, invoking a command that it shows in the little window before exporting, but which actually does not exist for MATLAB (OMRDisplayObject(Data);), as I previously mentioned.
I can only export to Excel, which is not tailored at all for my post processing and which, due to Murphy's Laws, does not work in this particular computer so I cannot copy nor save the data. I even tried saving as comma separated values but it never prompts where to save it, nor does it show the result. For now I will reinstall Excel, but in any case (Matlab, Excel, CSV), do you have any idea of the default folders for the suite to save files? I wonder whether the IL engine is saving things without prompting me in an unknown location. I checked the manual and there is no mention of any saving folder options.
For the Matlab exporting, the little window is where you can call your own Matlab function to process the data. The default entry OMRDisplayObject() references the example program referenced in the directory: c:\Program Files\Agilent\Photonic Application Suite\DemoMATLAB\. This example is actually rather outdated and attempts to display a trace that is labelled "IL", but this label is not used by the IL Engine. Instead it is called "Average_IL" in this engine. You can probably check the available traces after making the export by entering "Data.GraphsEnter" in your Matlab. The export has probably worked but the function did not find the trace IL. So you could just modify this sample program to fit your need. It sounds like you are planning to do more with the data than just display the graph anyway.
Again, if you want to run the measurement from Matlab, then you'll probably want to use the PnP driver directly.
The CSV export is indeed broken in the current release of the File Viewer and needs to be patched. Thank you for pointing this out. In the meantime if you want to do this, you could go back to the earlier release, N7700A version 1.2.3 where the export is working in the File Viewer and IL engine. To get the earlier version, just uncheck the box in the Package Manager for showing only the most recent versions. You would just need to change the main package and the IL package. The 816x driver can stay the same. Even simpler in some cases, you could install the earlier version on a different computer that may have better internet connections, and then just transfer the .omr measurement files from the measurement PC to that machine for the exporting.
Also as a tip for installing the N7700A on machines without network connections: the N7700A software with Package Manager can be installed on a network PC and the necessary packages downloaded there. Then the files can be copied from the download folder to the machine where they are needed, together with the setup file for the Package Manager. Then the installation can be made on that machine without network connection.
I wonder whether the IL engine loss can be somehow "hooked" to Labview via these VIs, so I could retrieve the measurements, do curve fitting, etc., and implement a feedback loop to control my tunable laser in a (hopefully) faster way than I would by programming everything myself in Matlab.
I Downloaded the "816x.zip" file for Labview 8 (although I am using Labview Version 9 on my laptop and Version 10 on our NI PXI 1042Q). I have communication with the instruments using the three "main" VIs of the Labview package (which has 267 Vis in total), but for some reason it seems to be a slow connection. I wonder whether I am supposed to find out on my own which VI blocks to use in a new project, and how to "link" them to the IL engine of the suite, if it is at all possible. I thought this should be (possible), because in the Manual of the Agilent N778xB (instrument which I do not have, but whose instructions I used for my Matlab code) I found many LabView Commands. However, I noticed they are considered obsolete and COM and ActiveX drivers are used now. Do you have any idea about which would be best suited for a NI PXI unit?
I assume somewhere in the middle of the sea of manuals and brochures I have, there must be something that will tell me whether I can do all this or not, but I have already taken a week with no much progress, so I thought asking you could considerably speed up the process.
Finally, I installed the Photonics Suite in the PXI 1042Q and tried to carry out a few tests with a smaller tunable laser in a smaller, 8163 mainframe. The IL engine sees the mainframe but it does not see the tunable laser nor the detector mounted in it. In contrast, when I activate the laser and read the detector via the (slower, at least for now) 816x VIs I copy into a new Labview project in the PXI machine, it does work (turn on, turn off, read, etc.). Could the IL engine have some particular trouble with the 8163? I just checked right now, and if I connect the 8164A to the PXI 1042Q computer, then the IL engine does detect everything there, and I can run measurements, just like my laptop (although I cannot export anything there either because that computer does not have office nor Matlab).
I will see if using another small 8163 mainframe works, and whether a change of TLS and photodetector helps.
Any advice regarding the connectivity of Labview to the Photonics Suite IL engine, as well as the suitability of the IL engine for the 8163 mainframe would be very much appreciated.