Configuration Guide Vol. 1


19.4.2 Setting of operational message output

This section explains how to use sysmsg module to print a specified character string as an operation message.

The following tables list the functions of sysmsg module.

Table 19-17: List of sysmsg Modules

Function Name

Description

send

Outputs operation messages.

<Structure of this section>

(1) Script file and execution results example

The following is an example of a script file that outputs operation messages.

Figure 19-21: Example of writing a script file (test1.py)
# test1.py
# -*- coding: utf-8 -*-
import sys
import extlib.sysmsg                                                  ..1
 
try:
    extlib.sysmsg.send("E3", 0xfedc, 0xba9876543210,"Script Start!!") ..2
    print("send success.")
except extlib.sysmsg.MsgSendError:                                    ..3
    print("send failed.")
    sys.exit()
  1. Import the module.

  2. Specify the operation message to be output as follows:

    • Event-Level E3

    • Message-identifier 3e03fedc

    • Additional information ba9876543210

    • Message text "Script Start!!"

  3. Captures an exception for failed operation message output.

The following shows the results of executing the script file test1.py and output of operation messages.

Figure 19-22: Result of executing a script (test1.py)
# python test1.py
send success.
#
Figure 19-23: Example of operation message output
EVT 07/07 12:00:00 01S E3 SCRIPT 3e03fedc 2600:ba9876543210 Script Start!!