LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Output of variables value from text file are not changing even after the user do changes.

Solved!
Go to solution

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.  

0 Kudos
Message 1 of 13
(2,562 Views)
Solution
Accepted by topic author ali_nad

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).

Message 2 of 13
(2,540 Views)

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 😊

0 Kudos
Message 3 of 13
(2,498 Views)

Still no code 😄

0 Kudos
Message 4 of 13
(2,490 Views)

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.

  • The attachment's molp_sose2021_group1_d.lvproj content type (application/octet-stream) does not match its file extension and has been removed.

 

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 

0 Kudos
Message 5 of 13
(2,487 Views)

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.

Message 6 of 13
(2,479 Views)

Just make a zip file with all your vi's and project file in. 

Message 7 of 13
(2,476 Views)

Hi 

Yea it works now 

0 Kudos
Message 8 of 13
(2,469 Views)

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).

Message 9 of 13
(2,456 Views)
Solution
Accepted by topic author ali_nad

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.

Message 10 of 13
(2,447 Views)