0

For my PhD, I am currently using a Tunics Plus Laser.

I am able to perform several communications like:

import pyvisa

gpib_address = pyvisa.ResourceManager().open_resource('GPIB0::10::INSTR') 
gpib_address.write('L=1550')

which sets the laser wavelength for exapmle.

Now there is also the command:

gpib_address.query('L?')

which should return the current laser wavelength. However, I do not reliably get an answer. I can't make out any cause, but it's rather arbitrary if or if not I get an answer. If not, it returns just an empty string, but not nothing?!? I tried by playing with the parameter query_delay, but that wasn't successful.

I also use various other GPIB devices and have no problems with them. They work fine.

Anybody has similar experiences?

  • try putting a delay between the write and the query. If it's the query is asked too quickly it could be still busy with setting the wavelength and then it won't give you an answer because it isn't set yet and will just hang the command. It won't automatically wait for the command to finish and looking at the manual the SCPI isn't implemented to the same standard as other instruments. – Zircatron Oct 16 '21 at 13:08
  • Hey, thanks for the answer. I tried that already, and it helped but unfortunately it did not resolve the issue... The problem is that the query and read out does not work reliably – Felix Hermann Oct 27 '21 at 11:06
  • Many instruments use `OPC?` to make sure that all settings/operations are complete before moving to the next step. I'd recommend putting an `OPC?` query between your `write` and `query` commands. See this question for similar code: https://stackoverflow.com/questions/69549189/pyvisa-data-extraction-issues-with-keysight-b1500 – SNygard Feb 11 '22 at 18:41

0 Answers0