I am trying to use my DAQ6510 with 7700 card to do a multichannel scan with Python using TSP. I am able to successfully perform the scan and extract the data using Test Script Builder, but I am having trouble translating the data buffer commands into Python using PyVISA. Below is a snippet of the TSP code in Test Script Builder. I'm not sure how to query the individual readings in the data buffer using Python commands. For example, 'defbuffer1' is not defined. How do I create Python data arrays from the defbuffer1.readings to extract the individual measurements?
-- set up Scan
scan.add("101:119")
scan.scancount = scanCount
-- set up trigger model
trigger.model.initiate()
display.changescreen(display.SCREEN_HOME)
-- print measurement data to console
i = 1
while i <= bufferSize do
delay(2)
lastIndex = defbuffer1.n
printbuffer(i, lastIndex, defbuffer1.readings)
i = lastIndex + 1
end