P. Fiery

Members
  • Content Count

    10
  • Joined

  • Last visited

About P. Fiery

  • Rank
    Member

Recent Profile Visitors

81 profile views
  1. Attila, thank you, this works. And thanks for pointing out the script hints in the status bar; all this time and I didn't notice them. Two additional things would make this coding environment sufficiently "complete" IMO: Within the script editor, please give us a hot key to sequence between different script tabs. CTRL+TAB would be consistent across the app. OR: If possible, provide separate simultaneous instances of the script editor so one can view and edit all script files at once. Of course, a search and replace would be great to have. It's the one editor function I truly miss. I cut, paste to notepad, and do search and replace there as a workaround. Helpful things: A way to clear the output window, other than quitting and restarting. If user accidentally closes a plot window, say PLOT1, it seems there is no way to bring back PLOT1. You have to instantiate a new plot, which will be automatically PLOT2, and manually set the axis as they were, and manually change any references from PLOT1 to PLOT2. The "safest" practice is to save everything: the individual scripts as .js, the script project, the scope project, waveform project, etc. This way, if user closes some child windows and saves the whole waveforms project that way, everything can be reassembled. Backups are good practice but one can still lose one's current post-backup work with a couple of thoughtless clicks perhaps to make screen space for multitasking. I'm saving individual things now manually whenever I've edited something. A "SAVE ALL" command would be great. Even without any of this, Waveforms + AD2 has about doubled my productivity as a consultant. And I have only begun to leverage it. So: Thank you for this great product! Two heads are useful:
  2. Attila you may already be aware of all the following, but in the hope of being helpful I offer a bug report on this beta release: The overall waveforms project file fails to store the window position of the script. Not sure this is so if the script is docked, but definitely when it is not docked. Minor issue. If the user has renamed script File 1 and File 2, the overall waveforms project file fails to store these new names. In general, the file save command within the script window functions like a file export. It seems that once the script is saved this way, no further reference is made by Waveforms to this saved .js file. Consistent with #3, in the scenario where user has file 1 and file 2 and associated tabs, and user has checked the 'include' box for file 2 in the file 1 tab, removing file 2 maintains it's functionality in the script. The file tabs disappear though. Modifying file 2.js externally with another editor has no effect, so there must be a local copy in memory. Worse, if waveforms is now closed and reopened, the 'include' functionality is gone, along with file 2. (Though if the user saved it, it is on drive. ) And by the way, if one has un-docked the script and closes the script window before saving the overall waveform project, the entire script is gone. Gone irretrievably it seems, unless of course one has an earlier backup, or one has saved the script project separately from the waveforms project, or one has, (now with this new beta), saved the individual script file. This is the case in the last official non-beta release and it still is. My overview is this is on the way to what I'd like, (using an external editor running simultaneously with waveforms.exe, with the "main" program in the native waveforms script window and the functions in the separate concurrent editor application), but it's not there yet. In general, unless one is careful and knows there are pitfalls, it would be quite easy to lose one's code entirely, or lose the portion of it in "file 2", or think the file on disk was actually in use within waveforms, etc. I almost did so a few weeks ago, but fortunately I'd just made a backup so I lost only a few comments I'd added.
  3. Thank you Attila, this will probably be an effective work around. I very much appreciate your support here. Coming to javascript from C, I have gleaned a great deal from the answers you have given to others' questions. The AD2 is really a fine and powerful tool and the scripting makes it open-ended and even more useful. I have an expensive Tektronix scope on my bench but the only reason to ever turn it on is if I need 1G sampling. An "AD3" could obviate it entirely. The AD2 with scripting is probably saving me about 6 months of time relative to how I was going to handle my current work before I tried scripting the AD2. But my script is getting quite long... Question: Is it possible to use some form of syntax such as src="filename.js"? I would be great to be able to keep a short "main" program within the editor integrated with AD2 script, and have all the functions in an external script. Having these two files side by side would be much more efficient than jumping around within one long script file, and it would be nice to work mostly in a full-featured JS editor.
  4. From within a script, how do I perform the equivalent of checking the View-FFT item to display and activate the FFT? I want to turn on the FFT, perform an acquisition, access the FFT mag and freq array data, and then turn off the FFT for subsequent acquisitions. The reason for turning it off after the first acquisition is that I'm doing a large series of sequential acquisitions and keeping the FFT function active takes an extra few milliseconds per acquisition, which adds up and slows down my application appreciably. I've used the completion feature, which looks very helpful, except consider: Scope1.FFT.Window.setChecked(true); This looks like it should do the trick, but it does nothing. Neither does the false argument, or 1 or 0. And there are many other plausible but unsatisfying things to try via the code completion feature. As a more general question then, how does one go from what one wants to do to finding the syntax to do it? Is there somewhere where all these possible statements are listed? Alternately, is there a way to dump all of the settings that configure what you see on the screen, then make the FFT graph visible, then dump all the settings again and look for what has changed to discover how to do such things in script?
  5. Thank you, this is clarifying regarding jitter. The glitch: [ Some time later... Yes, I see that setting "idle output" to "offset" repairs the behavior I've reported here. However, I'll leave this comment here with your permission as it may help someone just discovering the inner workings of the AD2, as I am. One really does need to know these non-obvious things to make proper use of the Wavegen module. ] I am using the Analog Discovery 2. The glitch seems due to the offset value not being maintained across the entire loop of the waveform buffer. You will not see this problem with any waveform that starts at zero but it shows up when you introduce an offset. In my example, the output should be -1v with a +1v pulse, but at t = 0 the output returns to 0 volts for what looks like one sample interval. Is it possible that a loop in Wavegen code responsible for adding the offset to the output is running from 1 to 4096 and excluding zero? Also, note that the drawn Wavegen signal spends the 5us delay at zero volts, differing from the actual signal produced. All in all, it seems there is something to reconcile here. [I still think the behavior here is counter-intuitive.]
  6. Hello, There is a pulse width jitter caused by some kind of aliasing between various unsynchronized events. My screen capture grabs only one frame of video, but you can see it in the red persistence trace, and I can see it on my Tek scope. I discovered this while running one of the script examples, and then confirmed that it exists in all the pulse modes of the Wavegen except as follows: It is here with these "simple" settings: It is here with these "basic" settings: For my buffer setting and 1% at 5KHz the pulse width here varies from 1.870 us to 1.98 us. It should be 2 us of course. The actual frequency is similarly unstable by a few Hz around 5KHz. Synchronization with a "Run" argument of 200 us or less cures the problem. It appears that when this is =< the set period, it dominates as the period of the waveform. : Placing Wavegen into "autosynchronized" mode does the same thing, but enforces a 200 us "run" argument: As expected, the "run" argument automatically takes on the period of the set frequency. However, note that at 2KHz a glitch appears in the pulse. (It is real): None of these setting produces a waveform that matches the settings exactly. The glitch is particularly troubling. Am I doing something wrong here? - Paul Vo
  7. Can you point me to some examples of scripts beyond what is available under the "examples" tab? Well-commented scripts would be especially helpful.
  8. Thank you very much. Great stuff, so many ways to do things with this tool. I think the logger is limited to a top sample rate of 1 MHz. My signal is ~ 2MHz, and I need to get some sub-nyquist detail so the results aren't mathematical fiction. But I get the idea. It looks like I can do the job entirely with scripting - except perhaps for the very last step. So, last 2 questions before I dive in: 1) the oversampling feature of the scope: Oversampling can mean different things. It should mean that when the sample rate is lower than the maximum sample rate several samples are taken in real time and averaged to produce the sample that is sent to the buffer. This can increase the effective precision beyond the 14 bits of each individual sample. However, it seems that with the scope I can set the sample rate to say 50 MHz and yet oversample by a factor of 16. With a max sample rate of 100MHz, this shouldn't be possible. So, exactly what does your scope oversampling actually do? 2) Everything I want to do appears to be possible with only scripting within ghe WaveForms app - except presenting the output. It's just a couple of numbers, but I'd like them to be seen across a room. Seems like this qualifies as a "custom gui" and would therefore require I use the SDK. Or can I send a couple of numbers to a file, (that could be read and displayed as I want by another process)?
  9. Hi Attila, Well I'm relieved to know I wasn't just confused. I have version 3.7.5 64 bit. I see the current version is 3.10.9. I'll install this. On a wider subject but still about the AD2: It's just right to form the hardware and software base upon which to construct a demonstration of a novel device for a client. The application consists of the following steps: 0) Generate a particular pulse signal using Wavegen, and synchronized with the completion of this pulse, do the following: 1) acquire a full buffer, (16K) of 14 bit samples. (sample rate about 15 MHz). 2) read this into an array. 3) upsample the array contents using a suitable order of FIR interpolation. (custom DSP unless it's a stock function) 4) perform a custom heuristic analysis of the larger array. (dump outliers, perform some array operations, etc. Probably all custom code.) 5) repeat steps 0 to 4 and average the results to hone resolution and accuracy. 6) Be able to "probe" intermediate results at least during development by displaying them in a waveform window. 7) The whole thing ends up producing two simple numbers that tell a particular truth about the object of the process. Display those numbers using a large font. My question is, what documents would you direct me to reference to be able to modify the waveforms app - or build a smaller custom GUI to do only what I want - using the AD2? Can I do all this with the Waveforms SDK? I had a look at your labview stuff. It seems too big and complex a hammer for this task.
  10. Hello, I just signed up, so first let me say hello. I've been using the Analog Discovery 2 for a while now and I must say, this is one of the best values available in its category. I seldom power up my Tektronix now. I turn to that only when I need more than two analog channels and/or faster sampling and higher bandwidth. What a great product! Okay, now to the question: I want to create a custom math channel that will climb a waveform looking for the highest sample value, (the peak). The output of this should hold each highest value encountered in C1 until a higher value is encountered. I tried: var yy = 0; if(C1>yy) { yy = C1 } return yy Seems reasonable, but when run I see the entire script is evaluated for every sample. Therefore yy is set to zero every time. The resulting math channel simply tracks the positive half of each waveform. I'd like to declare the variable yy and zero it at the start of each sweep of C1 data collection, not at every point of C1. The result of the above script is the same as simply writing "max(C1,Time )", which is the first thing I tried. What use is a "max" function that doesn't return the maximum of an array passed to it in the argument? I must be missing something. Maybe there is a way to cause a function to evaluate across the time argument rather than at each point? Please set me straight here. How does one accomplish this simple thing in this environment? Also, the commonly used functions you can click on to copy into the script editor: Is there a description somewhere of the arguments these functions require in the parenthesis? For example, the max( , ) function, what are the arguments? In Javascript there is a max method, which isn't the same thing. P. Fiery