• 0
Nick

Data Collection

Question

After I collect data using the scope, I'm trying to write the script to create an array with such data so that I can further analyze it. However, I noticed that the "Scope1.Channel1.data" (7693 samples) outputs different data from that shown in the table on the Scope tab -> View -> Data (8192 samples). Any recommendations on how to output the data displayed on the oscilloscope?

PS: On the "WaveForms 2015 Reference Manual" it is said that Scope1.Channel1.checked obtains the data array, but this is false since ".checked" returns true or false.

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Hi @attila

Thank you very much for your response, the .alldata worked!

Quick question, I'm trying to use File("path").read() to read information from a .txt file, I also tried readArray()  but I have not been successful.

This is the code I used:

var y = File("path").read()

print(y)

 

Thank you!

Share this post


Link to post
Share on other sites
  • 0

Hi @Nick

The File.read() is working for me on this file.
The readArray() splits the text by any of the following: comma, space or new line.
You can also read() all the text and split("\n") by new line.

i1.png.748238c9a4dc76f3273a9145c245e49b.png

Share this post


Link to post
Share on other sites
  • 0

Hi @attila

Now it does work, the only difference between our codes was that I didn't include the "~/" when writing the path name, once I write it in the program outputs correctly.

Thanks for all your help!

Share this post


Link to post
Share on other sites
  • 0

Hi @Nick

The ~ (tilde) is a notation for user home folder.
For paths absolute (C:/temp/myfile.txt) or relative to home should be specified.
When writing files note that Windows does not allow saving to certain folders: C:/, C:/Windows/ ... 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now