<< Prev        Next >>

ID : 9261

SysInfo

Function

To return the system information of the controller.

Syntax

SysInfo(index number )

Guaranteed Entry

Index number
Specify an index number with integer type data.

Return Value

Returns a Data Types corresponding to the specified index number to a variable specified with Variant Type data.

Description

The following system information can be acquired.

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

Pendant connecting status

0: Not connected
1: Smart TP is connected
2: Mini pendant is connected

Integer type
3

Number of global variables

The numbers from 0 to 7 correspond to the variable types as shown below.

0: I type
1: F type
2: D type
3: V type
4: Ptype
5: Jt ype
6: T type
7: S type

Array of integer type data
5

User permission given to a logged in account

1000: Operation
2000: Programming
3000: Maintenance
4000: Risk Management
5000 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
15 Encoder battery replacement schedule
-1: Replacement date has arrived
0: Replacement date not arrived
Integer type
16 Controller battery maintenance schedule
-1: Replacement date has arrived
0: Replacement date not arrived
Integer type
29 Controller type
0: RC9
Integer type
30 Safety type
0: Standard
1: Safey motion specification
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 controller to control the program.

Follow the procedure below.

  1. Program creator gets a MAC address of the controller 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 controller, 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 controller.

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 : 9261

<< Prev        Next >>