03-21-2020 09:16 AM - edited 03-21-2020 09:29 AM
I have copied this block diagram directly from my textbook. In the textbook, there aren't any errors that should arise, but in my diagram there is a problem at the bundle going into the XY Graph. Any suggestions?
03-21-2020 10:15 AM
To help us to help you, please attach the "code that fails", rather than a "picture of code that might or might not work". This saves us time and effort (which we are "donating", for free).
Bob Schor
03-21-2020 10:23 AM
03-21-2020 10:32 AM
You attached another picture, one that partly obscures the picture causing the Error. Assuming you are dealing with LabVIEW, you need to attach a file with the extension .vi, that is, LabVIEW code. We cannot "edit" a Picture, we cannot (or, at least, I cannot) clearly see a Picture (the pixels are blurry), and when I right-click it, I cannot execute a Picture (to see the Error, also blurry, for myself).
Bob Schor
03-21-2020 10:40 AM
I misunderstood. My mistake.
03-21-2020 11:12 AM
Thank you!
As it happens, I don't have MathScript installed on my version of LabVIEW (I use LabVIEW, not Matlab). But this is an opportunity to help you "learn LabVIEW", so bear with me.
First, look carefully at MathScript line 8. There is, I believe, a "typo" in the formula, which will certainly produce a nonsensical answer, if not an out-right Error.
So how to do this the "LabVIEW" way: use LabVIEW Structures and functions! Here we go:
I am uncertain why your MathScript routine gave you a 2D Array, but then I'm not a MathScript user. Try using LabVIEW, and see how easy (and logical) it is.
Bob Schor
03-21-2020 12:04 PM
Thank you. I will try this out. The reason we are using the Mathscript Structure in Labview is because the textbook had us do it that way. I just asked our instructor and he said whatever way we can solve the issue, he is fine with.
03-21-2020 01:51 PM - edited 03-21-2020 01:58 PM
remove one of the "t"s from the last line. one is enough!
"x=A*sin(pi*f*t)" instead of x=A*sin(t*pi*f*t)
Also please fill controls with typical default data before attaching code so we can run it without having to guess:
03-21-2020 02:00 PM
@altenbach wrote:
remove one of the "t"s from the last line. one is enough!
"x=A*sin(pi*f*t)" instead of x=A*sin(t*pi*f*t)
Close, but only half a cigar (there's a clue buried in there ...).
BS
03-21-2020 02:34 PM
@Bob_Schor wrote:
@altenbach wrote:
remove one of the "t"s from the last line. one is enough!
"x=A*sin(pi*f*t)" instead of x=A*sin(t*pi*f*t)
Close, but only half a cigar (there's a clue buried in there ...).
It gets rid of the error and outputs a 1D array as desired. Data looks like a sine function. Problem solved....
If different math is needed, that's out of my control 😉 I am not providing ashtrays! 😄
(But yes, using plain G instead of mathscript would turn is into a "fewliner".)