The sixth character from ISET? is read and discarded. If the device is
turned off and on again, this won't be there and causes 10 ms delay in
every ISET? Luckily, this value isn't queried that often. To get the
sixth byte, the *IDN? command has to be issued before ISET?.
struct dev_context *devc)
{
double value;
struct dev_context *devc)
{
double value;
float *target;
char status_byte;
float *target;
char status_byte;
devc->reply[count] = 0;
if (target) {
devc->reply[count] = 0;
if (target) {
- /* Handle the strange 'M'. */
- if (devc->reply[0] == 'M') {
- for (i = 1; i < count; i++)
- devc->reply[i - 1] = devc->reply[i];
- /* Get the last character. */
- if ((i = korad_kaxxxxp_read_chars(serial, 1,
- &(devc->reply[count]))) < 0)
- return i;
- }
value = g_ascii_strtod(devc->reply, NULL);
*target = (float)value;
sr_dbg("value: %f",value);
value = g_ascii_strtod(devc->reply, NULL);
*target = (float)value;
sr_dbg("value: %f",value);
(status_byte & (1 << 6)) ? "enabled" : "disabled",
(status_byte & (1 << 7)) ? "true" : "false");
}
(status_byte & (1 << 6)) ? "enabled" : "disabled",
(status_byte & (1 << 7)) ? "true" : "false");
}
+ /* Read the sixth byte from ISET? BUG workaround. */
+ if (devc->target == KAXXXXP_CURRENT_MAX)
+ serial_read_blocking(serial, &status_byte, 1, 10);
devc->reply_pending = FALSE;
return ret;
devc->reply_pending = FALSE;
return ret;