Tektronix Technical Forums are maintained by community involvement. Feel free to post questions or respond to questions by other members. Should you require a time-sensitive answer, please contact your local Tektronix support center here.

exponential measuring LUA

DAQ6510 6½-Digit Data Acquisition and Logging Multimeter System
Post Reply
Posts: 1
Joined: July 28th, 2020, 12:42 am
Country: Germany

exponential measuring LUA

Post by vincent.bezold » July 28th, 2020, 1:07 am

Hello everyone,

I just bought a DAQ6510 with a 7700 card and startet programming with the TSB in Lua. Everything works quit well so far, but I would like to variate the scaninterval during a measurement. My plan is to measure for about a week, at the beginning i want to scan (330Hz) as fast as possible and then a want to reduce exponentially the scan rate to about 0.01 Hz at the end. My plan was to create an array/table with all the time values (TimSteps) (loop over e^(-a*x)). After that I would like to do the following (it is just a sketch):

for i=1,LengthOfTimSteps,1 do
Voltage = scan.??? here ist the struggle

As shown a both I can not not find a function which just does a scan once. As far as I understood I always have to define all the parameters (scaninterval an so on) and then trigger the scan. But this does not give me the possibility to do it exponentially (scaninterval does not accept tables). Sorry for my English, I am foreign and sorry for me code, I am new to Lua.
It would be really nice if someone more experienced than me could help me.
Thank you!

Andrea C
Keithley Applications
Keithley Applications
Posts: 1468
Joined: October 15th, 2010, 10:35 am
Country: United States

Re: exponential measuring LUA

Post by Andrea C » September 1st, 2020, 3:23 am

Would something like this suffice?

Use the channel.setdmm() to associate a measure function and other measure settings with a channel.
Subsequently, when the channel is closed because you presumably want a measurement, the dmm config as well as any backplane relays for signal routing to the internal DMM will be managed for you.

Code: Select all

function read_chan(chan)

   value = dmm.measure.read()
   return value

end   -- function


-- associate a measure function with a channel
channel.setdmm("101", dmm.ATTR_MEAS_FUNCTION, dmm.FUNC_TEMPERATURE)
channel.setdmm("101", dmm.ATTR_MEAS_TRANSDUCER, dmm.TRANS_THERMOCOUPLE)
channel.setdmm("101", dmm.ATTR_MEAS_THERMOCOUPLE, dmm.THERMOCOUPLE_K)
channel.setdmm("101", dmm.ATTR_MEAS_REF_JUNCTION, dmm.REFJUNCT_INTERNAL)
channel.setdmm("101", dmm.ATTR_MEAS_OPEN_DETECTOR, dmm.ON)

channel.setdmm("106", dmm.ATTR_MEAS_FUNCTION, dmm.FUNC_RESISTANCE)

channel.setdmm("113", dmm.ATTR_MEAS_FUNCTION, dmm.FUNC_DC_VOLTAGE)

chan_list = {"101", "106", "113"}
scan_delay_list = {0.1, 0.25, 1, 1, 1, 1, 5, 10}

for i = 1, table.getn(scan_delay_list) do

        -- read each channel
    	for chanIndex = 1, table.getn(chan_list) do
		end   -- for loop on chanIndex
end  -- for loop

print("All done")

Post Reply

Return to “DAQ6510 Data Acquisition and Logging Multimeter System”

Who is online

Users browsing this forum: No registered users and 1 guest