Read ini file in TestStand
I have a computer with TestStand, but no LabVIEW. Can I read an ini file in TestStand directly? My file have several section headings and several keys under each. Any help appreciated.
Senior Test Engineer
[email protected]
If you are comfortable calling the Win32 sdk, you could use the DLL adapter to call:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms724353%28v=vs.85%29.aspx
Similar Messages
-
Dear ALL:
I have a VI use OpenG Read INI Cluster subvi to read a complex cluster data structure called step config data,and when I Run this VI,It sometimes read INI File quickly,and sometimes read INI File very slowly.If I want to speed up the read INI File speed,I must quit labview and restart it,and when I quit labview it will reports error just look like Labview Error Message.JPG
Attachments:
Labview Error Message.JPG 18 KB
Data Structure.JPG 92 KB
Get Data VI.JPG 189 KBI've got the same problem - it takes from 4 to 20 SECONDS to write and read 2 ini file clusters.
The first cluster I write have a few text strings, an error cluster and some numbers.
The second is an array of clusters (I loop through the array and writes each cluster separately.) containing some text and numbers, most of it contained in sub-clusters.
With 0 or 1 element in the array it takes around 4 secs to write and read this to ini file. With 20 in the cluster this takes 20 seconds (on a cFP-2120).
The openG functionality here is quite nice, but if I can't fix this time problem I'm afraid its quite useless!
Attachments:
WriteINIFile.jpg 211 KB
IniCluster.jpg 114 KB -
I need to write code that reads 'ini files', I would like to know If anyone has a sample or can guide me how to approach this task.
Thank youIf you have an ini file with values like :Thank you for your prompt reply. You got me intrigue, By any chance do you know where can I get more information about property files?
Thank you for your help.
value1=test
value2=another test
You can read the values by doing :
Properties props = new Properties();
FileInputStream fis = new
FileInputStream("D:\\test.ini");
props.load(fis);
fis.close();
String value1 = props.getProperty("value1");
// etc .........................Note : Unless there is some specific reason you should
use a properties file and not an ini file. -
Reading INI files with dashes in the section name
I am trying to read an INI file from a web site. Within that INI file are sections that have dashes in them. I need to be able to read several sections so I can locate specific files to download referenced within the INI files. I found a script for parsing
INI files, but when I run it, the script fails to handle the sections that have dashes. Any ideas on how I can work around the issue?
$Web = New-Object System.Net.WebClient
Function Get-INIContent ($ContentList){
$INI = @()
Switch -regex ($contentList)
"^\[(.+)\]"
[string]$Section = $Matches[1]
$INI[$Section] = @{}
$CommentCount = 0
$ContentList = $Web.Downloadstring("http://download.nai.com/PRODUCTS/COMMONUPDATER/avvdat.ini")
Get-INIContent $contentlist
What I was hoping to do was search through the INI until I found the sections I want, and then read the fields for that section so I know what to download. I won't be pulling all of the files, so I need to find a way to search for the sections I am
looking for then read all of the lines for that section and process them.Found part of the problem... When I pull the file into a variable I lose the ability to search it line by line. For example:
$Web = New-Object System.Net.WebClient
$ContentList = $Web.Downloadstring("http://download.nai.com/PRODUCTS/COMMONUPDATER/avvdat.ini")
#For some reason this returns the entire file
$contentlist | select -first 1
$contentlist | %{
#Thought this would be one line, but it is also
#the entire file...
$_
I have since shifted to a different method of reading the ini and I can process row by row...
$Web = New-Object System.Net.WebClient
$INILocation = "c:\SomeLocation\avvdat.ini"
$Web.DownloadFile("http://download.nai.com/PRODUCTS/COMMONUPDATER/avvdat.ini",$INILocation)
$INIFile = [System.IO.File]::OpenText($INILocation)
Do {
$CurrentLine = $INIFile.ReadLine()
#This is now one line like it should be.
$CurrentLine
While ($INIFile.EndOfStream -ne $True) -
Read ini file with multiple threads
I have a state machine architecture, but I have multiple threads. For instance, one is dealing with listening for mulitple tcp connections and storing their refnums to an array in a functional global. Another thread is accessing these refnums and collecting data it's receiving from each tcp connection. This data is queued up and then dequeued in a third thread which does some modification and sends it out via serial. My question is, when you have a situation like this and have to read an ini file, where should you read it? It seems like the most logical place would be outside your loops so you can get all the tcp and serial info (port, baud rate, etc) then wire it it to your create listener or initialize serial connection despite them being in different threads. But then again, normal state machine architecture would want an "initialize" case. If you did this though which loop would you put the init case in? And you would then have to worry about synchronizing loops becuase you wouldn't want one to try and create a listener while another thread was still reading ini data which would include the port to listen on. Maybe I'm overthinking this haha. Suggestions? Edit: one more question. Does it seem overkill that I have a tcp loop listening for data and queuing it up and a separate loop sending out the processed data via serial? Or should I just have one state that gets tcp data stores it in a shift register, then another state that sends it out via serial, and returns the state machine to the tcp read state?
Message Edited by for(imstuck) on 03-03-2010 01:13 PM
Message Edited by for(imstuck) on 03-03-2010 01:17 PM
CLA, LabVIEW Versions 2010-2013Most of the applications I work on at the moment are used for testing barcode and label printers. The test applications I design are focused on testing the printer's firmware, not the hardware. Within our applications we have three primary objects (Unfortunately they are not native LabVIEW objects yet. They were developed before native LVOOP.) The primary objects we use in our applications are a log object, a connection object (communication interface to the printer) and a printer object. In any single instance of a test we only have a single printer, a single connection to the printer and one or more discrete logs. Each instance of these objects represent a single, real physical entity. A singleton object is a virtual representation of the physical world. Let's take the log object since that is the most simple of the objects described above. Naturally for a given log file you have the log file name and path. We also provide other attributes such as the maximum size of a single file (we allow log files to span multiple files), whether it is a comma delimited file or if it contains raw data, if timestamps should be included with a log entry and so forth. Most of these attributes are static for a log file with the exception of the name and such things as whether the logging is actually enabled or disabled. If we split a wire and had multiple instances of the log file (the way native LVOOP actually works) the attribute for whether logging is currently enabled or disabled will only pertain to the specific instance, or specific wire for the that object. Since this truly represents a single item, one log file, we need that attribute to be shared for all references to the instance of the log object. Since we allow this we can set an attribute on the log object in any task and it will be reflected in any other task that is using it. Think of the way a action engine or functional global works. However, in this case we provide discrete methods for the various actions.
I hope that made some sense. If not let me know since I just whipped up this response.
Mark Yedinak
"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot -
Reading INI Files ? URGENT !!!
how can I read an INI file in Sun Solaris OS ? Is there any built-in package or external package ??
Its very Urgent.
Thanks in advance,
RajeshUrgent, urgent, urgent. Do you really think this will speed up this thing?
I do not.
As far as I know, you have to use the built-in text_io package. -
Reader.ini - offline network folder keeps changing
I have offline folders setup for all of my users for use with their personal home drives (network drives). Everytime they syncronize their offline folders before leaving at night, windows always lets them know that the "reader.ini" file is different than the one on the network. It is getting very annoying. Does anybody know what is cauing this? Any type of work around? Why is reader.ini in a network folder in the first place? Have tried deleting it but it just comes back.
SI have the same issue with the reader.ini file. Because it's default location is the Windows My Documents path (which in this case is a syncronised folder) you constantly get sync conflicts.
We need to know how to change the behavoir of Adobe so the reader.ini is in somewhere else like C:\Docs & Set\%user%\App Data\Adobe. I'm not sure why it's not in the first place.
Can anyone from Adobe please address this? -
Visual c++ load .ini files to combobox
I create pop up program for my company, I use Visual c++ CLR. I use .ini files for load and write data in my program.
than I have confuse when I want to load .ini files to show in combobox. I already use "GetPrivateProfileStringA/WritePrivateProfileStringA", but it can't read .ini files to combobox. please give my suggestion for my program. thank you (:Hi,
Welcome to MSDN.
I found that you have posted this issue with the following thread in C++ forum.
Visual
c++ load .ini files to combobox
You could focus on that thread to get support.
Have a nice day.
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Can TestStand 2.0.1 store/compare strings (local variables, e.t.c) as unicode strings? If so, how can I tune TS to do it? Is there built-in support for such strings in newer versions of TS? I've not found sufficient information on the matter at the DevZone Forums.
Hi Paul,
Try this example, I'm sure I downloaded this from NI website.
This just reads keys from an INI file but you can also write to an ini file by using the appropiate functions in the dll.
Hope this helps
Regards
Ray Farmer
Regards
Ray Farmer
Attachments:
ReadIniFile.seq 17 KB
IOWrite.ini 1 KB -
TestStand: Access Denied to testexec.ini file
When changing search directories, or any station property, I get an access denied error, and the changes to the search directories don't get saved.
Hello Shay,
If you are using Windows 2000/NT and your drive in which TestStand is located is partinoned as NTFS, you can set security permissions on folder or on a file basis. You should check your security settings for the folder \Cfg. This folder contains all the INI files that store the station options, and search directory settings. You may have the folder set to deny write access, when it should be set to full control. You can access the security options by right-clicking on the file/folder and selecting Properties from the context menu. Hope this helps. -
Hello,
I try to config lion server as file server for a windows application we use at work. All other computers are windows 7 or XP, lion server is the only mac. I choose lion server because it's size, quality and personal love of apple products.
10.7.2 lion server's samba file sharing works almost perfectly with all my windows machines, I can copy, delete, modify any text files or office files without any issue, but the most important windows application for my business doesn't work with samba file sharing. After some digging, I found it is because windows program can't read or write INI file stored on lion share. Windows API GetPrivateProfileString always returns empty if the INI file is store on lion share.
You can download a small application for read/write windows INI file from codeproject.com to test this problem:
http://www.codeproject.com/KB/files/ini.aspx
I can open/edit the in file using any text editor without any problem. The only problem is with those windows APIs. ACL is turned on for my lion share and assigned "delete" rights to samba users.
I install samba3 on the same server; it works perfectly with windows API. My windows program also works. Looks like there is something wrong with lion server's sambax.
I'd prefer to use built-in samba even I have samba3 working. Built-in samba is very immature right now, but considered how young it is, I will give apple some time to make it mature.
Does anyone have same issue or knows how to fix it?
Thanks,
Michael.All the memory is fine. The server rarely if ever goes down when there are only around 10-12 users connected. When there are 20+ users connected and working heavily it goes down often. When I say working heavily, I mean they are transferring huge files to the SAN (100GB+), sometimes 5 at a time per user, and there are a bunch of others who are reading large video files at a minimum of 220MB/sec from the SAN.
Though this worked on Snow Leopard without any issues, Lion just doesn't seem to be able to handle it. The odd thing is, on Snow Leopard there was only a single 1GB ethernet connection to a NAS system, whereas with Lion we have a much more powerful machine with a 6-port 10GB ethernet card and a 4 lane 8GB fiber card to a true SAN. You would think that the newer scenario with Lion would handle far more users with ease.
So far, very disappointing with regards to Lion's file serving performance. -
Using ini-files with write-key/read-key (double) and defined accurarcy
Hello,
in a popup the user can insert a numeric-double-value.
This value is saved in a ini-file using the Write-key-vi with Type = double. Works fine.
What do i have to do to set the values after the comma?
So if user inserts 1,532 i want to round to two digits after comma and save it. (-> 1,53)
Thx
Solved!
Go to Solution.I don't know how LV deals with different decimal seperators (e.g. comma instead of point), I guess it 'just works' depending on the system locale.
A few different options are available as follows...
The Write Key function has a 'precision' input which will set the number of decimal places to save the DBL to (in your case, set this to 2):
If you are using a numeric field, you can set the 'increment' property with 'coerce to nearest' to prevent them from entering more precision than is available:
The obvious method for post-rounding the input is to scale up the number, round to the nearest integer and then divide again to limit the precision:
I couldn't see anything in the numeric/math palettes that does this.
Certified LabVIEW Architect, Certified TestStand Developer
NI Days (and A&DF): 2010, 2011, 2013, 2014
NI Week: 2012, 2014
Knowledgeable in all things Giant Tetris and WebSockets -
How to edit the setup.ini file of the Adobe Reader X MUI?
Hi everyone.
I discovered today that is is possible to edit the setup.ini file of the Adobe Reader X MUI 10.1 installer (multilingual) in order to customize the installation. I stil have some questions about this.
1. I would like to make a custom installation of Reader X in german, english, french and spanish. Is this possible? I want to leave out all other languages from my installation..,.
2. I would like to edit the ini file to make an automatic update of my Reader, by installing all the patches (10.10, 10.11, 10.12, 10.13, 10.14, 10.15 and 10.16). Is this possible?
I patched my Reader manually, but when I install only the 10.15 and 10.16 updates, some functions are still missing (signature toolbar and add text function) so I suspect the patches are not-cumulative.
Can anyone on the forums show me the right codes for doing this? How can I get a 4-language upgraded Reader X?
Sincerely yours.
K. Adam.See the docs: http://www.adobe.com/devnet-docs/acrobatetk/index.html.
The admin guide tells you what updates are cumulative (all 10.x quarterlies) and how to set the lang via the cmd line. However, check out the Wizard Guide and download the free Wizard to customize your install and .ini as needed. Much easier.
hth,
Ben -
Read and sort values present in .ini file
Hi all,
I have a .ini file in which a set of modules with there order of execution is mentioned.I want to get all these values sorted as an array so that I can proceed with the execution of each in the order mentioned.The module list in the .ini file looks like this:
Here, digits represent the order of execution of module.
I should get output as an array with following values:
1 MNO
2 DEF
3 STU
4 PQR
5 GHI
6 VWZ
7 ABC
8 JKL
I know about config data and read key vis but since the module list is huge I dont know how to write an efficient code for this.All suggestions are welcome.
Thanks.
Solved!
Go to Solution.The snippet below should be very close to what you want.
-
Help!
When trying to deploy a test system i got the following error:
Error Code:-17500
Unknown System Error in TestStand - Read Seq Files in Workspace.vi->TestStand - Find Dependent Files.vi->TestStand - Add File and Dependent Files.vi->TestStand - Add All TestStand User Files to File Info Array.vi->TestStand - Update File Info.vi->TestStand - Distribution Wizard GUI.vi->TestStand - Deployment Utility Splash Screen.vi
I then tried to re-deploy previously successfully deployed systems - same error. (I have done nothing to my teststand setup/installation/engine or deployment files since the last successful deployment)
I removed teststand & then re-installed it - i still got the same error. These files it is searching for do not exist on my pc.
Any ideas what has gone wrong/how to fix it?
cheers
FiI've just had exactly the same problem and after posting a message, have been forwarded to this thread. Luckily it looks as though we've found a solution, or a cause of the problem. One of my work colleagues (SercoSteve on discussion forums) suggested removing the Teststand 3.1\cfg directory, and replacing it with a default one from another machine, and this seems to have done the trick and made the deployment wizard be able to analyse the files and build. We are editing files in cfg so I've now got the task of replacing each file in this directory one by one to find which is causing the problem.
I'll add another post when I find out which one it is.
David Clark
CLA | CTA
CLA Design Ltd
Hampshire, England
Maybe you are looking for
-
i cant get the new software update. why??
-
Some time ago I Inherited my wife's previous iPad along with her Apple ID for ICloud. I have now purchased a new iPad air 2 and transferred the old iPad info however her iCloud email address (gmail) came along with the transfer. I have my own Apple I
-
Is there a way to translate process flow to OMB+ ?
Hi all, Is there a way in OWB to translate process flow/mapping into OMB+ script? thanks.
-
I'm sure this has been asked repeatedly but..........I have a G3 iBook with OS 10.4.3, iSight, iChatAV, AIM Messenger. Two contacts have Dell and IBM computers respectively. Both have AIM 5.9 Messenger and appropriate Webcam software and cameras. We
-
Is it possible to enable screensaver during a powerpoint presentation?
On my previous Mac screensaver would operate as per system preferences during a slideshow in powerpoint. With Mountain Lion screensaver is automatically disabled during slideshow. Is there a way to enable it?