diff options
Diffstat (limited to 'instr-daemon.c')
-rw-r--r-- | instr-daemon.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/instr-daemon.c b/instr-daemon.c index ec70f97..2097a6c 100644 --- a/instr-daemon.c +++ b/instr-daemon.c @@ -403,13 +403,26 @@ static gboolean periodic_poll (void) Update_Main_Menu_If_Visible(); - GPIB_check_for_device_clear_signal(); - if (GPIB_check_for_messages(globals.Registers.gpib_buffer)) { - if (GPIB_handle_new_input(globals.Registers.gpib_buffer)) { - Parser_main(globals.Registers.gpib_buffer, 0, GPIB_send_query_response, NULL); + // don't check GPIB interface if a VXI interface is locked, + // or is currently handling a command + + if ((globals.4882Locks.locked_network_server == NO_SERVER_LOCKED) && + (globals.4882Locks.command_in_progress == FALSE)) { + + // tell VXI servers that the 4882 subsystem is busy + globals.4882Locks.command_in_progress = TRUE; + + GPIB_check_for_device_clear_signal(); + if (GPIB_check_for_messages(globals.Registers.gpib_buffer)) { + if (GPIB_handle_new_input(globals.Registers.gpib_buffer)) { + Parser_main(globals.Registers.gpib_buffer, 0, GPIB_send_query_response, NULL); + } } + GPIB_check_for_device_clear_signal(); + + // tell VXI servers that the 4882 subsystem is avilable again + globals.4882Locks.command_in_progress = FALSE; } - GPIB_check_for_device_clear_signal(); Update_Main_Menu_If_Visible(); } |