ISISComputingGroup / ISISComputingGroup/IBEX

Keithley 2700: Ordering issue with clearing buffer [TIMEBOX: 1 day and a half]

Open
#6,295 4 comments 0 reactions 0 assignees View on GitHub
5
Dominant language
No language data
Stars
6
Forks
2
Avg merge
16h 40m
Merged PRs (30d)
2

Description

As a developer I would like to be sure the Keithley 2700 correctly reads from the device after clearing the buffer. Currently you can see from the emulator that the IOC does the following:
1. Asks the next location on buffer
2. Clears the buffer
3. Asks the next location on buffer
4. Reads from the buffer assuming value in 1) rather than in 3)

```
021-03-09 17:16:25,197 INFO lewis.Keithley2700StreamInterface.StreamHandler: Processing request b'TRAC:NEXT?' using command TRAC:NEXT\?$
2021-03-09 17:16:25,197 INFO lewis.Keithley2700StreamInterface: Next buffer location: 16
2021-03-09 17:16:25,199 INFO lewis.Keithley2700StreamInterface.StreamHandler: Processing request b'TRAC:DATA:SEL? 14,2' using command TRAC:DATA:SEL\?\ ([+-]?\d+),([+-]?\d+)$
2021-03-09 17:16:25,199 INFO lewis.Keithley2700StreamInterface: Returned readings: +1084,6.164654970169067,+102,+1400,6.265652656555176,+103
2021-03-09 17:16:25,227 INFO lewis.SimulatedKeithley2700: Inserting mock data into buffer: ['+1583,6.367274522781372,+104']
2021-03-09 17:16:25,266 INFO lewis.SimulatedKeithley2700: Setting simulate readings to False
2021-03-09 17:16:25,386 INFO lewis.Keithley2700StreamInterface.StreamHandler: Processing request b'TRAC:CLE' using command TRAC:CLE$
2021-03-09 17:16:25,386 INFO lewis.SimulatedKeithley2700: === Cleared Buffer ===
2021-03-09 17:16:25,394 INFO lewis.Keithley2700StreamInterface.StreamHandler: Processing request b'TRAC:NEXT?' using command TRAC:NEXT\?$
2021-03-09 17:16:25,394 INFO lewis.Keithley2700StreamInterface: Next buffer location: 0
2021-03-09 17:16:25,395 INFO lewis.Keithley2700StreamInterface.StreamHandler: Processing request b'TRAC:DATA:SEL? 16,984' using command TRAC:DATA:SEL\?\ ([+-]?\d+),([+-]?\d+)$
2021-03-09 17:16:25,395 ERROR lewis.Keithley2700StreamInterface: An error occurred at requestb'TRAC:DATA:SEL? 16,984': IndexError('list index out of range')
2021-03-09 17:16:25,396 ERROR lewis.Keithley2700StreamInterface: Traceback (most recent call last):
File "C:\Instrument\Apps\Python3\lib\site-packages\lewis\adapters\stream.py", line 122, in found_terminator
reply = cmd.process_request(request)
File "C:\Instrument\Apps\Python3\lib\site-packages\lewis\adapters\stream.py", line 398, in process_request
return self.map_return_value(self.func(*args))
File "C:\Instrument\Apps\epics\support\DeviceEmulator\master\lewis_emulators\keithley_2700\interfaces\stream_interface.py", line 238, in get_readings
chunks.append("{},{},{}".format(self._device.buffer[buffer_location].reading,
IndexError: list index out of range
```

## Acceptance Criteria
* Fix the IOC to use the correct buffer length value
* Write tests to catch this
* Confirm that it still works on actual device

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.