Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Argument mismatch in the following APIs #103

Open
u625355 opened this issue Nov 10, 2023 · 1 comment
Open

[BUG]: Argument mismatch in the following APIs #103

u625355 opened this issue Nov 10, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@u625355
Copy link
Contributor

u625355 commented Nov 10, 2023

Description of the bug

Arguments data type is mismatched in the following APIs:

Models affected: Keithley SMU 2450|2451|2460|2470 Source Measure Units.

API PI Comments
smu.commands.buffer.write.format() buffer.write.format() String argument mapped to integer.
smu.commands.buffer.make() buffer.make() Return type is a table instead of a variable.

Steps To Reproduce

  1. Create a driver object named "smu" for any of the affected models.

  2. Use the "smu" driver object to write and query the above-mentioned APIs.
    Examples:

           smu.commands.buffer.write.format() 
    
           smu.commands.buffer.make()
    
  3. Error: There is a mismatch in the data type of one of the arguments and return type is a table instead of a variable.

image

Environment Information

Operating System:

  • Windows 10, 64-bit

Software Version:

  • tm-devices : 0.1.24

Additional Information

Alternative way to make the API functional as expected:

   buffervar1 = smu.write("buffer.make(200, buffer.STYLE_FULL)")
   smu.write("buffer.write.format(extBuffer, buffer.UNIT_WATT, buffer.DIGITS_3_5)")
@u625355 u625355 added the bug Something isn't working label Nov 10, 2023
@c3charvat
Copy link
Contributor

It returns a table because a buffer object is Lua a table. You can do nothing with it.

In order to get measurements back you must use the "printbuffer" command.

In order to use the buffer you must use the string name of it.

Fundamentally, the make buffer command should return the string name of the buffer if it was successfully made or raise an error of it isn't. It's the only way to do anything useful with it.

Addressing the way to make the api behave.. why is a write returning anything?... Does it really return the variable name?
If so why? Seems highly inconsistent with the visa definitions of "write","read"and "query"

I found something like this works with visa.
buffervarname = "buff1"
Smu.write(f"{buffervarname} = buffer.make(100) ")
*Do stuff to fill
Smu.query(f"printbuffer(1,{buffervarname}.n, {buffervarname}. readings)")

As for the incorrect mapping of a str variable to an integer, reference manual (2450 rev E. 2019 ) page 14-50 and 14-51. Is the relevant documentation for those interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants