From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
12-14-2006 05:36 PM
12-15-2006 03:49 AM
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
12-15-2006 03:58 AM
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
11-21-2019 01:12 PM
I have a proble using WriteKey vi to update my configuration file.
I write a string my config file as follow but I don need those symbols :""
How can I write w/o "" symbols?
[Model]-----------header
m0="MK12345"
I need as follow:
m0=MK12345
I did write in VBasic and have no problem.
11-21-2019 01:18 PM - edited 11-21-2019 01:19 PM
I don't think the quotation marks will cause you any trouble. They are used to show that everything between belongs together. For instance, if you had text that contained a linefeed, you'd need quotation marks to show that the line below is part of the string and not an error in the ini file.
I believe that to be true.
EDIT: If you are using your own brute-force reading of the ini file, then i suppose it will affect things.
11-21-2019 01:45 PM
Yes it affect my code.
I am using config as follow:
Below[Model] header I will write mn models w/o ""
Later I am using all there are below this header to fill out a combo box.
So every time I select a model I goes to a model header below and got var values as ss,sp,tt, IOport.
Make sense?
***********************
--------------How to use ini file
;Header [Models] Add all models in consecutive way ...from m0 to mn
;Model Header...[NA12-0101] add ifo as follow:
;sp=Declare program to use..NK81-000x.
;ss=Declare Speed Sensor wheel NK82-000x
;tt=Declare Thermistor type ...NTC or PTC
;IOport= Declare P0.3 bit output
[Model]
m0=NA12-0101
m1=NA12-0201
m2=NA12-0301
m3=NA12-0401
mn="NA12-0401"
[NA12-0101]
sp=NK81-0001
ss=NK82-0002
tt=PTC
IOport=0
[NA12-0201]
sp=NK81-0001
ss=NK82-0003
tt=PTC
IOport=0
[NA12-0301]
sp=NK81-0001
ss=NK82-0004
tt=NTC
IOport=1
[NA12-0401]
sp=NK81-0001
ss=NK82-0005
tt=PTC
IOport=1
11-21-2019 02:00 PM
Under the topic of enough rope to hang oneself...
Edit "NI_LVCOnfig.lvlib:Write Key (string).vi and right click "remove and rewire" the sub VI named "NI_LVConfig.lvlib:Add Quotes.vi"
But you do NOT want to do that!
If the built-in functions are not to your liking you can create a dll from Vbasic code and use that in your application.
Ben
11-21-2019 02:13 PM
Yes I can do that at home, I am in the work and have not VBasic installed.
Thank you.
11-21-2019 03:38 PM
Thank you for your help, problem already solved, not anymore quotes when I use writekey.vi.
11-21-2019 04:22 PM - edited 11-21-2019 04:26 PM
@Ubujuq wrote:
Yes it affect my code.
I am using config as follow:
Below[Model] header I will write mn models w/o ""
Later I am using all there are below this header to fill out a combo box.
So every time I select a model I goes to a model header below and got var values as ss,sp,tt, IOport.
Make sense?
***********************
--------------How to use ini file
;Header [Models] Add all models in consecutive way ...from m0 to mn
;Model Header...[NA12-0101] add ifo as follow:
;sp=Declare program to use..NK81-000x.
;ss=Declare Speed Sensor wheel NK82-000x
;tt=Declare Thermistor type ...NTC or PTC
;IOport= Declare P0.3 bit output
[Model]
m0=NA12-0101
m1=NA12-0201
m2=NA12-0301
m3=NA12-0401mn="NA12-0401"
[NA12-0101]
sp=NK81-0001
ss=NK82-0002
tt=PTC
IOport=0[NA12-0201]
sp=NK81-0001
ss=NK82-0003
tt=PTC
IOport=0[NA12-0301]
sp=NK81-0001
ss=NK82-0004
tt=NTC
IOport=1[NA12-0401]
sp=NK81-0001
ss=NK82-0005
tt=PTC
IOport=1
Although the ini file "standard" isn't well defined, quotation marks are acceptable in some implementations. I would hazard a guess that there are more complaints about how to make get values with quotation marks intact than the other way around. In other words, most built-in ini readers understand that quotation marks are used in the manner i described above, so your request is... unusual.
The fact that the "standard" is so ambiguous is probably one big reason a lot of applications use xml files instead.
The more you use LabVIEW, the more you will see that it almost always hews to some standard or other - sometimes frustratingly so. In other words, if quotation marks weren't acceptable, they wouldn't use them.