From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-07-2015 05:59 AM
Hello
I have simulated a sine wave using the 'simulate signal' block and stored ther resulting waveform as a TDMS file.
When I read the file and compare it with the generated sine wave of similar properties, I expect a constant true(LED) output.
Eventhough the probes show similar values under highlight, on comparison the 'equal' comparator does not give a consistent 'true' output.
Thanks
04-07-2015 06:01 AM
Have you tried comparing just the Y-values from the waveform? A waveform contains a t0 timestamp which will differ depending on when the waveform was started/saved so that might be why it's not showing as equal. Also, is there possibility in your code for the sine waves to become out of phase?
04-07-2015 06:09 AM
Also keep in mind that it is a real bad idea to compare floating point numbers by equal. You should compare the waveform to an envelope function.
Norbert
04-07-2015 07:05 AM
Norbert - I agree with you (if you have data from two different sources - a DBL of 0 doesn't always equal (bitwise) another 0) but in this case I would have hoped that the sine wave function to generate exactly the same values in both cases (assuming the parameters are the same)
04-07-2015 07:06 AM
@Sam_Sharp wrote:
[...] (assuming the parameters are the same)
That might be true for this instance, yes, but we urge for generic solutions, do we? 😉
Norbert