From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIB beginner Require control and monitor of Laser Diode Driver via GPIB

Hi - I am a university student in the UK and have got to do an experiment where I need to link my pc to my laser diode driver to control it and also feedback useful data (photo diode current etc).

I am using Labview 7.1, Windows XP Pro, and the GPIB-B interface to link the PC to the laser driver.

I am really stuck as I cannot see how to get Labview to be able to change a parameter, whilst at the same time retrieve the data and store this in a plotable form. If someone can knock up a VI or point me in the correct direction, I would be eternally grateful.

Many thanks

Will
0 Kudos
Message 1 of 6
(3,588 Views)
Need a bit more information from you.
1). Does the instrument show up in MAX when you do a scan for instruments?
2). Can you communicate with it in MAX?
3). Who makes the laser diode driver?
4). Is there a LabVIEW instrument driver available for it?
5). Are you using VISA Read/Write or GPIB Read/Write?
6). What error codes or messages are you getting?

Questions 1 and 2 are the most important. If nothing shows in MAX, then you won't be able to communicate. If sending commands in MAX doesn't work, you may have the syntax incorrect. Once you can get communication in MAX to work, you should try the shipping example called LabVIEW<->GPIB or the Instrument I/O Assistant.
0 Kudos
Message 2 of 6
(3,586 Views)

@Dennis Knutson wrote:
Need a bit more information from you.
1). Does the instrument show up in MAX when you do a scan for instruments?
2). Can you communicate with it in MAX?
3). Who makes the laser diode driver?
4). Is there a LabVIEW instrument driver available for it?
5). Are you using VISA Read/Write or GPIB Read/Write?
6). What error codes or messages are you getting?

Questions 1 and 2 are the most important. If nothing shows in MAX, then you won't be able to communicate. If sending commands in MAX doesn't work, you may have the syntax incorrect. Once you can get communication in MAX to work, you should try the shipping example called LabVIEW<->GPIB or the Instrument I/O Assistant.



Right thanks for the quick reply. Like I said I'm a total novice at Labview, so its all new to me. *please bear with me and excuse my ignorance - thanks *

Answers:
1) Ummmm.....MAX? Where do I find that on Labview 7.1?
2) Labview does sense a parameter - eg when you type in *idn? it shows the identity of the hardware correctly so there are communicating. I have tried to use the template GPIB but it doesnt seem to do what i want it to do - ie change the values of parameters by knobs/dials and to record data continuously.
3) It is the Thorlabs ITC502 TEC device (www.thorlabs.com - search ITC502), using the NI USB GPIB-B interface. I have installed the hardware and have got control over the hardware via the Remote ITC packaged software, where I can manually adjust the laser current to get values of the photo diode current. That works fine. Basically I want Labview to automatically increase the current and output the photo diode current in a plotable format - .txt or Excel file is best for me
4) Yes the hardware comes with the Labview driver
5) What is VISA read/write? How can i tell if I'm using VISA not GPIB read/write?
6) I don't know enough about Labview to be able to complete a VI yet. Therefore no error message - just plenty of frustration!


Thanks!

Will
0 Kudos
Message 3 of 6
(3,577 Views)
MAX is Measurment and Automation Explorer. A shortcut to it should be on your desktop. It's a utility program for configuring NI hardware and basic communication testing. Since you've been able to get the *IDN? query to work, that's a big step. Start MAX, expand Devices and Interfaces. Find the listing your USB GPIB interface. Right click and select Scan for Instruments.

Instead of trying to write your own VIs, you should start with the included drivers. The ones I downloaded are called plug and play drivers. The low level drivers are written in C and the LabVIEW code is nothing more than a wrapper to the C functions contained in a DLL. Start with the VI called Itc500 Initialize. Enter the correct GPIB address in the Resource Name string and run the VI. This VI does the *IDN? and resets the instrument. If this works without any errors, try some of the other functions. Try the VIs named Set to configure the instrument and the ones named Get to read the instrument. Turn on Help>Show Context Help. Moving your mouse over the VIs icon will get you a description of what the entire VI does and moving the mouse over a control will describe what that control is used for. These subVIs have a control called VISA Resource Name. Enter the correct address in the form GPIB0::address:INSTR or click on the little arrow on the right of the control. A list of instruments will be shown. Pick yours from the list.

Some of the functions in the driver have numeric inputs such as Set Photodiode Current. You can place a knob on a new VI and insert one of the functions on the diagram as a subVI. Wire from the knob to the numeric input of the subVI and you now have a nice user interface for one function. Completing the project is going to be a bit more complex of course. I would suggest you start by looking at the LabVIEW Measurements manual that's part of the LabVIEW Bookshelf (under the Help menu) and browse through the shipping examples. At the LabVIEW Learning Center you can also find links to books and LabVEWI tutorials to help you understand the basics of LabVIEW programming.
0 Kudos
Message 4 of 6
(3,570 Views)
Thanks fro your help - i finally found the itc500 folder - its was hidden fairly well within the Thorlabs installed files.

I have tried to run some of the Vi's you suggested like the *IDN? and after a few seconds this error message pops up and repeatedly pops up after a few seconds:

ERROR - 1073807346 occured at ITC500 'filename'.vi

Possible reasons:

VISA (Hex0,BFFFOOOE) The given session or object reference is invalid.

--end of msg-

However i can get Labview to retrieve the information but like i said, this message box keeps popping up - any ideas anyone?

Many thanks

Will (reading University UK)
0 Kudos
Message 5 of 6
(3,541 Views)
That message usually means that the name of the VISA reference or instrument handle is incorrect. Run the Initialize VI and make sure the name matches what is in MAX and with the regular VISA Write that you can get to work.
0 Kudos
Message 6 of 6
(3,536 Views)