LabView for Newport / Oriel Cornerstone Monochromator

For those who have worked with any monochromator in the Newport / Oriel Cornerstone family, you may be aware that Newport does provide LabView-based programs and functions for communicating with your system. However, in my finding, these functions worked well on their own, but it was rather difficult to try and integrate them into a larger test software package I was working on. So, I just decided to create my own LabView sub-VIs to give me access to all the main commands I needed to control the Cornerstone monochromator. Since I think these VIs may be very useful for others using this instrument, and because I’m a nice guy, I am providing them for free to anyone!

Feel free to use these VIs in developing your own code. I only ask that if you use them in a program that makes you big $$$, you at least send me a Starbucks gift card or something. And, be sure to pay it forward by providing some of your own work for free to others, just like I’m doing.

Side note: I’m not a professional, certified, grade-A LabView Code Developer dude. I just write code that works and fills a need in my lab. So, I apologize in advance if I did not follow some standard, systematic method in writing these VIs. The fact is, they work…’nuff said.

These VIs were made in LabView 8.6, so they should work with versions 8.6 and newer (I also have saved these for version 8.0…see last link below). I have tested these with both the Cornerstone 130 and Cornerstone 260 monochromators.



All VIs (.zip)

The LabView files here are all just .vi files. They are not compiled into an actual instrument driver. You could do this, but it’s not really necessary. Just use these as sub-VIs in your own code.

This initialization VI basically just queries the status byte and returns error codes (if any). I use it as a check to be sure I have the right GPIB address and that everything is communicating as it should.

The “Get” VI sends a command to query the monochromater for the current position of the grating (which grating and wavelength) and filter wheel.

The “Set” VI sends a command to the monochomator for changing a given parameter, such as wavelength, filter wheel, or which grating to use.

The “Write” VI is a lower level function just for sending commands to the monochromator.

The “Query” VI sends a query, meaning it sends a command and then waits for a response.

The “Get WL-Filter-Grating” VI sends a query to the monochromator to return the current wavelegnth, filter wheel position, and grating position.

The “Set All by WL” VI adjusts all parameters (which grating and filter to use, and wavelength) based on a single wavelength input. You will need to customize this function based on which filters and gratings are in your system. The specs for my system (for reference) are on the block diagram.

Zip File of All VIs – saved for v.8.0

If you have an earlier version of LabVIEW, down to 8.0, you can use these versions (this is the furthest back I could save it to, using v.8.6).

21 Comments on “LabView for Newport / Oriel Cornerstone Monochromator

  1. Are you trying to say that the labview VIs Newport/oriel provided are communicated with DLL. (.net framework)? I like the VI programs you made, which is controlled via NI-VISA, and SCPI command is supported. But I have the problem that the connection of Cornerstone to computer can not be established . The default setting the Cornerstone 130 is driven by its own driver, and the monochromator is not appearing under MAX. (VISA -Find does not find such devices). Can you help me out.

    • If it’s not even showing up within MAX, you have a basic communications failure somewhere. Check your cables, make sure it’s powered on, make sure the GPIB interface is active, etc etc. The command sent by MAX to all instruments is a basic request for ID. The Cornerstone may not respond with an ID (I forget exactly), but MAX will still show there is an active device at that GPIB address (should be 4).

  2. Hi, Kyle,
    Could you convert your VIs to LabVIEW 7.1 version? I have only the old LabVIEW 7.1 software.

    • Hi there! I tried to save for previous version, but my v8.6 of LabView only allows me to save back to v8.0. I would then have to open it in 8.0 and save for 7.1 (kind of dumb, but that’s the way it works). Unfortunately, v8.6 is the only copy I have to work with!

      • Hi Kyle, I have a student version of LabVIEW 8.0. So it will be perfect if you can offer me the VIs in LabVIEW8.0. I can do the conversion to 7.1 myself.

        • Very well…I saved them for 8.0 and posted up a link (see above) for the zip file with all VIs. Hope it helps!

  3. Hi Kyle,

    These files could make my life a thousand times easier- if only I could get them to work!

    The Monochromator is connected to the computer correctly (showing up in MAX and I can make changes with the Mono Utility software), and the I/O inputs in your VIs know that my monochromator is there (drop-down menu allows me to choose it). BUT it’s giving me error code 5500, along with “Problem communicating with Cornerstone”.

    Any advice is very appreciated.

    • Hi Megan — That error code indicates that nothing was received from the instrument after querying the Status bit (STB?). You might try using MAX to directly send commands to the instrument and see if you get any return from it. Usually, that’s where I can track down problems with communication from.

      • Hi Kyle,

        I’ve made what you said (querying the status bit and run NI I/O trace) and now, i have this message error “VISA: (Hex 0xBFFF0015), Timeout has expired”. I don’t know what to do? I already change timeout (1 seconde to 5 seconde) but iit doesn’t change anything. I’m also use a Cornerstone 130 USB.

        Thanks Kyle

        • Perhaps send me an email with the background details on your setup ( and what the problem is. Cheers!

  4. I have the same problem as Megan.
    I have a TLS Cornerstone 130 USB and I am able to controll it easily with the defautl softwares.
    When I try to run your Cornerstone_init i receive the 5500 error since i cannot select any i/o from the drop down menu…
    btw … what is MAX?
    thank you Kyle

    • Hi there! I do not think I have used a Cornerstone system with direct USB connection, but it should (in theory) still work the same. NI MAX is a free program that you can download from NI’s website. It is a great tool to scan all your I/O interfaces and tell you what instruments it is detecting. It will also show you what its I/O address is, which you can then use in the VIs I have. Cheers — Kyle

  5. Hi Kyle, I am trying to use the VIs you uploaded to control cornerstone monochromator through GPIB, they are great! But I didn’t find the VI for control the shutter and calibrate the Gratings, do you have VIs for these use? Thanks very much!

    • Hi Sheng — I do not have separate VIs for the shutter or calibrations…I never had the need to use those functions. But, I’m sure it would be pretty straight forward to implement those using my If you can figure out the command format for any function, just send it to the _Write VI and you should get the response you’re looking for. Hope that helps!

  6. Hi, I have tried your codes, and they work fine.

    I was wondering how you wrote these codes. I have had trouble finding the instrument driver for CS 130 in MAX and labview. How did you install them?

    Thanks for the help1

    • Hi! I wrote these using the underlying GPIB codes used in the original LabView drivers put out by Oriel. You should not need any additional instrument driver files to operate your CS130. As long as the instrument is showing in MAX, then the VIs should be able to address them.

  7. Hello Dr. Montgomery,

    First I want to say hi from Purdue as I looked at your fantastic website and found your Labview code for Newport monochromator, and at the same time went through the introduction and the excellent research outcome you had achieved so that I know you graduated from here. I tried to send you an email, but it didn’t go through.

    I am a Ph.D. student at Purdue and working on contamination detection, and we also use a Newport MS260i monochromator, however in an RS-232 interface. I have been trying hard to look at your GPIB code and want to convert to the RS-232 interface but still not succeed yet. Since I am not familiar with EE and these settings, I searched online to see the difference between RS-232 and GPIB but seems I am missing some pieces in between to connect the two. Would you mind giving me some suggestions to convert it into the RS-232 interface? Thank you!

    • Hi there! I’m glad to help out a fellow Purdue student! With an RS-232 interface, you should still be able to use the same VIs, but you will choose whichever COM port your RS-232 cable is connected to on your computer. Sometimes it can be a little tricky, but if you have the NI-MAX software (free download), then you should be able to detect what the name or alias should be for the “VISA Resource IN” box in the VI. If you have more questions, feel free to email me at Cheers!

  8. Hi,

    I am trying to get this to work with a cornerstone 260 connected via USB. The Newport MonoUtility software works fine, but I don’t see the monochromator in NI MAX, and the Cornerstone_Init “error out” box says “problem communicating with cornerstone.” What am I doing wrong?

    • Hi Robin — I know others have had this problem, but I do not recall what exactly the fix has been for others. Did you try uninstalling the Newport software, restarting, then plugging in the monochromator? There may be conflict with Newport and NI drivers that prevent the mono from showing up in NI MAX. However, once you see it show up in NI MAX, you should be good to go on the VIs. Best, Kyle

Leave a Reply

Your email address will not be published. Required fields are marked *