09-04-2017 03:10 PM
This may be a little abstract to talk about so I attached my code. Anyway, as you can see this is sort of a data entry vi. The user inputs info into the various string controls, and then those fields are concatenated together. That works fine, as you can see the intended conclusion in the large grey string indicator to the right of the main entry field.
But when I hit the save button nothing happens. It's supposed to save the created concatenated string as a text file in whatever folder I specify. And weirdly it used to work sporadically, but now it's no dice all together.
So, that's it. When looking at my code just tell the Write to Text function to put the concatenated string wherever you want and there should be all you need to test things.
Solved! Go to Solution.
09-04-2017 03:13 PM
Try putting probes to see if the data needs your expectations.
Try execution highlight to see if the data flow meets your expectations.
09-04-2017 03:38 PM
I put a bunch of probes down, especially as to the output of the string controls, and weirdly the probe returns Not executed. It's as if the program isn't even running. I mean, the probe should return a good reply if it's just a string control inputting a word into a string indicator. There's nothing simpler than that. I don't know, it feels like something else is gumming up the vi's works if simple coding like that doesn't work. But thanks for the suggestion.
09-04-2017 03:40 PM
I tried a different version of my program, this time using an event structure to handle the boolean states of the Save button. But again, it does the same thing...which is nothing. Well, actually, sometimes it does work but rarely. New program is attached.
09-04-2017 04:27 PM
Doh!!! This was a serious rookie mistake. I had all my strings outside the while loops, so they never were updated. Anyway, it's working now. I guess, you could say it definitely was an execution problem! Thanks again.
09-05-2017 01:35 AM - edited 09-05-2017 01:36 AM
Hi Orta,
I guess, you could say it definitely was an execution problem!
No. It was a typical PEBKAC problem, as you completely missed the basic principle of LabVIEW: THINK DATAFLOW!
😄
Anyway, it's working now.
Well, I hope you also put a loop around the second event structure?
Or even better: put all events into one event structure?
And you hopefully also put all (boolean) controls into their event cases?
Buttons usually should use a latched switching mode, so you don't need local variables to reset them…
You shouldn't use hard coded paths, especially not ones pointing to admin accounts…
Instead of that huge ConcatString I would prefer a FormatIntoString with a proper format string!
09-05-2017 04:08 AM
@GertW: +1 for PEBKAC AKA PICNIC. Both were new for me.