目录
---$-------------------------------------------------------
# ----------------------------------------------------------------------
config----------------------------------------------------------
copy ----------------------------------------------------------
delay ----------------------------------------------------------
delete ----------------------------------------------------------
direxist ----------------------------------------------------------
echo ----------------------------------------------------------
getkey-----------------------------------------------
goto-----------------------------------------------
mkdir -----------------------------------------------------------
onerror -----------------------------------------------------
print ---------------------------------------------------------------
rapid_delete_palette -----------------------------------------
rapid_delete_palette_instruction ---------------------------------------
setenv -----------------------------------------------
setstr ----------------------------------------------------
text ------------------------------------------------------------
timestamp --------------------------------------------------
3.1 概述
instalt.cmd文件是一个安装脚本,它定义了要加载的配置文件和事件日志消息文件。例如:定义了其中一个配置文件(sys.cfg)要加载的快速程序文件(.sys)
本节介绍可以在安装脚本安装.cmd中使用的命令的语法。
当使用重启模式重置系统自动安装许多不同的文件,如配置文件或文本文件时,将执行脚本安装。Install.cmd文件可以包含条件,因此只有在某些条件为真时才执行某些操作。
3.2 命令用法介绍
---$-------------------------------------------------------
$ defines the name of a string variable.
Example:
setstr -strvar $LANG -value "en"
Predefined strings:
String | Predefined value |
$BOOTPATH | The folder where install.cmd is executed. For example: /hd0a/<system name>/PRODUCTS/<Add-In folder> |
$HOME | /hd0a/<system name>/HOME |
$SYSPAR | /hd0a/<system name>/SYSPAR |
$RWTEMP | /hd0a/tem |
# ----------------------------------------------------------------------
Comment, if # followed by a space.
Label, if no space between # and text.
Example:
# A comment @#后有空格为备注
#Label @#后无空格为标签
config----------------------------------------------------------
This command can be used for two different purposes:
• Erase unprotected contents of a configuration domain before loading a new
content.
• Modify existing contents of a configuration domain.
Erase unprotected contents
The config command can be used to erase unprotected contents of a configuration domain before loading a new content.
Parameter | Description | Default |
domain | The topic of the cfg file. Allowed values are: • SIO - Communication • SYS - Controller • EIO - I/O • MMC - Man-machine communication • MOC - Motion | |
erase | Erase unprotected instances of the specified configuration | FALSE |
Example:
config -erase -domain MOC
Modify existing contents
The config command can be used to modify existing contents of a configuration
domain.
The following operations are possible:
1• Add new instances
2• Replace existing instances
3• Modify existing instances in the specified configuration domain
Parameter | Description | Default |
filename | The cfg file name, including file path. | |
load | The types and instances specified in the cfg file will be added to the cfg database. If an instance with the same name already exists, an error will be generated and the cfg file will not be loaded. To overwrite the existing instances, use option -replace. | TRUE |
internal | Load an internal configuration file. All instances loaded with this option will be write-protected. Once they have been loaded, they cannot be overwritten. | FALSE |
modify | Modify all existing instances with the same name as those in the loaded cfg file. With this option it is possible to change one or several parameters of each instance and all other mandatory parameters are not needed. | FALSE |
replace | Replace all existing instances with the same name as those in the loaded cfg file. | FALSE |
Example:
config -filename $BOOTPATH/eio.cfg -load
config -filename $BOOTPATH/sys.cfg -internal
config -filename $BOOTPATH/eiopw.cfg -replace
config -filename $BOOTPATH/awNoSimPrompt.cfg -replace -internal
copy ----------------------------------------------------------
Parameter | Description | Default |
from | The file to be copied, including the file path. | |
to | The new file name, including the file path. |
Example:
copy -from $BOOTPATH/instopt.cmd -to $RWTEMP/instopt.cmd
delay ----------------------------------------------------------
Parameter | Description | Default |
time | Number of milliseconds to delay. | 100 |
Example:
delay -time 1000
delete ----------------------------------------------------------
Parameter | Description | Default |
name | Name of file to delete, including file path. |
Example:
delete -path $RWTEMP/opt_l0.cmd
direxist ----------------------------------------------------------
Parameter | Description | Default |
path | The complete path to the folder. | |
label | The label to go to if the folder exists. |
If a directory exists, go to a label.
Example:
direxist -path $TEMP/MyFolder -label CLEANUP_0
echo ----------------------------------------------------------
Echo (print) a message to the VxWorks console output during the system start.
Parameter | Description | Default |
text | The text to show on the FlexPendant. |
Examples:
echo -text "Installing configuration files"
------------------------------------------------------fileexist ----------------------------------------------------------
If a file exists, go to a label.
Parameter | Description | Default |
path | File name, including the file path. | |
label | The label to go to if the file exists. |
Example:
fileexist -path $RWTEMP/opt_l0.cmd -label CLEANUP_0
------------------------------------------------------find_replace -----------------------------------------------
Find and replace occurrences of a string in a file. Only the first occurrence of the
string in each line of the text is replaced.
Parameter | Description | Default |
path | File to search, including the file path. | |
find | String to find. | |
replace | String to replace with. |
Example:
find_replace -path $HOME/myfile.txt -find "ABC" -replace "CBA"
getkey-----------------------------------------------
A number of selections can be made by user at the time of system creation. Values of these selections come from product manifest file and are stored by the system as a number of keys. The values stored in these keys can be read at the system startup time using the getkey command.
Parameter | Description | Default |
id | Name of the key whose value is to be retrieved. | |
strvar | Name of the variable where the result (the key value) is stored. | |
errlabel | Label to go to if an error occurs. |
Example:
getkey -id "LangSelect" -strvar $ANSWER -errlabel ENGLISH
goto-----------------------------------------------
Go to a label.
The label to go to can either be specified directly, using the parameter label, or via
a string containing the label name, using the parameter strvar.
Parameter | Description | Default |
strvar | A string containing the label name to go to. | |
label | Label to go to |
Examples:
goto -strvar $ANSWER
goto -label END_LABEL
------------------------------------------------------ifstr -----------------------------------------------
If a string variable is equal to a string value, go to the specified label. If not equal,
the next statement is executed.
If the string variable is undefined, the command returns an error code.
Parameter | Description | Default |
strvar | String variable to be compared with a string value. | |
value | String value to compare the string variable with. | |
label | Label to go to if the comparison is true. |
Example:
ifstr -strvar $ANSWER -value "IRT5454_2B" -label APP2
------------------------------------------------------ifvc -----------------------------------------------
If the script containing this command is run on the virtual controller, go to the
specified label.
Parameter | Description | Default |
label | Label to go to if the script is run on a virtual controller |
Example:
ifvc -label NO_START_DELAY
---------------------------------------------------include -----------------------------------------------
Include the script of another command file. Executes all commands in the script
and then return to the current script.
Parameter | Description | Default |
path | The file name of the included script, including the file path. |
Example:
include -path $BOOTPATH/instdrv.cmd
--------------------------------------------------math_lib_set_mem_size ------------------------------------
Used to increase the size of the memory pool used for matrix calculations in RAPID.
Parameter | Description | Default |
size | The size in bytes. | 20000 bytes |
The default size is 20000 bytes.
Minimum allowed size is 20000 (same as default size).
Maximum allowed size is 20000000, that is, 20 MB.
If several calls to math_lib_set_mem_size are made, the largest value is used.
mkdir -----------------------------------------------------------
Make a directory.
Parameter | Description | Default |
path | Directory name, including the path. |
Example:
mkdir -path $RWTEMP/newdir
onerror -----------------------------------------------------
Set the default behavior of the script motor in case a script command fails and
returns an error status code.
It is always the most recent onerror command that sets the current default
behavior. The onerror semantics of included scripts does not affect the onerror semantics of any script that includes it.
Parameter | Description | Default |
action | Defines if an error should result in: go to label, continue execution- continue , stop execution, system failure or return from included script to the including script action Defines what behavior an error should result in. The allowed values are: • goto - Go to a label • continue - Ignore errors and continue execution • stop - Stop execution of startup task using assert() • sysfail - Call SYS_FAIL() • return - If used by a script included by another script, execution returns to the calling script. The included script returns an error code that needs to be handled by the including script. | |
label | The label to go to if action is goto. |
Examples:
onerror -action goto -label MY_LABEL1
onerror -action continue
onerror -action stop
onerror -action sysfail
onerror -action return
print ---------------------------------------------------------------
Prints a text to the VXWorks console.
Parameter | Description | Default |
text | The text to show on the console. |
Example:
print -text "Copying files to $BOOTPATH"
rapid_delete_palette -----------------------------------------
Deletes a picklist in the FlexPendant programming window.
Parameter | Description | Default |
palette | The name of the picklist to be deleted. |
Example:
rapid_delete_palette -palette "M.C 3"
rapid_delete_palette -palette "Settings"
rapid_delete_palette_instruction ---------------------------------------
Deletes a RAPID instruction in a picklist in the FlexPendant programming window.
Parameter | Description | Default |
palette | The name of the picklist. | |
instruction | The name of the RAPID instruction to be deleted. |
Example:
rapid_delete_palette_instruction -palette "Common" -instruction
"FOR"
rapid_delete_palette_instruction -palette "Common" -instruction
":="
rapid_delete_palette_instruction -palette "Common" -instruction
"MoveAbsJ"
rapid_delete_palette_instruction -palette "M.C 1" -instruction
"MoveJ
setenv -----------------------------------------------
Define an environment variable and set its value.
An environment variable can be used in the RAPID code or in cfg files.
If you define the path to your add-in folder as an environment variable, this variable
can be used in your programs instead of hard coding the path.
Parameter | Description | Default |
name | The environment variable to be assigned a new value. | |
value | The string to assign to the environment variable. |
Example:
setenv -name CIRCLEMOVE -value $BOOTPATH
System environment variables
The following environment variables are set up by the system and cannot be
overwritten
Environment variable | value |
HOME | /hd0a/<system name>/HOME |
BACKUP | /hd0a/BACKUP |
SYSPAR | /hd0a/<system name>/SYSPAR |
TEMP | /hd0a/temp |
SYSTEM | /hd0a/<system name> |
RELEASE | /hd0a/<system name>/Products/ROBOTWARE_6.XX.XXXX |
setstr ----------------------------------------------------
Define a string variable and set its value. The string can only be used in the
installation script.
Parameter | Description | Default |
strvar | The string variable to be assigned a new string. | |
value | The string to assign to the string variable. |
Examples:
setstr -strvar $LANG -value "en"
setstr -strvar $CFGPATH -value $SYSPAR
text ------------------------------------------------------------
This command loads a text description file into a text resource of a package. It
accomplishes the same thing as the RAPID instruction TextTabInstall, but can also specify different texts for different languages.
Parameter | Description | Default |
filename | Name of the description file, including the file path. | |
package | Package for building the text resource. |
Example:
text -filename $BOOTPATH/language/en/text_file.xml -package "en"
timestamp --------------------------------------------------
Parameter | Description | Default |
----------------------------------------------------- Registers:-----------------------------------------------
目录
---$-------------------------------------------------------
---# ----------------------------------------------------------------------
----config----------------------------------------------------------
----delete ----------------------------------------------------------
----direxist ----------------------------------------------------------
----echo ----------------------------------------------------------
Registers additional information from an xml to controller registers, depending on
the type parameter.The supported types are:
【根据从xml寄存器到控制器寄存器的附加信息 类型参数。支持的类型有:】
1• Error messages (elogmes)
– register the xml-file to the elogtext_registry.xml file. Once registered, these messages can be used by the RAPID program.
【将xml文件注册到elogtext_registry.xml文件中。一旦注册了,这些消息就可以被快速程序使用】
2• Error message titles (elogtitle)
– register the xml-file to the elogtext_registry.xml file.
【将xml文件注册到elogtext_registry.xml文件中】
3• Options (option)
- Registers the option in the option_registry.xml file. This will enable automatic loading of FlexPendantapplications from the tps folder for the add-in.
【在option_registry.xml文件中注册该选项。这将支持从加载项的tps文件夹中自动加载弹性扩展式应用程序】
4• RAPID meta data (rapid_metadata)
– Registers additional RAPID argument settings to the rapid_metadata_registry.xml.
【向rapid_metadata_registry.xml注册其他快速参数设置】
5• RAPID texts (rapid_text)
– Registers additional RAPID texts with support for Unicode characters in rapid_text_registry.xml.
【在rapid_text_registry.xml中注册了一些支持Unicode字符的额外快速文本】
Registers | type parameter | xml文件 |
1 | Error messages (elogmes) | elogtext_registry.xml |
2 | Error message titles (elogtitle) | elogtext_registry.xml |
3 | Options (option) | option_registry.xml |
4 | RAPID meta data (rapid_metadata) | rapid_metadata_registry.xml |
5 | RAPID texts (rapid_text) | rapid_text_registry.xml |
Parameter | Description | Applies to type |
type | Defines which type (for example elogmes, elogtitle, option, rapid_metadata, or rapid_text) that is being registered. | |
Domain_no | Error messages are stored in different domains. Which domain to register in is defined by domain_no. For add-ins, domain_no should always be 9. | elogmes elogtitle |
min | The first message number in the file being registered. | elogmes elogtitle rapid_text |
max | The last message number in the file being registered. | elogmes elogtitle rapid_text |
prepath | The path to the language directory. | elogmes elogtitle rapid_metadata rapid_text |
postpath | The rest of the path, after the language directory, including the character \ (backslash) and the file name. | elogmes elogtitle rapid_metadata rapid_text |
extopt | A flag indicating that the add-in is an external add-in. | option |
Description | The name of the add-in. | option |
path | The path to the add-in. | option |
Examples:
# Register event log message for Add-In
register -type elogmes -domain_no 11 -min 5001 -max 5001 -prepath
$BOOTPATH/language/-postpath /CircleMove_elogtext.xml
-extopt
# Register path for Add-In
register -type option -description MyAddIn -path $BOOTPATH
# Register path for RAPID meta data
register -type rapid_metadata -prepath $HOME/ -postpath
my_rapid_edit_rules.xml
# Register path for RAPID text resource with Unicode support
register -type rapid_text -min 1 -max 123 -resource myAddIn -prepath
$BOOTPATH/language/ -postpath myAddInTexts.xml