Abdullah1 Posted April 10 Share Posted April 10 We are looking on collecting 50us of data every 1000us. However we are able to collect 50us at random times. See attached code. Could you suggest a modification to the code or a solution to this problem. clear() // Set up the scope channel 2 //Scope1.Rate.value = 50000000; // Sampling rate (50 Mz) //Scope1.Samples.value = 2500 // Scope1.Time.Position.value = 25e-6; Scope1.Time.Base.value = 50e-6 Scope1.Trigger.Type.text = "Edge"; // Trigger type Scope1.Trigger.Source.text = "Channel2"; // Trigger source Scope1.Trigger.Condition.text = "Rising"; // Trigger condition Scope1.Trigger.Level.value = 0.5; // 50% trigger level Scope1.Trigger.Hysteresis.value = 0.1; // Trigger hysteresis Scope1.Trigger.Filter.text = "Decimate"; // Trigger filter //Scope1.Trigger.BufferSize.value = 2500 //uffer size //Scope1.Trigger.Buffer.value = 0; // Buffer index //Scope1.Trigger.Delay.value = 0; // Trigger delay for(var i = 0; i < 200; i++){ print("Recording", + (i+1) + " of 200..."); Scope1.run(); Scope1.wait(); Scope1.Export("/home/SWE/Desktop/new007/new007_" + (i + 1) + ".csv"); wait(0.01) } print("Finish Recording") Link to comment Share on other sites More sharing options...
0 attila Posted April 10 Share Posted April 10 Hi @Abdullah1 Which device are you using? With Analog Discovery 3, ADP2230, ADP3X50... notice the high precision hardware trigger datetime stamp in top of the plot. With WaveForms app to improve the capture rate set: Update: Fastest, uncheck Noise, specify Samples, Edge Hist: Off (may work even with On), specify Buffers and Run: Buffer Stop For Buffers you can specify +1 since the first capture(s) seems to have a bit more delay, probably due to initial memory allocations. Make sure the Scope is not visible, like select Welcome tab, press Run button in Scope tab. Then export data using Script tool, looping through Scope.Buffer.value, like from 2 to 101 The ADP2230, ADP3X50 have device buffering which provides ~1us capture latency. This can be enabled under the dropdown before Buffer option. Since transfer does not influence capture latency, the View/Logging can be used to auto export captures sequentially. Custom app/script can perform better than WF app if less processing is performed between captures, like 4096 samples @ 100MHz on 2 channels at 1ms See the following example: AnalogIn_Triggers.py Link to comment Share on other sites More sharing options...
Question
Abdullah1
We are looking on collecting 50us of data every 1000us. However we are able to collect 50us at random times. See attached code. Could you suggest a modification to the code or a solution to this problem.
clear() // Set up the scope channel 2 //Scope1.Rate.value = 50000000; // Sampling rate (50 Mz) //Scope1.Samples.value = 2500 // Scope1.Time.Position.value = 25e-6; Scope1.Time.Base.value = 50e-6 Scope1.Trigger.Type.text = "Edge"; // Trigger type Scope1.Trigger.Source.text = "Channel2"; // Trigger source Scope1.Trigger.Condition.text = "Rising"; // Trigger condition Scope1.Trigger.Level.value = 0.5; // 50% trigger level Scope1.Trigger.Hysteresis.value = 0.1; // Trigger hysteresis Scope1.Trigger.Filter.text = "Decimate"; // Trigger filter //Scope1.Trigger.BufferSize.value = 2500 //uffer size //Scope1.Trigger.Buffer.value = 0; // Buffer index //Scope1.Trigger.Delay.value = 0; // Trigger delay for(var i = 0; i < 200; i++){ print("Recording", + (i+1) + " of 200..."); Scope1.run(); Scope1.wait(); Scope1.Export("/home/SWE/Desktop/new007/new007_" + (i + 1) + ".csv"); wait(0.01) } print("Finish Recording")
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now