<< Click to Display Table of Contents >> Navigation: Multi-Protocol MasterOPC Server > Lua 5.1 Reference Manual > Function library > The OTHERS Library > Other Functions |
Launches a process.
Function arguments are:
1 (STRING) – filename (as a rule, *.exe)
2 (STRING) – command line
3 (STRING) – work folder
4 (INT) – console visibility (0 – do not hide, 1 – hide)
The function returns
err (BOOL) – error (false – no error, true – error)
Pid (table) – process identifier
Terminates a process.
The function argument is a table Pid (see others.CreateProcess ).
Executes ping of IP address defined.
Function arguments are
1 (STRING) – IP address or a DNS name
2 (INT) – query timeout
The function returns 2 parameters:
err (BOOL) – error (false – no errors, true – error);
Time (INT) – query time by milliseconds in case of successful query; nil in case of an error
Example
err,Time = others.Ping("google.com",1000);
if err then
server.Message("ping error");
else
server.Message("ping success time = ",Time);
end
Produces a delay in script execution. A delay time by milliseconds is specified in parenthesis. There are no arguments returned.
Example
others.Sleep(1000); --the script will be stopped for 1000 ms.
Returns 2 parameters:
err (BOOL) – error (false – no error, true – error)
content (STRING) – content of a specified field of CSV file.
The function argument is a field name (STRING).
This function is available only in a script of a tag import template (see The Map Template Editor in the Tag Import section).
Returns 2 parameters:
err (BOOL) – error (false – no error, true – error)
content (STRING) – content of a specified field of CSV file.
The function argument is a field number (INT).
This function is available only in a script of a tag import template (see The Map Template Editor in the Tag Import section).