API User Guide (.Net Remoting)faremo.pmc.org.tw/RegisterServer/AppFiles/Help/SkyMars API Remoting...

184
Precision Machinery Research Development Center - Intelligent technology department 1 API User Guide (.Net Remoting) (Corresponding to SkyMars Professional / Express 3.06 above) . Version 3.06 2014/5/9 +

Transcript of API User Guide (.Net Remoting)faremo.pmc.org.tw/RegisterServer/AppFiles/Help/SkyMars API Remoting...

Precision Machinery Research Development Center - Intelligent technology department

1

API User Guide

(.Net Remoting)

(Corresponding to SkyMars Professional / Express 3.06 above)

.

Version 3.06

2014/5/9

+

Precision Machinery Research Development Center - Intelligent technology department

2

Contents

I. SkyMars Professional Archtecture ........................................................................................... 8

II. Developer’s required add-on components ................................................................................ 9

1. Add reference System.Runtime.Remoting ....................................................................... 9

2. Add reference InterfaceLib.dll ......................................................................................... 9

III. .Net Remoting pre-code ......................................................................................................... 10

1. Create a namespace and import the Remoting API support and SkyMars Interface ........ 10

2. Register the .Net Remoting channel and bind to it. ......................................................... 10

3. Reference following code: ............................................................................................. 10

4. How do I know the number of machines connected of SkyMars? ................................... 11

IV. Error Code and details ........................................................................................................... 13

V. FTP Error List ....................................................................................................................... 15

VI. Internal-info class function .................................................................................................... 17

1. SKY_version: Get SkyMar’s version and USB Key info ................................................ 17

2. SKY_conn_status: Get Connection status of CNC ......................................................... 17

3. SKY_conn_ip_port: Get CNC IP, port and other corelation info .................................... 18

4. SKY_nc_filename: Get CNC NC Filename ................................................................... 19

5. SKY_conn_count: Get SkyMars connection number ..................................................... 20

VII. Basic Type of Function .......................................................................................................... 22

1. GET_information: Basic Information of Correlation ...................................................... 22

2. GET_information_heid: Basic information of HEIDENHAIN controller ....................... 23

3. GET_status: Status information ..................................................................................... 24

4. GET_position: Coordinate Status ................................................................................... 25

5. GET_gcode: G Code...................................................................................................... 26

6. GET_othercode: Other Codes(H Code,D Code,T Code,M Code,B Code,F Code,S Code)

27

7. GET_feed_spindle: Feed rate / Spindle speed ................................................................ 28

8. GET_time: Time ............................................................................................................ 29

9. GET_time_heid: The ime of HEIDENHAIN Controller ................................................. 30

10. GET_time_cnc: Get the time of controller system .................................................. 31

11. GET_part_count: The count of part ........................................................................ 32

12. GET_part_total: ..................................................................................................... 33

13. GET_part_required: ............................................................................................... 33

14. SET_relpos: Set relative coordinate........................................................................ 34

15. SET_time_cnc: Set controller time ......................................................................... 35

VIII. The functions of Alert ............................................................................................................ 37

1. GET_alm_current: Current occurring alarm ................................................................... 37

2. GET_alm_current2: Current occurring alarm ................................................................. 37

3. GET_alm_current_heid: Get the current alarm of HEIDENHAIN controller .................. 39

Precision Machinery Research Development Center - Intelligent technology department

3

4. GET_alm_history: History of Alarms ............................................................................ 40

5. GET_alm_history2: History of Alarms........................................................................... 41

6. GET_alm_history_heid: History of Alarm for HEIDENHAIN Controller ...................... 42

7. GET_msg_current: Get the message of operation........................................................... 44

8. GET_msg_history: Get History of Operation ................................................................. 45

9. GET_plc_alarm: Get History of PLC Alarm .................................................................. 45

IX. The Functions of Servo Spindle ............................................................................................. 47

1. GET_servo_current: Current Loads of All Spindles ....................................................... 47

2. GET_servo_load: Get the percentage of servo load (%) ................................................. 47

3. GET_servo_speed: Get Servo Speed .............................................................................. 48

4. GET_spindle_load: Get the percentage of Spindle load (%) ........................................... 49

5. GET_spindle_speed: Get Spindle Speed ........................................................................ 50

6. GET_servo_temperature: Get the temperature of servo motor ........................................ 51

7. GET_spindle_temperature: Get the temperature of spindle ............................................ 52

X. The Functions of Tool Management (Controller) ................................................................... 53

1. GET_offset_title: Get the title of tool offset ................................................................... 53

2. GET_offset_all: Get the Offset of all tools ..................................................................... 54

3. GET_offset_scope: Get the tool offset according to designated scope ............................ 55

4. GET_offset_single: Get the Offset of a single tool ......................................................... 57

5. SET_offset_all: Write the Offsets of all tools ................................................................. 58

6. SET_offset_single: Write the Offset of a single tool ....................................................... 59

7. GET_offset_count: Get the count of offsets ................................................................... 60

8. GET_tool_title: Get the title of tool management ........................................................... 61

9. GET_tool_count: Get the count of Tool ......................................................................... 61

10. GET_tool_data: Get the data of all tool management ............................................. 62

11. GET_tool_data_mem: Get tool data and send the data into SkyMars memory ........ 63

12. GET_tool_data_scope: Get the data of Tool management and return the data of

indicated index ...................................................................................................................... 64

13. SET_tool_data: Write the data of management tool ................................................ 65

14. GET_pocket_title: Get the title of tool pocket ........................................................ 66

15. GET_pocket_count: Get the count of tool pocket ................................................... 67

16. GET_pocket_data: Get the data of Tool Pocket ...................................................... 68

17. SET_pocket_data: Write the data of tool pocket ..................................................... 69

18. GET_pocket_data_mem: Get the data from tool pocket, and write the data into

SkyMars memory .................................................................................................................. 70

19. GET_pocket_data_scope: Get the data of tool pocket, and return the data of

indicated index ...................................................................................................................... 71

XI. The Functions of Work Coordinates....................................................................................... 73

1. GET_work_coord_title: Get the title of work coordinates .............................................. 73

2. GET_work_coord_all: Get the data of all work coordinates ........................................... 73

Precision Machinery Research Development Center - Intelligent technology department

4

3. GET_work_coord_scope: Get the data of work coordinate by using indicated scope ...... 75

4. GET_work_coord_single: Get the data of a single work coordinate ............................... 76

5. SET_work_coord_all: Write the data of all work coordinates ......................................... 77

6. SET_work_coord_single: Write the data of a single workpiece coordinate ..................... 78

7. GET_work_coord_count: Get the count of workpiece coordinate .................................. 80

8. GET_preset_title: Get title of the program table ............................................................. 80

9. GET_preset_count: Get count of the program table ........................................................ 81

10. GET_preset_data: Get data of the program table .................................................... 82

11. SET_preset_data: Write data to a program table ..................................................... 84

12. GET_preset_data_mem: Get the program table, and save it in SkyMars memory ... 85

13. GET_preset_data_scope: Get data of the program table, and return it by indicated

index 86

XII. The Functions of Macro Variables (Common Variables) ........................................................ 88

1. GET_macro_all: Get all Macro (Common Variables) variables data ............................... 88

2. GET_macro_scope: Get Macro (Common Variable) variable data by scope indication ... 89

3. SET_macro_all: Set all Macro (Common Variable) variable data ................................... 90

4. GET_macro_single: Get single Macro (Common Variable) variable data ....................... 91

5. SET_macro_single: Set single Macro (Common Variable) variable data ........................ 92

6. GET_macro_variable: Get Macro (Common Variable) variable type .............................. 93

7. GET_pcode_single: Get single P-Code variable value (FANUC) ................................... 94

8. SET_pcode_single: Write single P-Code variable value (FANUC) ................................. 95

XIII. The Functions of NC Program ............................................................................................... 97

1. GET_nc_mem_list: Get the NC list from machine (memory) ......................................... 97

2. GET_nc_ftp_list: Get NC list from FTP ......................................................................... 98

3. GET_nc_mem_code: Get the content of NC from memory ............................................ 99

4. GET_nc_ftp_code: Get the content of NC from FTP.................................................... 100

5. UPLOAD_nc_mem: Upload NC to memory ................................................................ 101

6. UPLOAD_nc_ftp: Upload NC to FTP ....................................................................... 102

7. DEL_nc_mem: Delect NC from memory ..................................................................... 103

8. DEL_nc_ftp: Delect NC from FTP .............................................................................. 104

9. GET_nc_pointer: Get the pointer of the current NC ..................................................... 105

10. GET_nc_current_block: Get the current and next block of NC ............................. 107

11. GET_nc_freespace: Get free space of NC ............................................................ 108

12. SET_nc_main: Set or assign NC to main program ................................................ 109

13. UPLOAD_nc_mdi: Upload MDI NC program to Controller (MDI mode) ............ 109

XIV. The Functions of System parameter ......................................................................................111

1. GET_param_max: Get the Max number of the parameters (Or the last number)............111

2. GET_param_data: Get the parameter data .....................................................................111

3. SET_param_data: Set the parameter data ..................................................................... 115

XV. The Functions of PLC ......................................................................................................... 117

Precision Machinery Research Development Center - Intelligent technology department

5

1. GET_plc_ver: Get the version information of PLC ...................................................... 117

2. GET_plc_addr: Get the PLC address of start or end number ........................................ 117

3. GET_plc_addr2: Get the PLC address of start or end number ...................................... 119

4. GET_plc_status: Get the status of PLC ........................................................................ 120

5. GET_plc_status2: Get the status of PLC ...................................................................... 121

6. SET_plc_status: Set the status of PLC ......................................................................... 123

7. SET_plc_status2: Set the status of PLC ....................................................................... 125

XVI. The Functions of Files Management ............................................................................ 127

1. GET_file_directory: Get files and directories on controller .......................................... 127

2. UPLOAD_file2: Upload file from PC side to controller ............................................... 128

3. DOWNLOAD_file2: Download file from controller side to PC side ............................ 128

4. DEL_file: Delete file from controller ........................................................................... 129

XVII. The Functions of National Instruments 9233 (Accelerometer module) (Currently

disabled function.) ..................................................................................................................... 131

1. START_ni9233_get_data: Start module for data acquisition ........................................ 131

2. STOP_ni9233_get_data: Stop Data Acquisition ........................................................... 132

3. CHECK_ni9233_running: Check if DataAcquisition is running ................................... 132

4. GET_ni9233_spectrum_data: Get the data from NI 9233 ............................................. 133

5. GET_ni9233_error_msg: Get the error message of NI 9233 ......................................... 134

XVIII. The Function of RS232 Module ................................................................................... 136

1. GET_rs232_status: Get the status and parameters of RS232 ........................................ 136

2. OPEN_rs232: Open RS232 .......................................................................................... 137

3. SET_rs232: Set data into RS232 .................................................................................. 139

4. CHECK_rs232_data_received: Check if RS232 received data (IsOnCallbackEvent=true)

140

5. GET_rs232_data_received: Get the data from RS232 received .................................... 140

6. CLOSE_rs232: Close RS232 ....................................................................................... 141

7. GET_rs232_error_msg: Get the error message from RS-232........................................ 141

XIX. PC Camera Module Class(USB) .................................................................................. 143

1. CONNECT_cam: Connect to the camera ..................................................................... 143

2. DISCONNECT_cam: Disconnect the camera .............................................................. 143

3. CHECK_cam_running: Check if the camera gets connected and ready to capture vedios

144

4. GET_cam_image: Get a image from the camera .......................................................... 144

5. GET_cam_error: Get exception error of the camera ..................................................... 145

XX. SkyMars Professional Event Delegate ................................................................................. 147

1. EVENT_conn_cnc: Create an event happened after setting CNC info through SkyMars

Professional ......................................................................................................................... 148

2. EVENT_disconn_cnc: Create an event when CNC is disconnected through SkyMars

Professional ......................................................................................................................... 149

Precision Machinery Research Development Center - Intelligent technology department

6

3. EVENT_conn_status: Create an event of CNC status(OFF、RUN、IDLE、ALARM)

150

4. EVENT_nc_filename: Create an event of CNC changing NC filename ........................ 151

XXI. SkyMars Utilization Rate Data .................................................................................... 153

1. GET_utilization_all_today: Get today’s utilization rate data ........................................ 153

2. GET_utilization_single_time: Get a single machine utilization rate data based on time 154

3. GET_utilization_single_total: Get a single machine utilization rate data based on total

running counts(part counts and cycle times) ........................................................................ 155

4. GET_utilization_single_list: Get a single machine utilization rate historical data ......... 156

5. GET_utilization_single_all: Get a single machine all utilization rate data .................... 158

XXII. The Function of SkyMars Maintenance Management................................................... 161

1. GET_maint_count: Get maintenance management total count...................................... 161

2. GET_maint_title: Get maintenance management title .................................................. 161

3. GET_maint_all: Get maintenance management all data ............................................... 162

4. GET_maint_all_time: Get maintenance management all time (use time and life time) . 163

5. GET_maint_single: Get single maintenance management data ..................................... 164

6. GET_maint_single_time: Get single maintenance management time data (use time and

life time) ............................................................................................................................. 165

7. ADD_maint_single: Add single maintenance management data ................................... 165

8. SET_maint_single: Modify single maintenance management data ............................... 167

9. DEL_maint_single: Delete single maintenance management data ................................ 168

10. SET_maint_single_usetime: Modify single maintenance management use time ... 169

11. SET_maint_single_zero: Reset single maintenance management use time............ 169

XXIII. The Function of SkyMars Tool Management ............................................................... 171

1. GET_toolmanage_count: Get tool management total count .......................................... 171

2. GET_toolmanage_title2: Get tool management title ..................................................... 171

3. GET_toolmanage_all2: Get all tool management data .................................................. 172

4. GET_toolmanage_all_execute: Get all tool management cycle time, life time, part count

and life part count data ........................................................................................................ 173

5. GET_toolmanage_single2: Get single tool management data ....................................... 174

6. GET_toolmanage_single_execute: Get single tool management cycle time, life time, part

count and life part count data ............................................................................................... 175

7. ADD_toolmanage_single2: Add single tool management data ..................................... 176

8. SET_toolmanage_single2: Modify single tool management data .................................. 177

9. DEL_toolmanage_single: Delete single tool management data .................................... 179

10. SET_toolmanage_single_cycletime: Set single tool management cycle time ........ 179

11. SET_toolmanage_single_partcount: Set single tool management part count ......... 180

12. SET_toolmanage_single_zero: Reset for single tool management cycle time ....... 181

13. SET_toolmanage_single_zero_partcount: Reset single tool management part count

181

Precision Machinery Research Development Center - Intelligent technology department

7

XXIV. SkyMars APP Piracy-Proof Method ............................................................................. 183

XXV. Question & Answer ..................................................................................................... 184

Precision Machinery Research Development Center - Intelligent technology department

8

I. SkyMars Professional Archtecture

SkyMars Professional is composed of four sections as the following:

Cloud UI Plug-In

SkyMars Runtime

Hardward

1. SkyMars Runtime

This section is responsible for connecting with various CNC controllers and sensors.

2. User Interface (UI)

SkyMars Professional provides standard UI. Users will interact with SkyMars Runtime

when they perform any command. This UI provides info-monitering, program

upload/download, parameter, server spindle monitoring, and tool

management/maintainance.

3. Cloud

Cloud Module connects with a Cloud Server. The Cloud Module is called by SkyMars

Runtime section depending on situations.If the utilization rate service is activated,

SkyMars Rntime will transfer basic info and status to the Cloud Server through the

Cloud Module.

4. Plug-In

Plug-In Interface is composed of Interface DLL files. All fuction names and structure

variables are defined in the interface. Developers have to include this interface and

create namespaces in order to use all fuctions and structure variables.

CNC Controller Sensor

Precision Machinery Research Development Center - Intelligent technology department

9

II. Developer’s required add-on components

1. Add reference System.Runtime.Remoting

As shown below, select System.Runtime.Remoting.

2. Add reference InterfaceLib.dll

Copy InterfaceLib.dll to the project execute folder, and add it as a reference.

Precision Machinery Research Development Center - Intelligent technology department

10

III. .Net Remoting pre-code

1. Create a namespace and import the Remoting API support and SkyMars Interface

using System.Runtime.Remoting;

using System.Runtime.Remoting.Channels;

using System.Runtime.Remoting.Channels.Tcp;

using InterfaceLib;

You could reference following image:

2. Register the .Net Remoting channel and bind to it.

Create iRemoting variable of InterfaceLib.IMsg type

Add the code below:

if (ChannelServices.RegisteredChannels.Length == 0)

{

ChannelServices.RegisterChannel(new TcpChannel());

iRemoting = (IMsg)Activator.GetObject(typeof(IMsg),

"tcp://localhost:9501/RemoteObjectURI9501");

}

"tcp://localhost:9501/RemoteObjectURI9501":

9501 means the first machine connected with SkyMars. The second one is as

follows, for example, the second machine is 9502, and the third one is 9503 and

so on.

Must check that a firewall may block the transmission if TCP and binary stream

is used in connection.

3. Reference following code: using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

Precision Machinery Research Development Center - Intelligent technology department

11

using System.Linq;

using System.Text;

using System.Windows.Forms;

using System.Runtime.Remoting;

using System.Runtime.Remoting.Channels;

using System.Runtime.Remoting.Channels.Tcp;

using InterfaceLib;

namespace WindowsFormsApplication1

{

public partial class FormSample3 : Form

{

InterfaceLib.IMsg iRemoting = null;

StructMsg.Pwd _Pwd;

StructMsg.SkyConn_ip_port R1;

public FormSample3()

{

InitializeComponent();

}

private void FormSample3_Load(object sender, EventArgs e)

{

if (ChannelServices.RegisteredChannels.Length == 0)

ChannelServices.RegisterChannel(new TcpChannel(), false);

iRemoting = (IMsg)Activator.GetObject(typeof(IMsg),

"tcp://localhost:9501/RemoteObjectURI9501");

_Pwd.ConnectionKey = "123";

short ret = iRemoting.SKY_conn_ip_port(_Pwd, ref R1);

if (ret == 0)

{

txtManufacturer.Text = R1.Manufacturer[0];

txtName.Text = R1.MachineName[0];

}

}

}

}

4. How do I know the number of machines connected of SkyMars?

You could use API as "SKY_conn_count", as following example code:

StructMsg.Pwd _Pwd = new StructMsg.Pwd();

_Pwd.ConnectionKey = "123";

StructMsg.total_count R = new StructMsg.total_count();

Precision Machinery Research Development Center - Intelligent technology department

12

short ret = iRemoting.SKY_conn_count(_Pwd, ref R);

if (ret == 0)

MessageBox.Show(R.Count.ToString());

else

MessageBox.Show(ret.ToString());

Precision Machinery Research Development Center - Intelligent technology department

13

IV. Error Code and details

Error

Code Error Types Details

-31 Camera Exception Camera Internal Exception Error

-30 Camera Current Running Camera is connected and processing image

acquisition.

-29 Camera Disconnect Camera is not connected.

-28 RS-232 Close RS-232 Com Port is closed

-27 RS-232 Over limit The amount of modules connected to RS-232 is

over limit.

-26 RS-232 Return Type The variable of type returned via RS-232 is not

declared.

-25 RS-232 Open Failed RS-232 COM Port fails to open or has opened

already.

-24 RS-232 Exception RS-232 internal exception error, please call

corresponding functions to get more information.

-23 Sensor Exception

Sensor internal exception error or API error, please

call corresponding functions to get more

information.

-22 Sensor Current Running The sensor is running.

-21 USB key error USB Key doesn’t work

-20 Plug-In Time out The function is time out, set Register (FANUC

only) if you want to extend it.

-19 SkyMars Busy SkyMars is running

-18 Not supported The function is not supported for this controller.

-17 Protocol error (Ethernet version only) Data from Ethernet Board is incorrect.Contact with

the service section or the section in charge.

-16 Socket error (Ethernet version only) Investigate CNC power supply, Ethernet cable and

I/F board.

-15 DLL file error There is no DLL file for each CNC series

corresponding to specified node.

-8 Handle number error Get the library handle number.

-7 Version mismatch between the CNC/PMC and library

The CNC/PMC version does not match that of the

library.Replace the library or the CNC/PMC control

software.

-6 Abnormal library state An unanticipated error occurred.Contact with the

section in charge.

-2 Reset or stop request The RESET or STOP button was pressed.Call the

Precision Machinery Research Development Center - Intelligent technology department

14

termination function.

-1 CNC Busy Wait until the completion of CNC processing, or

retry.

0 Normal termination No errors detected!

1 Error(function is not executed, or not available)

Specific function which must be executed

beforehand has not been executed.Otherwise that

function is not available.

2 Error(data block length error, error of number of data) Check and correct the data block length or number

of data.

3 Error(data number error) Check and correct the data number.

4 Error(data attribute error) Check and correct the data attribute.

5 Error(data error) Check and correct the data.

6 Error(no option) There is no corresponding CNC option.

7 Error(write protection) Write operation is prohibited.

8 Error(memory overflow) CNC tape memory is overflowed.

9 Error(CNC parameter error) CNC parameter is set incorrectly.

10 Error(buffer empty/full) The buffer is empty or full.

11 Error(path number error) A path number is incorrect.

12 Error(CNC mode error) The CNC mode is incorrect.Correct the CNC mode.

13 Error(CNC execution rejection) The execution at the CNC is rejected.Check the

condition of execution.

14 Error(Data server error) Some errors occur at the data server.

15 Error(alarm) The function cannot be executed due to an alarm in

CNC.Remove the cause of alarm.

16 Error(stop) CNC status is stop or emergency.

17 Error(State of data protection) Data is protected by the CNC data protection

function.

18 Error(Not found Machine ID) Please Check or not send CNC_CONNECTION

command.

19 Error(No out) Please Check NO.

20 Error(Password) Incorrect Password.

21 Error(Compatible) Version compatible about problem.

Precision Machinery Research Development Center - Intelligent technology department

15

V. FTP Error List

110 Restart marker reply.

120 Service ready in (n) minutes.

125 Data connection already open, transfer starting.

150 File status okay, about to open data connection.

200 Command okay.

202 Command not implemented

211 System status, or system help reply.

212 Directory status.

213 File status.

214 Help message.

215 NAME system type. (NAME is an official system name from the list in the Assigned Numbers document.)

220 Service ready for new user.

221 Service closing control connection. (Logged out if appropriate.)

225 Data connection open, no transfer in progress.

226 Closing data connection. Requested file action successful (file transfer, abort, etc.).

227 Entering Passive Mode

230 User logged in, proceed.

250 Requested file action okay, completed.

257 PATHNAME created.

331 User name okay, need password.

332 Need account for login.

350 Requested file action pending further information.

421 Service not available, closing control connection. (May be a reply to any command if the service knows it

must shut down.)`

425 Can't open data connection.

426 Connection closed, transfer aborted.

450 Requested file action not taken. File unavailable (e.g., file busy).

451 Requested action aborted, local error in processing.

452 Requested action not taken. Insufficient storage space in system.

500 Syntax error, command unrecognized. This may include errors such as command line too long.

501 Syntax error in parameters or arguments.

502 Command not implemented.

503 Bad sequence of commands.

504 Command not implemented for that parameter.

530 User not logged in.

532 Need account for storing files.

550 Requested action not taken. File unavailable (e.g., file not found, no access).

552 Requested file action aborted, storage allocation exceeded

Precision Machinery Research Development Center - Intelligent technology department

16

553 Requested action not taken. Illegal file name.

Precision Machinery Research Development Center - Intelligent technology department

17

VI. Internal-info class function

1. SKY_version: Get SkyMar’s version and USB Key info

API Name SKY_Version

Description Get SkyMars version and USB Keyinfo

C# Method short SKY_version(StructMsg.Pwd P, ref StructMsg.SkyVersion

R);

VB.Net

Method

SKY_version(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.SkyVersion) As Short

Data

Structure

Structure name: SkyVersion

Variable Name Type [in/out] Description

Version float out SkyMars Version

SerialNumber long out USB key serial number

LicenseCount short out Maxinum of connecting

machines

Note SerialNumber is USB Key ID, which differs from each USB Key.

Support All controller or sensor.

C# Sample StructMsg.SkyVersion _SkyVersion;

StructMsg.Pwd _Pwd;

private void button1_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.SKY_version(_Pwd, ref _SkyVersion);

if (ret == 0)

{

txtVersion.Text = _SkyVersion.Version.ToString();

txtKeyId.Text = _SkyVersion.SerialNumber.ToString();

txtLic.Text = _SkyVersion.License.ToString();

}

}

2. SKY_conn_status: Get Connection status of CNC

API Name SKY_conn_status

Description Get CNC connection status

C# Method short SKY_conn_status(StructMsg.Pwd P, ref

StructMsg.SkyConn_status R);

VB.Net

Methos

SKY_conn_status(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.SkyConn_status) As Short

Precision Machinery Research Development Center - Intelligent technology department

18

Data

Structure

Structure Name: SkyConn_status

Pamarametr

Name

Type [in/out] Info

MachineNo int[] out Machine Index

Status short[] out 0:Off 1:RUN 2:IDLE

3:Alarm

4:RUN and Alarm

Note

Support All controller or sensor.

C# Sample StructMsg.SkyConn_status _SkyConn_status;

StructMsg.Pwd _Pwd;

private void button2_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.SKY_conn_status(_Pwd, ref

_SkyConn_status);

if (ret == 0)

{

txtMachineNo.Text =

_SkyConn_status.MachineNo[0].ToString();

txtStatus.Text =

_SkyConn_status.Status[0].ToString();

}

}

3. SKY_conn_ip_port: Get CNC IP, port and other corelation info

API Name SKY_conn_ip_port

Description Get CNC IP, port, and other correlation info

C# Method short SKY_conn_ip_port(StructMsg.Pwd P, ref

StructMsg.SkyConn_ip_port R);

VB.Net

Method

SKY_conn_ip_port(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.SkyConn_ip_port) As Short

Data

Structure

Structure Name: SkyConn_ip_port

Variable Name Type [in/out] Description

MachineNo int[] out Machine Index

MachineName string[] out Machine Name

IP string[] out Machine IP

Port short[] out Machine Port

Manufacturer string[] out Brand

Precision Machinery Research Development Center - Intelligent technology department

19

PlugInPort int[] out Plug-In Port

Note

Support All controller or sensor.

C# Sample StructMsg.SkyConn_ip_port _SkyConn_ip_port;

StructMsg.Pwd _Pwd;

private void button3_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.SKY_conn_ip_port(_Pwd, ref

_SkyConn_ip_port);

if (ret == 0)

{

txtMachineNo2.Text =

_SkyConn_ip_port.MachineNo[0].ToString();

txtMachineName.Text =

_SkyConn_ip_port.MachineName[0];

txtIP.Text = _SkyConn_ip_port.IP[0];

txtPort.Text = _SkyConn_ip_port.Port[0].ToString();

txtManufacturer.Text =

_SkyConn_ip_port.Manufacturer[0];

txtPlugInPort.Text =

_SkyConn_ip_port.PlugInPort[0].ToString();

}

}

4. SKY_nc_filename: Get CNC NC Filename

API Name SKY_nc_filename

Description Get CNC NC Filename

C# Method short SKY_nc_filename(StructMsg.Pwd P, ref

StructMsg.SkyNc_filename R);

VB.Net

Method

SKY_nc_filename(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.SkyNc_filename) As Short

Data

structure

Strcuture Name: SkyNc_filename

Variable

Name

Type [in/out] Description

RetType short in Indicate

-1:All ,Other:Machine

Index

Precision Machinery Research Development Center - Intelligent technology department

20

MachineNo int[] out Machine Index

MainProg string[] out Main-program Filename

SubProg string[] out Sub-program Filename

Note

Support All controller or sensor.

C# Sample StructMsg.SkyNc_filename _SkyNc_filename;

StructMsg.Pwd _Pwd;

private void button4_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.SKY_nc_filename(_Pwd, ref

_SkyNc_filename);

if (ret == 0)

{

txtMainProg.Text = _SkyNc_filename.MainProg[0];

txtSubProg.Text = _SkyNc_filename.SubProg[0];

}

}

5. SKY_conn_count: Get SkyMars connection number

API Name SKY_conn_count

Description Get SkyMars connection number

C# Method short SKY_conn_count(StructMsg.Pwd P, ref

StructMsg.total_count R);

VB.Net

Method

Data

structure

Strcuture Name: total_count

Variable

Name

Type [in/out] Description

Count short out Connection count.

Note

Support All controller or sensor.

C# Sample StructMsg.Pwd _Pwd = new StructMsg.Pwd();

_Pwd.ConnectionKey = "123";

StructMsg.total_count R = new StructMsg.total_count();

short ret = iRemoting.SKY_conn_count(_Pwd, ref R);

if (ret == 0)

MessageBox.Show(R.Count.ToString());

else

Precision Machinery Research Development Center - Intelligent technology department

21

MessageBox.Show(ret.ToString());

Precision Machinery Research Development Center - Intelligent technology department

22

VII. Basic Type of Function

1. GET_information: Basic Information of Correlation

API Name GET_information

Description Basic Information of Correlation

C# Method short GET_information(StructMsg.Pwd P, ref

StructMsg.information R);

VB.Net

Method

GET_information(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.information) As Short

Data

Structure

Structure Name: information

Variable

Names

Type [in/out] Description

Axes short Out Numbers of controllable

axes

CncType string Out ex :'18' : Series

180/180i

MaxAxes short Out Max Axes

Series string Out M/T type

Nc_Ver string Out NC version

AxisName string[] Out Names of coordinates

(Names of Axes)

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

LNC ITRI

O O

C# Sample StructMsg.information _information;

StructMsg.Pwd _Pwd;

private void button1_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_information(_Pwd, ref

_information);

if (ret == 0)

{

txtAxes.Text = _information.Axes.ToString();

txtCncType.Text = _information.CncType;

txtMaxAxes.Text = _information.MaxAxes.ToString();

txtSeries.Text = _information.Series;

Precision Machinery Research Development Center - Intelligent technology department

23

txtNc_Ver.Text = _information.Nc_Ver;

}

}

2. GET_information_heid: Basic information of HEIDENHAIN controller

API Name GET_information_heid

Description Basic information of correlation

C# Method short GET_information_heid(StructMsg.Pwd P, ref

StructMsg.information_heid R);

VB.Net

Method

GET_information_heid(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.information_heid) As Short

Data

structure

Structure name: information_heid

Variable

Names

Type [in/out] Description

Axes short Out Numbers of controllable

axes

Model string Out

Nc_Ver string Out

FCL string Out

Plc_Ver string Out

AxisName string[] Out Names of coordinates

(Names of Axes)

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

X X O X X

LNC ITRI

X X

C# Sample

StructMsg.information_heid _information_heid;

private void button1_Click(object sender, EventArgs e)

{

short ret = iRemoting.GET_information_heid(ref

_information_heid);

if (ret == 0)

{

txtAxes.Text = _information_heid.Axes.ToString();

txtModel.Text = _information_heid.Model;

txtNc_Ver.Text = _information_heid.Nc_Ver;

txtFCL.Text = _information_heid.FCL;

Precision Machinery Research Development Center - Intelligent technology department

24

txtPlc_Ver.Text = _information_heid.Plc_Ver;

txtAxisName.Text = _information_heid.AxisName[0];

}

}

3. GET_status: Status information

API Name GET_status

Description Status information

C# Method short GET_status(StructMsg.Pwd P, ref StructMsg.status R);

VB.Net

Method

GET_status(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.status) As Short

Data

structure

Structure name: status

Variable

names

Type [in/out] Description

MainProg string Out Number of main program

CurProg string Out Number of current

executing program

CurSeq int Out Sequence of current

executing program

Mode string Out ex:"MDI", "MEM"…

Status string Out ex:"STOP", "START"…

Alarm string Out ALARM

Emg string Out EMG

Monition string Out DWL / MTN

Note Monition is only supported for FANUC now.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O O ? O

LNC ITRI

O O

C# Sample StructMsg.status _status;

StructMsg.Pwd _Pwd;

private void button2_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_status(_Pwd, ref _status);

if (ret == 0)

{

txtMainProg.Text = _status.MainProg;

Precision Machinery Research Development Center - Intelligent technology department

25

txtCurProg.Text = _status.CurProg;

txtCurSeq.Text = _status.CurSeq.ToString();

txtMode.Text = _status.Mode;

txtStatus.Text = _status.Status;

txtAlarm.Text = _status.Alarm;

txtEMG.Text = _status.Emg;

}

}

4. GET_position: Coordinate Status

API Name GET_position

Description Coordinate Status

C# Method short GET_position(StructMsg.Pwd P, ref StructMsg.position R);

VB.Net

Method

GET_position(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.position) As Short

Data

Structure

Structure name: position

Variable

Names

Type [in/out] Description

AxisName string[] out Names of Axes

DecPoint sohrt out Floating point number of

Axes

Unit string[] out Unit of coordinates

Mach double[] out Mechanical coordinate

system

Abs double[] out Absolute coordinate

system

Rel double[] out Relative coordinate

system

Dist double[] out Remaining distance

Note ※ HEIDENHAIN controller doesn’t support relative coordinates.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O O O O

LNC ITRI

O O

C# Sample StructMsg.position _position;

StructMsg.Pwd _Pwd;

private void button11_Click(object sender, EventArgs e)

{

Precision Machinery Research Development Center - Intelligent technology department

26

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_position(_Pwd, ref _position);

if (ret == 0)

{

txtAbs.Text = _position.Abs[0].ToString();

txtMach.Text = _position.Mach[0].ToString();

txtRel.Text = _position.Rel[0].ToString();

txtDist.Text = _position.Dist[0].ToString();

}

}

5. GET_gcode: G Code

API Name GET_gcode

Description G Code

C# Method short GET_gcode(StructMsg.Pwd P, ref StructMsg.gcode R);

VB.Net

Method

GET_gcode(ByVal P As StructMsg.Pwd, ByRef R As StructMsg.gcode)

As Short

Data

Structure

Structure name: gcode

Variable

names

Type [in/out] Description

Gdata string[] out G Code

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

LNC ITRI

O O

C# Sample StructMsg.gcode _gcode;

StructMsg.Pwd _Pwd;

private void button3_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_gcode(_Pwd, ref _gcode);

if (ret == 0)

{

for (int i = 0; i <= _gcode.Gdata.Length - 1; i++)

{

txtGCode.Text += _gcode.Gdata[i] + " ";

}

Precision Machinery Research Development Center - Intelligent technology department

27

}

}

6. GET_othercode: Other Codes(H Code,D Code,T Code,M Code,B Code,F Code,S Code)

API Name GET_othercode

Description G Code (H Code,D Code,T Code,M Code,B Code,F Code,S Code)

C# Method short GET_othercode(StructMsg.Pwd P, ref StructMsg.othercode

R);

VB.Net

Method

GET_othercode(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.othercode) As Short

Data

Structure

Structure name: othercode

Variable

names

Type [in/out] Description

HCode int out H Code

DCode int out D Code

TCode int out T Code

MCode int out M Code

BCode int out B Code, Only MITSUBISHI

supported

FCode int out F Code

SCode int out S Code

Note ※ Only MITSUBISHI supports B Code.

※ HEIDENHAIN controller supports only M Code、F Code、T Code、

S Code.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

LNC ITRI

O O

C# Sample StructMsg.othercode _othercode;

StructMsg.Pwd _Pwd;

private void button4_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_othercode(_Pwd, ref _othercode);

if (ret == 0)

{

txtHCode.Text = _othercode.HCode.ToString();

txtDCode.Text = _othercode.DCode.ToString();

Precision Machinery Research Development Center - Intelligent technology department

28

txtTCode.Text = _othercode.TCode.ToString();

txtMCode.Text = _othercode.MCode.ToString();

txtBCode.Text = _othercode.BCode.ToString();

txtFCode.Text = _othercode.FCode.ToString();

txtSCode.Text = _othercode.SCode.ToString();

}

}

7. GET_feed_spindle: Feed rate / Spindle speed

API Name GET_feed_spindle

Description Feed rate / Spindle speed

C# Method short GET_feed_spindle(StructMsg.Pwd P, ref

StructMsg.feed_spindle R);

VB.Net

Method

GET_feed_spindle(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.feed_spindle) As Short

Data

Structure

Structure name: feed_spindle

Variable

names

Type [in/out] Description

OvFeed double out Feed Rate Over Ride

OvSpindle double out Spindle Over Ride

ActFeed double out Actual feed rate

ActSpindle int out Actual spindle speed

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O O ? O

LNC ITRI

O O

C# Sample StructMsg.feed_spindle _feed_spindle;

StructMsg.Pwd _Pwd;

private void button5_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_feed_spindle(_Pwd, ref

_feed_spindle);

if (ret == 0)

{

txtOvFeed.Text = _feed_spindle.OvFeed.ToString();

txtOvSpindle.Text =

Precision Machinery Research Development Center - Intelligent technology department

29

_feed_spindle.OvSpindle.ToString();

txtActFeed.Text = _feed_spindle.ActFeed.ToString();

txtActSpindle.Text =

_feed_spindle.ActSpindle.ToString();

}

}

8. GET_time: Time

API Name GET_time

Description Get the time of CNC

C# Method short GET_time(StructMsg.Pwd P, ref StructMsg.time R);

VB.Net

Method

GET_time(ByVal P As StructMsg.Pwd, ByRef R As StructMsg.time)

As Short

Data

Structure

Structure name: time

Variable

names

Type [in/out] Description

Power int[] out Time of power on

Cutting int[] out Time of cutting

Cycle int[] out Cycle Time

Operation int[] out Operating Time

Note ※ Cutting time:MITSUBISHI doesn’t support.

※ In the “timeData Structure”, there are always three arrays

in all variables. Index 0 means “hour”, index 1 means “minute”,

and index 2 means “second”.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

LNC ITRI

O O

C# Sample StructMsg.time _time;

StructMsg.Pwd _Pwd;

private void button6_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_time(_Pwd, ref _time);

if (ret == 0)

{

txtPower.Text = _time.Power[0].ToString() + " : " +

_time.Power[1].ToString() + " : " + _time.Power[2].ToString();

Precision Machinery Research Development Center - Intelligent technology department

30

txtCutting.Text = _time.Cutting[0].ToString() + " : " +

_time.Cutting[1].ToString() + " : " + _time.Cutting[2].ToString();

txtCycle.Text = _time.Cycle[0].ToString() + " : " +

_time.Cycle[1].ToString() + " : " + _time.Cycle[2].ToString();

txtOperation.Text = _time.Operation[0].ToString() + " : " +

_time.Operation[1].ToString() + " : " +

_time.Operation[2].ToString();

}

}

9. GET_time_heid: The ime of HEIDENHAIN Controller

API Name GET_time_heid

Description Get the time of HEIDENHAIN Controller

C# Method short GET_time_heid(StructMsg.Pwd P, ref StructMsg.time_heid

R);

VB.Net

Method

GET_time(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.time_heid) As Short

Data

Structure

Structure name: time_heid

Variable names Type [in/out] Description

MachineRunning int[] out This is the cumulative

machining time since

installation.

MachineUp int[] out This is the cumulative

time that the machine

has been on (no

emergency stop) since

installation.

NcUp int[] out This is the cumulative

time that the NC has

been turned on since

installation of the

machine.

SpindleRunning int[] out This is the cumulative

time the spindle has

been running (M3 or M4)

since installation of

the machine.

Note

Precision Machinery Research Development Center - Intelligent technology department

31

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

X X O X X

LNC ITRI

X X

C# Sample StructMsg.time_heid _time_heid;

StructMsg.Pwd _Pwd;

private void button6_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_time_heid(_Pwd, ref _time_heid);

if (ret == 0)

{

txtMachineRunning.Text = _time_heid.MachineRunning[0] + ":" +

_time_heid.MachineRunning[1];

txtMachineUp.Text = _time_heid.MachineUp[0] + ":" +

_time_heid.MachineUp[1];

txtNcUp.Text = _time_heid.NcUp[0] + ":" + _time_heid.NcUp[1];

txtSpindleRunning.Text = _time_heid.SpindleRunning[0] + ":" +

_time_heid.SpindleRunning[1];

}

}

10. GET_time_cnc: Get the time of controller system

API Name GET_time_cnc

Description Get the time of controller system

C# Method short GET_time_cnc(StructMsg.Pwd P, ref StructMsg.time_cnc R);

VB.Net

Method

GET_time_cnc(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.time_cnc) As Short

Data

Structure

Structure name: time_cnc

Variable

names

Type [in/out] Description

SystemTime short[] out About the time of

controller system, it

will return 6 arrays,

such as,

[0]:Year, [1]:Month,

[2]:Date, [3]:Hour,

[4]:Minute, [5]:Secound

Precision Machinery Research Development Center - Intelligent technology department

32

Note ※ HEIDENHAIN controller doesn’t support yet.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? X

LNC ITRI

X O

C# Sample StructMsg.time_cnc _time_cnc;

StructMsg.Pwd _Pwd;

private void button10_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_time_cnc(_Pwd, ref _time_cnc);

txtSysTime.Text = _time_cnc.SystemTime[0] + "/" +

_time_cnc.SystemTime[1] + "/" + _time_cnc.SystemTime[2] + "

" + _time_cnc.SystemTime[3] + ":" + _time_cnc.SystemTime[4]

+ ":" + _time_cnc.SystemTime[5];

}

11. GET_part_count: The count of part

API Name GET_part_count

Description Get the count of part

C# Method short GET_part_count(StructMsg.Pwd P, ref

StructMsg.part_count R);

VB.Net

Method

GET_part_count(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.part_count) As Short

Data

Structure

Structure name: part_count

Variable names Type [in/out] Description

part_count int out Get the count of part

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X O O

LNC ITRI

O O

C# Sample StructMsg.part_count _part_count;

StructMsg.Pwd _Pwd;

private void button7_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

Precision Machinery Research Development Center - Intelligent technology department

33

short ret = iRemoting.GET_part_count(_Pwd, ref

_part_count);

if (ret == 0)

{

txtPartCount.Text = _part_count.PartCount.ToString();

}

}

12. GET_part_total:

API Name GET_part_total

Description

C# Method short GET_part_total(StructMsg.Pwd P, ref

StructMsg.part_total R);

VB.Net

Method

GET_part_total(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.part_total) As Short

Data

Structure

Structure name: part_total

Variable

names

Type [in/out] Description

PartTotal int Out

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O X X X O

LNC ITRI

X X

C# Sample StructMsg.part_total _part_total;

StructMsg.Pwd _Pwd;

private void button8_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_part_total(_Pwd, ref

_part_total);

if (ret == 0)

{

txtPartTotal.Text = _part_total.PartTotal.ToString();

}

}

13. GET_part_required:

Precision Machinery Research Development Center - Intelligent technology department

34

API Name GET_part_required

Description

C# Method short GET_part_required(StructMsg.Pwd P, ref

StructMsg.part_required R);

VB.Net

Method

GET_part_required(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.part_required) As Short

Data

Structure

Structure name: part_required

Variable

names

Type [in/out] Description

PartRequired int out

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O X X X O

LNC ITRI

X X

C# Sample StructMsg.part_required _part_required;

StructMsg.Pwd _Pwd;

private void button9_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_part_required(_Pwd, ref

_part_required);

if (ret == 0)

{

txtPartRequired.Text =

_part_required.PartRequired.ToString();

}

}

14. SET_relpos: Set relative coordinate

API Name SET_relpos

Description

C# Method short SET_relpos(StructMsg.Pwd P, StructMsg.relpos R);

VB.Net

Method

Data

Structure

Structure name: relpos

Variable

names

Type [in/out] Description

Precision Machinery Research Development Center - Intelligent technology department

35

AxisName string in Coordinate name.

PosValue double in Write to CNC value.

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O ? ? ? O

LNC ITRI

? ?

C# Sample StructMsg.Pwd _Pwd;

StructMsg.relpos _relpos;

private void button12_Click(object sender, EventArgs e)

{

_Pwd.WritePwd = "123";

_relpos.AxisName = "X";

_relpos.PosValue = 0;

short ret = iRemoting.SET_relpos(_Pwd, _relpos);

_relpos.AxisName = "Y";

_relpos.PosValue = 0;

ret = iRemoting.SET_relpos(_Pwd, _relpos);

_relpos.AxisName = "Z";

_relpos.PosValue = 0;

ret = iRemoting.SET_relpos(_Pwd, _relpos);

}

15. SET_time_cnc: Set controller time

API Name SET_time_cnc

Description

C# Method short SET_time_cnc(StructMsg.Pwd P, StructMsg.time_cnc R);

VB.Net

Method

Data

Structure

Structure name: relpos

Variable

names

Type [in/out] Description

SystemTime short[] in Write to Controller's

datetime and input value

need as following array:

Precision Machinery Research Development Center - Intelligent technology department

36

[0]:Year, [1]:Month,

[2]:Day, [3]:Hour,

[4]:Minute, [5]:Second

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O ? ? ? ?

LNC ITRI

? ?

C# Sample StructMsg.time_cnc _time_cnc = new StructMsg.time_cnc();

_time_cnc.SystemTime = new short[]{(short)DateTime.Now.Year,

(short)DateTime.Now.Month,

(short)DateTime.Now.Day,

(short)DateTime.Now.Hour,

(short)DateTime.Now.Minute,

(short)DateTime.Now.Second};

short ret = iRemoting.SET_time_cnc(_Pwd, _time_cnc);

Precision Machinery Research Development Center - Intelligent technology department

37

VIII. The functions of Alert

1. GET_alm_current: Current occurring alarm

API Name GET_alm_current

Description Current occurring alarm

C# Method short GET_alm_current(StructMsg.Pwd P, ref

StructMsg.alm_current R);

VB.Net

Method

GET_alm_current(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.alm_current) As Short

Data

Structure

Structure name: alm_current

Variable

names

Type [in/out] Description

IsAlarm bool out Detect if it alarms or

not

AlmCode int out Get the code of alarm

AlmMsg string out Get the message of

current alarm

Note ※ When it alarms, if AlmMsg is blank, it means database may

not be built in.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

LNC ITRI

O O

C# Sample StructMsg.alm_current _alm_current;

StructMsg.Pwd _Pwd;

private void button1_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_alm_current(_Pwd, ref

_alm_current);

if (ret == 0 && _alm_current.IsAlarm)

{

txtAlmsg.Text = _alm_current.Almsg;

}

}

2. GET_alm_current2: Current occurring alarm

API Name GET_alm_current2

Description Current occurring alarm

Precision Machinery Research Development Center - Intelligent technology department

38

C# Method short GET_alm_current2(StructMsg.Pwd P, ref

StructMsg.alm_current2 R);

VB.Net

Method

GET_alm_current2(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.alm_current2) As Short

Data

Structure

Structure name: alm_current2

Variable

names

Type [in/out] Description

IsAlarm bool out Detect if it alarms or

not

AlmClass string[] out Get the class of alarm.

AlmCode string[] out Get the code of alarm

AlmMsg string[] out Get the message of

current alarm

Note ※ The "AlmClass" variable apply in: HEIDENHAIN and SYNTEC

controller.

When "SkyMars Maintenance Management" or "SkyMars Tool

Management" have alarm, then the class name will write to

"AlmClass" variable:

The "SkyMars Maintenance Management" have class name is

"SkyMarsMaintenance".

The "SkyMars Tool Management" have class name is

"SkyMarsToolManagement".

※ The "AlmCode" variable apply in: FANUC, HEIDENHAIN and SYNTEC

controller.

※ The "AlmMsg" variable apply in: FANUC, HEIDENHAIN, SYNTEC,

SkyMars Maintenance Management and SkyMars Tool Management.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O O O O

LNC ITRI

O O

C# Sample StructMsg.alm_current2 _alm_current2;

StructMsg.Pwd _Pwd;

private void button8_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_alm_current2(_Pwd, ref

_alm_current2);

if (ret == 0)

Precision Machinery Research Development Center - Intelligent technology department

39

{

txtC1.Text = _alm_current2.IsAlarm.ToString();

if (_alm_current2.IsAlarm)

{

txtC2.Text = _alm_current2.AlmClass[0];

txtC3.Text = _alm_current2.AlmCode[0];

txtC4.Text = _alm_current2.AlmMsg[0];

}

}

}

3. GET_alm_current_heid: Get the current alarm of HEIDENHAIN controller

API Name GET_alm_current_heid

Description Get the current alarm of HEIDENHAIN controller

C# Method short GET_alm_current_heid(StructMsg.Pwd P, ref

StructMsg.alm_current_heid R);

VB.Net

Method

GET_alm_current_heid(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.alm_current_heid) As Short

Data

Structure

Structure name: alm_current_heid

Variable names Type [in/out] Description

IsAlarm bool out Detect if it alarms or

not.

ErrNumber int[] out Nuumber error.

ErrGroup string[] out Group error.

ErrClass string[] out Class error.

ErrMsg string[] out Error messages.

ErrDescription string[] out Error descriptions.

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

X X O X X

LNC ITRI

X X

C# Sample StructMsg.alm_current_heid _alm_current_heid;

StructMsg.Pwd _Pwd;

private void button6_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_alm_current_heid(_Pwd, ref

Precision Machinery Research Development Center - Intelligent technology department

40

_alm_current_heid);

if (ret == 0 && _alm_current_heid.IsAlarm)

{

txtNumber.Text =

_alm_current_heid.ErrNumber[0].ToString();

txtGroup.Text = _alm_current_heid.ErrGroup[0];

txtClass.Text = _alm_current_heid.ErrClass[0];

txtMsg.Text = _alm_current_heid.ErrMsg[0];

txtDescription.Text =

_alm_current_heid.ErrDescription[0];

}

}

4. GET_alm_history: History of Alarms

API Name GET_alm_history

Description History of alarms

C# Method short GET_alm_history(StructMsg.Pwd P, ref

StructMsg.alm_history R);

VB.Net

Method

GET_alm_history(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.alm_history) As Short

Data

Structure

Structure name: alm_history

Variable

names

Type [in/out] Description

AlmCode int[] out Alarm Code

AlmDate string[] out Alerm Date

AlmMsg string[] out Alerm Message

Note Variable “AlmCode” doesn’t support for MITSUBISHI.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

LNC ITRI

O O

C# Sample StructMsg.alm_history _alm_history;

StructMsg.Pwd _Pwd;

private void button2_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_alm_history(_Pwd, ref

_alm_history);

Precision Machinery Research Development Center - Intelligent technology department

41

if (ret == 0)

{

txtAlmCode.Text = _alm_history.AlmCode[0].ToString();

txtAlmDate.Text = _alm_history.AlmDate[0];

txtAlmMsg.Text = _alm_history.AlmMsg[0];

}

}

5. GET_alm_history2: History of Alarms

API Name GET_alm_history2

Description History of alarms

C# Method short GET_alm_history2(StructMsg.Pwd P, ref

StructMsg.alm_history2 R);

VB.Net

Method

GET_alm_histor2y(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.alm_history2) As Short

Data

Structure

Structure name: alm_history2

Variable

names

Type [in/out] Description

AlmClass string[] out Alarm Class

AlmCode string[] out Alarm Code

AlmDate string[] out Alerm Date

AlmMsg string[] out Alerm Message

Note ※ The "AlmClass" variable apply in: HEIDENHAIN and SYNTEC

controller.

When "SkyMars Maintenance Management" or "SkyMars Tool

Management" have alarm, then the class name will write to

"AlmClass" variable:

The "SkyMars Maintenance Management" have class name is

"SkyMarsMaintenance".

The "SkyMars Tool Management" have class name is

"SkyMarsToolManagement".

※ The "AlmCode" variable apply in: FANUC, HEIDENHAIN and SYNTEC

controller.

※ The "AlmMsg" variable apply in: FANUC, HEIDENHAIN, SYNTEC,

SkyMars Maintenance Management and SkyMars Tool Management.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O O ? O

LNC ITRI

Precision Machinery Research Development Center - Intelligent technology department

42

O O

C# Sample StructMsg.alm_history2 _alm_history2;

StructMsg.Pwd _Pwd;

private void button7_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_alm_history2(_Pwd, ref

_alm_history2);

if (ret == 0)

{

if (_alm_history2.AlmClass.Length > 0)

{

txtH1.Text = _alm_history2.AlmClass[0];

txtH2.Text = _alm_history2.AlmCode[0];

txtH3.Text = _alm_history2.AlmDate[0];

txtH4.Text = _alm_history2.AlmMsg[0];

}

}

}

6. GET_alm_history_heid: History of Alarm for HEIDENHAIN Controller

API Name GET_alm_history_heid

Description History of alarm for HEIDENHAIN Controller

C# Method short GET_alm_history_heid(StructMsg.Pwd P, ref

StructMsg.alm_history_heid R);

VB.Net

Method

GET_alm_history_heid(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.alm_history_heid) As Short

Data

Structure

Structure name: alm_history_heid

Variable names Type [in/out] Description

ErrNumber int[] out Nuumber error.

ErrGroup string[] out Group error.

ErrClass string[] out Class error.

ErrMsg string[] out Error message.

ErrDescription string[] out Error description.

ErrDate string[] out Alarm date.

Note

Precision Machinery Research Development Center - Intelligent technology department

43

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

X X O X X

LNC ITRI

X X

C# Sample StructMsg.alm_history_heid _alm_history_heid;

StructMsg.Pwd _Pwd;

private void button1_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_alm_history_heid(_Pwd, ref

_alm_history_heid);

if (ret == 0)

{

DataTable dtHeid = new DataTable();

dtHeid.Columns.Add("HDate",

Type.GetType("System.String"));

dtHeid.Columns.Add("ErrNumber",

Type.GetType("System.Int32"));

dtHeid.Columns.Add("_Group",

Type.GetType("System.String"));

dtHeid.Columns.Add("_Class",

Type.GetType("System.String"));

dtHeid.Columns.Add("_Msg",

Type.GetType("System.String"));

dtHeid.Columns.Add("_Description",

Type.GetType("System.String"));

for (int i = 0; i <= _alm_history_heid.ErrNumber.Length -

1; i++)

{

DataRow dr = dtHeid.NewRow();

dr["HDate"] = _alm_history_heid.ErrDate[i];

dr["ErrNumber"] = _alm_history_heid.ErrNumber[i];

dr["_Group"] = _alm_history_heid.ErrGroup[i];

dr["_Class"] = _alm_history_heid.ErrClass[i];

dr["_Msg"] = _alm_history_heid.ErrMsg[i];

dr["_Description"] =

_alm_history_heid.ErrDescription[i];

dtHeid.Rows.Add(dr);

Precision Machinery Research Development Center - Intelligent technology department

44

}

dataGridView1.DataSource = dtHeid;

}

}

7. GET_msg_current: Get the message of operation

API Name GET_msg_current

Description Get the message of peration

C# Method short GET_msg_current(StructMsg.Pwd P, ref

StructMsg.msg_current R);

VB.Net

Method

GET_msg_current(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.msg_current) As Short

Data

Structure

Structure name: msg_current

Variable

names

Type [in/out] Description

IsMsg bool out Detect if there is

message of operation or

not.

MsgCode short out Message Code

MsgText string out Message Content

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O X X ? X

LNC ITRI

X X

C# Sample StructMsg.msg_current _msg_current;

StructMsg.Pwd _Pwd;

private void button3_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_msg_current(_Pwd, ref

_msg_current);

if (ret == 0 && _msg_current.IsMsg)

{

txtMsgCode.Text = _msg_current.MsgCode.ToString();

txtMsgText.Text = _msg_current.MsgText;

}

Precision Machinery Research Development Center - Intelligent technology department

45

}

8. GET_msg_history: Get History of Operation

API Name GET_msg_history

Description Get History of Operation

C# Method short GET_msg_history(StructMsg.Pwd P, ref

StructMsg.msg_history R);

VB.Net

Method

GET_msg_history(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.msg_history) As Short

Data

Structure

Structure name: msg_history

Variable

names

Type [in/out] Description

MsgCode short[] out Message Code

MsgDate string[] out Message Date

MsgText string[] out Message Content

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O X X ? X

LNC ITRI

X X

C# Sample StructMsg.msg_history _msg_history;

StructMsg.Pwd _Pwd;

private void button4_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_msg_history(_Pwd, ref

_msg_history);

if (ret == 0)

{

txtMsgCode2.Text =

_msg_history.MsgCode[0].ToString();

txtMsgDate.Text = _msg_history.MsgDate[0];

txtMsgText2.Text = _msg_history.MsgText[0];

}

}

9. GET_plc_alarm: Get History of PLC Alarm

API Name GET_plc_alarm

Precision Machinery Research Development Center - Intelligent technology department

46

Description Get History of PLC Alarm

C# Method short GET_plc_alarm(StructMsg.Pwd P, ref StructMsg.plc_alarm

R);

VB.Net

Method

GET_plc_alarm(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.plc_alarm) As Short

Data

Structure

Structure name: plc_alarm

Variable

names

Type [in/out] Description

AlmMsg string[] out Error Message of PLC

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O X X ? X

LNC ITRI

O ?

C# Sample StructMsg.plc_alarm _plc_alarm;

StructMsg.Pwd _Pwd;

private void button5_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_plc_alarm(_Pwd, ref _plc_alarm);

if (ret == 0)

{

if (_plc_alarm.AlmMsg != null)

txtAlmMsg2.Text = _plc_alarm.AlmMsg[0];

}

}

Precision Machinery Research Development Center - Intelligent technology department

47

IX. The Functions of Servo Spindle

1. GET_servo_current: Current Loads of All Spindles

API Name GET_servo_current

Description Get Current Loads of All Spindles

C# Method short GET_servo_current(StructMsg.Pwd P, ref

StructMsg.servo_current R);

VB.Net

Method

GET_servo_current(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.servo_current) As Short

Data

Structure

Structure name: servo_current

Variable

names

Type [in/out] Description

AxisCurrent int[] out Current value of Axes

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O X X ? X

LNC ITRI

X X

C# Sample StructMsg.servo_current _servo_current;

StructMsg.Pwd _Pwd;

private void button1_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_servo_current(_Pwd, ref

_servo_current);

if (ret == 0)

{

txtAxisCurrent.Text =

_servo_current.AxisCurrent[0].ToString();

}

}

2. GET_servo_load: Get the percentage of servo load (%)

API Name GET_servo_load

Description Get the percentage of servo load (%)

C# Method short GET_servo_load(StructMsg.Pwd P, ref

StructMsg.servo_load R);

VB.Net

Method

GET_servo_load(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.servo_load) As Short

Precision Machinery Research Development Center - Intelligent technology department

48

Data

Structure

Structure name: servo_load

Variable names Type [in/out] Description

ServoLoadPercent int[] out The percentage of

Servo load.

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O O ? X

LNC ITRI

X O

C# Sample StructMsg.servo_load _servo_load;

StructMsg.Pwd _Pwd;

private void button2_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_servo_load(_Pwd, ref

_servo_load);

if (ret == 0)

{

for (int i = 0; i <= _servo_load.ServoLoadPercent.Length

- 1; i++)

txtServoLoadPercent.Text +=

_servo_load.ServoLoadPercent[i].ToString() + " ";

}

}

3. GET_servo_speed: Get Servo Speed

API Name GET_servo_speed

Description Get Servo Speed

C# Method short GET_servo_speed(StructMsg.Pwd P, ref

StructMsg.servo_speed R);

VB.Net

Method

GET_servo_speed(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.servo_speed) As Short

Data

Structure

Structure name: servo_speed

Variable

names

Type [in/out] Description

ServoSpd int[] out Servo Speed

Note

Precision Machinery Research Development Center - Intelligent technology department

49

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O O ? X

LNC ITRI

X O

C# Sample StructMsg.servo_speed _servo_speed;

StructMsg.Pwd _Pwd;

private void button3_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_servo_speed(_Pwd, ref

_servo_speed);

if (ret == 0)

{

txtServoSpd.Text =

_servo_speed.ServoSpd[0].ToString();

}

}

4. GET_spindle_load: Get the percentage of Spindle load (%)

API Name GET_spindle_load

Description Get the percentage of Spindle load (%)

C# Method short GET_spindle_load(StructMsg.Pwd P, ref

StructMsg.spindle_load R);

VB.Net

Method

GET_spindle_load(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.spindle_load) As Short

Data

Structure

Structure name: spindle_load

Variable

names

Type [in/out] Description

SpLoad float out The percentage of

Spindle laod

Note Only supported for one spindle.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O O ? X

LNC ITRI

X O

C# Sample StructMsg.spindle_load _spindle_load;

StructMsg.Pwd _Pwd;

Precision Machinery Research Development Center - Intelligent technology department

50

private void button4_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_spindle_load(_Pwd, ref

_spindle_load);

if (ret == 0)

{

txtSpLoad.Text = _spindle_load.SpLoad.ToString();

}

else if (ret==6)

{

MessageBox.Show("There is no corresponding CNC

option.");

}

}

5. GET_spindle_speed: Get Spindle Speed

API Name GET_spindle_speed

Description Get Spindle Speed

C# Method short GET_spindle_speed(StructMsg.Pwd P, ref

StructMsg.spindle_speed R);

VB.Net

Method

GET_spindle_speed(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.spindle_speed) As Short

Data

Structure

Structure name: spindle_speed

Variable

names

Type [in/out] Description

SpSpeed int out Spindle speed

Note Only supported for one spindle.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O O ? X

LNC ITRI

X O

C# Sample StructMsg.spindle_speed _spindle_speed;

StructMsg.Pwd _Pwd;

private void button7_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_spindle_speed(_Pwd, ref

Precision Machinery Research Development Center - Intelligent technology department

51

_spindle_speed);

if (ret == 0)

{

txtSpindleSpeed.Text =

_spindle_speed.SpSpeed.ToString();

}

}

6. GET_servo_temperature: Get the temperature of servo motor

API Name GET_servo_temperature

Description Get the temperature of servo motor

C# Method short GET_servo_temperature(StructMsg.Pwd P, ref

StructMsg.servo_temperature R);

VB.Net

Method

GET_servo_temperature(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.servo_temperature) As Short

Data

Structure

Structure name: servo_temperature

Variable

names

Type [in/out] Description

AxisTemp float[] out Get the temperature of

servo motor

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O ? O ? X

LNC ITRI

X X

C# Sample StructMsg.servo_temperature _servo_temperature;

StructMsg.Pwd _Pwd;

private void button5_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_servo_temperature(_Pwd, ref

_servo_temperature);

if (ret == 0)

{

for (int i = 0; i <= _servo_temperature.AxisTemp.Length -

1; i++)

{

txtServoTemp.Text +=

Precision Machinery Research Development Center - Intelligent technology department

52

_servo_temperature.AxisTemp[i].ToString() + " ";

}

}

}

7. GET_spindle_temperature: Get the temperature of spindle

API Name GET_spindle_temperature

Description Get the temperature of spindle

C# Method short GET_spindle_temperature(StructMsg.Pwd P, ref

StructMsg.spindle_temperature R);

VB.Net

Method

GET_spindle_temperature(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.spindle_temperature) As Short

Data

Structure

Structure name: spindle_temperature

Variable names Type [in/out] Description

Spindle_1_Temp float out The temperature of

first spindle.

Spindle_2_Temp float out The temperature of

second spindle.

Note As for 0i-D / 30 series, it could only read the temperature of

single spindle currently.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O ? O ? X

LNC ITRI

X X

C# Sample StructMsg.spindle_temperature _spindle_temperature;

StructMsg.Pwd _Pwd;

private void button6_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_spindle_temperature(_Pwd, ref

_spindle_temperature);

if (ret == 0)

{

txtSpindleTemp.Text =

_spindle_temperature.Spindle_1_Temp.ToString();

}

}

Precision Machinery Research Development Center - Intelligent technology department

53

X. The Functions of Tool Management (Controller)

1. GET_offset_title: Get the title of tool offset

API Name GET_offset_title

Description Get the title of tool offset

C# Method short GET_offset_title(StructMsg.Pwd P, ref

StructMsg.offset_title R);

VB.Net

Method

GET_offset_title(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.offset_title) As Short

Data

Structure

Structure name: offset_title

Variable

names

Type [in/out] Description

OffsetTitle string[] out The title of tool offset.

Note ※The titles of FANUC are as below,

M Series,

System A:

{"DATA"}

System B:

{"GEOM","WEAR"}

System C:

{"LENGTH GEOM","LENGTH WEAR","RADIUS GEOM","RADIUS WEAR"}

T Series

Without Y axis:

{"WEAR X","WEAR Z","WEAR R","WEAR T","GEOM X","GEOM Z","GEOM

R","GEOM T"}

With Y axis:

{"WEAR X","WEAR Z","WEAR R","WEAR T","WEAR Y","GEOM X","GEOM

Z","GEOM R","GEOM T","GEOM Y"}

※The titles of MITSUBISHI are as below,

Tool compensation type : 1

{"DATA"}

Tool compensation type : 2

{"LENGTH GEOM","LENGTH WEAR","RADIUS GEOM","RADIUS WEAR"}

Tool compensation type : 3

Precision Machinery Research Development Center - Intelligent technology department

54

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

LNC ITRI

O O

C# Sample StructMsg.offset_title _offset_title;

StructMsg.Pwd _Pwd;

private void button1_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_offset_title(_Pwd, ref

_offset_title);

if (ret == 0)

{

for (int i = 0; i <= _offset_title.OffsetTitle.Length

- 1; i++)

rtbTitle.Text += _offset_title.OffsetTitle[i] + "

";

}

}

2. GET_offset_all: Get the Offset of all tools

API Name GET_offset_all

Description Get the Offset of all tools

C# Method short GET_offset_all(StructMsg.Pwd P, ref

StructMsg.offset_all R);

VB.Net

Method

GET_offset_all(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.offset_all) As Short

Data

Structure

Structure name: offset_all

Variable

names

Type [in/out] Description

OffsetData double[][] out The offset data

Note The second array of OffsetData, Please refer to the title.

(Length Geom…)

Using this function may spend lots of time reading data.

(Generally, it usually happens on a low-speed internet adapter.)

Please use “GET_offset_scope” to read by segment.

Precision Machinery Research Development Center - Intelligent technology department

55

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

LNC ITRI

O O

C# Sample StructMsg.offset_all _offset_all;

StructMsg.Pwd _Pwd;

private void button2_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_offset_all(_Pwd, ref

_offset_all);

if (ret == 0)

{

txtLGeom.Text =

_offset_all.OffsetData[0][0].ToString();

txtLWear.Text =

_offset_all.OffsetData[0][1].ToString();

txtRGeom.Text =

_offset_all.OffsetData[0][2].ToString();

txtRWear.Text =

_offset_all.OffsetData[0][3].ToString();

}

}

3. GET_offset_scope: Get the tool offset according to designated scope

API Name GET_offset_scope

Description Get the tool offset according to designated scope.

C# Method short GET_offset_scope(StructMsg.Pwd P, ref

StructMsg.offset_scope R);

VB.Net

Method

GET_offset_scope(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.offset_scope) As Short

Data

Structure

Structure name: offset_scope

Variable

names

Type [in/out] Description

StartNumber short in Initial number (From 1

on)

EndNumber short in Terminal number

OffsetData double[][] out Offset data

Precision Machinery Research Development Center - Intelligent technology department

56

Note As for the second array of OffsetData, please refer to the title

(Length Geom…).

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

LNC ITRI

O O

C# Sample StructMsg.offset_scope _offset_scope;

StructMsg.Pwd _Pwd;

private void button7_Click(object sender, EventArgs e)

{

_offset_scope.StartNumber = 1;

_offset_scope.EndNumber = 26;

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_offset_scope(_Pwd, ref

_offset_scope);

if (ret == 0)

{

DataTable dt = new DataTable();

//LENGTH GEOM","LENGTH WEAR","RADIUS GEOM","RADIUS WEAR

dt.Columns.Add("LGeom", Type.GetType("System.Double"));

dt.Columns.Add("LWrar", Type.GetType("System.Double"));

dt.Columns.Add("RGeom", Type.GetType("System.Double"));

dt.Columns.Add("RWear", Type.GetType("System.Double"));

DataRow dr;

for (int i = 0; i <= _offset_scope.OffsetData.Length - 1;

i++)

{

dr = dt.NewRow();

dr[0] = _offset_scope.OffsetData[i][0];

dr[1] = _offset_scope.OffsetData[i][1];

dr[2] = _offset_scope.OffsetData[i][2];

dr[3] = _offset_scope.OffsetData[i][3];

dt.Rows.Add(dr);

}

dataGridView1.DataSource = dt;

Precision Machinery Research Development Center - Intelligent technology department

57

}

}

4. GET_offset_single: Get the Offset of a single tool

API Name GET_offset_single

Description Get the Offset of single tool

C# Method short GET_offset_single(StructMsg.Pwd P, ref

StructMsg.offset_single R);

VB.Net

Method

GET_offset_single(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.offset_single) As Short

Data

Structure

Structure name: offset_single

Variable

names

Type [in/out] Description

ofNumber short in Set the number of offset

OffsetData double[] out Offset data

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

LNC ITRI

O O

C# Sample StructMsg.offset_single _offset_single;

StructMsg.Pwd _Pwd;

private void button4_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

_offset_single.ofNumber = 1; //Set offset number

short ret = iRemoting.GET_offset_single(_Pwd, ref

_offset_single);

if (ret == 0)

{

txtLGeom2.Text =

_offset_single.OffsetData[0].ToString();

txtLWear2.Text =

_offset_single.OffsetData[1].ToString();

txtRGeom2.Text =

_offset_single.OffsetData[2].ToString();

txtRWear2.Text =

_offset_single.OffsetData[3].ToString();

Precision Machinery Research Development Center - Intelligent technology department

58

}

}

5. SET_offset_all: Write the Offsets of all tools

API Name SET_offset_all

Description Write the Offsets of all tools

C# Method short SET_offset_all(StructMsg.Pwd P, StructMsg.offset_all

R);

VB.Net

Method

SET_offset_all(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.offset_all) As Short

Data

Structure

Structure name: offset_all

Variable

names

Type [in/out] Description

OffsetData double[][] in Set offset data

Note ※ Pwd: API Writable Password. (API setting of security)

When the return of function is 7, it means SkyMars is set

for unwritable.

When the return of function is 20, it means the password of

API is not correct.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

LNC ITRI

O O

C# Sample StructMsg.offset_all _offset_all;

StructMsg.Pwd _Pwd;

private void button5_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_offset_all(_Pwd, ref

_offset_all);

_offset_all.OffsetData[0][0] =

double.Parse(txtLGeom3.Text);

_offset_all.OffsetData[0][1] =

double.Parse(txtLWear3.Text);

_offset_all.OffsetData[0][2] =

double.Parse(txtRGeom3.Text);

_offset_all.OffsetData[0][3] =

double.Parse(txtRWear3.Text);

Precision Machinery Research Development Center - Intelligent technology department

59

ret = iRemoting.SET_offset_all(_offset_all);

if (ret == 0)

MessageBox.Show("Write success!");

else

MessageBox.Show("Write failed!");

}

6. SET_offset_single: Write the Offset of a single tool

API Name SET_offset_single

Description Write the Offset of a single tool

C# Method short SET_offset_single(StructMsg.Pwd P,

StructMsg.offset_single R);

VB.Net

Method

SET_offset_single(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.offset_single) As Short

Data

Structure

Structure name: offset_all

Variable

names

Type [in/out] Description

ofNumber short in Set offset number

OffsetData double[] in Set offset data

Note ※ Pwd: API Writable Password. (API setting of security)

When the return of function is 7, it means SkyMars is set for

unwritable.

When the return of function is 20, it means the password of

API is not correct.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

LNC ITRI

O O

C# Sample StructMsg.offset_single _offset_single;

StructMsg.Pwd _Pwd;

private void button6_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

_offset_single.ofNumber = 1;

_offset_single.OffsetData = new double[4];

_offset_single.OffsetData[0] =

double.Parse(txtLGeom4.Text);

Precision Machinery Research Development Center - Intelligent technology department

60

_offset_single.OffsetData[1] =

double.Parse(txtLWear4.Text);

_offset_single.OffsetData[2] =

double.Parse(txtRGeom4.Text);

_offset_single.OffsetData[3] =

double.Parse(txtRWear4.Text);

short ret = iRemoting.SET_offset_single(_Pwd,

_offset_single);

if (ret == 0)

MessageBox.Show("Write success!");

else

MessageBox.Show("Write failed!");

}

7. GET_offset_count: Get the count of offsets

API Name GET_offset_count

Description Get the count of offsets

C# Method short GET_offset_count(StructMsg.Pwd P, ref

StructMsg.total_count R);

VB.Net

Method

GET_offset_count(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.total_count) As Short

Data

Structure

Structure name: total_count

Variable

names

Type [in/out] Description

Count short out Count of Offset

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

LNC ITRI

O O

C# Sample StructMsg.total_count _total_count;

StructMsg.Pwd _Pwd;

private void button3_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_offset_count(_Pwd, ref

_total_count);

Precision Machinery Research Development Center - Intelligent technology department

61

if (ret == 0)

{

txtOffsetCount.Text = _total_count.Count.ToString();

}

}

8. GET_tool_title: Get the title of tool management

API Name GET_tool_title

Description Get the title of tool management

C# Method short GET_tool_title(StructMsg.Pwd P, ref

StructMsg.tool_title R);

VB.Net

Method

GET_tool_title(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.tool_title) As Short

Data

Structure

Structure name: tool_title

Variable

names

Type [in/out] Description

ToolTitle string[] out Titles of Tool

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

X X O ? X

LNC ITRI

X X

C# Sample StructMsg.tool_title _tool_title;

StructMsg.Pwd _Pwd;

private void button1_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_tool_title(_Pwd, ref _tool_title);

if (ret == 0)

{

for (int i = 0; i <= _tool_title.ToolTitle.Length - 1; i++)

{

rtbTitle.Text += _tool_title.ToolTitle[i] + "\r\n";

}

}

}

9. GET_tool_count: Get the count of Tool

Precision Machinery Research Development Center - Intelligent technology department

62

API Name GET_tool_count

Description Get the count of Tool

C# Method short GET_tool_count(StructMsg.Pwd P, ref

StructMsg.total_count R);

VB.Net

Method

GET_tool_count(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.total_count) As Short

Data

Structure

Structure name: total_count

Variable

names

Type [in/out] Description

Count short out The count of tool

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

X X O ? X

LNC ITRI

X X

C# Sample StructMsg.total_count _total_count;

StructMsg.Pwd _Pwd;

private void button2_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_tool_count(_Pwd, ref _total_count);

if (ret == 0)

{

MessageBox.Show(_total_count.Count.ToString());

}

}

10. GET_tool_data: Get the data of all tool management

API Name GET_tool_data

Description Get the data of all tool management

C# Method short GET_tool_data(StructMsg.Pwd P, ref StructMsg.tool_data

R);

VB.Net

Method

GET_tool_data(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.tool_data) As Short

Data

Structure

Structure name: tool_data

Variable

names

Type [in/out] Description

Data string[][] out Tool management data

Precision Machinery Research Development Center - Intelligent technology department

63

Note ※As for the second array of Data, please refer to the title.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

X X O ? X

LNC ITRI

X X

C# Sample StructMsg.tool_data _tool_data;

StructMsg.Pwd _Pwd;

private void button3_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_tool_data(_Pwd, ref _tool_data);

if (ret == 0)

{

DataTable dtTool = new DataTable();

for (int i = 0; i <= _tool_title.ToolTitle.Length - 1; i++)

{

dtTool.Columns.Add(_tool_title.ToolTitle[i],

Type.GetType("System.String"));

}

for (int i = 0; i <= _tool_data.Data.Length - 1; i++)

{

DataRow dr = dtTool.NewRow();

for (int j = 0; j <= _tool_title.ToolTitle.Length - 1;

j++)

{

dr[j] = _tool_data.Data[i][j];

}

dtTool.Rows.Add(dr);

}

dgvTool.DataSource = dtTool;

}

}

11. GET_tool_data_mem: Get tool data and send the data into SkyMars memory

API Name GET_tool_data_mem

Description Get tool data and send the data into SkyMars memory, and then

Precision Machinery Research Development Center - Intelligent technology department

64

return the max index value of data array

C# Method short GET_tool_data_mem(StructMsg.Pwd P, ref

StructMsg.tool_data_max_index R);

VB.Net

Method

Data

Structure

Structure name: tool_data_max_index

Variable

names

Type [in/out] Description

MaxIndex int out The max index value of

data array.

Note If you need to read the data of tool management by segment, please

execute the function “GET_tool_data_mem” first, and use the

function “GET_tool_data_scope”, and then read the data of

indicated index.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

X X O ? X

LNC ITRI

X X

C# Sample StructMsg.tool_data_max_index _ToolMaxIndex;

StructMsg.Pwd _Pwd;

_Pwd.ConnectionKey = "123";

ret = iRemoting.GET_tool_data_mem(_Pwd, ref _ToolMaxIndex);

12. GET_tool_data_scope: Get the data of Tool management and return the data of indicated

index

API Name GET_tool_data_scope

Description Get the data of Tool management and return the data of indicated

index.

C# Method short GET_tool_data_scope(StructMsg.Pwd P, ref

StructMsg.tool_data_scope R);

VB.Net

Method

Data

Structure

Structure name: tool_data_scope

Variable

names

Type [in/out] Description

StartIndex int in Start Index

EndIndex int in End Index

Data string[][] out Data

Precision Machinery Research Development Center - Intelligent technology department

65

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

X X O ? X

LNC ITRI

X X

C# Sample StructMsg.tool_data_scope _DataScope;

StructMsg.Pwd _Pwd;

for (int i = 0; i <= _ToolMaxIndex.MaxIndex; i += 20)

{

_DataScope.StartIndex = i;

if ((i + 20) <= _ToolMaxIndex.MaxIndex)

_DataScope.EndIndex = i + 20 - 1;

else

_DataScope.EndIndex = _ToolMaxIndex.MaxIndex;

_Pwd.ConnectionKey = "123";

ret = iRemoting.GET_tool_data_scope(_Pwd, ref _DataScope);

if (ret == 0)

{

for (int j = 0; j <= _DataScope.Data.Length - 1; j++)

{

DataRow dr = dtTool.NewRow();

for (int s = 0; s <= _tool_title.ToolTitle.Length - 1;

s++)

{

dr[s] = _DataScope.Data[j][s];

}

dtTool.Rows.Add(dr);

}

}

}

13. SET_tool_data: Write the data of management tool

API Name SET_tool_data

Description Write the data of management tool

C# Method short SET_tool_data(StructMsg.Pwd P, StructMsg.tool_data R);

Precision Machinery Research Development Center - Intelligent technology department

66

VB.Net

Method

SET_tool_data(ByVal P As StructMsg.Pwd, ByVal R As

StructMsg.tool_data) As Short

Data

Structure

Structure name: tool_data

Variable

names

Type [in/out] Description

Data string[][] in Set the data tool

management

Note ※ You could write all data or just certain part of data.

※ If you just write certain part of data, you could use

array[][0] to indicate number, as the following example.

※ Pwd: API Writable Password. (API setting of security)

When the return of function is 7, it means SkyMars is set

for unwritable.

When the return of function is 20, it means the password of

API is not correct.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

X X O ? X

LNC ITRI

X X

C# Sample StructMsg.Pwd _Pwd;

private void button4_Click(object sender, EventArgs e)

{

_tool_data.Data = new string[1][];

_tool_data.Data[0] = new

string[_tool_title.ToolTitle.Length];

DataTable dtTool = (DataTable)dgvTool.DataSource;

for (int i = 0; i <= _tool_title.ToolTitle.Length - 1; i++)

{

_tool_data.Data[0][i] = dtTool.Rows[0][i].ToString();

}

_Pwd.ConnectionKey = "123";

_Pwd.WritePwd = "123";

short ret = iRemoting.SET_tool_data(_Pwd, _tool_data);

}

14. GET_pocket_title: Get the title of tool pocket

Precision Machinery Research Development Center - Intelligent technology department

67

API Name GET_pocket_title

Description Get the title of tool pocket

C# Method short GET_pocket_title(StructMsg.Pwd P, ref

StructMsg.pocket_title R);

VB.Net

Method

GET_pocket_title(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.pocket_title) As Short

Data

Structure

Structure name: pocket_title

Variable

names

Type [in/out] Description

PocketTitle string[] out The title of Tool Pocket

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

X X O ? X

LNC ITRI

X X

C# Sample StructMsg.pocket_title _pocket_title;

StructMsg.Pwd _Pwd;

private void button1_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_pocket_title(_Pwd, ref

_pocket_title);

if (ret == 0)

{

for (int i = 0; i <= _pocket_title.PocketTitle.Length - 1;

i++)

{

rtbTitle.Text += _pocket_title.PocketTitle[i] +

"\r\n";

}

}

}

15. GET_pocket_count: Get the count of tool pocket

API Name GET_pocket_count

Description Get the count of tool pocket

C# Method short GET_pocket_count(StructMsg.Pwd P, ref

StructMsg.total_count R);

Precision Machinery Research Development Center - Intelligent technology department

68

VB.Net

Method

GET_pocket_count(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.total_count) As Short

Data

Structure

Structure name: total_count

Variable

names

Type [in/out] Description

Count short out Count of packet

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

X X O ? X

LNC ITRI

X X

C# Sample StructMsg.total_count _total_count;

StructMsg.Pwd _Pwd;

private void button2_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_pocket_count(_Pwd, ref

_total_count);

if (ret == 0)

{

MessageBox.Show(_total_count.Count.ToString());

}

}

16. GET_pocket_data: Get the data of Tool Pocket

API Name GET_pocket_data

Description Get the data of Tool Pocket

C# Method short GET_pocket_data(StructMsg.Pwd P, ref

StructMsg.pocket_data R);

VB.Net

Method

GET_pocket_data(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.pocket_data) As Short

Data

Structure

Structure name: pocket_data

Variable

names

Type [in/out] Description

Data string[][] out Data of Pocket

Note ※ As for the second array of Data, please refer to the title.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

Precision Machinery Research Development Center - Intelligent technology department

69

X X O ? X

LNC ITRI

X X

C# Sample StructMsg.pocket_data _pocket_data;

StructMsg.Pwd _Pwd;

private void button3_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_pocket_data(_Pwd, ref _pocket_data);

if (ret == 0)

{

DataTable dtPocket = new DataTable();

for (int i = 0; i <= _pocket_title.PocketTitle.Length - 1;

i++)

{

dtPocket.Columns.Add(_pocket_title.PocketTitle[i],

Type.GetType("System.String"));

}

for (int i = 0; i <= _pocket_data.Data.Length - 1; i++)

{

DataRow dr = dtPocket.NewRow();

for (int j = 0; j <= _pocket_title.PocketTitle.Length

- 1; j++)

{

dr[j] = _pocket_data.Data[i][j];

}

dtPocket.Rows.Add(dr);

}

dgvTool.DataSource = dtPocket;

}

}

17. SET_pocket_data: Write the data of tool pocket

API Name SET_pocket_data

Description Write the data of tool pocket

C# Method short SET_pocket_data(StructMsg.Pwd P, StructMsg.pocket_data

R);

Precision Machinery Research Development Center - Intelligent technology department

70

VB.Net

Method

SET_pocket_data(ByVal P As StructMsg.Pwd, ByVal R As

StructMsg.pocket_data) As Short

Data

Structure

Structure name: pocket_data

Variable

names

Type [in/out] Description

Data string[][] in Set the data of tool

management

Note ※ You could write all data or just certain part of data.

※If you write certain part of data, you could use array [][0]

to indicate the number, as the following example.

※ Pwd: API Writable Password. (API setting of security)

When the return of function is 7, it means SkyMars is set

for unwritable.

When the return of function is 20, it means the password of

API is not correct.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

X X O ? X

LNC ITRI

X X

C# Sample _pocket_data.Data = new string[1][];

_pocket_data.Data[0] = new

string[_pocket_title.PocketTitle.Length];

DataTable dtTool = (DataTable)dgvTool.DataSource;

for (int i = 0; i <= _pocket_title.PocketTitle.Length - 1; i++)

{

_pocket_data.Data[0][i] = dtTool.Rows[0][i].ToString();

}

StructMsg.Pwd _Pwd;

_Pwd.ConnectionKey = "123";

_Pwd.WritePwd = "123";

short ret = iRemoting.SET_pocket_data(_pocket_data);

18. GET_pocket_data_mem: Get the data from tool pocket, and write the data into SkyMars

memory

API Name GET_pocket_data_mem

Description Get the data from tool pocket, and write the data into SkyMars

Precision Machinery Research Development Center - Intelligent technology department

71

memory,and then return the max index of the array.

C# Method short GET_pocket_data_mem(StructMsg.Pwd P, ref

StructMsg.pocket_data_max_index R);

VB.Net

Method

Data

Structure

Structure name: pocket_data_max_index

Variable

names

Type [in/out] Description

MaxIndex int out The max index of data

array

Note If you need read the data of tool management by segment, please

execute the function ” GET_pocket_data_mem” first, and use the

function “GET_pocket_data_scope”, and then return the data of

indicated index.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

X X O ? X

LNC ITRI

X X

C# Sample StructMsg.pocket_data_max_index _PocketMaxIndex;

StructMsg.Pwd _Pwd;

_Pwd.ConnectionKey = "123";

ret = iRemoting.GET_pocket_data_mem(_Pwd, ref _PocketMaxIndex);

19. GET_pocket_data_scope: Get the data of tool pocket, and return the data of indicated

index

API Name GET_pocket_data_scope

Description Get the data of tool pocket, and return the data of indicated

index.

C# Method short GET_pocket_data_scope(StructMsg.Pwd P, ref

StructMsg.tool_data_scope R);

VB.Net

Method

Data

Structure

Structure name: pocket_data_scope

Variable

names

Type [in/out] Description

StartIndex int in Start Index

EndIndex int in End Index

Data string[][] out Tool management data

Precision Machinery Research Development Center - Intelligent technology department

72

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

X X O ? X

LNC ITRI

X X

C# Sample StructMsg.pocket_data_scope _DataScope;

StructMsg.Pwd _Pwd;

for (int i = 0; i <= _PocketMaxIndex.MaxIndex; i += 20)

{

_DataScope.StartIndex = i;

if ((i + 20) <= _PocketMaxIndex.MaxIndex)

_DataScope.EndIndex = i + 20 - 1;

else

_DataScope.EndIndex = _PocketMaxIndex.MaxIndex;

_Pwd.ConnectionKey = "123";

ret = iRemoting.GET_pocket_data_scope(_Pwd, ref _DataScope);

if (ret == 0)

{

for (int j = 0; j <= _DataScope.Data.Length - 1; j++)

{

DataRow dr = dtTool.NewRow();

for (int s = 0; s <= _pocket_title.PocketTitle.Length -

1; s++)

{

dr[s] = _DataScope.Data[j][s];

}

dtTool.Rows.Add(dr);

}

}

}

Precision Machinery Research Development Center - Intelligent technology department

73

XI. The Functions of Work Coordinates

1. GET_work_coord_title: Get the title of work coordinates

API Name GET_work_coord_title

Description Get the title of work coordinates

C# Method short GET_work_coord_title(StructMsg.Pwd P, ref

StructMsg.work_coord_title R);

VB.Net

Method

GET_work_coord_title(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.work_coord_title) As Short

Data

Structure

Structure name: work_coord_title

Variable names Type [in/out] Description

WorkCoordTitle string[] out The title of work

coordinates

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

LNC ITRI

O O

C# Sample StructMsg.work_coord_title _work_coord_title;

StructMsg.Pwd _Pwd;

private void button1_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_work_coord_title(_Pwd, ref

_work_coord_title);

if (ret == 0)

{

for (int i = 0; i <= _work_coord_title.WorkCoordTitle.Length

- 1; i++)

rtbTitle.Text += _work_coord_title.WorkCoordTitle[i] +

" ";

}

}

2. GET_work_coord_all: Get the data of all work coordinates

API Name GET_work_coord_all

Description Get the data of all work coordinates

C# Method short GET_work_coord_all(StructMsg.Pwd P, ref

StructMsg.work_coord_all R);

Precision Machinery Research Development Center - Intelligent technology department

74

VB.Net

Method

GET_work_coord_all(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.work_coord_all) As Short

Data

Structure

Structure name: work_coord_all

Variable

names

Type [in/out] Description

CoordName string[] out items, ex:EXT,G54,G55…

WorkCoord double[][] out The data of work

coordinates

Note The items of CoordName are as below:

Such as EXT, G54, G55, G56, G57, G58, G59 , G54.1P1, G54.1P2,

G54.1P3…etc.

Using this function may spend lots of time reading data.

(Generally, it usually happens on a low-speed internet adapter.)

Please use “GET_offset_scope” to read by segment.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

LNC ITRI

O O

C# Sample StructMsg.work_coord_all _work_coord_all;

StructMsg.Pwd _Pwd;

private void button2_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_work_coord_all(_Pwd, ref

_work_coord_all);

if (ret == 0)

{

//EXT Work Coord

txtItem.Text = _work_coord_all.CoordName[0];

txtX.Text =

_work_coord_all.WorkCoord[0][0].ToString();

txtY.Text =

_work_coord_all.WorkCoord[0][1].ToString();

txtZ.Text =

_work_coord_all.WorkCoord[0][2].ToString();

}

}

Precision Machinery Research Development Center - Intelligent technology department

75

3. GET_work_coord_scope: Get the data of work coordinate by using indicated scope

API Name GET_work_coord_scope

Description Get the data of work coordinate by using indicated scope

C# Method short GET_work_coord_scope(StructMsg.Pwd P, ref

StructMsg.work_coord_scope R);

VB.Net

Method

GET_work_coord_scope(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.work_coord_scope) As Short

Data

Structure

Structure name: work_coord_scope

Variable

names

Type [in/out] Description

StartNumber short in Start number (From 1 on)

EndNumber short in End number

CoordName string[] out items,ex:EXT,G54,G55…

WorkCoord double[][] out The data of work

coordinate

Note The items of CoordName are as below:

Such as EXT, G54, G55, G56, G57, G58, G59 , G54.1P1, G54.1P2,

G54.1P3 …etc.

The table of indicated number corresponding to the work

coordinates is as below:

Work Name Corresponding

number

EXT 1

G54 2

G55 3

G56 4

G57 5

G58 6

G59 7

G54.1 P1~Pn 8~n

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

LNC ITRI

O O

C# Sample StructMsg.work_coord_scope _work_coord_scope;

StructMsg.Pwd _Pwd;

private void button7_Click(object sender, EventArgs e)

{

Precision Machinery Research Development Center - Intelligent technology department

76

_work_coord_scope.StartNumber = 1;

_work_coord_scope.EndNumber = 8;

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_work_coord_scope(_Pwd, ref

_work_coord_scope);

if (ret == 0)

{

//EXT Work Coord

txtItem.Text = _work_coord_scope.CoordName[0];

txtX.Text = _work_coord_scope.WorkCoord[0][0].ToString();

txtY.Text = _work_coord_scope.WorkCoord[0][1].ToString();

txtZ.Text = _work_coord_scope.WorkCoord[0][2].ToString();

}

}

4. GET_work_coord_single: Get the data of a single work coordinate

API Name GET_work_coord_single

Description Get the data of a single work coordinate

C# Method short GET_work_coord_single(StructMsg.Pwd P, ref

StructMsg.work_coord_single R);

VB.Net

Method

GET_work_coord_single(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.work_coord_single) As Short

Data

Structure

Structure name: work_coord_single

Variable

names

Type [in/out] Description

CoordName string in items, ex:EXT,G54,G55…

WorkCoord double[] out The data of work

coordinate

Note The items of CoordName are as below:

Such as EXT, G54, G55, G56, G57, G58, G59 , G54.1P1, G54.1P2,

G54.1P3…etc.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

LNC ITRI

O O

C# Sample StructMsg.work_coord_single _work_coord_single;

StructMsg.Pwd _Pwd;

Precision Machinery Research Development Center - Intelligent technology department

77

private void button4_Click(object sender, EventArgs e)

{

_work_coord_single.CoordName = "G55";

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_work_coord_single(_Pwd, ref

_work_coord_single);

if (ret == 0)

{

//EXT Work Coord

txtItem2.Text = _work_coord_single.CoordName;

txtX2.Text =

_work_coord_single.WorkCoord[0].ToString();

txtY2.Text =

_work_coord_single.WorkCoord[1].ToString();

txtZ2.Text =

_work_coord_single.WorkCoord[2].ToString();

}

}

5. SET_work_coord_all: Write the data of all work coordinates

API Name SET_work_coord_all

Description Write the data of all work coordinates

C# Method short SET_work_coord_all(StructMsg.Pwd P,

StructMsg.work_coord_all R);

VB.Net

Method

SET_work_coord_all(ByVal P As StructMsg.Pwd, ByVal R As

StructMsg.work_coord_all) As Short

Data

Structure

Structure name: work_coord_all

Variable

names

Type [in/out] Description

CoordName string[] in Set items,

ex:EXT,G54,G55…

WorkCoord double[][] in Set data of work

coordinates

Note The items of CoordName are as below:

Such as EXT, G54, G55, G56, G57, G58, G59 , G54.1P1, G54.1P2,

G54.1P3…etc.

※ Pwd: API Writable Password. (API setting of security)

When the return of function is 7, it means SkyMars is set

for unwritable.

Precision Machinery Research Development Center - Intelligent technology department

78

When the return of function is 20, it means the password of

API is not correct.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

LNC ITRI

O O

C# Sample StructMsg.work_coord_all _work_coord_all;

StructMsg.Pwd _Pwd;

private void button5_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_work_coord_all(_Pwd, ref

_work_coord_all);

if (ret == 0)

{

//write G57 = [4]

_work_coord_all.WorkCoord[4][0] =

double.Parse(txtX3.Text);

_work_coord_all.WorkCoord[4][1] =

double.Parse(txtY3.Text);

_work_coord_all.WorkCoord[4][2] =

double.Parse(txtZ3.Text);

}

ret = iRemoting.SET_work_coord_all(_work_coord_all);

if (ret == 0)

MessageBox.Show("Write success!");

else

MessageBox.Show("Write failed!");

}

6. SET_work_coord_single: Write the data of a single workpiece coordinate

API Name SET_work_coord_single

Description Write the data of a single workpiece coordinate

C# Method short SET_work_coord_single(StructMsg.Pwd P,

StructMsg.work_coord_single R);

VB.Net

Method

SET_work_coord_single(ByVal P As StructMsg.Pwd, ByVal R As

StructMsg.work_coord_single) As Short

Precision Machinery Research Development Center - Intelligent technology department

79

Data

Structure

Structure name: work_coord_single

Variable

names

Type [in/out] Description

CoordName string in Set

items,ex:EXT,G54,G55…

WorkCoord double[] in Set the workpiece

coordinates

Note ※ CoordName setting items are as below:

EXT, G54, G55, G56, G57, G58, G59 , G54.1P1, G54.1P2, G54.1P3

ext.

※ The length of WorkCoord array must equalize the number of

axises.

※ Pwd: API Writable Password. (API setting of security)

When the return of function is 7, it means SkyMars is set

for unwritable.

When the return of function is 20, it means the password of

API is not correct.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

LNC ITRI

O O

C# Sample StructMsg.work_coord_single _work_coord_single;

StructMsg.Pwd _Pwd;

private void button6_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

_work_coord_single.CoordName = "G57";

_work_coord_single.WorkCoord = new double[3];

_work_coord_single.WorkCoord[0] =

double.Parse(txtX3.Text);

_work_coord_single.WorkCoord[1] =

double.Parse(txtY3.Text);

_work_coord_single.WorkCoord[2] =

double.Parse(txtZ3.Text);

short ret = iRemoting.SET_work_coord_single(_Pwd,

_work_coord_single);

Precision Machinery Research Development Center - Intelligent technology department

80

if (ret == 0)

MessageBox.Show("Write success!");

else

MessageBox.Show("Write failed!");

}

7. GET_work_coord_count: Get the count of workpiece coordinate

API Name GET_work_coord_count

Description Get the count of workpiece coordinate

C# Method short GET_work_coord_count(StructMsg.Pwd P, ref

StructMsg.total_count R);

VB.Net

Method

GET_work_coord_count(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.total_count) As Short

Data

Structure

Structure name: work_coord_single

Variable

names

Type [in/out] Description

Count short out the count of workpiece

coordinate

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

LNC ITRI

O O

C# Sample StructMsg.total_count _total_count;

StructMsg.Pwd _Pwd;

private void button3_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_work_coord_count(_Pwd, ref

_total_count);

if (ret == 0)

{

txtCount.Text = _total_count.Count.ToString();

}

}

8. GET_preset_title: Get title of the program table

API Name GET_preset_title

Precision Machinery Research Development Center - Intelligent technology department

81

Description Get title of the program table

C# Method short GET_preset_title(StructMsg.Pwd P, ref

StructMsg.preset_title R);

VB.Net

Method

GET_preset_title(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.preset_title) As Short

Data

Structure

Structure name: pocket_title

Variable

names

Type [in/out] Description

PresetName string in Program Table Name

(PRESET.PR / PRESET2.PR

/ PRESET3.PR)

PresetTitle string[] out Title

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

X X O ? X

LNC ITRI

X X

C# Sample StructMsg.preset_title _preset_title;

StructMsg.Pwd _Pwd;

private void button1_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

_preset_title.PresetName = "PRESET.PR";

short ret = iRemoting.GET_preset_title(_Pwd, ref

_preset_title);

if (ret == 0)

{

for (int i = 0; i <= _preset_title.PresetTitle.Length - 1;

i++)

{

rtbTitle.Text += _preset_title.PresetTitle[i] +

"\r\n";

}

}

}

9. GET_preset_count: Get count of the program table

API Name GET_preset_count

Precision Machinery Research Development Center - Intelligent technology department

82

Description Get count of the program table

C# Method short GET_preset_count(StructMsg.Pwd P, ref

StructMsg.preset_count R);

VB.Net

Method

GET_preset_count(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.preset_count) As Short

Data

Structure

Structure name: preset_count

Variable

names

Type [in/out] Description

PresetName string in Program Table Name

(PRESET.PR / PRESET2.PR

/ PRESET3.PR)

Count short out The Count of the program

table

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

X X O ? X

LNC ITRI

X X

C# Sample StructMsg.preset_count _preset_count;

StructMsg.Pwd _Pwd;

private void button2_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

_preset_count.PresetName = "PRESET.PR";

short ret = iRemoting.GET_preset_count(_Pwd, ref

_preset_count);

if (ret == 0)

{

MessageBox.Show(_preset_count.Count.ToString());

}

}

10. GET_preset_data: Get data of the program table

API Name GET_preset_data

Description Get data of the program table

C# Method short GET_preset_data(StructMsg.Pwd P, ref

StructMsg.preset_data R);

VB.Net GET_preset_data(ByVal P As StructMsg.Pwd, ByRef R As

Precision Machinery Research Development Center - Intelligent technology department

83

Method StructMsg.preset_data) As Short

Data

Structure

Structure name: preset_data

Variable

names

Type [in/out] Description

PresetName string in Program Table Name

(PRESET.PR / PRESET2.PR

/ PRESET3.PR)

Data string[][] out The data of the program

table

Note ※ The second array of the data needs to refer to the title.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

X X O ? X

LNC ITRI

X X

C# Sample StructMsg.preset_data _preset_data;

StructMsg.Pwd _Pwd;

private void button3_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

_preset_data.PresetName = "PRESET.PR";

short ret = iRemoting.GET_preset_data(_Pwd, ref _preset_data);

if (ret == 0)

{

DataTable dtTool = new DataTable();

for (int i = 0; i <= _preset_title.PresetTitle.Length - 1;

i++)

{

dtTool.Columns.Add(_preset_title.PresetTitle[i],

Type.GetType("System.String"));

}

for (int i = 0; i <= _preset_data.Data.Length - 1; i++)

{

DataRow dr = dtTool.NewRow();

for (int j = 0; j <= _preset_title.PresetTitle.Length - 1;

j++)

{

dr[j] = _preset_data.Data[i][j];

Precision Machinery Research Development Center - Intelligent technology department

84

}

dtTool.Rows.Add(dr);

}

dgvTool.DataSource = dtTool;

}

}

11. SET_preset_data: Write data to a program table

API Name SET_preset_data

Description Write data to a program table

C# Method short SET_preset_data(StructMsg.Pwd P, StructMsg.preset_data

R);

VB.Net

Method

SET_preset_data(ByVal P As StructMsg.Pwd, ByVal R As

StructMsg.preset_data) As Short

Data

Structure

Structure name: preset_data

Variable

names

Type [in/out] Description

PresetName string in Program Table Name

(PRESET.PR / PRESET2.PR

/ PRESET3.PR)

Data string[][] in Set data to a program

table

Note ※ The data can be updated by indicated index or by all indexes.

※ While updating data by indicated index, developers can use

[][0] to indicate the index, such as:

※ Pwd: API Writable Password. (API setting of security)

When the return of function is 7, it means SkyMars is set

for unwritable.

When the return of function is 20, it means the password of

API is not correct.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

X X O ? X

LNC ITRI

X X

C# Sample StructMsg.Pwd _Pwd;

_preset_data.Data = new string[1][];

_preset_data.Data[0] = new

Precision Machinery Research Development Center - Intelligent technology department

85

string[_preset_title.PresetTitle.Length];

DataTable dtTool = (DataTable)dgvTool.DataSource;

for (int i = 0; i <= _preset_title.PresetTitle.Length - 1; i++)

{

_preset_data.Data[0][i] = dtTool.Rows[0][i].ToString();

}

_Pwd.ConnectionKey = "123";

short ret = iRemoting.SET_preset_data(_Pwd, _preset_data);

12. GET_preset_data_mem: Get the program table, and save it in SkyMars memory

API Name GET_preset_data_mem

Description Get the program table, save it in SkyMars memory, and return

the maximum index of the data array.

C# Method short GET_preset_data_mem(StructMsg.Pwd P, ref StructMsg.

preset_data_max_index R);

VB.Net

Method

Data

Structure

Structure name: preset_data_max_index

Variable

names

Type [in/out] Description

PresetName string in PRESET.PR、

PRESET2.PR、

PRESET3.PR

MaxIndex int out The maximum index value

of the data array

Note If you want to read a partial program table, execute

GET_preset_data_mem function first and then use

GET_preset_data_scope function to get index-indicated data.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

X X O ? X

LNC ITRI

X X

C# Sample StructMsg.Pwd _Pwd;

_Pwd.ConnectionKey = "123";

_PresetMaxIndex.PresetName = "PRESET.PR";

ret = iRemoting.GET_preset_data_mem(_Pwd, ref _PresetMaxIndex);

Precision Machinery Research Development Center - Intelligent technology department

86

13. GET_preset_data_scope: Get data of the program table, and return it by indicated index

API Name GET_preset_data_scope

Description Get data of the program table, and return it by indicated index.

C# Method short GET_preset_data_scope(StructMsg.Pwd P, ref StructMsg.

preset_data_scope R);

VB.Net

Method

Data

Structure

Structure name: pocket_data_scope

Variable

names

Type [in/out] Description

StartIndex int in Start Index

EndIndex int in End Index

PresetName string in PRESET.PR、

PRESET2.PR、

PRESET3.PR

Data string[][] out Program Table Data

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

X X O ? X

LNC ITRI

X X

C# Sample StructMsg.preset_data_scope _DataScope;

StructMsg.Pwd _Pwd;

for (int i = 0; i <= _PresetMaxIndex.MaxIndex; i += 20)

{

_Pwd.ConnectionKey = "123";

_DataScope.StartIndex = i;

if ((i + 20) <= _PresetMaxIndex.MaxIndex)

_DataScope.EndIndex = i + 20 - 1;

else

_DataScope.EndIndex = _PresetMaxIndex.MaxIndex;

_DataScope.PresetName = "PRESET.PR";

ret = iRemoting.GET_preset_data_scope(_Pwd, ref _DataScope);

if (ret == 0)

{

Precision Machinery Research Development Center - Intelligent technology department

87

for (int j = 0; j <= _DataScope.Data.Length - 1; j++)

{

DataRow dr = dtTool.NewRow();

for (int s = 0; s <= _preset_title.PresetTitle.Length -

1; s++)

{

dr[s] = _DataScope.Data[j][s];

}

dtTool.Rows.Add(dr);

}

}

}

Precision Machinery Research Development Center - Intelligent technology department

88

XII. The Functions of Macro Variables (Common Variables)

1. GET_macro_all: Get all Macro (Common Variables) variables data

API Name GET_macro_all

Description Get all Macro (Common Variables) variables data

C# Method short GET_macro_all(StructMsg.Pwd P, ref StructMsg.macro_all

R);

VB.Net

Method

GET_macro_all(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.macro_all) As Short

Data

Structure

Structure name: macro_all

Variable

names

Type [in/out] Description

MacroNumber short[] out Macro Number

MacroData double[] out Macro Variable Data

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

LNC ITRI

O O

C# Sample StructMsg.macro_all _macro_all;

StructMsg.Pwd _Pwd;

private void button2_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_macro_all(_Pwd, ref _macro_all);

if (ret == 0)

{

DataTable dtMacro = new DataTable();

dtMacro.Columns.Add("No",

Type.GetType("System.Int16"));

dtMacro.Columns.Add("Data",

Type.GetType("System.Double"));

DataRow dr;

for (int i = 0; i <= _macro_all.MacroNumber.Length - 1;

i++)

{

dr = dtMacro.NewRow();

dr[0] = _macro_all.MacroNumber[i];

dr[1] = _macro_all.MacroData[i];

Precision Machinery Research Development Center - Intelligent technology department

89

dtMacro.Rows.Add(dr);

}

dataGridView1.DataSource = dtMacro;

}

}

2. GET_macro_scope: Get Macro (Common Variable) variable data by scope indication

API Name GET_macro_scope

Description Get Macro(Common Variable) variable data by scope indication

C# Method short GET_macro_scope(StructMsg.Pwd P, ref

StructMsg.macro_scope R);

VB.Net

Method

GET_macro_scope(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.macro_scope) As Short

Data

Structure

Structure name: macro_scope

Variable

names

Type [in/out] Description

StartNumber short in Start Number (From 1)

EndNumber short in End Number

MacroNumber short[] out Macro Number

MacroData double[] out Macro Valuable Data

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

LNC ITRI

O O

C# Sample StructMsg.macro_scope _macro_scope;

StructMsg.Pwd _Pwd;

private void button6_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

_macro_scope.StartNumber = 513;

_macro_scope.EndNumber = 515;

short ret = iRemoting.GET_macro_scope(_Pwd, ref _macro_scope);

if (ret == 0)

{

DataTable dtMacro = new DataTable();

dtMacro.Columns.Add("No", Type.GetType("System.Int16"));

Precision Machinery Research Development Center - Intelligent technology department

90

dtMacro.Columns.Add("Data",

Type.GetType("System.Double"));

DataRow dr;

for (int i = 0; i <= _macro_scope.MacroNumber.Length - 1;

i++)

{

dr = dtMacro.NewRow();

dr[0] = _macro_scope.MacroNumber[i];

dr[1] = _macro_scope.MacroData[i];

dtMacro.Rows.Add(dr);

}

dataGridView1.DataSource = dtMacro;

}

}

3. SET_macro_all: Set all Macro (Common Variable) variable data

API Name SET_macro_all

Description Set all Macro (Common Variable) variable data

C# Method short SET_macro_all(StructMsg.Pwd P, StructMsg.macro_all R);

VB.Net

Method

SET_macro_all(ByVal P As StructMsg.Pwd, ByVal R As

StructMsg.macro_all) As Short

Data

Structure

Structure name: macro_all

Variable

names

Type [in/out] Description

MacroNumber short[] in Set Macro Number

MacroData double[] in Set Macro variable Data

Note ※ Pwd: API Writable Password. (API setting of security)

When the return of function is 7, it means SkyMars is set

for unwritable.

When the return of function is 20, it means the password of

API is not correct.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

LNC ITRI

O O

C# Sample StructMsg.macro_all _macro_all;

StructMsg.Pwd _Pwd;

private void button3_Click(object sender, EventArgs e)

Precision Machinery Research Development Center - Intelligent technology department

91

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_macro_all(_Pwd, ref _macro_all);

if (ret == 0)

{

//Search no

for (int i = 0; i <= _macro_all.MacroNumber.Length - 1;

i++)

{

if (_macro_all.MacroNumber[i] ==

short.Parse(txtNo.Text))

{

_macro_all.MacroData[i] =

double.Parse(txtData.Text);

break;

}

}

}

ret = iRemoting.SET_macro_all(_macro_all);

if (ret == 0)

MessageBox.Show("Write success!");

else

MessageBox.Show("Write failed! ret:" + ret.ToString());

}

4. GET_macro_single: Get single Macro (Common Variable) variable data

API Name GET_macro_single

Description Get single Macro (Common Variable) variable data

C# Method short GET_macro_single(StructMsg.Pwd P, ref

StructMsg.macro_single R);

VB.Net

Method

GET_macro_single(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.macro_single) As Short

Data

Structure

Structure name: macro_single

Variable

names

Type [in/out] Description

MacroNumber short in Macro Number

MacroData double out Macro Variable Data

Note

Precision Machinery Research Development Center - Intelligent technology department

92

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

LNC ITRI

O O

C# Sample StructMsg.macro_single _macro_single;

StructMsg.Pwd _Pwd;

private void button4_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

_macro_single.MacroNumber = short.Parse(txtNo.Text);

short ret = iRemoting.GET_macro_single(_Pwd, ref

_macro_single);

if (ret == 0)

{

txtData.Text = _macro_single.MacroData.ToString();

}

}

5. SET_macro_single: Set single Macro (Common Variable) variable data

API Name SET_macro_single

Description Set single Macro (Common Variable) variable data

C# Method short SET_macro_single(StructMsg.Pwd P,

StructMsg.macro_single R);

VB.Net

Method

SET_macro_single(ByVal P As StructMsg.Pwd, ByVal R As

StructMsg.macro_single) As Short

Data

Structure

Structure name: macro_single

Variable

names

Type [in/out] Description

MacroNumber short in Set Macro Number

MacroData double in Set Macro variable Data

Note ※ Pwd: API Writable Password. (API setting of security)

When the return of function is 7, it means SkyMars is set

for unwritable.

When the return of function is 20, it means the password of

API is not correct.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

Precision Machinery Research Development Center - Intelligent technology department

93

LNC ITRI

O O

C# Sample StructMsg.macro_single _macro_single;

StructMsg.Pwd _Pwd;

private void button5_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

_macro_single.MacroNumber = short.Parse(txtNo.Text);

_macro_single.MacroData = double.Parse(txtData.Text);

short ret = iRemoting.SET_macro_single(_Pwd,

_macro_single);

if (ret == 0)

MessageBox.Show("Write success!");

else

MessageBox.Show("Write failed! ret:" + ret.ToString());

}

6. GET_macro_variable: Get Macro (Common Variable) variable type

API Name GET_macro_count

Description Get Macro (Common Variable) variable type

C# Method short GET_macro_variable(StructMsg.Pwd P, ref

StructMsg.macro_variable R);

VB.Net

Method

GET_macro_variable(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.macro_variable) As Short

Data

Structure

Structure name: macro_variable

Variable

names

Type [in/out] Description

Variable short[][] out Macro Variable Type

Note Arraies declaration: Variable[type][0]:Start Number

Variable[type][1]:End Number

EX:

Variable[0][0]:100

Variable[0][1]:199

Variable[1][0]:500

Variable[1][1]:599

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

Precision Machinery Research Development Center - Intelligent technology department

94

LNC ITRI

O O

C# Sample InterfaceLib.StructMsg.macro_variable _macro_variable;

StructMsg.Pwd _Pwd;

private void button1_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_macro_variable(_Pwd, ref

_macro_variable);

if (ret == 0)

{

for (int i = 0; i <= _macro_variable.Variable.Length -

1; i++)

{

txtVariable.Text += "Type:" + (i + 1).ToString() +

"\r\n";

txtVariable.Text += "Start Number:" +

_macro_variable.Variable[i][0].ToString() + "\r\n";

txtVariable.Text += "End Number:" +

_macro_variable.Variable[i][1].ToString() + "\r\n";

}

}

}

7. GET_pcode_single: Get single P-Code variable value (FANUC)

API Name GET_pcode_single

Description Get single P-Code variable value (FANUC).

C# Method short GET_pcode_single(StructMsg.Pwd P, ref

StructMsg.macro_single R);

VB.Net

Method

GET_pcode_single(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.macro_single) As Short

Data

Structure

Structure name: macro_single

Variable

names

Type [in/out] Description

MacroNumber int in P code number.

MacroData double out P code value.

Note If return value is 6, then please check as follow:

1. Check controller have installed "macro-executor" option.

Precision Machinery Research Development Center - Intelligent technology department

95

2. The "macro-executor" program have installed in controller.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O X X X X

LNC ITRI

X X

C# Sample StructMsg.macro_single _macro_single;

StructMsg.Pwd _Pwd;

private void button4_Click(object sender, EventArgs e)

{

_Single.MacroNumber = int.Parse(txtNum.Text);

short ret = iRemoting.GET_pcode_single(_Pwd, ref _Single);

if (ret == 0)

txtValue.Text = _Single.MacroData.ToString();

else

MessageBox.Show(ret.ToString());

}

8. SET_pcode_single: Write single P-Code variable value (FANUC)

API Name SET_pcode_single

Description Get single P-Code variable value (FANUC).

C# Method short SET_pcode_single(StructMsg.Pwd P,

StructMsg.macro_single R);

VB.Net

Method

SET_pcode_single(ByVal P As StructMsg.Pwd, ByVal R As

StructMsg.macro_single) As Short

Data

Structure

Structure name: macro_single

Variable

names

Type [in/out] Description

MacroNumber int in P code number.

MacroData double in P code value.

Note If return value is 6, then please check as follow:

1. Check controller have installed "macro-executor" option.

2. The "macro-executor" program have installed in controller.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O X X X X

LNC ITRI

X X

C# Sample StructMsg.macro_single _macro_single;

Precision Machinery Research Development Center - Intelligent technology department

96

StructMsg.Pwd _Pwd;

private void button5_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

_Single.MacroNumber = int.Parse(txtNum.Text);

_Single.MacroData = double.Parse(txtValue.Text);

short ret = iRemoting.SET_pcode_single(_Pwd, _Single);

}

Precision Machinery Research Development Center - Intelligent technology department

97

XIII. The Functions of NC Program

1. GET_nc_mem_list: Get the NC list from machine (memory)

API Name GET_nc_mem_list

Description Get the NC list from machine (memory)

C# Method short GET_nc_mem_list(StructMsg.Pwd P, ref StructMsg.nc_list

R);

VB.Net

Method

GET_nc_mem_list(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.nc_list) As Short

Data

Structure

Structure name: nc_list

Variable

names

Type [in/out] Description

FolderPath string in Folder path

NcList string[][] out NC List

Note ※FANUC 0i-D / 31i Controller: the default of nc_list.FolderPath

is //CNC_MEM/USER/PATH1/

※ The second array of NcList:

[0]:NC Name

[1]:Size (byte)

[2]:DateTime

[3]:Note (Remark)

[4]:file / directory

※For FANUC, this function does not support DateTime.

※For MITSUBISHI, this function does not support DateTime, and

Note (Remark).

※ For HEIDENHAIN, it must set “FolderPath”.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O O ? O

LNC ITRI

O O

C# Sample StructMsg.nc_list _nc_list;

StructMsg.Pwd _Pwd;

private void button1_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_nc_mem_list(_Pwd, ref _nc_list);

if (ret == 0)

Precision Machinery Research Development Center - Intelligent technology department

98

{

DataTable dtNcList = new DataTable();

dtNcList.Columns.Add("Name",

Type.GetType("System.String"));

dtNcList.Columns.Add("Size",

Type.GetType("System.Int32"));

dtNcList.Columns.Add("Remark",

Type.GetType("System.String"));

DataRow dr;

for (int i = 0; i <= _nc_list.NcList.Length - 1; i++)

{

dr = dtNcList.NewRow();

dr[0] = _nc_list.NcList[i][0];

dr[1] = int.Parse(_nc_list.NcList[i][1]);

dr[2] = _nc_list.NcList[i][3];

dtNcList.Rows.Add(dr);

}

dataGridView1.DataSource = dtNcList;

}

}

2. GET_nc_ftp_list: Get NC list from FTP

API Name GET_nc_ftp_list

Description Get NC list from FTP

C# Method short GET_nc_ftp_list(StructMsg.Pwd P, ref StructMsg.nc_list

R);

VB.Net

Method

GET_nc_ftp_list(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.nc_list) As Short

Data

Structure

Structure name: nc_list

Variable

names

Type [in/out] Description

FolderPath string in Not use

NcList string[][] out NC List

Note FANUC Controller must have DataServer, and must have set

username (account) and password.

The second array of NcList include:

[0]:NC name (Name)

Precision Machinery Research Development Center - Intelligent technology department

99

[1]:Size (Size)

[2]:DateTime

[3]:property (directory, file)

If when the return includes error codes, please refer to the

table of FTP Error codes.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? X

LNC ITRI

X X

C# Sample StructMsg.Pwd _Pwd;

private void button2_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_nc_ftp_list(_Pwd, ref _nc_list);

if (ret == 0)

{

DataTable dtNcList = new DataTable();

dtNcList.Columns.Add("Name",

Type.GetType("System.String"));

dtNcList.Columns.Add("Size",

Type.GetType("System.Int32"));

DataRow dr;

for (int i = 0; i <= _nc_list.NcList.Length - 1; i++)

{

if (_nc_list.NcList[i][3] == "f")

{

dr = dtNcList.NewRow();

dr[0] = _nc_list.NcList[i][0];

dr[1] = int.Parse(_nc_list.NcList[i][1]);

dtNcList.Rows.Add(dr);

}

}

dataGridView2.DataSource = dtNcList;

}

}

3. GET_nc_mem_code: Get the content of NC from memory

Precision Machinery Research Development Center - Intelligent technology department

100

API Name GET_nc_mem_code

Description Get the content of NC from memory

C# Method short GET_nc_mem_code(StructMsg.Pwd P, ref StructMsg.nc_code

R);

VB.Net

Method

GET_nc_mem_code(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.nc_code) As Short

Data

Structure

Structure name: nc_code

Variable

names

Type [in/out] Description

FolderPath string in Folder path

NcName string in NC name

NcCode string out NC code (content)

Note FANUC 0i-D / 31i Controller: The default of FolderPath is

//CNC_MEM/USER/PATH1/

HEIDENHAIN Controller must set “FolderPath”.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O O ? O

LNC ITRI

O O

C# Sample StructMsg.nc_code _nc_code;

StructMsg.Pwd _Pwd;

private void button3_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

_nc_code.NcName =

dataGridView1.CurrentRow.Cells[0].Value.ToString();

short ret = iRemoting.GET_nc_mem_code(_Pwd, ref _nc_code);

if (ret == 0)

{

rtbMemNcCode.Text = _nc_code.NcCode;

}

}

4. GET_nc_ftp_code: Get the content of NC from FTP

API Name GET_nc_ftp_code

Description Get the content of NC from FTP

C# Method short GET_nc_ftp_code(StructMsg.Pwd P, ref StructMsg.nc_code

R);

Precision Machinery Research Development Center - Intelligent technology department

101

VB.Net

Method

GET_nc_ftp_code(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.nc_code) As Short

Data

Structure

Structure name: nc_code

Variable

names

Type [in/out] Description

FolderPath string in Not use

NcName string in NC Name

NcCode string out NC code (Content)

Note ※ FANUC Controller must have FTP, and must have set username

and password.

※ If when the return includes error codes, please refer to the

table of FTP Error codes.

※ The MITSUBISHI ontroller cann't use in Windows operator.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? X

LNC ITRI

X X

C# Sample StructMsg.nc_code _nc_code;

StructMsg.Pwd _Pwd;

private void button4_Click(object sender, EventArgs e)

{

_nc_code.NcName =

dataGridView2.CurrentRow.Cells[0].Value.ToString();

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_nc_ftp_code(_Pwd, ref _nc_code);

if (ret == 0)

{

rtbDsNcCode.Text = _nc_code.NcCode;

}

}

5. UPLOAD_nc_mem: Upload NC to memory

API Name UPLOAD_nc_mem

Description Upload NC to memory

C# Method short UPLOAD_nc_mem(StructMsg.Pwd P, StructMsg.nc_code R);

VB.Net

Method

UPLOAD_nc_mem(ByVal P As StructMsg.Pwd, ByVal R As

StructMsg.nc_code) As Short

Precision Machinery Research Development Center - Intelligent technology department

102

Data

Structure

Structure name: nc_code

Variable

names

Type [in/out] Description

FolderPath string in Folder path

NcName string in NC Name

NcCode string in NC Code (content)

Note FANUC 0i-D / 31i Controller: the default of FolderPath is

//CNC_MEM/USER/PATH1/

HEIDENHAIN Controller must set “FolderPath”.

※ Pwd: API Writable Password. (API setting of security)

When the return of function is 7, it means SkyMars is set

for unwritable.

When the return of function is 20, it means the password of

API is not correct.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O O ? O

LNC ITRI

O O

C# Sample StructMsg.nc_code _nc_code;

StructMsg.Pwd _Pwd;

private void button5_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

_nc_code.NcName = "O0002";

_nc_code.NcCode =

System.IO.File.ReadAllText("D:\\O0002");

short ret = iRemoting.UPLOAD_nc_mem(_Pwd, _nc_code);

if (ret == 0)

MessageBox.Show("Write success!");

else

MessageBox.Show("Write failed! ret:" + ret.ToString());

}

6. UPLOAD_nc_ftp: Upload NC to FTP

API Name UPLOAD_nc_ftp

Description Upload NC to FTP

C# Method short UPLOAD_nc_ftp(StructMsg.Pwd P, StructMsg.nc_code R);

Precision Machinery Research Development Center - Intelligent technology department

103

VB.Net

Method

UPLOAD_nc_ftp(ByVal P As StructMsg.Pwd, ByVal R As

StructMsg.nc_code) As Short

Data

Structure

Structure name: nc_code

Variable

names

Type [in/out] Description

FolderPath string in Folder path

NcName string in NC Name

NcCode string in Nc code (content)

Note FANUC Controller must have FTP, and must have set username and

password.

If when the return includes error codes, please refer to the

table of FTP Error codes.

※ Pwd: API Writable Password. (API setting of security)

When the return of function is 7, it means SkyMars is set

for unwritable.

When the return of function is 20, it means the password of

API is not correct.

※ The MITSUBISHI ontroller cann't use in Windows operator.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? X

LNC ITRI

X X

C# Sample StructMsg.nc_code _nc_code;

StructMsg.Pwd _Pwd;

private void button6_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

_nc_code.NcName = "O0002";

_nc_code.NcCode =

System.IO.File.ReadAllText("D:\\O0002");

short ret = iRemoting.UPLOAD_nc_ftp(_Pwd, _nc_code);

if (ret == 0)

MessageBox.Show("Write success!");

else

MessageBox.Show("Write failed! ret:" + ret.ToString());

}

7. DEL_nc_mem: Delect NC from memory

Precision Machinery Research Development Center - Intelligent technology department

104

API Name DEL_nc_mem

Description Delect NC from memory

C# Method short DEL_nc_mem(StructMsg.Pwd P, StructMsg.NcName R);

VB.Net

Method

DEL_nc_mem(ByVal P As StructMsg.Pwd, ByVal R As

StructMsg.NcName) As Short

Data

Structure

Structure name: NcName

Variable

names

Type [in/out] Description

FolderPath string in Folder path

Name string in NC Name

Note FANUC 0i-D / 31i Controller: The default of FolderPath is

//CNC_MEM/USER/PATH1/

HEIDENHAIN Controller must set “FolderPath”.

※ Pwd: API Writable Password. (API setting of security)

When the return of function is 7, it means SkyMars is set

for unwritable.

When the return of function is 20, it means the password of

API is not correct.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O O ? O

LNC ITRI

O O

C# Sample StructMsg.NcName _NcName;

StructMsg.Pwd _Pwd;

private void button7_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

_NcName.Name =

dataGridView1.CurrentRow.Cells[0].Value.ToString();

short ret = iRemoting.DEL_nc_mem(_Pwd, _NcName);

if (ret == 0)

MessageBox.Show("Write success!");

else

MessageBox.Show("Write failed! ret:" + ret.ToString());

}

8. DEL_nc_ftp: Delect NC from FTP

API Name DEL_nc_ftp

Precision Machinery Research Development Center - Intelligent technology department

105

Description Delect NC from FTP

C# Method short DEL_nc_ftp(StructMsg.Pwd P, StructMsg.NcName R);

VB.Net

Method

DEL_nc_ftp(ByVal P As StructMsg.Pwd, ByVal R As

StructMsg.NcName) As Short

Data

Structure

Structure name: NcName

Variable

names

Type [in/out] Description

FolderPath string in Not use

Name string in Name

Note FANUC Controller must have FTP, and must have set username and

password.

If when the return includes error codes, please refer to the

table of FTP Error codes.

※ Pwd: API Writable Password. (API setting of security)

When the return of function is 7, it means SkyMars is set

for unwritable.

When the return of function is 20, it means the password of

API is not correct.

※ The MITSUBISHI ontroller cann't use in Windows operator.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? X

LNC ITRI

X X

C# Sample StructMsg.NcName _NcName;

StructMsg.Pwd _Pwd;

private void button8_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

_NcName.Name =

dataGridView2.CurrentRow.Cells[0].Value.ToString();

short ret = iRemoting.DEL_nc_ftp(_Pwd, _NcName);

if (ret == 0)

MessageBox.Show("Write success!");

else

MessageBox.Show("Write failed! ret:" + ret.ToString());

}

9. GET_nc_pointer: Get the pointer of the current NC

Precision Machinery Research Development Center - Intelligent technology department

106

API Name GET_nc_pointer

Description Get the pointer (line) of the current NC

C# Method short GET_nc_pointer(StructMsg.Pwd P, StructMsg.NcPointer R);

VB.Net

Method

GET_nc_pointer(ByVal R As StructMsg.NcPointer) As Short

Data

Structure

Structure name: NcPointer

Variable

names

Type [in/out] Description

BlkPointer int out The pointer (line) of

Current NC

Note ※ This function does not support MITSUBISHI Controller.

※ EX: FANUC NC Code:

O0050(BT2);

G01 Y0 X0 Z0 F1000.;

G01 X10.2 F500.;

X-6.325;

M30;

%

It’s running G01Y0X0Z0F1000.;

Ihe pointer is 2. (BlkPointer=2).

※ EX: HEIDENHAINNC Code:

BEGIN PGM tt2 MM

BLK FORM 0.1 Z X+0 Y+0 Z+0

BLK FORM 0.2 X+333 Y+333 Z+333

TOOL CALL 1 Z S2000

LBL 1

L X+0 Y+0 Z+100 R0 FMAX M3

L X+100 Y+100 Z+0 FMAX

LBL 0

CALL LBL 1 REP9999

END PGM tt2 MM

It’s running L X+0 Y+0 Z+100 R0 FMAX M3

The pointer is 6. (BlkPointer=6)

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O X O ? O

LNC ITRI

O O

C# Sample StructMsg.NcPointer _NcPointer;

Precision Machinery Research Development Center - Intelligent technology department

107

StructMsg.Pwd _Pwd;

private void button9_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_nc_pointer(_Pwd, ref _NcPointer);

if (ret == 0)

{

txtPointer.Text = _NcPointer.BlkPointer.ToString();

}

}

10. GET_nc_current_block: Get the current and next block of NC

API Name GET_nc_current_block

Description Get the current and next block of NC

C# Method short GET_nc_current_block(StructMsg.Pwd P, ref

StructMsg.nc_current_block R);

VB.Net

Method

Data

Structure

Structure name: nc_current_block

Variable

names

Type [in/out] Description

Block string[] Out The block array

Note ※ "0"-th index in the array is the current block that NC is

running now.

※ It only read 256 bits.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O O ? O

LNC ITRI

O X

C# Sample StructMsg.nc_current_block _current_block;

StructMsg.Pwd _Pwd;

private void button10_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_nc_current_block(_Pwd, ref

_current_block);

if (ret==0)

{

Precision Machinery Research Development Center - Intelligent technology department

108

for (int i = 0; i <= _current_block.Block.Length - 1;

i++)

{

richTextBox1.Text += _current_block.Block[i] +

";\r\n";

}

}

}

11. GET_nc_freespace: Get free space of NC

API Name GET_nc_freespace

Description Get free space of NC

C# Method short GET_nc_freespace(StructMsg.Pwd P, ref

StructMsg.nc_freespace R);

VB.Net

Method

Data

Structure

Structure name: nc_freespace

Variable

names

Type [in/out] Description

FreeSpace int Out Free space of NC

Note ※ The unit of FANUC and MITSUBISHI is CHAR.

※ The unit of HEIDENHAIN is byte.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O O ? O

LNC ITRI

O O

C# Sample StructMsg.nc_freespace _nc_freespace;

StructMsg.Pwd _Pwd;

private void button11_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_nc_freespace(_Pwd, ref

_nc_freespace);

if (ret == 0)

{

MessageBox.Show("Free: " + _nc_freespace.FreeSpace);

}

}

Precision Machinery Research Development Center - Intelligent technology department

109

12. SET_nc_main: Set or assign NC to main program

API Name SET_nc_main

Description Set or assign NC to main program.

C# Method short SET_nc_main(StructMsg.Pwd P, StructMsg.NcName R);

VB.Net

Method

Data

Structure

Structure name: nc_Name

Variable

names

Type [in/out] Description

FolderPath string in Folder Path.

Name string in NC Name.

Note FANUC 0i-D / 31i Controller: The default of FolderPath is

//CNC_MEM/USER/PATH1/

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O ? ? ? O

LNC ITRI

? ?

C# Sample _NcName.FolderPath = "//CNC_MEM/USER/PATH1/";

_NcName.Name = textBox1.Text;

short ret = iRemoting.SET_nc_main(_Pwd, _NcName);

if (ret != 0)

MessageBox.Show(ret.ToString());

13. UPLOAD_nc_mdi: Upload MDI NC program to Controller (MDI mode)

API Name UPLOAD_nc_mdi

Description Upload MDI NC program to Controller (MDI mode).

C# Method short SET_nc_main(StructMsg.Pwd P, StructMsg.NcName R);

VB.Net

Method

Data

Structure

Structure name: nc_code

Variable

names

Type [in/out] Description

NcCode string in NC Code.

Note ※ The FANUC controller series that have different restrict:

Series 160/180/210, 16i/18/21i, 0i-A/B/C : Maximun 470 Char.

Series 300i, 0i-D : Maximun 500 Char.

Precision Machinery Research Development Center - Intelligent technology department

110

※ The Controller need mode to MDI.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O ? ? ? O

LNC ITRI

? ?

C# Sample string NcCode = "G00X0.Y0.Z0.\n" +

"F1500.\n" +

"G01X100.Y100.Z20.\n" +

"G04X2.";

_nc_code.NcCode = NcCode;

short ret = iRemoting.UPLOAD_nc_mdi(_Pwd, _nc_code);

if (ret != 0)

MessageBox.Show(ret.ToString());

Precision Machinery Research Development Center - Intelligent technology department

111

XIV. The Functions of System parameter

1. GET_param_max: Get the Max number of the parameters (Or the last number)

API Name GET_param_max

Description Get the Max number of the parameters (Or the last number)

C# Method short GET_param_max(StructMsg.Pwd P, ref StructMsg.param_max

R);

VB.Net

Method

Data

Structure

Structure name: param_max

Variable

names

Type [in/out] Description

MaxNumber int out Max number

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O ? ? O

LNC ITRI

X O

C# Sample StructMsg.param_max _param_max;

StructMsg.Pwd _Pwd;

private void button1_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_param_max(_Pwd, ref _param_max);

if (ret == 0)

{

textBox1.Text = _param_max.MaxNumber.ToString();

}

}

2. GET_param_data: Get the parameter data

API Name GET_param_data

Description Get the parameter data.

C# Method short GET_param_data(StructMsg.Pwd P,

StructMsg.param_search_number SearchNumber, ref

StructMsg.param_data[] R);

VB.Net

Method

Data Structure name: param_search_number

Precision Machinery Research Development Center - Intelligent technology department

112

Structure Variable

names

Type [in/out] Description

ParamStart int in The start number of

parameter

ParamEnd int in The end number of

parameter

Structure name: param_data

Variable

names

Type [in/out] Description

ParamNumber int out Parameter number

ParamType short out The data type of

Parameter:

0:binary 1:int 2:double

3:string

ParamMulti bool out Check if

multi-Dimentions or

axes

ParamDataS string[] out The Parameter data

(binary / string)

ParamDataI int[] out The Parameter data

(Integar)

ParamDataD double[] out The Parameter data

(Double)

Note ※ When the indicated parameter doesn’t exist in the controller

or getting the the parameter failed, ParamType would be set "-1".

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O ? ? O

LNC ITRI

X O

C# Sample StructMsg.param_search_number _InputNumber;

StructMsg.param_data[] _param_data;

StructMsg.Pwd _Pwd;

private void button2_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

DataTable dt = new DataTable();

Precision Machinery Research Development Center - Intelligent technology department

113

dt.Columns.Add("ParamNum",

Type.GetType("System.Int32"));

dt.Columns.Add("ParamData",

Type.GetType("System.String"));

_InputNumber.ParamStart = int.Parse(txtStart.Text);

_InputNumber.ParamEnd = int.Parse(txtEnd.Text);

short ret = iRemoting.GET_param_data(_Pwd, _InputNumber,

ref _param_data);

if (ret == 0)

{

DataRow dr;

for (int i = 0; i <= _param_data.Length - 1; i++)

{

if (_param_data[i].ParamType != -1)

{

dr = dt.NewRow();

dr[0] = _param_data[i].ParamNumber;

if (_param_data[i].ParamMulti == false)

{

switch (_param_data[i].ParamType)

{

case 0:

dr[1] = _param_data[i].ParamDataS[0];

break;

case 1:

dr[1] = _param_data[i].ParamDataI[0].ToString();

break;

case 2:

dr[1] = _param_data[i].ParamDataD[0].ToString();

break;

case 3:

dr[1] = _param_data[i].ParamDataS[0];

break;

}

}

else

{

switch (_param_data[i].ParamType)

{

Precision Machinery Research Development Center - Intelligent technology department

114

case 0:

for (int j = 0; j <= _param_data[i].ParamDataS.Length -

1; j++)

{

if (j == 0)

dr[1] = _param_data[i].ParamDataS[j];

else

dr[1] += ", " + _param_data[i].ParamDataS[j];

}

break;

case 1:

for (int j = 0; j <= _param_data[i].ParamDataI.Length -

1; j++)

{

if (j == 0)

dr[1] = _param_data[i].ParamDataI[j];

else

dr[1] += ", " + _param_data[i].ParamDataI[j];

}

break;

case 2:

for (int j = 0; j <= _param_data[i].ParamDataD.Length

- 1; j++)

{

if (j == 0)

dr[1] = _param_data[i].ParamDataD[j];

else

dr[1] += ", " + _param_data[i].ParamDataD[j];

}

break;

case 3:

for (int j = 0; j <= _param_data[i].ParamDataS.Length -

1; j++)

{

if (j == 0)

dr[1] = _param_data[i].ParamDataS[j];

else

dr[1] += ", " + _param_data[i].ParamDataS[j];

}

break;

Precision Machinery Research Development Center - Intelligent technology department

115

}

}

dt.Rows.Add(dr);

}

}

dataGridView1.DataSource = dt;

}

}

3. SET_param_data: Set the parameter data

API Name GET_param_max

Description Set the parameter data.

C# Method short SET_param_data(StructMsg.Pwd P, StructMsg.param_data[]

R);

VB.Net

Method

Data

Structure

Structure name: param_data

Variable

names

Type [in/out] Description

ParamNumber int in Parameter number

ParamType short in The data type of

Parameter:

0:binary 1:int 2:double

3:string

ParamMulti bool in Check if

multi-Dimentions or

axes

ParamDataS string[] in The Parameter data

(binary / string)

ParamDataI int[] in The Parameter data

(Integar)

ParamDataD double[] in The Parameter data

(Double)

Note

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O ? ? ? O

Precision Machinery Research Development Center - Intelligent technology department

116

LNC ITRI

X ?

C# Sample StructMsg.param_data[] _param_data = new

StructMsg.param_data[3];

_param_data[0].ParamNumber = 162;

_param_data[0].ParamType = 0;

_param_data[0].ParamMulti = false;

_param_data[0].ParamDataS = new string[] { "00000011" };

_param_data[1].ParamNumber = 171;

_param_data[1].ParamType = 1;

_param_data[1].ParamMulti = false;

_param_data[1].ParamDataI = new int[] { 8 };

_param_data[2].ParamNumber = 1006;

_param_data[2].ParamType = 0;

_param_data[2].ParamMulti = true;

_param_data[2].ParamDataS = new string[3];

_param_data[2].ParamDataS[0] = "01100000";

_param_data[2].ParamDataS[1] = "00000000";

_param_data[2].ParamDataS[2] = "00000000";

short ret = iRemoting.SET_param_data(_Pwd, _param_data);

MessageBox.Show(ret.ToString());

Precision Machinery Research Development Center - Intelligent technology department

117

XV. The Functions of PLC

1. GET_plc_ver: Get the version information of PLC

API Name GET_plc_ver

Description Get the version information of PLC

C# Method short GET_plc_ver(StructMsg.Pwd P, ref StructMsg.plc_ver R);

VB.Net

Method

GET_plc_ver(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.plc_ver) As Short

Data

Structure

Structure name: plc_ver

Variable

names

Type [in/out] Description

Version String out Version information

Date String out Date

Designed String out Designer

Note ※ FANUC Controller:

Version = PROGRAM DRAWING NO.

Date = DATE OF PROGRAMING

Designed = PROGRAM DESIGNED BY

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O X ? O

LNC ITRI

O O

C# Sample StructMsg.plc_ver _plc_ver;

StructMsg.Pwd _Pwd;

private void button2_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_plc_ver(_Pwd, ref _plc_ver);

if (ret == 0)

{

textBox1.Text = _plc_ver.Version;

}

}

2. GET_plc_addr: Get the PLC address of start or end number

API Name GET_plc_addr

Description Get the PLC address of start or end number.

C# Method short GET_plc_addr(StructMsg.Pwd P, ref StructMsg.plc_addr R);

Precision Machinery Research Development Center - Intelligent technology department

118

VB.Net

Method

Data

Structure

Structure name: plc_addr

Variable

names

Type [in/out] Description

Addr string in ex:A,D,T,C

PlcStart int[] out Start address number.

PlcEnd int[] out End address number.

Note ※ FANUC Controller accept address:

G, F, Y, X, A, R, T, K, C, D, E

※ SYNTEC Controller accept address:

I, O, C, S, A, R

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O ? ? ? O

LNC ITRI

? ?

C# Sample StructMsg.Pwd _Pwd;

StructMsg.plc_addr _plc_addr;

private void comboBox1_SelectedIndexChanged(object sender,

EventArgs e)

{

txtPlcStart.Text = ""; txtPlcEnd.Text = "";

_Pwd.ConnectionKey = "123";

_plc_addr.Addr = comboBox1.Text;

short ret = iRemoting.GET_plc_addr(_Pwd, ref _plc_addr);

if (ret == 0)

{

for (int i = 0; i <= _plc_addr.PlcStart.Length - 1; i++)

{

txtPlcStart.Text += _plc_addr.PlcStart[i].ToString() + "\t";

txtPlcEnd.Text += _plc_addr.PlcEnd[i].ToString() + "\t";

}

}

else

{

MessageBox.Show(ret.ToString());

}

Precision Machinery Research Development Center - Intelligent technology department

119

}

3. GET_plc_addr2: Get the PLC address of start or end number

API Name GET_plc_addr2

Description Get the PLC address of start or end number.

C# Method short GET_plc_addr2(StructMsg.Pwd P, ref StructMsg.plc_addr2

R);

VB.Net

Method

Data

Structure

Structure name: plc_addr2

Variable

names

Type [in/out] Description

Version string in ex:A,D,T,C

PlcStart int[] out Start address number.

PlcEnd int[] out End address number.

PlcType short[] out 0:byte, 1:short, 2:int

3:bool, 4:double,

5:string

6:sbyte

Note ※ FANUC Controller accept address:

G, F, Y, X, A, R, T, K, C, D, E

※ SYNTEC Controller accept address:

I, O, C, S, A, R

※ HEIDENHAIN Controller accept address:

M, B, W, D, I, O, T, C, S, IB, IW, ID, OB, OW, OD

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O ? O ? O

LNC ITRI

? ?

C# Sample StructMsg.plc_addr2 _plc_addr2 = new StructMsg.plc_addr2();

_Pwd.ConnectionKey = "123";

_plc_addr2.Addr = comHeidAddr.Text;

short ret = iRemoting.GET_plc_addr2(_Pwd, ref _plc_addr2);

if (ret == 0)

{

txtHeidStart.Text = _plc_addr2.PlcStart[0].ToString();

txtHeidEnd.Text = _plc_addr2.PlcEnd[0].ToString();

txtHeidType.Text = _plc_addr2.PlcType[0].ToString();

Precision Machinery Research Development Center - Intelligent technology department

120

}

4. GET_plc_status: Get the status of PLC

API Name GET_plc_status

Description Get the status of PLC

C# Method short GET_plc_status(StructMsg.Pwd P, ref

StructMsg.plc_status R);

VB.Net

Method

GET_plc_status(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.plc_status) As Short

Data

Structure

Structure name: plc_status

Variable

names

Type [in/out] Description

Addr string in ex:A,D,T,C

PlcStart int in Start value of Address

PlcEnd int in End value of Address

PlcType short out 0:byte, 1:short, 2:int

PlcDataB byte[] out PLC Data (byte)

PlcDataS short[] out PLC Data (short)

PlcDataI int[] out PLC Data (int)

Note ※ The addresses that FANUC Controller support:

G, F, Y, X, A, R, T, K, C, D, E

※ The addresses that MITSUBISHI Controller (M70/M700) support:

X, Y, M, F, L, SM, D, R, W, B, SB, V, SW, SD

※ The addresses that SYNTEC Controller support:

I, O, C, S, A, R

※ The addresses that LNC Controller support:

A, R, C, I, S, O

※ The addresses that ITRI Controller support:

I, O, C, S, A, B, Force I, Force O, Force C

※ The value gotten from PLC will be put into the array of

PlcData(B,S,I), if getting number failed, the array would be

set as -1.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O ? ? O

LNC ITRI

O O

C# Sample StructMsg.plc_status _plc_status;

StructMsg.Pwd _Pwd;

Precision Machinery Research Development Center - Intelligent technology department

121

private void button1_Click(object sender, EventArgs e)

{

_plc_status.Addr = "T";

_plc_status.PlcStart = 2;

_plc_status.PlcEnd = 2;

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_plc_status(_Pwd, ref

_plc_status);

if (ret == 0)

{

if (_plc_status.PlcType==0)

txtPlcData.Text =

_plc_status.PlcDataB[0].ToString();

else if (_plc_status.PlcType==1)

txtPlcData.Text =

_plc_status.PlcDataS[0].ToString();

else

txtPlcData.Text =

_plc_status.PlcDataI[0].ToString();

}

}

5. GET_plc_status2: Get the status of PLC

API Name GET_plc_status2

Description Get the status of PLC

C# Method short GET_plc_status2(StructMsg.Pwd P, ref

StructMsg.plc_status2[] R);

VB.Net

Method

Data

Structure

Structure name: plc_status2

Variable

names

Type [in/out] Description

Addr string in ex:A,D,T,C

PlcNumber int in Plc number.

PlcType short out 0:byte, 1:short, 2:int

3:bool, 4:double,

5:string

6:sbyte

PlcDataByte byte out Plc data (byte)

Precision Machinery Research Development Center - Intelligent technology department

122

PlcDataShort short out Plc data (short)

PlcDataInt int out Plc data (int)

PlcDataBool bool out Plc data (bool)

PlcDataDouble double out Plc data (double)

PlcDataString string out Plc data (string)

PlcDataSByte sbyte out Plc data (sbyte)

Note ※ The addresses that FANUC Controller support:

G, F, Y, X, A, R, T, K, C, D, E

※ The addresses that MITSUBISHI Controller (M70/M700) support:

X, Y, M, F, L, SM, D, R, W, B, SB, V, SW, SD

※ The addresses that SYNTEC Controller support:

I, O, C, S, A, R

※ The addresses that LNC Controller support:

A, R, C, I, S, O

※ The addresses that ITRI Controller support:

I, O, C, S, A, B, Force I, Force O, Force C

※ The value gotten from PLC will be put into the array of

PlcData(B,S,I), if getting number failed, the array would be

set as -1.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O O O ? O

LNC ITRI

O O

C# Sample _Pwd.ConnectionKey = "123";

StructMsg.plc_status2[] _plc_status2 = new

StructMsg.plc_status2[1];

_plc_status2[0].Addr = "W";

_plc_status2[0].PlcNumber = 9804;

DataTable dt = new DataTable();

dt.Columns.Add("PlcNumber", Type.GetType("System.Int32"));

dt.Columns.Add("PlcType", Type.GetType("System.Int16"));

dt.Columns.Add("PlcValue", Type.GetType("System.String"));

short ret = iRemoting.GET_plc_status2(_Pwd, ref _plc_status2);

if (ret == 0)

{

for (int i = 0; i <= _plc_status2.Length - 1; i++)

Precision Machinery Research Development Center - Intelligent technology department

123

{

DataRow dr = dt.NewRow();

dr["PlcNumber"] = _plc_status2[i].PlcNumber;

dr["PlcType"] = _plc_status2[i].PlcType;

switch (_plc_status2[i].PlcType)

{

case 0:

dr["PlcValue"] = _plc_status2[i].PlcDataByte;

break;

case 1:

dr["PlcValue"] = _plc_status2[i].PlcDataShort;

break;

case 2:

dr["PlcValue"] = _plc_status2[i].PlcDataInt;

break;

case 3:

dr["PlcValue"] = _plc_status2[i].PlcDataBool;

break;

case 4:

dr["PlcValue"] = _plc_status2[i].PlcDataDouble;

break;

case 5:

dr["PlcValue"] = _plc_status2[i].PlcDataString;

break;

}

dt.Rows.Add(dr);

}

dgvHeid.DataSource = dt;

}

6. SET_plc_status: Set the status of PLC

API Name SET_plc_status

Description Set the status of PLC

C# Method short SET_plc_status(StructMsg.Pwd P, StructMsg.plc_status

R);

VB.Net

Method

SET_plc_status(ByVal P As StructMsg.Pwd, ByVal R As

StructMsg.plc_status) As Short

Precision Machinery Research Development Center - Intelligent technology department

124

Data

Structure

Structure name: plc_status

Variable

names

Type [in/out] Description

Addr string in ex:A,D,T,C

PlcStart int in Start value of Address

PlcEnd int in End value of Address

PlcType short in 0:byte, 1:short, 2:int

PlcDataB byte[] in PLC data (byte)

PlcDataS short[] in PLC data (short)

PlcDataI int[] in PLC data (int)

Note ※ The addresses that FANUC Controllers support:

G, F, Y, X, A, R, T, K, C, D, E

※ FANUC Controllers accept only byteType, so please set PlcType

as 0 and put the data into the variable “PlcDataB”.

※ The addressses that MITSUBISHI Controllers support:

X, Y, M, F, L, SM, D, R, W, B, SB, V, SW, SD

※ The addresses that SYNTEC Controller support:

I, O, C, S, A, R

※ The addresses that LNC Controller support:

A, R, C, I, S, O

※ The addresses that ITRI Controller support:

I, O, C, S, A, B, Force I, Force O, Force C

※ Pwd: API Writable Password. (API setting of security)

When the return of function is 7, it means SkyMars is set

for unwritable.

When the return of function is 20, it means the password of

API is not correct.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O ? ? ? O

LNC ITRI

O O

C# Sample StructMsg.Pwd _Pwd;

private void button4_Click(object sender, EventArgs e)

{

_plc_status.Addr = "D";

_plc_status.PlcStart = 15;

_plc_status.PlcEnd = 20;

_plc_status.PlcType = 0;

Precision Machinery Research Development Center - Intelligent technology department

125

_plc_status.PlcDataB = new byte[5];

_plc_status.PlcDataB[0] = 1;

_plc_status.PlcDataB[1] = 2;

_plc_status.PlcDataB[2] = 3;

_plc_status.PlcDataB[3] = 4;

_plc_status.PlcDataB[4] = 5;

_Pwd.ConnectionKey = "123";

short ret = iRemoting.SET_plc_status(_Pwd, _plc_status);

if (ret == 0)

MessageBox.Show("Write success!");

else

MessageBox.Show(ret.ToString());

}

7. SET_plc_status2: Set the status of PLC

API Name SET_plc_status2

Description Set the status of PLC

C# Method short SET_plc_status2(StructMsg.Pwd P,

StructMsg.plc_status2[] R);

VB.Net

Method

Data

Structure

Structure name: plc_status2

Variable

names

Type [in/out] Description

Addr string in ex:A,D,T,C

PlcNumber int in Plc number.

PlcType short in 0:byte, 1:short, 2:int

3:bool, 4:double,

5:string

6:sbyte

PlcDataByte byte in Plc data (byte)

PlcDataShort short in Plc data (short)

PlcDataInt int in Plc data (int)

PlcDataBool bool in Plc data (bool)

PlcDataDouble double in Plc data (double)

PlcDataString string in Plc data (string)

PlcDataSByte sbyte in Plc data (sbyte)

Note ※ The addresses that FANUC Controllers support:

Precision Machinery Research Development Center - Intelligent technology department

126

G, F, Y, X, A, R, T, K, C, D, E

※ FANUC Controllers accept only byteType, so please set PlcType

as 0 and put the data into the variable “PlcDataB”.

※ The addressses that MITSUBISHI Controllers support:

X, Y, M, F, L, SM, D, R, W, B, SB, V, SW, SD

※ The addresses that SYNTEC Controller support:

I, O, C, S, A, R

※ The addresses that LNC Controller support:

A, R, C, I, S, O

※ The addresses that ITRI Controller support:

I, O, C, S, A, B, Force I, Force O, Force C

※ Pwd: API Writable Password. (API setting of security)

When the return of function is 7, it means SkyMars is set

for unwritable.

When the return of function is 20, it means the password of

API is not correct.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

O ? O ? O

LNC ITRI

O O

C# Sample _Pwd.ConnectionKey = "123";

StructMsg.plc_status2[] _plc_status2 = new

StructMsg.plc_status2[1];

_plc_status2[0].Addr = "W";

_plc_status2[0].PlcNumber = 9804;

_plc_status2[0].PlcType = 1;

_plc_status2[0].PlcDataShort = 20;

short ret = iRemoting.SET_plc_status2(_Pwd, _plc_status2);

MessageBox.Show(ret.ToString());

Precision Machinery Research Development Center - Intelligent technology department

127

XVI. The Functions of Files Management

1. GET_file_directory: Get files and directories on controller

API Name GET_file_directory

Description Get files and directories on controller.

C# Method short GET_file_directory(StructMsg.Pwd P, ref

StructMsg.file_list R);

VB.Net

Method

Data

Structure

Structure name: file_list

Variable

names

Type [in/out] Description

FolderPath string in Folder path.

DirList string[][] out Directory data.

Note ※ Currently only apply in HEIDENHAIN controller.

※ The "file_list" structure in second array:

[0]: File or directory name.

[1]: Size (byte).

[2]: Date.

[3]: Authority, have three words, is "drw":

The first one character represents this project is "folder

(directory) or file":

As for the [d] is the folder (directory); When is [-] is the file.

The first two characters are representative of this file "readable".

As for the [r] is readable; When is [-] is unreadable.

The first three characters are representative of this file, "write".

As for the [w] is writable; When is [-] is not writable.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

? ? O ? ?

LNC ITRI

? ?

C# Sample StructMsg.file_list _file_list = new StructMsg.file_list();

lvList.Items.Clear();

_file_list.FolderPath = txtPath.Text;

short ret = iRemoting.GET_file_directory(_Pwd, ref

_file_list);

if (ret == 0)

{

for (int i = 0; i <= _file_list.DirList.Length - 1; i++)

Precision Machinery Research Development Center - Intelligent technology department

128

{

ListViewItem item = new

ListViewItem(_file_list.DirList[i][0]);

item.SubItems.Add(_file_list.DirList[i][1]);

item.SubItems.Add(_file_list.DirList[i][2]);

item.SubItems.Add(_file_list.DirList[i][3]);

lvList.Items.Add(item);

}

}

2. UPLOAD_file2: Upload file from PC side to controller

API Name UPLOAD_file2

Description Upload file from PC side to controller.

C# Method short UPLOAD_file2(StructMsg.Pwd P, StructMsg.file_path2 R);

VB.Net

Method

Data

Structure

Structure name: file_list

Variable

names

Type [in/out] Description

FileContent byte[] in Upload file from PC side.

DestFile string in File path and file name

in controller.

Note ※ Currently only apply in HEIDENHAIN controller.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

? ? O ? ?

LNC ITRI

? ?

C# Sample StructMsg.file_path _file_path = new StructMsg.file_path();

_file_path.SourceFile = openFileDialog1.FileName;

_file_path.DestFile = txtPath.Text + "\\" +

openFileDialog1.SafeFileName;

short ret = iRemoting.UPLOAD_file(_Pwd, _file_path);

3. DOWNLOAD_file2: Download file from controller side to PC side

API Name DOWNLOAD_file2

Description Download file from controller side to PC side.

C# Method short UPLOAD_file2(StructMsg.Pwd P, StructMsg.file_path2 R);

Precision Machinery Research Development Center - Intelligent technology department

129

VB.Net

Method

Data

Structure

Structure name: file_path2

Variable

names

Type [in/out] Description

SourceFile string in File path and file name

in controller.

FileContent byte[] out Download file content

from Controller.

Note ※ Currently only apply in HEIDENHAIN controller.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

? ? O ? ?

LNC ITRI

? ?

C# Sample StructMsg.file_path _file_path = new StructMsg.file_path();

_file_path.SourceFile = txtPath.Text + "\\" +

lvList.SelectedItems[0].Text;

_file_path.DestFile = saveFileDialog1.FileName;

short ret = iRemoting.DOWNLOAD_file(_Pwd, _file_path);

4. DEL_file: Delete file from controller

API Name DEL_file

Description Delete file from controller.

C# Method short DEL_file(StructMsg.Pwd P, StructMsg.file_path R);

VB.Net

Method

Data

Structure

Structure name: file_path2

Variable

names

Type [in/out] Description

SourceFile string in File path and file name

in controller.

Note ※ Currently only apply in HEIDENHAIN controller.

Support O : Supported X : Not supported ? : On-going

FANUC MITSUBISHI HEIDENHAIN SIEMENS SYNTEC

? ? O ? ?

LNC ITRI

? ?

Precision Machinery Research Development Center - Intelligent technology department

130

C# Sample StructMsg.file_path _file_path = new StructMsg.file_path();

_file_path.SourceFile = txtPath.Text + "\\" +

lvList.SelectedItems[0].Text;

short ret = iRemoting.DEL_file(_Pwd, _file_path);

Precision Machinery Research Development Center - Intelligent technology department

131

XVII. The Functions of National Instruments 9233 (Accelerometer module) (Currently

disabled function.)

1. START_ni9233_get_data: Start module for data acquisition

API Name START_ni9233_get_data

Description Start module for data acquisition

C# Method short START_ni9233_get_data(StructMsg.Pwd P,

StructMsg.NI9233_Param R);

VB.Net

Method

START_ni9233_get_data(ByVal P As StructMsg.Pwd, ByRef R As

StructMsg.NI9233_Param) As Short

Data

Structure

Structure name: NI9233_Param

Variable names Type [in/out] Description

PhysicalChannel string in The name of physical

channel, ex: the first

channel of the first

module is “Dev1/ai0”.

And if there are two

channels in one

module, that would be

Dev1/ai0, Dev1/ai1.

MinimumValue double in The minimum Voltage of

the module “NI 9233”

MaximumValue double in The maximum Voltage of

the module “NI 9233”

Rate double in Sample rate: the

points per second

Gain double[] in Set gain value

Offset double[] in Set offset valute

Note ※After this function have been executing, data acquisition

would be continued until the function “STOP_ni9233_get_data”

is executed, and then data acquisition would be stoped.

※If the error of the return is -22, it means the sensor is

working, and you can use the function

“GET_ni9233_spectrum_data” to get the data.

※If the error of the return is -23, it means some failure

happened at the sensor or the API. Please use the function

“GET_ni9233_error_msg” to get the error messages.

Support It supports only the module “National Instruments 9233”.

C# Sample StructMsg.NI9233_Param _NI9233_Param;

private void button1_Click(object sender, EventArgs e)

Precision Machinery Research Development Center - Intelligent technology department

132

{

if (iRemoting.CHECK_ni9233_running() == false)

{

//Parameter setting

_NI9233_Param.PhysicalChannel =

"Dev1/ai0,Dev1/ai1,Dev1/ai2";

_NI9233_Param.MinimumValue = -5;

_NI9233_Param.MaximumValue = 5;

_NI9233_Param.Rate = 100;

_NI9233_Param.SamplesPerChannel = 1000;

_NI9233_Param.Gain = new double[] { 10.208, 9.94,

10.352 };

_NI9233_Param.Offset = new double[] { 0, 0, 0 };

iRemoting.START_ni9233_get_data(_NI9233_Param);

}

else

{

//It is running

MessageBox.Show("It is running now.");

}

}

2. STOP_ni9233_get_data: Stop Data Acquisition

API Name STOP_ni9233_get_data

Description Stop data acquisition

C# Method void STOP_ni9233_get_data();

VB.Net

Method

STOP_ni9233_get_data()

Data

Structure

Note

Support It supports only the module “National Instruments 9233”.

C# Sample iRemoting.STOP_ni9233_get_data();

3. CHECK_ni9233_running: Check if DataAcquisition is running

API Name STOP_ni9233_get_data

Description Check if DataAcquisition is running

Precision Machinery Research Development Center - Intelligent technology department

133

C# Method bool CHECK_ni9233_running();

VB.Net

Method

CHECK_ni9233_running() As Boolean

Data

Structure

Note

Support It supports only the module “National Instruments 9233”.

C# Sample private void button4_Click(object sender, EventArgs e)

{

if (iRemoting.CHECK_ni9233_running())

MessageBox.Show("It is running now!");

else

MessageBox.Show("It’s not running!");

}

4. GET_ni9233_spectrum_data: Get the data from NI 9233

API Name GET_ni9233_spectrum_data

Description Get the data from NI 9233

C# Method bool GET_ni9233_spectrum_data(ref

StructMsg.NI9233_SpectrumData R);

VB.Net

Method

GET_ni9233_spectrum_data(ByRef R As

StructMsg.NI9233_SpectrumData) As Boolean

Data

Structure

Structure name: NI9233_Param

Variable

names

Type [in/out] Description

Time DateTime[] out The time of every point

Samples Double[,] out The value of Samples

(2D array)

Note Samples (2D array): [n-th Sample, the value of n-th Sample on

n-th channel]

Support It supports only the module “National Instruments 9233”.

C# Sample StructMsg.NI9233_SpectrumData SpectrumData;

private void button2_Click(object sender, EventArgs e)

{

DataTable dt = new DataTable();

dt.Columns.Add("Time", Type.GetType("System.String"));

dt.Columns.Add("Ch1", Type.GetType("System.Double"));

dt.Columns.Add("Ch2", Type.GetType("System.Double"));

dt.Columns.Add("Ch3", Type.GetType("System.Double"));

Precision Machinery Research Development Center - Intelligent technology department

134

dt.Columns.Add("Ch4", Type.GetType("System.Double"));

bool IsSuccess = iRemoting.GET_ni9233_spectrum_data(ref

SpectrumData);

if (IsSuccess == true)

{

DataRow dr;

for (int i = 0; i <= SpectrumData.Time.Length - 1; i++)

{

dr = dt.NewRow();

dr[0] =

SpectrumData.Time[i].Millisecond.ToString();

dr[1] = SpectrumData.Samples[i, 0];

dr[2] = SpectrumData.Samples[i, 1];

dr[3] = SpectrumData.Samples[i, 2];

dt.Rows.Add(dr);

}

}

dataGridView1.DataSource = dt;

}

5. GET_ni9233_error_msg: Get the error message of NI 9233

API Name GET_ni9233_error_msg

Description Get the error message of NI 9233

C# Method StructMsg.SkyException GET_ni9233_error_msg();

VB.Net

Method

GET_ni9233_error_msg() As StructMsg.SkyException

Data

Structure

Structure name: SkyException

Variable names Type [in/out] Description

IsException bool out Detect if there is an

exceptional error

ExceptionMsg string out Error message

ErrorCode int out Error code

Note

Support It supports only the module “National Instruments 9233”.

C# Sample StructMsg.SkyException R = iRemoting.GET_ni9233_error();

MessageBox.Show(R.ExceptionMsg);

Precision Machinery Research Development Center - Intelligent technology department

135

Precision Machinery Research Development Center - Intelligent technology department

136

XVIII. The Function of RS232 Module

1. GET_rs232_status: Get the status and parameters of RS232

API Name GET_rs232_status

Description Get the status and parameters of RS232

C# Method void GET_rs232_status(StructMsg.Pwd P, ref

StructMsg.RS232_Param[] R);

VB.Net

Method

GET_rs232_status(ByRef R() As StructMsg.RS232_Param)

Data

Structure

Structure name: RS232_Param[]

Variable names Type [in/out] Description

IsOpen bool out Check if Com Port

opens.

TaskName string out Task Name

RS232_PortName string out The Names of Com

Port,ex:COM1

RS232_Parity Parity out Parity Check

RS232_DataBit Int out Data Bit of RS232

RS232_StopBit StopBits out Stop Bit of RS232

RS232_BaudRate Int out Set Baud Rate of

RS232

RS232_Handshake Handshake out Handshake of RS232

SerialType short out The Serial Type of

ComPort,

0:string ,

1:byte[]

IsOnCallbackEvent Bool out Check if it is on

call back event. If

it is true, it must

set termination

character (End

text or string).

EndText string out End text or string

EndByte Byte out End Byte

Note ※ SkyMars allows to build up 10 arrays (from 10 different Com

Port), and it returns the structure array with the fixed

length, “10”.

※ You could know if Com port is being used or the variable of

TaskName by checking the array of IsOpen.

Support RS-232 Module

Precision Machinery Research Development Center - Intelligent technology department

137

C# Sample StructMsg.RS232_Param[] _Param;

StructMsg.Pwd _Pwd;

private void button6_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

iRemoting.GET_rs232_status(_Pwd, ref _Param);

DataTable dt = new DataTable();

dt.Columns.Add("IsOpen",

Type.GetType("System.Boolean"));

dt.Columns.Add("TaskName",

Type.GetType("System.String"));

for (int i = 0; i <= _Param.Length - 1; i++)

{

DataRow dr = dt.NewRow();

dr[0] = _Param[i].IsOpen;

dr[1] = _Param[i].TaskName;

dt.Rows.Add(dr);

}

dataGridView1.DataSource = dt;

}

2. OPEN_rs232: Open RS232

API Name OPEN_rs232

Description Open RS232

C# Method short OPEN_rs232(StructMsg.Pwd P, int index,

StructMsg.RS232_Param R);

VB.Net

Method

OPEN_rs232(ByVal index As Integer, ByVal R As StructMsg.RS232)

As Short

Data

Structure

Structure name: RS232_Param

Variable names Type [in/out] Description

TaskName string in Set the name of task

RS232_PortName string in Set the name of Com

port,ex: COM1

RS232_Parity Parity in Set Parity check

RS232_DataBit int in Set Data bit

RS232_StopBit StopBits in Set Stop bit

Precision Machinery Research Development Center - Intelligent technology department

138

RS232_BaudRate int in Set Baud rate

RS232_Handshake Handshake in Set handshake

SerialType short in Set the type of Com

Port, 0:string ,

1:byte[]

IsOnCallbackEvent bool in Check if it needs on

call back event. If

it is true, it must

set termination

character (End text

or string).

EndText string in End text or string

EndByte byte in End Byte

Note ※ index: the n-th array in SkyMars means serial port of the

n-th.

※ When SerialType is set 0, it means using “string” to transfer

data.

※ When IsOnCallbackEvent is set “true”, you must set the

variable of EndText or EndByte.

※ When IsOnCallbackEvent is set “false”, you could neglect the

variable of EndText or EndByte.

※ If a ComPort of a certain index has being opened, it will

not be able to set, and send out error code -25. You must turn

off the Com Port at first and then it could be able to set.

Support RS-232 Module

C# Sample StructMsg.RS232_Param _RS232_Param;

StructMsg.Pwd _Pwd;

private void button1_Click(object sender, EventArgs e)

{

_RS232_Param.RS232_BaudRate = 2400;

_RS232_Param.RS232_DataBit = 8;

_RS232_Param.RS232_Handshake = Handshake.None;

_RS232_Param.RS232_Parity = Parity.None;

_RS232_Param.RS232_PortName = "COM6";

_RS232_Param.RS232_StopBit = StopBits.One;

_RS232_Param.EndByte = 0x7c;

_RS232_Param.IsOnCallbackEvent = true;

_RS232_Param.SerialType = 1;

_RS232_Param.TaskName = "Temperature Card";

Precision Machinery Research Development Center - Intelligent technology department

139

_Pwd.ConnectionKey = "123";

short ret = iRemoting.OPEN_rs232(_Pwd, 0, _RS232_Param);

MessageBox.Show(ret.ToString());

}

3. SET_rs232: Set data into RS232

API Name SET_rs232

Description Set data into RS232

C# Method short SET_rs232(StructMsg.Pwd P, int index,

StructMsg.RS232_Data R);

VB.Net

Method

SET_rs232(ByVal P As StructMsg.Pwd, ByVal index As

Integer,ByVal R As StructMsg.RS232_Data) As Short

Data

Structure

Structure name: RS232_Data

Variable names Type [in/out] Description

Text string in Set string

ArrayByte byte[] in Set array byte

Note ※ index: the n-th array in SkyMars means the Com Port of n-th.

※ As for selecting the variable of “Text” or “ArrayByte”, please

refer to “SerialType” in the function “OPEN_rs232” before.

Ex: SerialType=0, please set variable “Text” and neglect

“ArrayByte”.

If SerialType=1, please set variable “ArrayByte” and neglect

“Text”.

※ Pwd: API Writable Password. (API setting of security)

When the return of function is 7, it means SkyMars is set

for unwritable.

When the return of function is 20, it means the password of

API is not correct.

Support RS-232 Module

C# Sample StructMsg.RS232_Data _RS232_Data;

StructMsg.Pwd _Pwd;

private void button2_Click(object sender, EventArgs e)

{

byte[] wrCmd = { 0x05, 0x05, 0x05, 0x37 };

_RS232_Data.ArrayByte = wrCmd;

_Pwd.ConnectionKey = "123";

short ret = iRemoting.SET_rs232(_Pwd, 0, _RS232_Data);

Precision Machinery Research Development Center - Intelligent technology department

140

MessageBox.Show(ret.ToString());

}

4. CHECK_rs232_data_received: Check if RS232 received data (IsOnCallbackEvent=true)

API Name CHECK_rs232_data_received

Description Check if RS232 received data (IsOnCallbackEvent=true)

C# Method bool CHECK_rs232_data_received(StructMsg.Pwd P, int index);

VB.Net

Method

CHECK_rs232_data_received(index As Integer) As Boolean

Data

Structure

Note ※ index: the n-th array in SkyMars means the Com Port of n-th.

Support RS-232 Module

C# Sample StructMsg.Pwd _Pwd;

_Pwd.ConnectionKey = "123";

bool IsRet = iRemoting.CHECK_rs232_data_received(_Pwd, 0);

MessageBox.Show(IsRet.ToString());

5. GET_rs232_data_received: Get the data from RS232 received

API Name GET_rs232_data_received

Description Get the data from RS232 received

C# Method short GET_rs232_data_received(int index, ref

StructMsg.RS232_Data R);

VB.Net

Method

GET_rs232_data_received(ByVal index As Integer,ByRef R As

StructMsg.RS232_Data) As Short

Data

Structure

Structure name: RS232_Data

Variable names Type [in/out] Description

Text string out Return String

ArrayByte byte[] out Return Array Byte

Note ※ index: the n-th array in SkyMars means the Com Port of n-th.

※ As for selecting the variable of “Text” or “ArrayByte”, please

refer to “SerialType” in the function “OPEN_rs232” before.

Ex: If SerialType=0, please use “Text” to get the data return.

If SerialType=1, Please use “ArrayByte” to get the data return.

Support RS-232 Module

C# Sample StructMsg.RS232_Data _RS232_Data;

private void button4_Click(object sender, EventArgs e)

{

Precision Machinery Research Development Center - Intelligent technology department

141

short ret = iRemoting.GET_rs232_data_received(0, ref

_RS232_Data);

byte[] readByte = _RS232_Data.ArrayByte;

}

6. CLOSE_rs232: Close RS232

API Name CLOSE_rs232

Description Close RS232

C# Method void CLOSE_rs232(StructMsg.Pwd P, int index);

VB.Net

Method

CLOSE_rs232(index As Integer)

Data

Structure

Note ※ index: the n-th array in SkyMars means the Com Port of n-th.

Support RS-232 Module

C# Sample StructMsg.RS232_Data _RS232_Data;

StructMsg.Pwd _Pwd;

_Pwd.ConnectionKey = "123";

iRemoting.CLOSE_rs232(_Pwd, 0);

7. GET_rs232_error_msg: Get the error message from RS-232

API Name GET_rs232_error_msg

Description Get the error message from RS-232

C# Method StructMsg.SkyException GET_rs232_error_msg(StructMsg.Pwd P,

int index);

VB.Net

Method

GET_rs232_error_msg(index As Integer) As

StructMsg.SkyException

Data

Structure

Structure name: SkyException

Variable names Type [in/out] Description

IsException bool out Check if there is any

error

ExceptionMsg string out Error message

ErrorCode int out Error code

Note

Support RS-232 Module

C# Sample StructMsg.Pwd _Pwd;

_Pwd.ConnectionKey = "123";

Precision Machinery Research Development Center - Intelligent technology department

142

StructMsg.SkyException R = iRemoting.GET_rs232_error(_Pwd,

0);

MessageBox.Show(R.ExceptionMsg +"\r\n" +

R.ErrorCode.ToString());

Precision Machinery Research Development Center - Intelligent technology department

143

XIX. PC Camera Module Class(USB)

1. CONNECT_cam: Connect to the camera

API Name CONNECT_cam

Description Connect to the camera.

C# Method short CONNECT_cam(StructMsg.Pwd P, StructMsg.Camera_Param R);

VB.Net

Method

Data

Structure

Structure name: Camera_Param

Variable

names

Type [in/out] Description

VideoDevice int in Camera Index

(Starting from 0)

VideoWidth int in Set Vedio Width

VideoHeight int in Set Vedio Height

Note ※ If you want set video width is default, the value is -1.

※ If you want set video height is default, the value is -1.

※ Once the connection gets established, CPU utilization will

increase.

Support USB PC Camera or USB Web Camera

C# Sample _Camera_Param.VideoDevice = 0;

_Camera_Param.VideoWidth = -1;

_Camera_Param.VideoHeight = -1;

StructMsg.Pwd _Pwd;

_Pwd.ConnectionKey = "123";

short ret = iRemoting.CONNECT_cam(_Pwd, _Camera_Param);

if (ret == 0)

MessageBox.Show("Success");

else

MessageBox.Show("Failed");

2. DISCONNECT_cam: Disconnect the camera

API Name DISCONNECT_cam

Description Disconnect the camera

C# Method void DISCONNECT_cam(StructMsg.Pwd P);

VB.Net

Method

Precision Machinery Research Development Center - Intelligent technology department

144

Data

Structure

Note

Support USB PC Camera or USB Web Camera

C# Sample StructMsg.Pwd _Pwd;

_Pwd.ConnectionKey = "123";

iRemoting.DISCONNECT_cam(_Pwd);

3. CHECK_cam_running: Check if the camera gets connected and ready to capture vedios

API Name CHECK_cam_running

Description Check if the camera gets connected and ready to capture vedios.

C# Method bool CHECK_cam_running(StructMsg.Pwd P);

VB.Net

Method

Data

Structure

Note

Support USB PC Camera or USB Web Camera

C# Sample StructMsg.Pwd _Pwd;

_Pwd.ConnectionKey = "123";

bool IsRunning = iRemoting.CHECK_cam_running();

if (IsRunning)

MessageBox.Show("The camera is capturing a vedio");

else

MessageBox.Show("The camera doesn’t get connected");

4. GET_cam_image: Get a image from the camera

API Name GET_cam_image

Description Get a image from the camera

C# Method short GET_cam_image(StructMsg.Pwd P, ref

StructMsg.Camera_Image R);

VB.Net

Method

Data

Structure

Structure name: Camera_Image

Variable name Type [in/out] Description

CamImage byte[] out Get the byte array of a

image

Note ※ The type of Vairable CamImage is Bitmap after transfering.

Precision Machinery Research Development Center - Intelligent technology department

145

Support USB PC Camera or USB Web Camera

C# Sample StructMsg.Camera_Image _Camera_Image;

StructMsg.Pwd _Pwd;

private void timer1_Tick(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_cam_image(_Pwd, ref

_Camera_Image);

if (ret == 0)

{

if (_Camera_Image.CamImage == null ||

_Camera_Image.CamImage.Length == 0) { return; }

//Image oImage = null;

Bitmap oBitmap = null;

using (MemoryStream oMemoryStream = new

MemoryStream(_Camera_Image.CamImage))

{

oMemoryStream.Position = 0;

oBitmap = new Bitmap(oMemoryStream);

//oBitmap =

System.Drawing.Bitmap.FromStream(oMemoryStream);

pictureBox1.Image = oBitmap;

}

}

}

5. GET_cam_error: Get exception error of the camera

API Name GET_cam_error

Description Get exception error of the camera

C# Method StructMsg.SkyException GET_cam_error(StructMsg.Pwd P);

VB.Net

Method

Data

Structure

Structure name: SkyException

Variable names Type [in/out] Description

IsException bool out Is exception or not

ExceptionMsg string out Error Message

ErrorCode int out Error Code

Note

Precision Machinery Research Development Center - Intelligent technology department

146

Support USB PC Camera or USB Web Camera

C# Sample StructMsg.Pwd _Pwd;

_Pwd.ConnectionKey = "123";

StructMsg.SkyException R = iRemoting.GET_cam_error(_Pwd);

MessageBox.Show(R.ExceptionMsg + "\r\n" +

R.ErrorCode.ToString());

Precision Machinery Research Development Center - Intelligent technology department

147

XX. SkyMars Professional Event Delegate

SkyMars Professional has built-in event-delegate structure, which can register applications

events to SkyMars Professional. When these events occur, the applications will get

notifications.

The application event delegate is using different thread, that you must create "delegate" to call

it. Prevent cross-threading issues.

You must create EventMsg class and make instance before event delegate.

Constructors public EventMsg(string IP, int Port);

Parameters IP

IP of SkyMars. If your application and SkyMars in same computer

that you write "localhost".

Port

Port of SkyMars. Default:9500.

Note: We recommend your application and SkyMars to same PC, Because have

maybe delivery failures.

The complete source code that you reference as follow:

private void Form1_Load(object sender, EventArgs e)

{

try

{

InterfaceLib.EventMsg eMsg = new InterfaceLib.EventMsg("localhost",

9500);

eMsg.EVENT_conn_cnc += new

InterfaceLib.dele_conn_cnc(eMsg_EVENT_conn_cnc);

eMsg.EVENT_conn_status += new

InterfaceLib.dele_conn_status(eMsg_EVENT_conn_status);

eMsg.EVENT_disconn_cnc += new

InterfaceLib.dele_disconn_cnc(eMsg_EVENT_disconn_cnc);

eMsg.EVENT_nc_filename += new

InterfaceLib.dele_nc_filename(eMsg_EVENT_nc_filename);

}

catch (Exception ex)

{

MessageBox.Show(ex.Message);

}

}

delegate void ShowDataDelegate(string info);

private void ShowData(string info)

{

textBox1.Text = info;

}

void eMsg_EVENT_conn_cnc(InterfaceLib.StructMsg.SkyConn_ip_port2 R)

{

Precision Machinery Research Development Center - Intelligent technology department

148

ShowDataDelegate _ShowDataDelegate = new ShowDataDelegate(ShowData);

this.BeginInvoke(_ShowDataDelegate, new object[] { R.MachineNo + "," +

R.MachineName + "," + R.Manufacturer });

}

void eMsg_EVENT_disconn_cnc(bool IsExitSkyMars)

{

if (IsExitSkyMars == false)

{

ShowDataDelegate _ShowDataDelegate = new ShowDataDelegate(ShowData);

this.BeginInvoke(_ShowDataDelegate, new object[] { "Power OFF of CNC" });

}

else

{

this.Close();

}

}

void eMsg_EVENT_conn_status(InterfaceLib.StructMsg.SkyConn_status2 R)

{

ShowDataDelegate _ShowDataDelegate = new ShowDataDelegate(ShowData);

this.BeginInvoke(_ShowDataDelegate, new object[] { R.MachineNo + "," +

R.Status });

}

void eMsg_EVENT_nc_filename(InterfaceLib.StructMsg.SkyNc_filename2 R)

{

ShowDataDelegate _ShowDataDelegate = new ShowDataDelegate(ShowData);

this.BeginInvoke(_ShowDataDelegate, new object[] { R.MachineNo + "," +

R.MainProg

+ ", " + R.SubProg });

}

1. EVENT_conn_cnc: Create an event happened after setting CNC info through SkyMars

Professional

API Name EVENT_conn_cnc

Description Create an event happened after setting CNC info through SkyMars

Professional.

C# Method event EventHandler_conn_cnc EVENT_conn_cnc;

VB.Net

Method

Data

Structure

Structure name: SkyConn_ip_port2

Variable Name Type [in/out] Description

MachineNo int out Machine Index

MachineName string out Machine Name

IP string out Machine IP

Port short out Machine Port

Manufacturer string out Machine Brand

PlugInPort int out Plug-In Port

Precision Machinery Research Development Center - Intelligent technology department

149

Note

Support All Controllers

C# Sample 1.Create event

Wrapper.Local_EVENT_conn_cnc += new

EventHandler_conn_cnc(Wrapper_EVENT_conn_cnc)

;

iEvent.EVENT_conn_cnc += new

EventHandler_conn_cnc(Wrapper.BC_conn_cnc);

2.Create Method

delegate void ShowDataDelegate(string info);

void Wrapper_EVENT_conn_cnc(StructMsg.SkyConn_ip_port2 R)

{

ShowDataDelegate _DisplayInfoDelegate = new

ShowDataDelegate(ShowData);

this.BeginInvoke(_DisplayInfoDelegate, new object[]

{ "Connection CNC" });

}

private void ShowData(string info)

{

richTextBox1.Text += info + "\r\n";

}

2. EVENT_disconn_cnc: Create an event when CNC is disconnected through SkyMars

Professional

API Name EVENT_disconn_cnc

Description Create an event when CNC is disconnected through SkyMars

Professional

C# Method event EventHandler_disconn_cnc EVENT_disconn_cnc;

VB.Net

Method

Data

Structure

Variable names Type [in/out] Description

IsExitSkyMars bool out Exit SkyMars or not

Note While exiting SkyMars, the event will be dispatched to an

application,and the value of IsExitSkyMars will be ture, which

can be used to exit the application.

Support All Controllers

C# Sample 1.Create event

Precision Machinery Research Development Center - Intelligent technology department

150

Wrapper.Local_EVENT_disconn_cnc += new

EventHandler_disconn_cnc(Wrapper_EVENT_disconn_c

nc);

iEvent.EVENT_disconn_cnc += new

EventHandler_disconn_cnc(Wrapper.BC_disconn_cnc)

;

2.Create Method

delegate void ShowDataDelegate(string info);

void Wrapper_EVENT_disconn_cnc(bool IsExitSkyMars)

{

ShowDataDelegate _DisplayInfoDelegate = new

ShowDataDelegate(ShowData);

this.BeginInvoke(_DisplayInfoDelegate, new object[]

{ "Disconnection CNC" });

}

private void ShowData(string info)

{

richTextBox1.Text += info + "\r\n";

}

3. EVENT_conn_status: Create an event of CNC status(OFF、RUN、IDLE、ALARM)

API Name EVENT_conn_status

Description Create an event of CNC status (OFF、RUN、IDLE、ALARM).

C# Method event EventHandler_conn_status EVENT_conn_status;

VB.Net

Method

Data

Structure

Structure name: SkyConn_status2

Variable names Type [in/out] Description

MachineNo int Out Machine Index

Status short Out 0:OFF 1:RUN 2:IDLE

3:Alarm

Note

Support All Controllers

C# Sample 1.Create event

Wrapper.Local_EVENT_conn_status += new

EventHandler_conn_status(Wrapper_EVENT_conn_statu

s);

iEvent.EVENT_conn_status += new

Precision Machinery Research Development Center - Intelligent technology department

151

EventHandler_conn_status(Wrapper.BC_conn_status);

2.Create Method

delegate void ShowDataDelegate(string info);

void Wrapper_EVENT_conn_status(StructMsg.SkyConn_status2 R)

{

ShowDataDelegate _DisplayInfoDelegate = new

ShowDataDelegate(ShowData);

string StatusName = "";

switch (R.Status)

{

case 0:

StatusName = "OFF";

break;

case 1:

StatusName = "RUN";

break;

case 2:

StatusName = "IDLE";

break;

case 3:

StatusName = "Alarm";

break;

}

this.BeginInvoke(_DisplayInfoDelegate, new object[]

{ StatusName });

}

private void ShowData(string info)

{

richTextBox1.Text += info + "\r\n";

}

4. EVENT_nc_filename: Create an event of CNC changing NC filename

API Name EVENT_nc_filename

Description Create an event of CNC changing NC filename.

C# Method event EventHandler_conn_status EVENT_conn_status;

VB.Net

Precision Machinery Research Development Center - Intelligent technology department

152

Method

Data

Structure

Structure name: SkyNc_filename

Variable

names

Type [in/out] Description

MachineNo int out Machine Index

MainProg string out Main Program Filename

SubProg string out Sub Program Filename

Note

Support All Controllers

C# Sample 1.Create event

Wrapper.Local_EVENT_nc_filename += new

EventHandler_nc_filename(Wrapper_EVENT_nc_filenam

e);

iEvent.EVENT_nc_filename += new

EventHandler_nc_filename(Wrapper.BC_nc_filename);

2.Create Method

delegate void ShowDataDelegate(string info);

void Wrapper_EVENT_nc_filename(StructMsg.SkyNc_filename2 R)

{

ShowDataDelegate _DisplayInfoDelegate = new

ShowDataDelegate(ShowData);

this.BeginInvoke(_DisplayInfoDelegate, new object[]

{ R.MainProg + ", " + R.SubProg });

}

private void ShowData(string info)

{

richTextBox1.Text += info + "\r\n";

}

Precision Machinery Research Development Center - Intelligent technology department

153

XXI. SkyMars Utilization Rate Data

1. GET_utilization_all_today: Get today’s utilization rate data

API Name GET_utilization_all_today

Description Get today’s utilization rate data

C# Method short GET_utilization_all_today(StructMsg.Pwd P, ref

StructMsg.Utilization_Today R)

VB.Net

Method

Data

Structure

Structure name: Utilization_Today

Variable

names

Type [in/out] Description

PartTotal int[] out Today’s total part count

CycleTotal int[] out Today’s total running

cycle count

BusyTotal double[] out Today’s total running

time(Unit:hour)

IdleTotal double[] out Today’s total idle

time(Unit:hour)

AlarmTotal double[] out Today’s total abnormal

time(Unit:hour)

OffTotal double[] out Today’s total shutdown

time(Unit:hour)

Note ※ Please connect Port 9501 to send and receive Utilization Rate

information.

※ BusyTotal contain Busy Time or BUSY&ALARM Time.

Support All Controller.

C# Sample StructMsg.Utilization_Today _Util_Today;

StructMsg.Pwd _Pwd;

private void button1_Click(object sender, EventArgs e)

{

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_utilization_all_today(_Pwd, ref

_Util_Today);

if (ret == 0)

{

txtMachineName.Text = _Util_Today.MachineName[0];

txtPartTotal.Text = _Util_Today.PartTotal[0].ToString();

txtCycleTotal.Text =

_Util_Today.CycleTotal[0].ToString();

Precision Machinery Research Development Center - Intelligent technology department

154

txtBusyTotal.Text = _Util_Today.BusyTotal[0].ToString();

txtIdleTotal.Text = _Util_Today.IdleTotal[0].ToString();

txtAlarmTotal.Text =

_Util_Today.AlarmTotal[0].ToString();

txtOffTotal.Text = _Util_Today.OffTotal[0].ToString();

}

}

2. GET_utilization_single_time: Get a single machine utilization rate data based on time

API Name GET_utilization_single_time

Description Get a single machine utilization rate data based on time

C# Method short GET_utilization_single_time(StructMsg.Pwd P, ref

StructMsg.Utilization R)

VB.Net

Method

Data

Structure

Structure name: Utilization

Variable

names

Type [in/out] Description

MachineName int in Machine Name

StDate DateTime in Start Date

EndDate DateTime in End Date

BusyTotal double out Total Running

Time(Unit:hour)

IdleTotal double out Total Idle

Time(Unit:hour)

AlarmTotal double out Total Abnormal

Time(Unit:hour)

OffTotal double out Total Shutdown

Time(Unit:hour)

Note ※ Please connect Port 9501 to send and receive Utilization Rate

information.

※ BusyTotal contain Busy Time or BUSY&ALARM Time。

※ If you want to search the same day, the variables "StDate"

and "EndDate" recommend to use the full date time, such as:

StDate: 2014/5/7 00:00:00.000

EndDate: 2014/5/7 23:59:59.999

Support All Controller.

C# Sample StructMsg.Utilization _Util;

StructMsg.Pwd _Pwd;

Precision Machinery Research Development Center - Intelligent technology department

155

private void button2_Click(object sender, EventArgs e)

{

_Util.MachineName = "Demo";

_Util.StDate = DateTime.Now;

_Util.EndDate = DateTime.Now;

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_utilization_single_time(_Pwd, ref

_Util);

if (ret == 0)

{

txtBusyTotal2.Text = _Util.BusyTotal.ToString();

txtIdleTotal2.Text = _Util.IdleTotal.ToString();

txtAlarmTotal2.Text = _Util.AlarmTotal.ToString();

txtOffTotal2.Text = _Util.OffTotal.ToString();

}

}

3. GET_utilization_single_total: Get a single machine utilization rate data based on total

running counts(part counts and cycle times)

API Name GET_utilization_single_total

Description Get a single machine utilization rate data based on total running

counts(part counts and cycle times)

C# Method short GET_utilization_single_total(StructMsg.Pwd P, ref

StructMsg.Utilization R)

VB.Net

Method

Data

Structure

Structure name: Utilization

Variable

names

Type [in/out] Description

MachineName int in Machine Name

StDate DateTime in Start Date

EndDate DateTime in End Date

PartTotal int out Total counts of Parts

CycleTotal int out Total running cycle times

Note ※ Please connect Port 9501 to send and receive Utilization Rate

information.

※ If you want to search the same day, the variables "StDate"

and "EndDate" recommend to use the full date time, such as:

Precision Machinery Research Development Center - Intelligent technology department

156

StDate: 2014/5/7 00:00:00.000

EndDate: 2014/5/7 23:59:59.999

Support All Controller.

C# Sample StructMsg.Utilization _Util;

StructMsg.Pwd _Pwd;

private void button3_Click(object sender, EventArgs e)

{

_Util.MachineName = "Demo";

_Util.StDate = DateTime.Now;

_Util.EndDate = DateTime.Now;

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_utilization_single_total(_Pwd, ref

_Util);

if (ret == 0)

{

txtPartTotal2.Text = _Util.PartTotal.ToString();

txtCycleTotal2.Text = _Util.CycleTotal.ToString();

}

}

4. GET_utilization_single_list: Get a single machine utilization rate historical data

API Name GET_utilization_single_list

Description Get a single machine utilization rate historical data

C# Method short GET_utilization_single_list(StructMsg.Pwd P, ref

StructMsg.Utilization_List R)

VB.Net

Method

Data

Structure

Structure name: Utilization_List

Variable

names

Type [in/out] Description

MachineName int In Machine Name

StDate DateTime In Start Time

EndDate DateTime In End Time

ListData string[][] out Historical Data

Note ※ Please connect Port 9501 to send and receive Utilization Rate

information.

※ ListData is two-dimension array(non-regular array), whose

indexes are identified as follows:

Precision Machinery Research Development Center - Intelligent technology department

157

ListData[][0]:Status (OFF, IDLE, ALARM, BUSY and

BUSY&ALARM)

ListData[][1]:Start Time

ListData[][2]:End Time

ListData[][3]:Total Time(End Time - Start Time)

ListData[][4]:Part counts

ListData[][5]:CNC Program Name

ListData[][6]:CNC Alarm Message

※ If you want to search the same day, the variables "StDate"

and "EndDate" recommend to use the full date time, such as:

StDate: 2014/5/7 00:00:00.000

EndDate: 2014/5/7 23:59:59.999

Support All Controller.

C# Sample StructMsg.Utilization_List _RList;

StructMsg.Pwd _Pwd;

private void button4_Click(object sender, EventArgs e)

{

_RList.MachineName = "Demo";

_RList.StDate = DateTime.Now.AddDays(-10);

_RList.EndDate = DateTime.Now;

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_utilization_single_list(_Pwd, ref

_RList);

if (ret == 0)

{

DataTable dt = new DataTable();

dt.Columns.Add("STATUS", Type.GetType("System.String"));

dt.Columns.Add("StTIME", Type.GetType("System.String"));

dt.Columns.Add("EndTIME",

Type.GetType("System.String"));

dt.Columns.Add("TotalTIME",

Type.GetType("System.String"));

dt.Columns.Add("PARTCOUNT",

Type.GetType("System.String"));

dt.Columns.Add("NCNAME", Type.GetType("System.String"));

for (int i = 0; i <= _RList.ListData.Length - 1; i++)

{

Precision Machinery Research Development Center - Intelligent technology department

158

DataRow dr = dt.NewRow();

dr[0] = _RList.ListData[i][0];

dr[1] = _RList.ListData[i][1];

dr[2] = _RList.ListData[i][2];

dr[3] = _RList.ListData[i][3];

dr[4] = _RList.ListData[i][4];

dr[5] = _RList.ListData[i][5];

dt.Rows.Add(dr);

}

dataGridView1.DataSource = dt;

}

}

5. GET_utilization_single_all: Get a single machine all utilization rate data

API Name GET_utilization_single_all

Description Get a single machine all utilization rate data.

C# Method short GET_utilization_single_all(StructMsg.Pwd P, ref

StructMsg.Utilization R , ref StructMsg.Utilization_List RList)

VB.Net

Method

Data

Structure

Structure name: Utilization

Variable

names

Type [in/out] Description

MachineName int in Machine Name

StDate DateTime in Start Date

EndDate DateTime in End Date

BusyTotal double out Total Running

Time(Unit:hour)

IdleTotal double out Total Idle

Time(Unit:hour)

AlarmTotal double out Total Abnormal

Time(Unit:hour)

OffTotal double out Total Shutdown

Time(Unit:hour)

PartTotal int out Total Part Counts

CycleTotal int out Total Running Cycle Times

Structure name: Utilization_List

Precision Machinery Research Development Center - Intelligent technology department

159

Variable

names

Type [in/out] Description

ListData string[][] out Historical Data

Note ※ Please connect Port 9501 to send and receive Utilization Rate

information.

※ ListData is two-dimension array, whose indexes are identified

as follows:

ListData[][0]:Status (OFF, IDLE, ALARM, BUSY and

BUSY&ALARM)

ListData[][1]:Start Time

ListData[][2]:End Time

ListData[][3]:Total Time(End Time – Start Time)

ListData[][4]:Part Counts

ListData[][5]:NC Program Name

ListData[][6]:CNC Alarm Message

※ Please connect Port 9501 to send and receive Utilization Rate

information.

Support All Controller.

C# Sample StructMsg.Utilization _Util;

StructMsg.Utilization_List _RList;

StructMsg.Pwd _Pwd;

private void button5_Click(object sender, EventArgs e)

{

_Util.MachineName = "Demo";

_Util.StDate = DateTime.Now.AddDays(-10);

_Util.EndDate = DateTime.Now;

_Pwd.ConnectionKey = "123";

short ret = iRemoting.GET_utilization_single_all(_Pwd, ref

_Util, ref _RList);

if (ret == 0)

{

txtBusyTotal2.Text = _Util.BusyTotal.ToString();

txtIdleTotal2.Text = _Util.IdleTotal.ToString();

txtAlarmTotal2.Text = _Util.AlarmTotal.ToString();

txtOffTotal2.Text = _Util.OffTotal.ToString();

txtPartTotal2.Text = _Util.PartTotal.ToString();

txtCycleTotal2.Text = _Util.CycleTotal.ToString();

Precision Machinery Research Development Center - Intelligent technology department

160

//History Data:

DataTable dt = new DataTable();

dt.Columns.Add("STATUS", Type.GetType("System.String"));

dt.Columns.Add("StTIME", Type.GetType("System.String"));

dt.Columns.Add("EndTIME",

Type.GetType("System.String"));

dt.Columns.Add("TotalTIME",

Type.GetType("System.String"));

dt.Columns.Add("PARTCOUNT",

Type.GetType("System.String"));

dt.Columns.Add("NCNAME", Type.GetType("System.String"));

for (int i = 0; i <= _RList.ListData.Length - 1; i++)

{

DataRow dr = dt.NewRow();

dr[0] = _RList.ListData[i][0];

dr[1] = _RList.ListData[i][1];

dr[2] = _RList.ListData[i][2];

dr[3] = _RList.ListData[i][3];

dr[4] = _RList.ListData[i][4];

dr[5] = _RList.ListData[i][5];

dt.Rows.Add(dr);

}

dataGridView1.DataSource = dt;

}

}

Precision Machinery Research Development Center - Intelligent technology department

161

XXII. The Function of SkyMars Maintenance Management

1. GET_maint_count: Get maintenance management total count

API Name GET_maint_count

Description Get maintenance management total count.

C# Method short GET_maint_count(StructMsg.Pwd P, ref

StructMsg.total_count R)

VB.Net

Method

Data

Structure

Structure name: total_count

Variable

names

Type [in/out] Description

Count short out Total count.

Note ※ Please connect Port 9501 to send and receive Maintenance

information.

Support All Controller.

C# Sample StructMsg.Pwd _Pwd;

StructMsg.total_count _total_count;

private void button1_Click(object sender, EventArgs e)

{

short ret = iRemoting.GET_maint_count(_Pwd, ref

_total_count);

MessageBox.Show(_total_count.Count.ToString());

}

2. GET_maint_title: Get maintenance management title

API Name GET_maint_title

Description Get maintenance management title.

C# Method short GET_maint_title(StructMsg.Pwd P, ref

StructMsg.Maint_Title R)

VB.Net

Method

Data

Structure

Structure name: Maint_Title

Variable

names

Type [in/out] Description

Title string[] out Title.

Note ※ Please connect Port 9501 to send and receive Maintenance

information.

Support All Controller.

C# Sample StructMsg.Pwd _Pwd;

Precision Machinery Research Development Center - Intelligent technology department

162

StructMsg.Maint_Title _Maint_Title;

private void button1_Click(object sender, EventArgs e)

{

short ret = iRemoting.GET_maint_title(_Pwd, ref

_Maint_Title);

for (int i = 0; i <= _Maint_Title.Title.Length - 1; i++)

MessageBox.Show(_Maint_Title.Title[i]);

}

3. GET_maint_all: Get maintenance management all data

API Name GET_maint_all

Description Get maintenance management all data.

C# Method short GET_maint_all(StructMsg.Pwd P, ref StructMsg.Maint_All

R)

VB.Net

Method

Data

Structure

Structure name: Maint_All

Variable

names

Type [in/out] Description

ItemName string[] out Item name.

UseTime double[] out Use time.

LifeTime double[] out Life time.

PlcNode string[] out PLC node. If this not use,

not input.

Spec string[] out Specification.

Supplier string[] out Supplier.

Contact string[] out Contact.

Telephone string[] out Telephone.

Note ※ Please connect Port 9501 to send and receive Maintenance

information.

Support All Controller.

C# Sample StructMsg.Pwd _Pwd;

StructMsg.Maint_All _Maint_All;

private void LoadMaintData()

{

short ret = iRemoting.GET_maint_all(_Pwd, ref _Maint_All);

for (int i = 0; i <= _Maint_All.ItemName.Length - 1; i++)

{

DataRow dr = dtMain.NewRow();

Precision Machinery Research Development Center - Intelligent technology department

163

dr["ColStatus"] = Math.Round(_Maint_All.UseTime[i] /

_Maint_All.LifeTime[i] * 100, 3) + "%";

dr["ColItem"] = _Maint_All.ItemName[i];

dr["ColUseTime"] = Math.Round(_Maint_All.UseTime[i],

3);

dr["ColLiftTime"] =

Math.Round(_Maint_All.LifeTime[i], 3);

dr["ColPlc"] = _Maint_All.PlcNode[i];

dr["ColSpec"] = _Maint_All.Spec[i];

dr["ColMan"] = _Maint_All.Supplier[i];

dr["ColContact"] = _Maint_All.Contact[i];

dr["ColTel"] = _Maint_All.Telephone[i];

dtMain.Rows.Add(dr);

}

}

4. GET_maint_all_time: Get maintenance management all time (use time and life time)

API Name GET_maint_all_time

Description Get maintenance management all time (use time and life time).

C# Method short GET_maint_all_time(StructMsg.Pwd P, ref

StructMsg.Maint_All_Time R)

VB.Net

Method

Data

Structure

Structure name: Maint_All_Time

Variable

names

Type [in/out] Description

ItemName string[] out Item name.

UseTime double[] out Use time.

LifeTime double[] out Life time.

Note ※ Please connect Port 9501 to send and receive Maintenance

information.

Support All Controller.

C# Sample StructMsg.Pwd _Pwd;

StructMsg.Maint_All_Time _Maint_All_Time;

private void button1_Click(object sender, EventArgs e)

{

short ret = iRemoting.GET_maint_all_time(_Pwd, ref

_Maint_All_Time);

if (ret == 0)

Precision Machinery Research Development Center - Intelligent technology department

164

{

for (int i = 0; i <= dtMain.Rows.Count - 1; i++)

{

dtMain.Rows[i]["ColUseTime"] =

_Maint_All_Time.UseTime[i];

dtMain.Rows[i]["ColLiftTime"] =

_Maint_All_Time.LifeTime[i];

}

}

}

5. GET_maint_single: Get single maintenance management data

API Name GET_maint_single

Description Get single maintenance management data.

C# Method short GET_maint_single(StructMsg.Pwd P, ref

StructMsg.Maint_Single R)

VB.Net

Method

Data

Structure

Structure name: Maint_Single

Variable

names

Type [in/out] Description

ItemName string in Item name.

UseTime double out Use time.

LifeTime double out Life time.

PlcNode string out PLC node. If this not use,

not input.

Spec string out Specification.

Supplier string out Supplier.

Contact string out Contact.

Telephone string out Telephone.

Note ※ Please connect Port 9501 to send and receive Maintenance

information.

Support All Controller.

C# Sample StructMsg.Pwd _Pwd;

StructMsg.Maint_Single _Maint_Single;

private void button1_Click(object sender, EventArgs e)

{

_Maint_Single.ItemName = "Oil";

short ret = iRemoting.GET_maint_single(_Pwd, ref

Precision Machinery Research Development Center - Intelligent technology department

165

_Maint_Single);

if (ret == 0)

{

//...

}

}

6. GET_maint_single_time: Get single maintenance management time data (use time and

life time)

API Name GET_maint_single_time

Description Get single maintenance management time data (use time and life

time).

C# Method short GET_maint_single_time(StructMsg.Pwd P, ref

StructMsg.Maint_Single_Time R)

VB.Net

Method

Data

Structure

Structure name: Maint_Single_Time

Variable

names

Type [in/out] Description

ItemName string in Item name.

UseTime double out Use time.

LifeTime double out Life time.

Note ※ Please connect Port 9501 to send and receive Maintenance

information.

Support All Controller.

C# Sample StructMsg.Pwd _Pwd;

StructMsg.Maint_Single_Time _Maint_Single_Time;

private void button1_Click(object sender, EventArgs e)

{

_Maint_Single.ItemName = "Oil";

short ret = iRemoting.GET_maint_single_time(_Pwd, ref

_Maint_Single_Time);

if (ret == 0)

{

//...

}

}

7. ADD_maint_single: Add single maintenance management data

Precision Machinery Research Development Center - Intelligent technology department

166

API Name ADD_maint_single

Description Add maintenance management data.

C# Method short ADD_maint_single(StructMsg.Pwd P,

StructMsg.Maint_Single R)

VB.Net

Method

Data

Structure

Structure name: Maint_Single_Time

Variable

names

Type [in/out] Description

ItemName string in Item name.

UseTime double in Use time.

LifeTime double in Life time.

PlcNode string in PLC node. If this not use,

not input.

Spec string in Specification.

Supplier string in Supplier.

Contact string in Contact.

Telephone string in Telephone.

Note ※ Please connect Port 9501 to send and receive Maintenance

information.

Support All Controller.

C# Sample StructMsg.Pwd _Pwd;

StructMsg.Maint_Single _Maint_Single;

private void button1_Click(object sender, EventArgs e)

{

_Maint_Single.ItemName =

dt.Rows[i]["ColItem"].ToString();

_Maint_Single.UseTime = (double)dt.Rows[i]["ColUseTime"];

_Maint_Single.LifeTime =

(double)dt.Rows[i]["ColLiftTime"];

_Maint_Single.PlcNode = dt.Rows[i]["ColPlc"].ToString();

_Maint_Single.Spec = dt.Rows[i]["ColSpec"].ToString();

_Maint_Single.Supplier = dt.Rows[i]["ColMan"].ToString();

_Maint_Single.Contact =

dt.Rows[i]["ColContact"].ToString();

_Maint_Single.Telephone =

dt.Rows[i]["ColTel"].ToString();

ret = iRemoting.ADD_maint_single(_Pwd, _Maint_Single);

Precision Machinery Research Development Center - Intelligent technology department

167

if (ret != 0)

{

MessageBox.Show("Write faild!");

break;

}

}

8. SET_maint_single: Modify single maintenance management data

API Name SET_maint_single

Description Modify maintenance management data.

C# Method short SET_maint_single(StructMsg.Pwd P,

StructMsg.Maint_Single R)

VB.Net

Method

Data

Structure

Structure name: Maint_Single_Time

Variable names Type [in/out] Description

Original_ItemName string in Item name (Original).

ItemName string in Item name.

UseTime double in Use time.

LifeTime double in Life time.

PlcNode string in PLC node. If this not

use, not input.

Spec string in Specification.

Supplier string in Supplier.

Contact string in Contact.

Telephone string in Telephone.

Note ※ Please connect Port 9501 to send and receive Maintenance

information.

Support All Controller.

C# Sample StructMsg.Pwd _Pwd;

StructMsg.Maint_Single _Maint_Single;

private void button1_Click(object sender, EventArgs e)

{

_Maint_Single.Original_ItemName = dt.Rows[i]["ColItem",

DataRowVersion.Original].ToString();

_Maint_Single.ItemName =

dt.Rows[i]["ColItem"].ToString();

_Maint_Single.LifeTime =

(double)dt.Rows[i]["ColLiftTime"];

Precision Machinery Research Development Center - Intelligent technology department

168

_Maint_Single.PlcNode = dt.Rows[i]["ColPlc"].ToString();

_Maint_Single.Spec = dt.Rows[i]["ColSpec"].ToString();

_Maint_Single.Supplier = dt.Rows[i]["ColMan"].ToString();

_Maint_Single.Contact =

dt.Rows[i]["ColContact"].ToString();

_Maint_Single.Telephone =

dt.Rows[i]["ColTel"].ToString();

ret = iRemoting.SET_maint_single(_Pwd, _Maint_Single);

if (ret != 0)

{

MessageBox.Show("Write failed!");

break;

}

}

9. DEL_maint_single: Delete single maintenance management data

API Name DEL_maint_single

Description Delete maintenance management data.

C# Method short DEL_maint_single(StructMsg.Pwd P,

StructMsg.Maint_ItemName R)

VB.Net

Method

Data

Structure

Structure name: Maint_ItemName

Variable names Type [in/out] Description

Name string in Item name.

Note ※ Please connect Port 9501 to send and receive Maintenance

information.

Support All Controller.

C# Sample StructMsg.Pwd _Pwd;

StructMsg.Maint_ItemName _Maint_ItemName;

private void button1_Click(object sender, EventArgs e)

{

_Maint_ItemName.Name = dt.Rows[i]["ColItem",

DataRowVersion.Original].ToString();

ret = iRemoting.DEL_maint_single(_Pwd, _Maint_ItemName);

if (ret != 0)

{

MessageBox.Show("Delete failed!");

Precision Machinery Research Development Center - Intelligent technology department

169

break;

}

}

10. SET_maint_single_usetime: Modify single maintenance management use time

API Name SET_maint_single_usetime

Description Modify single maintenance management use time.

C# Method short SET_maint_single_usetime(StructMsg.Pwd P,

StructMsg.Maint_Single_UseTime R)

VB.Net

Method

Data

Structure

Structure name: Maint_Single_UseTime

Variable names Type [in/out] Description

ItemName string in Item name.

UseTime double in Use time.

Note ※ Please connect Port 9501 to send and receive Maintenance

information.

Support All Controller.

C# Sample StructMsg.Pwd _Pwd;

StructMsg.Maint_Single_UseTime _Maint_Single_UseTime;

private void button1_Click(object sender, EventArgs e)

{

_Maint_Single_UseTime.ItemName = "Oil";

_Maint_Single_UseTime.UseTime = 10;

short ret = iRemoting.SET_maint_single_usetime(_Pwd,

_Maint_Single_UseTime);

}

11. SET_maint_single_zero: Reset single maintenance management use time

API Name SET_maint_single_zero

Description Reset single maintenance management use time.

C# Method short SET_maint_single_zero(StructMsg.Pwd P,

StructMsg.Maint_ItemName R)

VB.Net

Method

Data

Structure

Structure name: Maint_ItemName

Variable names Type [in/out] Description

Name string in Item name.

Note ※ Please connect Port 9501 to send and receive Maintenance

Precision Machinery Research Development Center - Intelligent technology department

170

information.

Support All Controller.

C# Sample StructMsg.Pwd _Pwd;

StructMsg.Maint_ItemName _Maint_ItemName;

private void button1_Click(object sender, EventArgs e)

{

_Maint_ItemName.Name =

dgvMain.Rows[e.RowIndex].Cells["ColItem"].Value.ToStri

ng();

short ret = iRemoting.SET_maint_single_zero(_Pwd,

_Maint_ItemName);

if (ret != 0)

MessageBox.Show("Reset failed!");

}

Precision Machinery Research Development Center - Intelligent technology department

171

XXIII. The Function of SkyMars Tool Management

1. GET_toolmanage_count: Get tool management total count

API Name GET_toolmanage_count

Description Get tool management total count.

C# Method short GET_toolmanage_count(StructMsg.Pwd P, ref

StructMsg.total_count R)

VB.Net

Method

Data

Structure

Structure name: total_count

Variable

names

Type [in/out] Description

Count short out Total count.

Note ※ Please connect Port 9501 to send and receive Tool Management

information.

Support All Controller.

C# Sample StructMsg.Pwd _Pwd;

StructMsg.total_count _total_count;

private void button1_Click(object sender, EventArgs e)

{

short ret = iRemoting.GET_toolmanage_count(_Pwd, ref

_total_count);

MessageBox.Show(_total_count.Count.ToString());

}

2. GET_toolmanage_title2: Get tool management title

API Name GET_toolmanage_title2

Description Get tool management title.

C# Method short GET_toolmanage_title2(StructMsg.Pwd P, ref

StructMsg.Toolmanage_Title R)

VB.Net

Method

Data

Structure

Structure name: total_count

Variable

names

Type [in/out] Description

Title string[] out Title.

Note ※ Please connect Port 9501 to send and receive Tool Management

information.

Title variable array:

[0] = "ToolNo";

Precision Machinery Research Development Center - Intelligent technology department

172

[1] = "ToolType";

[2] = "CycleTime";

[3] = "LifeTime";

[4] = "PartCount";

[5] = "LifePartCount";

[6] = "FeedRate";

[7] = "SpindleSpeed";

[8] = "WorkMaterial";

[9] = "ToolMaterial";

[10] = "Diameter";

[11] = "ToolLength";

[12] = "Supplier";

[13] = "Contact";

[14] = "Telephone";

Support All Controller.

C# Sample StructMsg.Pwd _Pwd;

StructMsg.Toolmanage_Title _Toolmanage_Title;

private void button1_Click(object sender, EventArgs e)

{

short ret = iRemoting.GET_toolmanage_title2(_Pwd, ref

_Toolmanage_Title);

for (int i = 0; i <= _Toolmanage_Title.Title.Length - 1; i++)

MessageBox.Show(_Toolmanage_Title.Title[i]);

}

3. GET_toolmanage_all2: Get all tool management data

API Name GET_toolmanage_all2

Description Get all tool management data.

C# Method short GET_toolmanage_all2(StructMsg.Pwd P, ref

StructMsg.Toolmanage_Single2[] R);

VB.Net

Method

Data

Structure

Structure name: Toolmanage_Single2

Variable names Type [in/out] Description

ToolNo int out Tool number.

ToolType string out Tool type.

CycleTime double out Cycle time.

LifeTime double out Life time.

PartCount int out Part count (Used).

Precision Machinery Research Development Center - Intelligent technology department

173

LifePartCount int out Part count (Life).

FeedRate int out Feed Rate.

SpindleSpeed int out Spindle speed.

WorkMaterial string out Work material.

ToolMaterial string out Tool material.

Diameter double out Tool Diameter.

ToolLength double out Tool length.

Supplier string out Supplier.

Contact string out Contact.

Telephone string out Telephone.

Note ※ Please connect Port 9501 to send and receive Tool Management

information.

Support All Controller.

C# Sample StructMsg.Pwd _Pwd;

StructMsg.Toolmanage_Single2[] _AllData;

private void button1_Click(object sender, EventArgs e)

{

ret = iRemoting.GET_toolmanage_all2(_Pwd, ref _AllData);

if (ret == 0)

{

for (int i = 0; i <= _AllData.Length - 1; i++)

{

...

}

}

}

4. GET_toolmanage_all_execute: Get all tool management cycle time, life time, part count

and life part count data

API Name GET_toolmanage_all_execute

Description Get all tool management cycle time, life time, part count and

life part count data.

C# Method short GET_toolmanage_all_execute(StructMsg.Pwd P, ref

StructMsg.Toolmanage_Single_Execute[] R);

VB.Net

Method

Data

Structure

Structure name: Toolmanage_Single_Execute

Variable names Type [in/out] Description

ToolNo int out Tool number.

Precision Machinery Research Development Center - Intelligent technology department

174

ToolType string out Tool type.

CycleTime double out Cycle time.

LifeTime double out Life time.

PartCount int out Part count (Used).

LifePartCount int out Part count (Life).

Note ※ Please connect Port 9501 to send and receive Tool Management

information.

Support All Controller.

C# Sample StructMsg.Pwd _Pwd;

StructMsg.Toolmanage_Single_Execute[] _AllExecute;

private void button1_Click(object sender, EventArgs e)

{

short ret = iRemoting.GET_toolmanage_all_execute(_Pwd, ref

_AllExecute);

if (ret == 0)

{

...

}

}

5. GET_toolmanage_single2: Get single tool management data

API Name GET_toolmanage_single2

Description Get single tool management data.

C# Method short GET_toolmanage_single2(StructMsg.Pwd P, ref

StructMsg.Toolmanage_Single2 R);

VB.Net

Method

Data

Structure

Structure name: Toolmanage_Single2

Variable names Type [in/out] Description

ToolNo int in Tool number.

ToolType string out Tool type.

CycleTime double out Cycle time.

LifeTime double out Life time.

PartCount int out Part count (Used).

LifePartCount int out Part count (Life).

FeedRate int out Feed Rate.

SpindleSpeed int out Spindle speed.

WorkMaterial string out Work material.

ToolMaterial string out Tool material.

Precision Machinery Research Development Center - Intelligent technology department

175

Diameter double out Tool Diameter.

ToolLength double out Tool length.

Supplier string out Supplier.

Contact string out Contact.

Telephone string out Telephone.

Note ※ Please connect Port 9501 to send and receive Tool Management

information.

Support All Controller.

C# Sample StructMsg.Pwd _Pwd;

StructMsg.Toolmanage_Single2 _Single;

private void button1_Click(object sender, EventArgs e)

{

_Single.ToolNo = int.Parse(textBox1.Text);

short ret = iRemoting.GET_toolmanage_single2(_Pwd, ref

_Single);

if (ret == 0)

{

...

}

}

6. GET_toolmanage_single_execute: Get single tool management cycle time, life time, part

count and life part count data

API Name GET_toolmanage_singe_execute

Description Get single tool management cycle time, life time, part count

and life part count data.

C# Method short GET_toolmanage_single_execute(StructMsg.Pwd P, ref

StructMsg.Toolmanage_Single_Execute R);

VB.Net

Method

Data

Structure

Structure name: Toolmanage_Single_Execute

Variable names Type [in/out] Description

ToolNo int in Tool number.

ToolType string out Tool type.

CycleTime double out Cycle time.

LifeTime double out Life time.

PartCount int out Part count (Used).

LifePartCount int out Part count (Life).

Note ※ Please connect Port 9501 to send and receive Tool Management

Precision Machinery Research Development Center - Intelligent technology department

176

information.

Support All Controller.

C# Sample StructMsg.Pwd _Pwd;

StructMsg.Toolmanage_Single_Execute _Execute;

private void button1_Click(object sender, EventArgs e)

{

_Execute.ToolNo = int.Parse(textBox1.Text);

short ret = iRemoting.GET_toolmanage_single_execute(_Pwd,

ref

_Execute);

if (ret == 0)

{

...

}

}

7. ADD_toolmanage_single2: Add single tool management data

API Name ADD_toolmanage_singe2

Description Add single tool management data.

C# Method short ADD_toolmanage_single2(StructMsg.Pwd P,

StructMsg.Toolmanage_Single2 R);

VB.Net

Method

Data

Structure

Structure name: Toolmanage_Single2

Variable names Type [in/out] Description

ToolNo int in Tool number.

ToolType string in Tool type.

CycleTime double in Cycle time.

LifeTime double in Life time.

PartCount int in Part count (Used).

LifePartCount int in Part count (Life).

FeedRate int in Feed Rate.

SpindleSpeed int in Spindle speed.

WorkMaterial string in Work material.

ToolMaterial string in Tool material.

Diameter double in Tool Diameter.

ToolLength double in Tool length.

Supplier string in Supplier.

Contact string in Contact.

Precision Machinery Research Development Center - Intelligent technology department

177

Telephone string in Telephone.

Note ※ Please connect Port 9501 to send and receive Tool Management

information.

Support All Controller.

C# Sample StructMsg.Pwd _Pwd;

StructMsg.Toolmanage_Single2 _Single;

private void button1_Click(object sender, EventArgs e)

{

_Single.ToolNo = 2;

_Single.ToolType = "TEST";

_Single.CycleTime = 0;

_Single.LifeTime = 100;

_Single.PartCount = 0;

_Single.LifePartCount = 10;

_Single.FeedRate = 1000;

_Single.SpindleSpeed = 1000;

_Single.WorkMaterial = "TEST";

_Single.ToolMaterial = "TEST";

_Single.Diameter = 10;

_Single.ToolLength = 10;

_Single.Supplier = "TEST";

_Single.Contact = "XXX";

_Single.Telephone = "04-23599009";

short ret = iRemoting.ADD_toolmanage_single2(_Pwd,

_Single);

MessageBox.Show(ret.ToString());

}

8. SET_toolmanage_single2: Modify single tool management data

API Name SET_toolmanage_singe2

Description Modify single tool management data.

C# Method short SET_toolmanage_single2(StructMsg.Pwd P,

StructMsg.Toolmanage_Single2 R);

VB.Net

Method

Data

Structure

Structure name: Toolmanage_Single2

Variable names Type [in/out] Description

Original_ToolNo int in Tool number

Precision Machinery Research Development Center - Intelligent technology department

178

(Original).

ToolNo int in Tool number.

ToolType string in Tool type.

LifeTime double in Life time.

LifePartCount int in Part count (Life).

FeedRate int in Feed Rate.

SpindleSpeed int in Spindle speed.

WorkMaterial string in Work material.

ToolMaterial string in Tool material.

Diameter double in Tool Diameter.

ToolLength double in Tool length.

Supplier string in Supplier.

Contact string in Contact.

Telephone string in Telephone.

Note ※ Please connect Port 9501 to send and receive Tool Management

information.

Support All Controller.

C# Sample StructMsg.Pwd _Pwd;

StructMsg.Toolmanage_Single2 _Single;

private void button1_Click(object sender, EventArgs e)

{

_Single.Original_ToolNo = 2;

_Single.ToolNo = 2;

_Single.ToolType = "TEST";

_Single.LifeTime = 200;

_Single.LifePartCount = 20;

_Single.FeedRate = 1000;

_Single.SpindleSpeed = 1000;

_Single.WorkMaterial = "TEST";

_Single.ToolMaterial = "TEST";

_Single.Diameter = 10;

_Single.ToolLength = 10;

_Single.Supplier = "TEST";

_Single.Contact = "XXX";

_Single.Telephone = "04-23599009";

short ret = iRemoting.SET_toolmanage_single2(_Pwd,

_Single);

MessageBox.Show(ret.ToString());

Precision Machinery Research Development Center - Intelligent technology department

179

}

9. DEL_toolmanage_single: Delete single tool management data

API Name DEL_toolmanage_single

Description Delete single tool management data.

C# Method short DEL_toolmanage_single(StructMsg.Pwd P,

StructMsg.Toolmanage_ToolNo R)

VB.Net

Method

Data

Structure

Structure name: Toolmanage_ToolNo

Variable names Type [in/out] Description

No int in Tool number.

Note ※ Please connect Port 9501 to send and receive Tool Management

information.

Support All Controller.

C# Sample StructMsg.Pwd _Pwd;

StructMsg.Toolmanage_ToolNo _Toolmanage_ToolNo;

private void button1_Click(object sender, EventArgs e)

{

_Toolmanage_ToolNo.No = 1;

ret = iRemoting.DEL_toolmanage_single(_Pwd,

_Toolmanage_ToolNo

);

if (ret != 0)

{

MessageBox.Show("Delete failed!");

}

}

10. SET_toolmanage_single_cycletime: Set single tool management cycle time

API Name SET_toolmanage_single_cycletime

Description Set single tool management cycle time.

C# Method short SET_toolmanage_single_cycletime(StructMsg.Pwd P,

StructMsg.Toolmanage_Single_CycleTime R)

VB.Net

Method

Data

Structure

Structure name: Toolmanage_Single_CycleTime

Variable names Type [in/out] Description

ToolNo int in Tool number.

Precision Machinery Research Development Center - Intelligent technology department

180

CycleTime Double in Cycle time.

Note ※ Please connect Port 9501 to send and receive Tool Management

information.

Support All Controller.

C# Sample StructMsg.Pwd _Pwd;

StructMsg.Toolmanage_Single_CycleTime

_Toolmanage_Single_CycleTime;

private void button1_Click(object sender, EventArgs e)

{

_Toolmanage_Single_CycleTime.ToolNo = 1;

short ret =

iRemoting.SET_toolmanage_single_cycletime(_Pwd,

_Toolmanage_Single_CycleTime);

if (ret != 0)

{

MessageBox.Show("Set failed!");

}

}

11. SET_toolmanage_single_partcount: Set single tool management part count

API Name SET_toolmanage_single_partcount

Description Set single tool management part count.

C# Method short SET_toolmanage_single_partcount(StructMsg.Pwd P,

StructMsg.Toolmanage_Single_PartCount R);

VB.Net

Method

Data

Structure

Structure name: Toolmanage_Single_CycleTime

Variable names Type [in/out] Description

ToolNo int in Tool number.

PartCount int in Part count.

Note ※ Please connect Port 9501 to send and receive Tool Management

information.

Support All Controller.

C# Sample StructMsg.Pwd _Pwd;

StructMsg.Toolmanage_Single_PartCount _PartCount;

private void button1_Click(object sender, EventArgs e)

{

_PartCount.ToolNo = 2;

_PartCount.PartCount = 30;

Precision Machinery Research Development Center - Intelligent technology department

181

short ret =

iRemoting.SET_toolmanage_single_partcount(_Pwd,

_PartCount);

MessageBox.Show(ret.ToString());

}

12. SET_toolmanage_single_zero: Reset for single tool management cycle time

API Name SET_toolmanage_single_zero

Description Reset for single tool management cycle time.

C# Method short SET_toolmanage_single_partcount(StructMsg.Pwd P,

StructMsg.Toolmanage_Single_PartCount R);

VB.Net

Method

Data

Structure

Structure name: Toolmanage_Single_PartCount

Variable names Type [in/out] Description

No int in Tool number.

Note ※ Please connect Port 9501 to send and receive Tool Management

information.

Support All Controller.

C# Sample StructMsg.Pwd _Pwd;

StructMsg.Toolmanage_ToolNo _Toolmanage_ToolNo;

private void button1_Click(object sender, EventArgs e)

{

_Toolmanage_ToolNo.No = 1;

short ret = iRemoting.SET_toolmanage_single_zero(_Pwd,

_Toolmanage_ToolNo);

}

13. SET_toolmanage_single_zero_partcount: Reset single tool management part count

API Name SET_toolmanage_single_zero_partcount

Description Reset single tool management part count.

C# Method short SET_toolmanage_single_zero_partcount(StructMsg.Pwd P,

StructMsg.Toolmanage_ToolNo R);

VB.Net

Method

Data

Structure

Structure name: Toolmanage_ToolNo

Variable names Type [in/out] Description

No int in Tool number.

Note ※ Please connect Port 9501 to send and receive Tool Management

Precision Machinery Research Development Center - Intelligent technology department

182

information.

Support All Controller.

C# Sample StructMsg.Pwd _Pwd;

StructMsg.Toolmanage_ToolNo _ToolNo;

private void button1_Click(object sender, EventArgs e)

{

_ToolNo.No = 2;

short ret = iRemoting.SET_toolmanage_single_zero(_Pwd,

_ToolNo);

MessageBox.Show(ret.ToString());

}

Precision Machinery Research Development Center - Intelligent technology department

183

XXIV. SkyMars APP Piracy-Proof Method

SkyMars Professional has two kinds of Piracy-proof method, allowing programmers to select

the most appropriate one on demand. The costs and strengths on different levels of piracy

proof methods are altered; therefore, we should understand them in order to decide the most

suitable protection method for our applications.

It is necessary to run SkyMars with a USB Key, which is an USB lock and can’t be copied or

rewrote. Information saved in the USB Key contains ID and maximum of machines allowed to

be connecting. These data can be gotten by using SKY_version API. ID of each key is

identified. Developers can use ID to validate and control permission.

Two kinds of Piracy-proof method are as followed:

1. Validated by USB Key ID

Because each USB KEY ID is identified, developers can get it in advance and put it into

your codes or database (need to be encoded). When an application starts running, ID can

be retrieved by using SKY_version API and be checked with validation, and then this

application can continue running.

2. Pass USB Key ID back and produce another serial number

At first time running an application, USB Key ID can be retrieved by calling SKY_version

API and pass ID and user info to developers. Developers can use e-mail or registration

server to verify these data. If it is verified, another serial number (using custom encoding

rules or encryption algorithms) will be created and passed back to users. Users need to

input this serial number to the application, and the application will confirm the number

with USB Key ID and decide to keep or stop running.

Application

(App.)

Get the serial

number (SN)

SkyMars API

Validated

SN

Checking and

execute App.

App.

Get the serial

number (SN)

SkyMars API

Developer

Company

ID Create another new

SN

User Input SN

Precision Machinery Research Development Center - Intelligent technology department

184

XXV. Question & Answer

1. Question: Your application call using SkyMars API (InterfaceLib.dll) when the error

message is "Cannot resolve the invocation to the correct method."

Answer: You current using InterfaceLib is old, please you replace new InterfaceLib.dll.