I am looking for a command line tool to export pi point attributes of a specified point source to a text file. I don't have excel on the pi server. I am mainly interested in the tag attributes for ~5000 tags of a particular point source.
The location codes are specific to classic tags so you will need to access the classic table:
If you want the locations for all tags of a particular pointsource, like R, then you can use something like the following:
The last argument will output the results to a text file in the %piserver%/adm directory, but you can specify the full path to the text file to put in any folder.
Here is a link to documentation on piconfig:
I tried the following script at command line
and ran piconfig as
piconfig < extract_attributes.txt
But I couldn't figure out which of the returned values represent Location1,2,3,4,5 which is what I am interested in.
Firstly, you don't need to have Excel installed on the PI server to do this extract with Excel. You can import PI tag attributes into Excel running on your workstation, so long as you have network connectivity to PI. Using PI Builder is the easiest way to do this, or the older PI Tag Configurator add-in to Excel if you don't have PI Builder available.
If you really need to use a piconfig script to do this, I would suggest the following modifications to the script you posted:
@select tag=*, pointsource=TEST1
Key thing to remember is that the location code attributes belong to the Classic point class, so you need to switch to that point class after selecting the pipoint table. Secondly, if you are only interested in specific attributes, specify only those attributes in your @ostructure command. Lastly, if you need to specify any other attributes, and are not sure what the attribute name will appear as in the table, use the following commands to get the attribute list:
This is exactly what I was looking for, thanks much.
Retrieving data ...