06-02-2021 06:46 PM
Hello everyone
I am writing a code where user can change select some options at the beginning of the program, depends on the user selection (which selection is one is going to do something then).
I am writing my variables in a text file, this text file has my selections as the following:
The section name is: Plants
Variables are: Plant 1 and Plant 2
and there is an open config file to read the initial values of my plants (so if plant 1 is FALSE means that the settings for that plant will not run and vice versa). There is for every plant a control toggle to change it between TRUE and FALSE so the user can select the plants.
The attached picture shows the other details of the code.
The problem is when I run the code whatever I change the toggles it keeps the same output. like when I toggle plant one the output Led for plant one keeps the same. and the values of the variables of that text file keeps the same values with no change. I am attaching the picture of that code for each front panel and control panel. I would like to read your opinions.
Thanks for helping.
Solved! Go to Solution.
06-02-2021 06:57 PM
You didn't post your code... you posted a picture of your code. Hard to debug a picture 😉
Your problem is the Bundle/Unbundle. The "Plants" variable goes into the Bundle By Name terminal, then you overwrite those values with what you read from the file.
You want the "Plants" cluster to go into Unbundle, then to Write. Leave the Bundle By Name terminal unwired (or better yet, use a Typedef, but for now you can ignore it).
06-03-2021 03:50 AM
Hello
Thank you for your reply.
and yep sorry I should've uploaded my code too. but I couldn't because it's deleted automatically from the attachments for some extension matching error.
Yea exactly you are right I was thinking the same about this overwriting from the file but also is it ok to leave the Bundle unwired?
I tried that it will not debug and the error is that the Bundle is unwired.
I am inserting the code now in this reply.
Thanks again 😊
06-03-2021 04:30 AM
Still no code 😄
06-03-2021 04:45 AM
Hello AeroSoul
Unfortunately, I am getting this error every time I am trying to post my code in the attachment
Correct the highlighted errors and try again.
I am sorry but I am quite new here and with LabVIEW if you have got this error before and you have info would like to tell me 😀
Also, my code is written on the Target device which is an external device myRIO, could it be a reason why it couldn't be uploaded?
Thanks
06-03-2021 04:57 AM
I think this forum only accepts VI files, so if it's a project file you need to zip it all together and then you can post it.
06-03-2021 05:03 AM
Just make a zip file with all your vi's and project file in.
06-03-2021 06:27 AM
Hi
Yea it works now
06-03-2021 09:37 AM
A LabVIEW project file does not contain any useful code. TO attach a project, you need to also include all relevant VIs.
(Also don't use rar when we ask for zip. Nobody will install special windows software just to look at your attachment).
06-03-2021 10:14 AM
Add some indicators to the functions going into your Write and Read VI's. This is NOT a problem with the ini files, it's a problem with the bundle/unbundle nodes. Follow the data flow. Use probes (right click on the wire) to see what is going into the wires.