04-14-2020 09:59 PM
No, I was using LabVIEW 2019. (and down-converted to 2018 for you).
Here's the 2019 version.
04-14-2020 10:03 PM
@eddy1990 wrote:
Attaching the 2019 version, with which I tried.
Common sense dictates that you inspect the actual inputs to the function. You wired your format string to the wrong input.
04-14-2020 10:09 PM - edited 04-14-2020 10:14 PM
The problem is in your format into string function. I put a probe on the string wire coming out of the working and non-working VI's.
Working: (sin(0.5*x)/x)-0.125000
Non-working: (sin(0.5*x)/x)-%f0.125000
Hmm. Different. Why does the Non-working one have an extra %f in there. Nothing visible on the block diagram to show a difference.
So I right clicked on the Format into String and looked at Edit format String
Working: (sin(0.5*x)/x)-%f
Non-working: %f
There's the difference. Those constants you have wired into of "(sin(0.5*x)/x)-%f" are Initial string connection.
They should have been put into the Format String (top of function connector).
Just delete that Format into String. Drop a new one, and wire it up properly with the string constant wired to the top of the function!
PS. This thread is a perfect example of why we request actual VI's and not just pictures. It is hard to debug without going in and poking around.
PPS: It is also why cleaning up wires in block diagrams is so important. When I open up Altenbach's VI, the constant is wired to the top, but the wire bends makes it look like it is going into the top left. (Sorry Christian, your snippet, and your actual VI when I opened it didn't look like it should.)
04-14-2020 10:11 PM
Thanks. My bad not checking into finer details. Thanks a bunch.
04-15-2020 12:33 AM
The problem with programming is that the program will always do what you tell it to do, and not always what you want it to do. With experience, (hopefully) the two will converge.
When something doesn't work right, always assume first that you aren't doing something right.