Posted Wed, 07 Aug 2024 08:23:24 GMT by hang, chen
My device is 2636B, with TSB, lua programming can be operated, but I need to realize the data obtained from the test (in the buffer) written to a file to facilitate the subsequent call, repeated errors, I have tried to change the permissions, change the absolute path of the file and other operations, I wrote a simple code here in the lua compiler SciTE can be run normally, but not in the TSB! I have written a simple code here, it works fine in lua compiler SciTE, but not in TSB, what could be the reason for this, I desperately want to solve this problem,
 I look forward to an early reply, thank you very much!
Here is my code


local file = io.open("numbers.txt", "w")

if file then

    local success, error_message = file:write("123\n456\n789\n")

    if success then
        print("Numbers have been successfully written to the file.")
    else
        print("Error writing to file: " .. error_message)
    end

    io.close(file)
else
    print("Error opening file")
end
Posted Wed, 07 Aug 2024 22:18:08 GMT by C, Andrea
When running this Lua code on the 2636B, the only file system available is the USB drive on front panel.  You need to insert a FAT32 formatted USB drive into the port.

I think instead you are wanting to put the information to the HDD of the computer, right?
Posted Thu, 08 Aug 2024 01:18:17 GMT by hang, chen
Thank you for taking your valuable time to respond to my question!
Yes, I need to use it in conjunction with several devices, so automatically storing the test data to the computer's hard disk is a must, is there a good way to do this please?

You must be signed in to post in this forum.