long_measurement.lua

otii.clear()

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

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("high")
box:set_max_current(0.5)
box:enable_channel("mc", true)
box:enable_channel("mv", true)

-- Measure
otii.writeln("Capturing data...")
project:enable_main_power(true)
project:start()

box:led(100, 100)
for i = 1, 1000 do
    otii.msleep(60000)
    otii.write(".")
end
box:led(1)

project:stop()
project:enable_main_power(false)

local filename = string.format("%s/capture_%s.otii",
                               otii.get_otii_dir(),
                               os.date("%Y%m%d%H%M%S"))
project:save(filename)
project:close()
box:close()
generated by LDoc 1.4.6 Last updated 2021-10-13 21:46:39