on1arf / jds6600_python

python library to remote-control a Junce-Instruments JDS6600 signal generator over USB
MIT License
29 stars 11 forks source link

Channel enable/disable started behaving weird... #6

Open DrBwts opened 2 years ago

DrBwts commented 2 years ago

It was all working fine before Xmas but now whenever I uses j.setchannelenable(True, True) the channels sometimes turn on & off but always raises the exception UnexpectedReplyError(ret)

It doesnt seem to matter which channel I'm enable/disabling I sometimes get what I asked for but always get that exception.

Things I've changed, I'm now running from a virtual environment which has QCodes in it that needs Python 3.8 or above, will this effect the functionality of your code?

on1arf commented 2 years ago

Hi,

On 17.01.22 15:49, DrBwts wrote:

It was all working fine before Xmas but now whenever I uses |j.setchannelenable(True, True)| the channels sometimes turn on & off but always raises the exception |UnexpectedReplyError(ret)|

It doesnt seem to matter which channel I'm enable/disabling I sometimes get what I asked for but always get that exception.

Things I've changed, I'm now running from a virtual environment which has QCodes in it that needs Python 3.8 or above, will this effect the functionality of your code?

Thanks for your feedback.

Two questions:

Kr.Message ID: @.***

DrBwts commented 2 years ago

All the commands return the exception. When I put them in a try: .. except: ... they all do their jobs except the change frequency method that does nothing.

on1arf commented 2 years ago

Hi,

On 18.01.22 15:10, DrBwts wrote:

All the commands return the exception. When I put them in a |try: .. except: ...| they all do their jobs except the change frequency method that does nothing.

I have just tried on an ubuntu 20.04LTS with python 3.8.10 and python 3.9.5 and both seems to work correctly.

The error you get indicate that the module does not receive a ":ok" after issuing a command to the device. Can you try the following debug commands. (You should get the following answers)

j.DEBUG_readregister(0,0) b':r00=60.\r\n'

j.DEBUG_writeregister(0,100) b':ok\r\n'

j.DEBUG_readregister(0,0) b':r00=60.\r\n'

Note, that changing the frequency does not work is normal as the method first calls a "self.getmode()" before changing the frequency.

If that command fails, it will not continue, so the frequency is never set.

Kr.

Message ID: @.***

DrBwts commented 2 years ago

j.DEBUG_readregister(0, 0) b':r00=15.\r\n j.DEBUG_writeregister(0, 100) b':ok\r\n j.DEBUG_readregister(0, 0) b':r00=15.\r\n