10-09-2024 02:55 PM - edited 10-09-2024 02:56 PM
@SPRD wrote:
Hi Jay,
thanks for Your feedback, but the point is that ini file is correctly read, not all of the data are correctly displayed as this refnum is not handled properly by the exe, while in the development evironment everything works well.
Silvio, can you please "strip down" your project just up to few "minimal" SubVIs with few controls, where this problem is reproducible and share project here as source code as attachment?
10-09-2024 03:22 PM - edited 10-09-2024 03:49 PM
@SPRD wrote:
Hi Jay,
thanks for Your feedback, but the point is that ini file is correctly read, not all of the data are correctly displayed as this refnum is not handled properly by the exe, while in the development evironment everything works well.
I previously indexed directly the array of refnums, with a lastvalue + conditional behavior to have the needed refnum referring to the controls where I need to show the data.
With the problems I found, I changed the parsing VI as I read that this approach can give problems.
I get refnum without errors out of the parser, but when i fetch it to a "To a more specific class" VI, than rises the 1057 error.
On development environment I see that the ControlRef is referring to the correct control, so I do not unerstand why I get the error.
Silvio
Yes, you are getting the 1057 error because;
Do what I said before.
Then we can try to figure out why the string array is empty (probably a rel path changes in the exe causing an error 7 that you lose in the following 0 iteration For Loop! BECAUSE you didn't put the Error wire on a SR)
You really want to return "Not a Refnum" if the string array is empty or the control Label is not found!!! As it is you will return refnum index 0 in either of those cases! And that refnum is to a listbox control type! Hence, error 1057 from the "To More Specific [Ring]"
Note: do not simply replace your loop with the search array primitive! A NULL string matches everything and you'll just exchange bugs.
Lastly, thanks are kudos. Just click the yellow star ⭐
"Thanks but," generally means that we failed to communicate. So let me be clear... Your Get Refnum from Name.vi is f'd^! Fix it!
10-10-2024 01:19 AM
@SPRD wrote:
Dear UliB,
Probe 34: if I run the program on development machine, the result si as for below image
Thnks
... and what is the probe value in the executable? It does not help to check the value in the working development environment.
Jay already pointed out that there is a possibility that error 1057 is a only symptom and happens because there went something wrong before.
10-10-2024 08:26 AM
Dear Jay, UliB, Andrey,
about the Kudos, I am new to this platform, so I was unaware about conventions.
Regarding the suggestion form Jay, please confirm me that You were suggesting the following IV configuration.
With the suggestions I received, I verified the VI that generates the two arrays (Controls Labels and Refnums) and found that when the application was run on the development platform I had 83 control reference, while if run from as EXE, the arrays were both of 50 references.
I modified the VI and the way I pass the main's VI reference to obtain the two arrays, opening the VI reference from the main VI and not inside the subVI.
10-10-2024 08:45 AM - edited 10-10-2024 08:46 AM
@SPRD wrote:
Dear Jay, UliB, Andrey,
Regarding the suggestion form Jay, please confirm me that You were suggesting the following IV configuration.
Not fully correct. If you have no error and no equal condition the while loop will never stop.
Replace the while loop with a for loop (which can have a conditional terminal too). Now the autoindexing input tunnel will also limit the loop count.
10-10-2024 08:58 AM - edited 10-10-2024 09:00 AM
I re-read Jays suggestion and now I would go with something like that
Edit: No need for the error wire in the loop and if no label matches return 'not a reference'.
10-10-2024 09:48 AM
@SPRD wrote:
Dear Jay, UliB, Andrey,
about the Kudos, I am new to this platform, so I was unaware about conventions.
Regarding the suggestion form Jay, please confirm
See the excellent for loop UIB implemented.
10-10-2024 09:52 AM - edited 10-10-2024 10:10 AM
@UliB wrote:
I re-read Jays suggestion and now I would go with something like that
Edit: No need for the error wire in the loop and if no label matches return 'not a reference'.
Excellent! Extra kudos in tag. Although, I would rearrange the diagram so that the terminals match the connector pane. That's just a style practice.
EDIT: Bonus, the loop is "Parallelizible" so right-click the loop and chose the Enable Parallel loop option to speed it up if the arrays are large. (We really have a case where the TRUE condition is sparse 0 or 1 instances of all) you could even inline that vi.
10-10-2024 10:07 AM - edited 10-10-2024 10:14 AM
@JÞB wrote:
@UliB wrote:
I re-read Jays suggestion and now I would go with something like that
Edit: No need for the error wire in the loop and if no label matches return 'not a reference'.
Excellent! Extra kudos in tag. Although, I would rearrange the diagram so that the terminals match the connector pane. That's just a style practice.
My snipped does not have a connector pane 😉 , but when I look at the VI connector pane from OP I think the terminals match the connector pane perfectly.
Edit: If you talk about front panel controls and indicators I would go with this
10-10-2024 10:17 AM
@UliB wrote:
@JÞB wrote:
@UliB wrote:
I re-read Jays suggestion and now I would go with something like that
Edit: No need for the error wire in the loop and if no label matches return 'not a reference'.
Excellent! Extra kudos in tag. Although, I would rearrange the diagram so that the terminals match the connector pane. That's just a style practice.
My snipped does not have a connector pane 😉 , but when I look at the VI connector pane from OP I think the terminals match the connector pane perfectly.
Fair enough, those wires should have been uncrowded by rearranging the cluster order!
As long as the subvi above has error in, USE IT so not a refnum is returned on error OR no match.