LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

So my Save Button doesn't work....

Solved!
Go to solution

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. 

0 Kudos
Message 1 of 7
(3,717 Views)
Solution
Accepted by topic author ShogunOrta

Try putting probes to see if the data needs your expectations.

Try execution highlight to see if the data flow meets your expectations.

0 Kudos
Message 2 of 7
(3,715 Views)

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.

0 Kudos
Message 3 of 7
(3,702 Views)

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.

0 Kudos
Message 4 of 7
(3,699 Views)

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.

0 Kudos
Message 5 of 7
(3,684 Views)

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!

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 7
(3,651 Views)

@GertW: +1 for PEBKAC AKA PICNIC. Both were new for me.

Message 7 of 7
(3,635 Views)