project.lua

local devices = otii.get_devices("Arc")
assert(#devices > 0, "No available devices")
local box = otii.open_device(devices[1].id)
assert(box ~= nil, "No available otii")

box:set_main_voltage(3.0)
box:set_range("low")
box:enable_channel("mc", true)
box:enable_channel("mv", true)

local project = otii.create_project()
assert(project ~= nil, "Cannot create project")

project:enable_main_power(true)

for i = 1, 10 do
    project:start()
    otii.msleep(60000)
    project:stop()

    local filename = string.format("%s/capture_%s.otii",
                                   otii.get_otii_dir(),
                                   os.date("%Y%m%d%H%M%S"))
    project:save(filename)

    local recording_id = project:get_last_recording_id()
    project:remove_recording(recording_id)
end

project:enable_main_power(false)

project:close()
box:close()
generated by LDoc 1.4.6 Last updated 2021-10-13 21:46:39