08-22-2018 09:30 AM
I have successfully placed the 'red' dot at the lead end of an XY orbit plot, but am at a loss for placing the 'trigger' dot on the time waveforms. Obviously, the trigger happens once per revolution, so if I place four full sine waves on the screen, there should be four 'dots' marking the trigger positions.
Solved! Go to Solution.
08-22-2018 10:57 AM
08-22-2018 01:03 PM
I have a trigger pulse that is equivalent to a 5% duty cycle square wave. I want to represent the peak of that trigger pulse on the two time waveforms that are collected at the same time. See the plots included:
08-22-2018 02:15 PM
@Coryman wrote:
I have a trigger pulse that is equivalent to a 5% duty cycle square wave. I want to represent the peak of that trigger pulse on the two time waveforms that are collected at the same time. See the plots included:
I'm not sure what you mean by the "peak of a 5% duty cycle square wave". If you plot the square wave itself, you will definitely see its rising and falling edges. In fact, you can use this to make something similar to what you are talking about. The code below generates two waveforms (from the Waveform Generation sub-Palette). The first is a Sinusoid, the second a Square Wave of the same frequency. It's been given a 1% Duty Cycle (so it is very brief), been offset by 0.1 (so it sits just above the sinusoid peak), and has a phase of -85 (to more-or-less center the 1% peak over the sinusoid -- this needs to be adjusted for the sampling time). The Sine Wave has been plotted as a line, the Square Wave as Dots.
Try coding this up and see how it works without the sub-VI "Secret Sauce". You'll see there are a lot of points at 0.1 that aren't showing on this plot. What did Secret Sauce do to them? [Hint -- what does not get plotted on a Graph or Chart?]
The point here is that you can, in principle, generate a Waveform that has most of its points "invisible" and selected points (at times and Y magnitudes of your choosing) plottable, so you can put "dots" where you want.
Bob Schor
08-22-2018 02:28 PM
Bob,
That is real close to what I want. I need to take that red dot and have it coincide with the sine wave, be part of it. I know there are routines to strip out dt and y, so I need to merge those dots so that the y values are the same, then the dots would overlay on the sine wave. Yes?
08-22-2018 03:49 PM - edited 08-22-2018 03:50 PM
What about adding another waveform to your sinwave chart? Change the properties of this waveform to only show black points and no line between them.
The data set for this new waveform by default would fall outside of your sine wave chart so that you don't see anything if there is no trigger (autoscale for Y will need to be off). And then when your trigger occurs, replace your new waveform default (x,y) value with your current sinewave y value and your trigger point x value.
Let me know if this makes any sense to you.
- S
p.s. You would need to create a new waveform for each sinewave you have
08-22-2018 08:23 PM
I put the Red Dots above the sinusoid by setting the offset to 0.1. If I leave it at 0, it sits on top.
Bob Schor
08-23-2018 11:47 AM
Bob,
Sorry. Obviously I was involved with too much stuff when I looked at your solution. I will implement it today and let you know.
Thanks!
Ron
08-23-2018 01:41 PM
Bob,
Seriously? I looked at your example and it doesn't give me any answer. It poses a test like I was still in school. 'What's in the secret sauce?' If I knew that, I wouldn't have posted the question in the first place!!!!
Here is what I have so far. Two time waveforms that are not at the same phase. I also have a tach 1 volt peak pulse that is also not at the same time as the sine waves. They are all at the same frequency. So, I want to have the trigger show up on each of the ttime waveforms at the time of the trigger pulse, as a dot on each trace. I figure the peak search routine will give me the location of each of the peaks. So my problem is merging the plots.
08-23-2018 03:51 PM
Some more detail. I passed the trigger waveformthrough a 'peak detector', so I have an output of locations where the pulses occur. I have multiplied those locations by 0.000488 seconds. That is required to give the locations in seconds. I have also broken the time waveforms apart, so there is only one sine wave and that is what I want to put the trigger 'dots' on. So I need to merge those two into one graph.