====== Logger ====== Commands that provide access to logger instrument data and functions. \\ ===== Get Current State ===== ---- Get the current state of the instrument's channel **Command** * **logger** - (Object) - The logger * **channel type** - (Object) - The channel type (analog or digital). * **#** - (Array) - An array of command objects to apply to the logger channel. * **command** - (String) - The Get Current State command: “getCurrentState” **Response** * **logger** - (Object) - The logger object. * **channel type** - (Object) - The channel type (analog or digital). * **#** - (Array) - An array of command objects applied to the logger channel. * **command** - (String) - The Get Current State command: “getCurrentState” * **statusCode** - (Integer) - A numeric value representing the device status. See [[software:digilent-instrumentation-protocol:status-codes]] * **wait** - (Integer) - The number of ms to wait before the device is ready to process another command. * **state** - (String) - The state of the instrument channel: "idle", "stopped", "busy", or "running". * **stopReason**: - (String) - The reason the channel stopped: "NORMAL" or "OVERFLOW". * **startIndex** - (Integer) - The start index of the desired data. * **actualCount**- (Integer) - The number of samples available. * **maxSampleCount** - (Integer) - The max sample count. A value of -1 denotes an infinite number of samples. * **actualGain**- (Double) - The gain on the analog channel. * **actualVOffset**- (Integer) - The voltage offset. * **actualSampleFreq** - (Integer) - The actual sample frequency in uHz. * **actualStartDelay** - (Integer) - The start delay in ps. * **overflow** - (String) - The actual overflow setting: "circular" or "stop". * **storageLocation** - (String) - The location where the logging file will be stored. Empty string if logging to ram (streaming). * **uri** - (String) - The file name of the logging file. Empty string if not set or logging to ram (streaming). === Example === **Command** { "log": { "analog": { "1": [{ "command": "getCurrentState" }] } } } **Response** { "log": { "analog": { "1": [{ "command":"getCurrentState", "statusCode":0, "state":"stopped", "stopReason":"NORMAL", "startIndex":0, "actualCount":0, "maxSampleCount":-1, "actualGain":0.075, "actualVOffset":0, "actualSampleFreq":50000000, "actualStartDelay":0, "overflow":"circular", "storageLocation":"sd0", "uri":"ch1.bin", "wait":0 }] } } } \\ ===== Set Parameters ===== ---- Set log parameters. **Command** * **logger** - (Object) - The logger * **channel type** - (Object) - The channel type (analog or digital). * **#** - (Array) - An array of command objects to apply to the logger channel. * **command** - (String) - The Set Parameters command: “setParameters” * **maxSampleCount** - (Integer) - The max sample count. A value of -1 denotes an infinite number of samples. * **gain**- (Double) - The gain on the analog channel. * **vOffset**- (Integer) - The voltage offset. * **sampleFreq** - (Integer) - The actual sample frequency in uHz. * **startDelay** - (Integer) - The start delay in ps. * **storageLocation** - (String) - The location where the logging file will be stored. Empty string if logging to ram (streaming). * **uri** - (String) - The file name of the logging file. Empty string if not set or logging to ram (streaming). **Response** * **logger** - (Object) - The logger object. * **channel type** - (Object) - The channel type (analog or digital). * **#** - (Array) - An array of command objects applied to the logger channel. * **command** - (String) - The Set Parameters command: “setParameters” * **statusCode** - (Integer) - A numeric value representing the device status. See [[software:digilent-instrumentation-protocol:status-codes]] * **wait** - (Integer) - The number of ms to wait before the device is ready to process another command. * **maxSampleCount** - (Integer) - The max sample count. A value of -1 denotes an infinite number of samples. * **actualGain**- (Double) - The gain on the analog channel. * **actualVOffset**- (Integer) - The voltage offset. * **actualSampleFreq** - (Integer) - The actual sample frequency in uHz. * **actualStartDelay** - (Integer) - The start delay in ps. * **storageLocation** - (String) - The location where the logging file will be stored. Empty string if logging to ram (streaming). * **uri** - (String) - The file name of the logging file. Empty string if not set or logging to ram (streaming). === Example === **Command** { "log":{ "analog":{ "1":[{ "command":"setParameters", "maxSampleCount":1000, "gain":0.25, "vOffset":0, "sampleFreq":200000000, "startDelay":0, "storageLocation":"ram", "uri":"" }], "2":[{ "command":"setParameters", "maxSampleCount":1000, "gain":0.25, "vOffset":0, "sampleFreq":200000000, "startDelay":0, "storageLocation":"ram", "uri":"" }] } } } **Response** { "log":{ "analog":{ "1":[{ "command":"setParameters", "statusCode":0, "maxSampleCount":1000, "actualGain":0.25, "actualVOffset":-37, "actualSampleFreq":200000000, "actualStartDelay":0, "storageLocation":"ram", "uri":"", "wait":0 }], "2":[{ "command":"setParameters", "statusCode":0, "maxSampleCount":1000, "actualGain":0.25, "actualVOffset":12, "actualSampleFreq":200000000, "actualStartDelay":0, "storageLocation":"ram", "uri":"", "wait":0 }] } } } \\ ===== Run ===== ---- Run the logger **Command** * **logger** - (Object) - The logger * **channel type** - (Object) - The channel type (analog or digital). * **#** - (Array) - An array of command objects to apply to the logger channel. * **command** - (String) - The Run command: “run” **Response** * **logger** - (Object) - The logger object. * **channel type** - (Object) - The channel type (analog or digital). * **#** - (Array) - An array of command objects applied to the logger channel. * **command** - (String) - The Run command: “run” * **statusCode** - (Integer) - A numeric value representing the device status. See [[software:digilent-instrumentation-protocol:status-codes]] * **wait** - (Integer) - The number of ms to wait before the device is ready to process another command. === Example === **Command** { "log": { "analog": { "1": [{ "command": "run" }] } } } **Response** { "log": { "analog": { "1": [{ "command":"run", "statusCode":0, "wait":-1 }] } } } \\ ===== Read ===== ---- Read live logger while it runs **Command** * **logger** - (Object) - The logger * **channel type** - (Object) - The channel type (analog or digital). * **#** - (Array) - An array of command objects to apply to the logger channel. * **command** - (String) - The Read command: “read” * **startIndex** - (Integer) - The start index to read from * **count** - (Integer) - The number of points to read **Response** * **logger** - (Object) - The logger object. * **channel type** - (Object) - The channel type (analog or digital). * **#** - (Array) - An array of command objects applied to the logger channel. * **command** - (String) - The Read command: “read” * **statusCode** - (Integer) - A numeric value representing the device status. See [[software:digilent-instrumentation-protocol:status-codes]] * **wait** - (Integer) - The number of ms to wait before the device is ready to process another command. * **binaryOffset** - (Integer) - The first byte of the buffer in the binary data chunk. * **binaryLength** - (Integer) - The buffer size in bytes. * **actualCount** - (Integer) - The actual number of data points returned. * **startIndex** - (Integer) - The actual start index of the points returned. * **maxSampleCount** - (Integer) - The max sample count parameter currently set. * **actualGain** - (Double) - The gain parameter currently set. * **actualVOffset** - (Integer) - The offset parameter currently set. * **actualSampleFreq** - (Integer) - The actual sample frequency currently set. * **actualStartDelay** - (Integer) - The actual start delay currently set. * **overflow** - (String) - The actual overflow currently set. * **storageLocation** - (String) - The storage location of the data. * **uri** - (String) - The name of the log file === Example === **Command** { "log": { "analog": { "1": [{ "command":"read", "startIndex":0, "count":0 }] } } } **Response** 12F\r\n { "log": { "analog": { "1": [{ "command":"read", "statusCode":0, "binaryOffset":0, "binaryLength":2, "actualCount":1, "startIndex":0, "maxSampleCount":1000, "actualGain":1, "actualVOffset":-68, "actualSampleFreq":200000000, "actualStartDelay":0, "overflow":"circular", "storageLocation":"ram", "uri":"ch1.bin", "wait":0 }] } } }\r\n 2\r\n \r\n 0\r\n \r\n \\ ===== Stop ===== ---- Stop the logger **Command** * **logger** - (Object) - The logger * **channel type** - (Object) - The channel type (analog or digital). * **#** - (Array) - An array of command objects to apply to the logger channel. * **command** - (String) - The Stop command: “stop” **Response** * **logger** - (Object) - The logger object. * **channel type** - (Object) - The channel type (analog or digital). * **#** - (Array) - An array of command objects applied to the logger channel. * **command** - (String) - The Stop command: “stop” * **statusCode** - (Integer) - A numeric value representing the device status. See [[software:digilent-instrumentation-protocol:status-codes]] * **wait** - (Integer) - The number of ms to wait before the device is ready to process another command. === Example === **Command** { "log": { "analog": { "1": [{ "command": "stop" }] } } } **Response** { "log": { "analog": { "1": [{ "command":"stop", "statusCode":0, "wait":0 }] } } } \\ \\