You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some of the instruments I'd like to simulate have settings that contain multiple elements/variables. For example, if I want to set the ramp rate of a heater, I send the following:
RAMP {output_idx}, {enable}, {rate}
{output_idx} is the output channel, {enable} is whether or not the heater should be turned on, and {rate} is what rate you want the heating to proceed at. All three need to be specified at once. How do I store all three settings in one property?
I currently have {output_id} set up as a channel, since the examples show how to retrieve channel ids, and that works elsewhere in my file. However, my attempts to set parameters such as default and boundary values do not work by putting the separate values in as tuples, dicts, or lists.
TypeError: Could not parse definitions file. 'Traceback (most recent call last):
File "C:\path\to\pyvisa-sim\parser.py", line 144, in update_component
getter, setter, prop_dict.get(\'specs\', {}))
File "C:\path\to\pyvisa-sim\channels.py", line 112, in add_property
default_value, specs)
File "C:\path\to\pyvisa-sim\channels.py", line 28, in __init__
super(ChannelProperty, self).__init__(name, default_value, specs)
File "C:\path\to\pyvisa-sim\component.py", line 50, in __init__
specs[key] = t(specs[key])
TypeError: \'str\' object is not callable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\path\to\pyvisa-sim\highlevel.py", line 65, in _init
self.devices = parser.get_devices(self.library_path, False)
File "C:\path\to\pyvisa-sim\parser.py", line 296, in get_devices
get_device(device_name, dd, loader, resource_dict))
File "C:\path\to\pyvisa-sim\parser.py", line 205, in get_device
loader, resource_dict))
File "C:\path\to\pyvisa-sim\parser.py", line 179, in get_channel
update_component(ch_name, channels, channel_dict)
File "C:\path\to\pyvisa-sim\parser.py", line 147, in update_component
raise type(e)(msg % (name, prop_name, format_exc()))
TypeError: In device out, malformed property ramp
\'Traceback (most recent call last):
File "C:\path\to\pyvisa-sim\parser.py", line 144, in update_component
getter, setter, prop_dict.get(\'specs\', {}))
File "C:\path\to\pyvisa-sim\channels.py", line 112, in add_property
default_value, specs)
File "C:\path\to\pyvisa-sim\channels.py", line 28, in __init__
super(ChannelProperty, self).__init__(name, default_value, specs)
File "C:\path\to\pyvisa-sim\component.py", line 50, in __init__
specs[key] = t(specs[key])
TypeError: \'str\' object is not callable
\'
'
I cannot send the settings to the instrument as a list (i.e., no q: "RAMP {ch_id}, [{enable}, {rate}]"). Am I just wrong about how to specify/index entries to stringparser, or is this an absent feature?
The text was updated successfully, but these errors were encountered:
Some of the instruments I'd like to simulate have settings that contain multiple elements/variables. For example, if I want to set the ramp rate of a heater, I send the following:
RAMP {output_idx}, {enable}, {rate}
{output_idx} is the output channel, {enable} is whether or not the heater should be turned on, and {rate} is what rate you want the heating to proceed at. All three need to be specified at once. How do I store all three settings in one property?
I currently have {output_id} set up as a channel, since the examples show how to retrieve channel ids, and that works elsewhere in my file. However, my attempts to set parameters such as default and boundary values do not work by putting the separate values in as tuples, dicts, or lists.
my setup (using lists) is:
The error is:
I cannot send the settings to the instrument as a list (i.e., no
q: "RAMP {ch_id}, [{enable}, {rate}]"
). Am I just wrong about how to specify/index entries to stringparser, or is this an absent feature?The text was updated successfully, but these errors were encountered: