Promotic

InfoWriteToFile - method of the Pm object

Description:
The method writes the tab content of the INFO system into the text file. It performs it in the same way as the action after pressing the "Print into the file" button in the INFO system window.
Syntax:
Boolean InfoWriteToFile(String sInfoPath, String sInfoName, String sFile, String sOptions)
Parameters:
sInfoPath(String) Path to the item of the INFO system.
It is for example "COMM/PmModbusMr_0" for communication.
Caution: this isn't a path in the Pma objects tree. This is the path in the tree when viewing the INFO system!
sInfoName(String) The item name, which is the name of the tab in the INFO system.
It is for example "Monitor" for "COMM/driver" item.
If "$all" is entered, then the write is executed for all tabs contained in corresponding item.
sFile(String) The file name with the path where data have to be written.
It is recommended to use the PROMOTIC path syntax - see PROMOTIC path to files and folders.
sOptions(String) Specifies how the tab content will be written. Entries are in the KeyVal format, for example "add:1;empty:0;header:compact;".
add - Specifies the behavior for existing file.
0 - to overwrite the file
1 (default) - append to the end of the file
empty - Specifies whether an empty tab will be written.
0 (default) - do not write empty tab
1 - write also the empty tab
header - Specifies how to write the tab header.
compact (default) - write header in high density in a single row without the time
full - write the header to multiple rows including the time
Return value:
true - on success
false - on error
Note:
This method is not functional in Web panels.
Example1:
Add the list of global errors into the text file Info.txt in the application folder.
JavaScriptVBScriptSelect and copy to clipboard

Pm.InfoWriteToFile("Errors", "Global", "#app:Info.txt", "");
Example2:
See Example1 in the description of the PmaRoot.onAppStopEnd event.

History:
Pm9.00.16: New sOptions parameter allows setting how the tab will be written.
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
Navigation:
 
- Pm
 
- Abs
- Cos
- E
- Exp
- InfoWriteToFile
 
 
- LN2
- PI
- Pow
- Sin
- Tan
© MICROSYS, spol. s r.o.