LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

INI file functions don't work in EXE on on some devices

Solved!
Go to solution

It reads from the INI file only once on startup, which also doesn't work.  That VI looks basically the same as the one in the picture, but instead of writing to the INI file, it reads.  I'm not sure what some of your abbreviations mean.

 

Thanks

Certified LabVIEW Architect since 2007
0 Kudos
Message 21 of 44
(988 Views)

@David_R._Asher wrote:

It reads from the INI file only once on startup, which also doesn't work.  That VI looks basically the same as the one in the picture, but instead of writing to the INI file, it reads.  I'm not sure what some of your abbreviations mean.

 

Thanks


Opening a config file in two places results in two unique references, so I don't think that could be the issue.  Closing one ref wouldn't make the other ref invalid.

 

But really, making guesses based on a picture isn't going to be helpful.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 22 of 44
(982 Views)

Yeah, I don't think it could be a race condition for various reasons, but mostly because the INI file access happens in different states of the same state machine and it always opens, accesses, and closes the INI file in one VI.

 

I'm beginning to suspect that maybe the path is weird on the tablet.  I am using the Open G "Current VIs Parent Directory" function to derive the path and maybe that is doing something weird on the tablet for some reason.  I initially assumed that it was ok because the Open INI File VI does not throw any errors, but I'll have to double check what the path is next time I have access to the tablet.

 

Thanks!

Certified LabVIEW Architect since 2007
0 Kudos
Message 23 of 44
(977 Views)

@David_R._Asher wrote:

Yeah, I don't think it could be a race condition for various reasons, but mostly because the INI file access happens in different states of the same state machine and it always opens, accesses, and closes the INI file in one VI.

 

I'm beginning to suspect that maybe the path is weird on the tablet.  I am using the Open G "Current VIs Parent Directory" function to derive the path and maybe that is doing something weird on the tablet for some reason.  I initially assumed that it was ok because the Open INI File VI does not throw any errors, but I'll have to double check what the path is next time I have access to the tablet.

 

Thanks!


The tablet is still using a Windows File system so I would not suspect that (Unless the current vis path is in a restricted area on the tablet)

 

If nothing else, going to the AE route gives you exactly one vi to debug.


"Should be" isn't "Is" -Jay
0 Kudos
Message 24 of 44
(973 Views)

@David_R._Asher wrote:

Yeah, I don't think it could be a race condition for various reasons, but mostly because the INI file access happens in different states of the same state machine and it always opens, accesses, and closes the INI file in one VI.

 

I'm beginning to suspect that maybe the path is weird on the tablet.  I am using the Open G "Current VIs Parent Directory" function to derive the path and maybe that is doing something weird on the tablet for some reason.  I initially assumed that it was ok because the Open INI File VI does not throw any errors, but I'll have to double check what the path is next time I have access to the tablet.

 

Thanks!


I tried putting in malformed paths, nonexistent paths, all these things made various errors happen when opening the ref like you mentioned, not in the read and/or write VIs.  Does the pictured VI have a default case?  Is something bad happening in there that would cause a ref to become invalid (such as some flavor of the "default value if unwired" issue)?  I don't like asking a lot of questions about pictures with case structures that I cannot parse.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 25 of 44
(968 Views)

The default case just passes the file refnum and error through.

 

Thanks.

Certified LabVIEW Architect since 2007
0 Kudos
Message 26 of 44
(959 Views)

is the error 1 thrown captured by your error handler or by the automatic handling? cos the variant to data error out is not connected to the write ini

CY (expired CLAD)
0 Kudos
Message 27 of 44
(939 Views)

LabVIEW: (Hex 0x1) An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @.

 

or is the key or value having "not allowed" characters?

CY (expired CLAD)
0 Kudos
Message 28 of 44
(933 Views)
Solution
Accepted by topic author David_R._Asher

@David_R._Asher wrote:

 

Save Front Panel Controls.png

 


Other than the fact that you're kinda duplicating functionality which already exists in OpenG (saving/loading panel values), I don't see anything immediately wrong here. As pointed out, one of the other cases (not necessarily the default one) might be the culprit in not passing the reference through correctly.

 

My first suggestion would be to just try to use the OpenG or MGI panel handling VIs, as that's probably the least amount of work.

 

If that doesn't work, then at this point, I think your only option is more detailed debugging. You seem to be pretty sure about where the error is coming from, but I would suggest adding in some logging, even at the cost of editing the NI VIs (make a backup of them before you start or temporarily replace them with a copy of your own). See exactly where in the process the error happens, which controls did you manage to save, what is the binary value of the reference (type cast it to a number or strings), etc. This should hopefully help you understand what's causing the issue.


___________________
Try to take over the world!
0 Kudos
Message 29 of 44
(926 Views)

@cy... wrote:

is the error 1 thrown captured by your error handler or by the automatic handling? cos the variant to data error out is not connected to the write ini


While it is true that a possible error from the Variant To Data.vi would not be handled, it would report an error 91 if a problem occurred, and it would return the default value for the data type, so no error would be thrown in the Write Key.vi .  I might want to handle that error though.  You'd never know if values going into the config file were invalid, otherwise.  It's a valid concern because it's a "calculated" path, and maybe for some reason, returning the ref for the wrong VI.  I mean, you'd probably know after the fact because your app wasn't running properly, but it might be subtle enough that it appears to be running correctly, but really, it's not.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 30 of 44
(904 Views)