<< Prev        Next >>

ID : 3978

SysInfo

Function

Return the system information of the COBOTTA.

Syntax

SysInfo(index number)

Guaranteed Entry

Index number
Designate an index number by integer type data.

Return Value

For a variable designated by Variant Type, return Data Types data according to the index number.

Description

You can acquire the following system information.

Index number System information Data type
0 Manufacturing number (serial number of the COBOTTA) String type
1 MAC address of built-in network card in the COBOTTA String type
3

The numbers from 0 to 7 correspond to the variable types as shown below.
With the number, specify a variable type that you intend to obtain the number of variables.

0 : I type
1 : F type
2 : D type
3 : V type
4 : P type
5 : J type
6 : T type
7 : S type

Integer type array
5

Login user level

1000 : Operator
2000 : Programmer
3000 : Maintainer
3001 or more : Reserved for system

Integer type
6

Supervisory task status

-1 : Running
0 : Not running

Integer type
7

TP panel display status

-1 : Displayed
0 : Not displayed

Integer type
8 Total Operation Integer type
9 Total Running Integer type
10 Cumu.Operation Integer type
11 Cumu.Running Integer type
12 Operation Integer type
13 Running Integer type
14 MotorOn Count Integer type
16

COBOTTA battery maintenance schedule

-1 : Replacement date has arrived
0 : Replacement date not arrived

Integer type

Attention

-

Example

Example 1

'!TITLE "Acquire the Manufacturing Number"
'Acquire and display the manufacturing number
Sub Sample_SysInfo
	Dim aaa As Variant
	'Acquire the manufacturing number
	aaa = SysInfo(0)
	'Display the manufacturing number in the message window
	PrintDbg aaa
End Sub

Example 2

We show the example for protection that allows only the unique COBOTTA to control the program.

Follow the following procedure.

  1. Program creator gets a MAC address of the COBOTTA from the program user and creates a cancel code with the formula described in the program. Once the cancel code is created, let the program user know that.
  2. Program creator encrypts the program and sends it to program users. (For details about encryption operation, refer to "Encryption of Source Code.")
  3. Program users input a cancel code in the global variable "S0" to execute the program. Then, the program loads a Mac address of the COBOTTA, generates a cancel code "lic" and compares it to "S0" at the time of execution, so the process is executed when the program finds it is correct COBOTTA.

Sub Main 
#pragma encrypt(on)
if IsLocked() Then Exit Sub

	'Describe the process here

#pragma encrypt(off)	
End Sub

#pragma encrypt(on)
Function IsLocked( ) As Integer
	Dim mac As Variant
	Dim lic As String
	Dim key As Variant
	Dim n As Integer
	
	key = Array( &HAA, &HF5, &H55, &H3C, &H57, &H81 ) 
	mac = split( SysInfo( 1 ), "-" ) ' X1-X2-X3-X4-X5-X6
	lic = ""
	For n = 0 To 5
		lic = lic + Hex( Val( "&H" & mac( n ) ) Xor key( n ) )
	Next
	'Debug.print "LIC = " & lic & ", MAC = " & SysInfo( 1 )
	
	If lic = S0 Then
		IsLocked = False
	Else
		IsLocked = True
	End If 
	
End Function
#pragma encrypt(off)

ID : 3978

<< Prev        Next >>