Add command AIN:ACQUIRE:ENABLE
This commit is contained in:
parent
2bf8b9f938
commit
ce08bd84e4
|
@ -119,6 +119,7 @@ In the response string, such data elements are separated by space characters.
|
||||||
| `AIN:TRIGGER:STATUS?` | Trigger status. |
|
| `AIN:TRIGGER:STATUS?` | Trigger status. |
|
||||||
| `AIN:TRIGGER:EXT:CHANNEL` | External trigger channel. |
|
| `AIN:TRIGGER:EXT:CHANNEL` | External trigger channel. |
|
||||||
| `AIN:TRIGGER:EXT:EDGE` | External trigger edge. |
|
| `AIN:TRIGGER:EXT:EDGE` | External trigger edge. |
|
||||||
|
| `AIN:ACQUIRE:ENABLE` | Enable analog acquisition. |
|
||||||
| `TT:SAMPLE?` | Digital input state. |
|
| `TT:SAMPLE?` | Digital input state. |
|
||||||
| `TT:EVENT:MASK` | Timetagger event mask. |
|
| `TT:EVENT:MASK` | Timetagger event mask. |
|
||||||
| `TT:MARK` | Emit timetagger marker. |
|
| `TT:MARK` | Emit timetagger marker. |
|
||||||
|
@ -382,6 +383,18 @@ This command selects rising or falling edges in the external trigger signal.
|
||||||
Query: `AIN:TRIGGER:EXT:EDGE?` <br>
|
Query: `AIN:TRIGGER:EXT:EDGE?` <br>
|
||||||
Response: either `RISING` or `FALLING`.
|
Response: either `RISING` or `FALLING`.
|
||||||
|
|
||||||
|
### `AIN:ACQUIRE:ENABLE`
|
||||||
|
|
||||||
|
Command: `AIN:ACQUIRE:ENABLE en` <br>
|
||||||
|
Parameter _en_: either `0` or `1`.
|
||||||
|
|
||||||
|
This command enables or disables analog acquisition.
|
||||||
|
When enabled, analog samples are acquired according to the configured trigger mode.
|
||||||
|
When disabled, all triggers are ignored and any ongoing analog acquisition stops immediately.
|
||||||
|
|
||||||
|
Query: `AIN:ACQUIRE:ENABLE?` <br>
|
||||||
|
Response: either `0` or `1`.
|
||||||
|
|
||||||
### `TT:SAMPLE?`
|
### `TT:SAMPLE?`
|
||||||
|
|
||||||
Query: `TT:SAMPLE?` <br>
|
Query: `TT:SAMPLE?` <br>
|
||||||
|
|
|
@ -543,9 +543,6 @@ public:
|
||||||
m_device.set_record_length(1024);
|
m_device.set_record_length(1024);
|
||||||
m_device.set_timetagger_event_mask(0);
|
m_device.set_timetagger_event_mask(0);
|
||||||
m_device.clear_adc_range();
|
m_device.clear_adc_range();
|
||||||
|
|
||||||
// Enable analog acquisition.
|
|
||||||
m_device.set_acquisition_enabled(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -901,6 +898,12 @@ private:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Handle command AIN:ACQUIRE:ENABLE? */
|
||||||
|
std::string qry_acquire_enable(CommandEnvironment env)
|
||||||
|
{
|
||||||
|
return m_device.is_acquisition_enabled() ? "1" : "0";
|
||||||
|
}
|
||||||
|
|
||||||
/** Handle command TT:SAMPLE? */
|
/** Handle command TT:SAMPLE? */
|
||||||
std::string qry_tt_sample(CommandEnvironment env)
|
std::string qry_tt_sample(CommandEnvironment env)
|
||||||
{
|
{
|
||||||
|
@ -1288,6 +1291,18 @@ private:
|
||||||
return "OK";
|
return "OK";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Handle command AIN:ACQUIRE:ENABLE */
|
||||||
|
std::string cmd_acquire_enable(CommandEnvironment env,
|
||||||
|
const std::string& arg)
|
||||||
|
{
|
||||||
|
unsigned int n;
|
||||||
|
if ((! parse_uint(arg, n)) || (n > 1)) {
|
||||||
|
return err_invalid_argument();
|
||||||
|
}
|
||||||
|
m_device.set_acquisition_enabled(n != 0);
|
||||||
|
return "OK";
|
||||||
|
}
|
||||||
|
|
||||||
/** Handle command TT:EVENT:MASK */
|
/** Handle command TT:EVENT:MASK */
|
||||||
std::string cmd_tt_event_mask(CommandEnvironment env,
|
std::string cmd_tt_event_mask(CommandEnvironment env,
|
||||||
const std::string& arg)
|
const std::string& arg)
|
||||||
|
@ -1367,6 +1382,7 @@ private:
|
||||||
{ "ain:chN:sample:raw?", &CommandHandler::qry_channel_sample },
|
{ "ain:chN:sample:raw?", &CommandHandler::qry_channel_sample },
|
||||||
{ "ain:chN:minmax?", &CommandHandler::qry_channel_minmax },
|
{ "ain:chN:minmax?", &CommandHandler::qry_channel_minmax },
|
||||||
{ "ain:chN:minmax:raw?", &CommandHandler::qry_channel_minmax },
|
{ "ain:chN:minmax:raw?", &CommandHandler::qry_channel_minmax },
|
||||||
|
{ "ain:acquire:enable?", &CommandHandler::qry_acquire_enable },
|
||||||
{ "ain:srate?", &CommandHandler::qry_srate },
|
{ "ain:srate?", &CommandHandler::qry_srate },
|
||||||
{ "ain:srate:divisor?", &CommandHandler::qry_srate_divisor },
|
{ "ain:srate:divisor?", &CommandHandler::qry_srate_divisor },
|
||||||
{ "ain:srate:mode?", &CommandHandler::qry_srate_mode },
|
{ "ain:srate:mode?", &CommandHandler::qry_srate_mode },
|
||||||
|
@ -1402,6 +1418,7 @@ private:
|
||||||
{ "ain:chN:offset:RR", &CommandHandler::cmd_channel_offset },
|
{ "ain:chN:offset:RR", &CommandHandler::cmd_channel_offset },
|
||||||
{ "ain:chN:gain", &CommandHandler::cmd_channel_gain },
|
{ "ain:chN:gain", &CommandHandler::cmd_channel_gain },
|
||||||
{ "ain:chN:gain:RR", &CommandHandler::cmd_channel_gain },
|
{ "ain:chN:gain:RR", &CommandHandler::cmd_channel_gain },
|
||||||
|
{ "ain:acquire:enable", &CommandHandler::cmd_acquire_enable },
|
||||||
{ "ain:srate", &CommandHandler::cmd_srate },
|
{ "ain:srate", &CommandHandler::cmd_srate },
|
||||||
{ "ain:srate:divisor", &CommandHandler::cmd_srate_divisor },
|
{ "ain:srate:divisor", &CommandHandler::cmd_srate_divisor },
|
||||||
{ "ain:srate:mode", &CommandHandler::cmd_srate_mode },
|
{ "ain:srate:mode", &CommandHandler::cmd_srate_mode },
|
||||||
|
@ -1864,13 +1881,12 @@ int run_remote_control_server(
|
||||||
command_handler.add_data_server(acq_server);
|
command_handler.add_data_server(acq_server);
|
||||||
command_handler.add_data_server(timetagger_server);
|
command_handler.add_data_server(timetagger_server);
|
||||||
|
|
||||||
// Restore firmware status on exit from this function.
|
// Disable DMA on exit from this function.
|
||||||
struct ScopeGuard {
|
struct ScopeGuard {
|
||||||
PuzzleFwDevice& m_device;
|
PuzzleFwDevice& m_device;
|
||||||
ScopeGuard(PuzzleFwDevice& device) : m_device(device) { }
|
ScopeGuard(PuzzleFwDevice& device) : m_device(device) { }
|
||||||
~ScopeGuard() {
|
~ScopeGuard() {
|
||||||
m_device.set_dma_enabled(false);
|
m_device.set_dma_enabled(false);
|
||||||
m_device.set_acquisition_enabled(false);
|
|
||||||
}
|
}
|
||||||
} scope_guard(device);
|
} scope_guard(device);
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
#define PUZZLEFW_SW_MAJOR 0
|
#define PUZZLEFW_SW_MAJOR 0
|
||||||
#define PUZZLEFW_SW_MINOR 3
|
#define PUZZLEFW_SW_MINOR 4
|
||||||
|
|
Loading…
Reference in New Issue