0% found this document useful (0 votes)
357 views28 pages

Raybox Interface Documents V1.3

The document describes an API interface for a machine application. It provides details on: 1. The required parameters in the request header, including token, timestamp, and sign, and how the sign is generated; 2. How to get the token and secret; and 3. Several example API calls for getting machine and application lists, details and statuses.

Uploaded by

maintenance
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
357 views28 pages

Raybox Interface Documents V1.3

The document describes an API interface for a machine application. It provides details on: 1. The required parameters in the request header, including token, timestamp, and sign, and how the sign is generated; 2. How to get the token and secret; and 3. Several example API calls for getting machine and application lists, details and statuses.

Uploaded by

maintenance
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

API Interface Steps

1. Parameter Description
2. How to get token and secret
3. Configuring token permissions
4. sign generation rules
5. Example Tests
Software Version Support
API Interface Category
About Machine Application Interface
About Task Class Interface
About the Statistics Interface
Machine Application Interface
1.1 Get Machine List
1.2 Get Application list
1.3 Get machine details
1.4 Get application details
1.5 Get machine status(part)
1.6 Get machine status(complete)
CypCut
TubePro
Task Interface
2.1 Push task
2.2 Assigning tasks to machine
2.3 Cancel assignment to machine
2.4 Remote open the task
Statistical interface
3.1 All statistical data
3.2 Daily cutting and air travel statistics
3.3 Daily piercing count statistics
3.4 Daily laser time statistics
3.5 Daily gasopen time statistics
3.6 Daily running hours statistics
3.7 Extreme statistical data
DemoExample
Problem Description
1. The request header's token, timestamp, and sign are all correct, returning the prompt:
"timestamp timed out."
Get Raybox System Time
2. Inconsistent or missing field descriptions for parameters returned by the request
3.Get machine system status information interface field description(CypCut)

API Interface Steps


For each API interface call, the request header must have token, timestamp, and sign in it,
and the same sign is not allowed.Access only after passing the checksum rule.

1. Parameter Description

token:Request interface identification and manage permissions


timestamp:Unix timestamp (milliseconds) of current system, e.g. 1597133108993
secret:sign, necessary parameters for generating signatures
sign:Generated by token, timestamp, and secret through specific rules.
The timestamp is different in each request header, and the sign is also unique and
different.

Note: Please save the secret and prohibit it from being carried in the request.

2. How to get token and secret

Log in to Raybox, click Settings on the left side of the navigation bar, and click API Management.

Click Add token, fill in the expiration date, description and other basic information, then click
Generate button, you will get the token and secret.

Note: secret is only displayed once when it is generated and cannot be viewed after it is closed.

3. Configuring token permissions

A token needs to be configured with permissions to access the corresponding interface, and the
permissions of the token can be configured in the interface management.
配置成功后,此时的token和secret就具有访问目标路径下的权限。

Configuration success,and then the token can allow to access these url.

4. sign generation rules

sign = MD5("timestamp="+timestamp+“&token=”+token+“&secret=”+secret)

timestamp = 1597133108993
token = 360CE4B93AFA04452D
secret = 9fe92438c953ffd5de28
# MD5 calculation sign
MD5(timestamp=1597133108993&token=360CE4B93AFA04452D&secret=9fe92438c953ffd5de28
)
sign=d881de433e0dce1441a7141e8407af2b
# The above data has been practically validated and can be used to test data
consistency.

Example of signature generation (java version)

public String calcSign(String token,String secret,String timestamp){


String signStr = "timestamp=" + time + "&token=" + token + "&secret=" +
secret;
return DigestUtils.md5DigestAsHex(signStr.getBytes());
}

DemoExamples

5. Example Tests

{
"status": 0,
"msg": "OK",
"data": {
"serverID": "{B84CB645-FC1D-4AB1-A828-DDF6533E8E6C}",
"serverIP": "10.1.133.197",
"serverPort": 9527,
"replyPort": "7089",
"serverName": "DESKTOP-UHK2CVK",
"gmid": 114429,
"cardId": "",
"macAddress": "B4:2E:99:0F:0B:99",
"appName": "DataCenter",
"messageType": 2,
"createTime": "2020-09-04 15:10:30",
"aliveTime": "2020-09-04 15:25:30",
"appInfos": [
{
"appVer": "6.3.762.4",
"appType": 1,
"appName": "CypCut"
}
],
"apps": [
{
"appVer": "6.3.762.4",
"appType": 1,
"appName": "CypCut"
}
]
}
}

Software Version Support


All the following interface parameters, referenced fromTubePro-V7.0.15.141(2020-11-17)
andCypCut-V6.3.762.6(2020-11-04)and CypCut-V6.3.763.3(2020-11-28)

API Interface Category


About Machine Application Interface

API Description

/api/datacenter/list Get Machine List

/api/datacenter/listRunningApp Get Application List

/api/datacenter/info Get machine details

/api/datacenter/appInfo Get application details

/api/monitor/state Get machine status(part)

/api/monitor/cutSystemState Get machine status(complete)


About Task Class Interface

API Description

/api/task/upload Upload task

/api/task/assign Assigning tasks to machine

/api/task/cancelAssign Cancel assignment to machine

About the Statistics Interface

The statistics interface is currently only for CypCut, TubePro statistics are inaccurate and unstable,
use with caution!

API Description

/api/statistic/summary All statistical data

/api/statistic/daily/length Daily cutting and air travel statistics

/api/statistic/daily/pierceCount Daily piercing count statistics

/api/statistic/daily/laser Daily laser time statistics

/api/statistic/daily/gasTime Daily gasopen time statistics

/api/statistic/daily/runTime Daily running hours statistics

/api/statistic/extreme Extreme statistical data

Machine Application Interface


1.1 Get Machine List

url: GET http://{Rayboxip}:8080/api/datacenter/list

Interface Description:

Get a list of machine tools on a LAN with support for serverName and ip field search queries.

Request Parameters:

Name Type Required Default Desc Note

Search Supports serverName


searchText string No None
Keywords and ip search.

Example:http://10.1.133.197:8080/api/datacenter/list

Return Results:

{
"status": 0,
"msg": "OK",
"data": [
{
"serverID": "{1571885E-75D5-4BAA-A267-BB74CDF6DAC0}",
"serverIP": "10.1.19.82",
"serverPort": 9527,
"serverName": "DESKTOP-SOEMU61",
"replyPort": 9527,
"gmid": 152700,
"macAddress": "a8:5e:45:e2:0a:53",
"cardId": "null",
"appName": "DataCenter",
"aliveTime": "2020-07-14 16:59:28",
"appInfos": [{
"appName": "CypCut",
"appVer": "6.3.762.2",
"appType": 1
}]
},
{
"serverID": "{82FE2334-7F79-4148-A6E7-0F10CC637D8E}",
"serverIP": "10.1.40.60",
"serverPort": 9527,
"serverName": "DESKTOP-T922TTD",
"replyPort": 9527,
"gmid": 102186,
"macAddress": "40:8d:5c:88:eb:5c",
"cardId": "",
"appName": "DataCenter",
"aliveTime": "2020-07-14 16:59:28",
"appInfos": [{
"appName": "CypCut",
"appVer": "6.3.810.0",
"appType": 1
}]
},
{
"serverID": "{67C517A7-F659-421F-8C93-D61D57CF23C2}",
"serverIP": "10.1.40.63",
"serverPort": 9527,
"serverName": "CH",
"replyPort": 9527,
"gmid": 10828,
"macAddress": "1c:1b:0d:c0:4d:1c",
"cardId": "null",
"appName": "DataCenter",
"aliveTime": "2020-07-14 16:59:28",
"appInfos": [{
"appName": "CypCut",
"appVer": "6.3.810.0",
"appType": 1
}]
}
]
}
1.2 Get Application list

url: GET http://{Rayboxip}:8080/api/datacenter/listRunningApp

Interface Description:

Get the applications currently being used by the machine in the LAN.

Request Parameters:

Name Type Required Default Desc Note

Search Supports serverName


searchText string No None
Keywords and ip search.

Example:http://10.1.133.197:8080/api/datacenter/listRunningApp

Return Results:

{
"status": 0,
"msg": "OK",
"data": [
{
"serverIP": "10.1.255.168",
"serverName": "WIN-3DGQA31OGCA",
"gmid": 299,
"macAddress": "00:07:32:36:f0:4e",
"cardId": "",
"appName": "DataCenter",
"aliveTime": "2020-08-22 16:19:36",
"appInfos": [
{
"appName": "CypVision",
"appVer": "3.0.31.0",
"appType": 1
}
]
},
{
"serverIP": "10.1.255.190",
"serverName": "WINDOWS-TFF0PK4",
"gmid": 6917,
"macAddress": "00:07:32:36:ef:d4",
"cardId": "",
"appName": "DataCenter",
"aliveTime": "2020-08-22 16:19:17",
"appInfos": [
{
"appName": "CypOne",
"appVer": "6.1.725.3",
"appType": 1
}
]
}
]
}

1.3 Get machine details

url: GET http://{Rayboxip}:8080/api/datacenter/info

Interface Description:

Get details of the machine's equipment by IP address

Request Parameters:

Name Type Required Default Desc Note

Machine The correct IP address format,


ip string Yes None
IP e.g.10.1.19.175

Example:http://10.1.133.197:8080/api/datacenter/info?ip=10.1.19.175

Return Results:

{
"status":0,
"msg":"OK",
"data":{
"gmid":16434,
"serverIP":"10.1.19.175",
"serverName":"TSQ",
"cardId":"null",
"appName":"DataCenter",
"messageType":2,
"macAddress":"",
"appInfos":[
{
"appVer":"6.3.810.0",
"appType":1,
"appName":"CypCut"
}
]
}
}

1.4 Get application details

url: GET http://{Rayboxip}:8080/api/datacenter/appInfo

Interface Description:

Get detailed information about the machine running applications on the LAN

Request Parameters:
Name Type Required Default Desc Note

Machine The correct IP address


ip string Yes None
IP format,e.g.10.1.255.164

Software
appName string Yes None CypCut
AppName

Example:http://10.1.133.197:8080/api/datacenter/appInfo?ip=10.1.255.164&appName=CypCut

Return Results:

{
"status": 0,
"msg": "OK",
"data": {
"CypCut": [
{
"name": "BCS100ID",
"value": "201410010419",
"desc": "调高器编号"
},
{
"name": "CardType",
"value": "BMC2104",
"desc": "控制卡类型"
},
{
"name": "SerialNumber",
"value": "RXBB-PPPR-PRBE-TYD8V",
"desc": "序列号"
},
{
"name": "CardID",
"value": "190733010002",
"desc": "控制卡ID"
},
{
"name": "LaserType",
"value": "Raycus(1000W)",
"desc": "激光器类型"
},
{
"name": "CutRange", //TubePro does not have this parameter.
"value": "300.00 X 400.00",
"desc": "机床幅面"
},
{
"name": "BCS100Type",
"value": "BCS100",
"desc": "调高器类型"
},
{
"name": "FileName", //TubePro does not have this parameter.
"value": "",
"desc": "打开的文件名"
},
{
"name": "LicenceValidEnd", //TubePro does not have this
parameter.
"value": "",
"desc": "有效期"
},
]
}
}

1.5 Get machine status(part)

Only for CypCut

url: GET http://{Rayboxip}:8080/api/monitor/state

Interface Description:

Get machine status(part)

Request Parameters:

Name Type Required Default Desc Note

Machine The correct IP address


ip string Yes None
Ip format,e.g.10.1.255.164

Software
appName string Yes None CypCut
AppName

Example:http://10.1.133.197:8080/api/monitor/state?ip=10.1.255.190&appName=CypCut

Return Results:

{
"status": 0,
"msg": "OK",
"data": {
"workSpeed": 0.0, //加工速度
"laserPower": 500.0, //激光器功率
"workState": 1, //SysStat(ps:Low version will not work) 1,In process;
2,Pause or stop;3,Machine standby;-1,other status
"alarmState": false, //报警状态
"diodeCurrent": 0.0, //峰值功率(%)
"totalCutLength": 17668.9815 //切割总长
}
}
1.6 Get machine status(complete)

url: GET http://{Rayboxip}:8080/api/monitor/cutSystemState

Interface Description:

Get machine status(complete)

Request Parameters:

Name Type Required Default Desc Note

Machine The correct IP address


ip string Yes None
Ip format,e.g.10.1.255.164

Software
appName string Yes None CypCut
AppName

Example:http://10.1.133.197:8080/api/monitor/cutSystemState?ip=10.1.40.35&appName=CypC
ut

Return Results:

CypCut

{
"status": 0,
"msg": "OK",
"data": {
"CutSystemState": {
"NcState":{
"AxisY": 0, //Y轴
"AxisX": 0, //X轴
"DA2": 0, //DA2
"DA1": 0, //DA1
"CADHomeRefY": 0, //CAD coordinates of Y-axis stopping point
"CADHomeRefX": 0, //CAD coordinates of X-axis stopping point
"CanRestoreFromStop": false, //Breakpoint continues
"AlarmCount": 0, //Number of alarms
"OutportBytes": 0, //Output port value
"InportBytes": 0, //Input port value
"RunningTime": 0.0696574768517166, //运行时间
"RunningTimeStr": "1分15秒",
"WorkTime": 0, //加工时长
"WorkTimeStr": "00:00:00.000", //加工时长
"TotalWorkTime": 0, //Total processing time
"UcsOrgY": 0, //Y-axis zero point coordinates
"UcsOrgX": 0, //X-axis zero point coordinates
"HomeRefY": 0, //Mechanical coordinates of Y-axis stopping
point
"HomeRefX": 0, //Mechanical coordinates of X-axis stopping
point
"WorkSpeed": 0, //Processing speed
"CutPercent": 0, //Processing progress(%)
"AlarmMsg": "", //Warning messages, multiple entries separated
by ","
"IsJogFast": false, //Quick Tap
"SwitchTableNum": -1, //Number of switchboards
"LaserPower": 1000, //激光器功率
"StationIndex": 0, //Current station number
"FeedRate": 100, //Feed rate
"SysState": 0, //SysState 0,Standby;1,Simulation;2,Point and
Move;3,Back to zero;4,Back to marker point;5,Back to the stopping point;
6,Back to the origin;7,Go to the border;8,Processing;9,Pause;10,Go on;
11,Forward;12,Backward;Please see the following problem statement for other
detailed status
"TaskName": "20180814001.lxds" //Processing file name
},
"DeviceState": {
"IsFollowing": false, //Follow or not
"PwmFreq": 5000, //Pwm Frequency(Hz)
"IsEmissionOn": false, //Whether the light gate is open
"GasType": "", //气体类型
"CurrentZ": 85, //Z-axis coordinates
"CurrentH": 15, //Follow height (real time value)
"GasPressure": 4, //Cutting air pressure(bar)
"IsLaserOn": false, //Whether to open laser
"PwmRatio": 0.2, //Pwm占空比(%)
"IsGasOn": false, //Is out of gas
"TargetHeight": 0, //Following height (set value)
"IsAimingOn": false, //Red light on
"DiodeCurrent": 100 //Peak power (%)
}
}
}
}

TubePro

{
"status": 0,
"msg": "OK",
"data": {
"CutSystemState": {
"NcState": {
"SumConsumetime": 2.683688808889, //Total processing hours
(can be zeroed out, in days)
"AlarmCount": 0, //Number of alarms
"CurPartNum": 1, //Number of parts machined from the drawing
"RunningTime": 0.0563390740717296, //Running time (unit: days)
"WorkTime": 0, //Processing time (walking edge does not count,
unit: days)
"TotalWorkTime": 5609077.08340837, //Cumulative processing time
(not to be cleared except for idle time, unit: s)
"SpeedY": 0, //Y轴速度(mm/s)
"SpeedX": 0, //X轴速度(mm/s)
"SpeedB": 0, //B轴速度(mm/s)
"AlarmMsg": "", //Warning messages, multiple entries separated
by ","
"SumPartNum": 1, //Total number of drawing parts
"Trace": 0.619678378105164, //Track speed
"PosZ": 140.0, //Z-axis mechanical coordinate(mm)
"PosY": 217968.76, //Y-axis mechanical coordinate(mm)
"PosX": 0.003, //X-axis mechanical coordinate(mm)
"PosB": 0, //B-axis mechanical coordinate(mm)
"LaserPower": 1000.0, //激光器功率
"SumParts": 5927.0, //Cumulative number of parts processed
"SysState": 0, //SysState 0,free;1,Processing;2,Pause;
3,Execute plc;4,Point and Move;5,Back to the origin;6,other
"RunningTimeStr": "1小时21分7秒", //运行时长
"WorkTimeStr": "0秒", //加工时长,
“WorkSpeed”: 0, //加工速度(新版本单位m/min)
//The following are TubePro-v7.15.145.6 new data
“CutMode”:0, //CutMode,0,Normal;1,Empty walking;2,
Simulation;3,Arbitrary trajectory error determination
"FocusPos": 0, //Current focus (optional, effective only when
cutting head is present)
"PosA": 0, //A-axis mechanical coordinates(mm)
"SpeedA": 0, //A-axis speed(mm/s)
"DA2": 0, //第一块扩展板的DA2
"DA1": 0, //第一块扩展板的DA1
“BeamSize”: 0, //Current light spot(Optional, effective when
cutting head device is present)
"PortionID":"", //Unique identification of the current task
plane
“FileID”:"", //Unique identification of the current task file
"PartName":"", //Processing file part name
"NestName":"", //Processing file plane name(Null if it is a
file base image)
"IsJogFast":false, //Quick Tap
"FeedRate":0, //Feed rate,value(0~100)
“LaserRatio":0, //占空比,范围0~100
"TaskName":"" //Processing file name
},
"DeviceState": {
"IsFollowing": false, //Follow or not
"PwmFreq": 1000.0, //Pwm Frequency(Hz)
"IsEmissionOn": false, //Whether the light gate is open
"GasType": "", //气体类型
"CurrentZ": 0, //Z-axis coordinates
"CurrentH": 25.0, //Follow height (real time value,unit:mm)
"GasPressure": 0, //Cutting air pressure(bar)
"IsLaserOn": false, //Whether to open laser
"PwmRatio": 1.0, //激光器占空比(%),范围0~1
"IsGasOn": false, //Is out of gas
"TargetHeight": 1.0, //Following height (set value,unit:mm)
"IsAimingOn": false, //Red light on
"DiodeCurrent": 100.0 //Peak power (%)
},
"SpeedUnitStr": "m/min", //切割速度单位
}
}
}

Task Interface
2.1 Push task

url: POST http://{Rayboxip}:8080/api/task/upload

Parameter Type:multipart/form-data

Interface Description:

Push task numbers and machining drawing files to the Raybox

Request Parameters

Name Type Required Default Desc Note

Do not
duplicate an
Custom
taskIdentifier string No Empty existing one
task id
if it is not
empty.

material string No Empty Material

Plate
thickness double No 0 Unit mm
Thickness

Supported
Processing File
taskFile MultipartFile Yes None
Files Formats:zx
zzx

Number
count int No 1 of
Processes

taskName string Yes None taskName

The ability to
specify a
Assigned cutting
targetMachineIp int No Empty Machine machine
IP when
uploading
task

Example:
Return Results:

{
"status": 0,
"msg": "OK",
"data": "7154215767e64fbca0fc6370d0a1b922"
}

2.2 Assigning tasks to machine

url: POST http://{Rayboxip}:8080/api/task/assign

Parameter Type:application/json

Interface Description:

Assigning tasks to machine

Request Parameters

Name Type Required Default Desc Note

taskIdentifier string Yes None Custom task id

machineIp string Yes None Assigned Machine IP

Example:

{
"machineIp": "192.168.0.1",
"taskIdentifier": "abe15753f7084f30b51e9400b0056879"
}

Return Results:
{
"status": 0,
"msg": "OK"
}

2.3 Cancel assignment to machine

url: POST http://{Rayboxip}:8080/api/task/cancelAssign

Parameter Type:application/json

Interface Description:

Cancel assignment to machine

Request Parameters

Name 类型 Required Default Desc Note

taskIdentifier string Yes None Custom task id

Example:

{
"taskIdentifier": "1234565"
}

Return Results:

{
"status": 0,
"msg": "OK"
}

2.4 Remote open the task

url: get http://{Rayboxip}:8080/api/task/openFile

Interface Description

Remote open the task file on machine,only for CypCut

Request Parameters

Name Type Required Default Desc Note

id string Yes None task uuid or custom id

ip string Yes None machine ip 10.1.133.196

Example: http://10.1.133.197:8080/api/task/openFile?ip=123456&ip=10.1.133.196

Return Results
{
"status": 0,
"msg": "OK"
}

Statistical interface
3.1 All statistical data

url: GET http://{Rayboxip}:8080/api/statistic/summary

Interface Description:

Get all the statistics of the machine

Request Parameters

Name Type Required Default Desc Note

The correct IP address


ip string Yes None Machine Ip
format

yyyy-MM-dd
startDate string Yes None Start Time
HH:mm:ss

yyyy-MM-dd
endDate string Yes None End Time
HH:mm:ss

Software
appName string Yes None CypCut,TubePro
AppName

Example: http://10.1.133.197:8080/api/statistic/summary?ip=10.1.255.188&startDate=2020-08-
01 19:11:37&endDate=2020-09-01 19:11:37&appName=CypCut

Return Results:

{
"status": 0,
"msg": "OK",
"data": {
"gasTime": 74438, //unit:s
"moveLength": 7271764.1993268225, //unit:mm
"startRate": "3.62%",
"cutRate": "24.45%",
"workTime": 77340, //unit:s
"laserTime": 1722, //unit:s
"idleTime": 238980, //unit:s
"pierceCount": 3728,
"cutLength": 537221.8099902763 //unit:mm
}
}
3.2 Daily cutting and air travel statistics

url: GET http://{Rayboxip}:8080/api/statistic/daily/length

Interface Description:

Daily cutting and air travel statistics

Request Parameters

Name Type Required Default Desc Note

The correct IP address


ip string Yes None Machine Ip
format

startDate string Yes None Start Time yyyy-MM-dd

endDate string Yes None End Time yyyy-MM-dd

Software
appName string Yes None CypCut,TubePro
AppName

Example: http://10.1.133.197:8080/api/statistic/daily/length?ip=10.1.133.197&startDate=2020-
09-01&endDate=2020-10-01&appName=CypCut

Return Results:

{
"status": 0,
"msg": "OK",
"data": [
{
"moveLength": 0.0,
"statDate": 20200806,
"cutLength": 0.0
},
{
"moveLength": 0.0,
"statDate": 20200812,
"cutLength": 0.0
},
{
"moveLength": 0.0,
"statDate": 20200813,
"cutLength": 0.0
},
{
"moveLength": 0.0,
"statDate": 20200814,
"cutLength": 0.0
},
{
"statDate": 20200817,
"moveLength": 49082.9003510534,
"cutLength": 0.0
},
{
"moveLength": 0.0,
"statDate": 20200818,
"cutLength": 0.0
},
{
"statDate": 20200820,
"moveLength": 0.0,
"cutLength": 0.0
},
{
"statDate": 20200821,
"moveLength": 2649009.375789716,
"cutLength": 0.0
},
{
"statDate": 20200822,
"moveLength": 4102394.655087231,
"cutLength": 0.0
},
{
"moveLength": 0.0,
"cutLength": 0.0,
"statDate": 20200827
},
{
"moveLength": 0.0,
"statDate": 20200828,
"cutLength": 0.0
},
{
"cutLength": 9837.41925839182,
"statDate": 20200829,
"moveLength": 100581.1680078622
}
]
}

3.3 Daily piercing count statistics

url: GET http://{Rayboxip}:8080/api/statistic/daily/pierceCount

Interface Description:

Daily piercing count statistics on the machine

Request Parameters
Name Type Required Default Desc Note

The correct IP address


ip string Yes None Machine Ip
format

startDate string Yes None Start Time yyyy-MM-dd

endDate string Yes None End Time yyyy-MM-dd

Software
appName string Yes None CypCut,TubePro
AppName

Example: http://10.1.133.197:8080/api/statistic/daily/pierceCount?
ip=10.1.255.188&startDate=2020-08-01&endDate=2020-09-01&appName=CypCut

Return Results:

{
"status": 0,
"msg": "OK",
"data": [
{
"statDate": 20200814,
"pierceCount": 0
},
{
"pierceCount": 12,
"statDate": 20200817
},
{
"statDate": 20200820,
"pierceCount": 0
},
{
"statDate": 20200821,
"pierceCount": 1179
},
{
"statDate": 20200822,
"pierceCount": 1827
},
{
"pierceCount": 0,
"statDate": 20200827
},
{
"statDate": 20200828,
"pierceCount": 0
},
{
"pierceCount": 90,
"statDate": 20200829
},
{
"pierceCount": 20,
"statDate": 20200831
},
{
"statDate": 20200901,
"pierceCount": 600
}
]
}

3.4 Daily laser time statistics

url: GET http://{Rayboxip}:8080/api/statistic/daily/laser

Interface Description:

Get daily laser time statistics on the machine

Request Parameters

Name Type Required Default Desc Note

The correct IP address


ip string Yes None Machine Ip
format

startDate string Yes None Start Time yyyy-MM-dd

endDate string Yes None End Time yyyy-MM-dd

Software
appName string Yes None CypCut,TubePro
AppName

Example: http://10.1.133.197:8080/api/statistic/daily/laser?ip=10.1.255.188&startDate=2020-08-
01&endDate=2020-09-01&appName=CypCut

Return Results:

{
"status": 0,
"msg": "OK",
"data": [
{
"statDate": 20200822,
"laserTime": 0
},
{
"laserTime": 0,
"statDate": 20200827
},
{
"statDate": 20200828,
"laserTime": 0
},
{
"statDate": 20200829,
"laserTime": 35
},
{
"laserTime": 23,
"statDate": 20200831
},
{
"statDate": 20200901,
"laserTime": 1664
}
]
}

3.5 Daily gasopen time statistics

url: GET http://{Rayboxip}:8080/api/statistic/daily/gasTime

Interface Description:

Get daily gasopen time statistics on the machine

Request Parameters

Name Type Required Default Desc Note

The correct IP address


ip string Yes None Machine Ip
format

startDate string Yes None Start Time yyyy-MM-dd

endDate string Yes None End Time yyyy-MM-dd

Software
appName string Yes None CypCut,TubePro
AppName

Example: http://10.1.133.197:8080/api/statistic/daily/gasTime?ip=10.1.255.188&startDate=2020-
08-01&endDate=2020-09-01&appName=CypCut

Return Results:

{
"status": 0,
"msg": "OK",
"data": [
{
"gasTime": 0,
"statDate": 20200814
},
{
"statDate": 20200817,
"gasTime": 382
},
{
"statDate": 20200820,
"gasTime": 0
},
{
"statDate": 20200821,
"gasTime": 27843
},
{
"statDate": 20200822,
"gasTime": 43146
},
{
"gasTime": 373,
"statDate": 20200829
}
]
}

3.6 Daily running hours statistics

url: GET http://{Rayboxip}:8080/api/statistic/daily/runTime

Interface Description:

Get daily running hours statistics on the machine

Request Parameters

Name Type Required Default Desc Note

The correct IP address


ip string Yes None Machine Ip
format

startDate string Yes None Start Time yyyy-MM-dd

endDate string Yes None End Time yyyy-MM-dd

Software
appName string Yes None CypCut,TubePro
AppName

Example: http://10.1.133.197:8080/api/statistic/daily/runTime?ip=10.1.255.188&startDate=2020-
08-01&endDate=2020-09-01&appName=CypCut

Return Results:

{
"status": 0,
"msg": "OK",
"data": [
{
"workTime": 444,
"idleTime": 14796, //空闲时间
"statDate": 20200817 //
},
{
"statDate": 20200818,
"workTime": 0,
"idleTime": 0
},
{
"statDate": 20200820,
"idleTime": 13466,
"workTime": 0
},
{
"statDate": 20200821,
"workTime": 28597,
"idleTime": 57683
},
{
"statDate": 20200822,
"idleTime": 36,
"workTime": 43344
},
{
"idleTime": 13944,
"statDate": 20200828,
"workTime": 0
},
{
"statDate": 20200901,
"idleTime": 17832,
"workTime": 4340
}
]
}

3.7 Extreme statistical data

url: GET http://{Rayboxip}:8080/api/statistic/extreme

Interface Description:

Extreme statistical data on the machine

Request Parameters

Name Type Required Default Desc Note

The correct IP address


ip string Yes None Machine Ip
format

yyyy-MM-dd
startDate string Yes None Start Time
HH:mm:ss

yyyy-MM-dd
endDate string Yes None End Time
HH:mm:ss

Software
appName string Yes None CypCut,TubePro
AppName

Example: http://10.1.133.197:8080/api/statistic/extreme?ip=10.1.255.188&startDate=2020-08-01
19:11:37&endDate=2020-09-01 19:11:37&appName=CypCut

Return Results:

{
"status": 0,
"msg": "OK",
"data": {
"minGasTime": 0, //Min. opening time
"minCutLength": 0.0, //Min. cutting length
"minWorkTime": 0, //Min. processing time
"minMoveLength": 0.0, //Min. move length
"maxIdleTime": 57720, //Max. free time
"maxCutlength": 525499.498408445, //Max. cutting length
"minLaserTime": 0, //Min. laser time
"minPierceCount": 0, //Min. number of piercings
"maxWorkTime": 43344, //Max. processing time
"maxMoveLength": 4102394.655087231, //Max. air shift distance
"maxLaserTime": 1664, //Max. opening time
"minIdleTime": 0, //Min. free time
"maxPierceCount": 1827, //Max. number of piercings
"maxGasTime": 43146 //Max. opening time
}
}

DemoExample
Java Example

public static void apiRequest() throws IOException {


// Parameter preparation
String token = "6287419788F57E56921D951B5B8180E5";
String secret = "6321ad9811af7af5c3fa8859071bb495";
long timestamp = System.currentTimeMillis();

// MD5-sign
String signStr = "timestamp=" + timestamp + "&token=" + token +
"&secret=" + secret;
String sign = DigestUtils.md5DigestAsHex(signStr.getBytes());

//Add Request Parameters


HashMap<String, String> params = new HashMap<>(2);
params.put("machineIp", "10.1.133.197");
params.put("taskIdentifier", "789455");

//Request url
String url = "http://10.1.9.13:8080/api/task/assign";

OkHttpClient client = new OkHttpClient().newBuilder().build();


MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, new
JSONObject(params).toString());
Request request = new Request.Builder()
.url(url)
.method("POST", body)
.addHeader("token", token)
.addHeader("sign", sign)
.addHeader("timestamp", Long.toString(timestamp))
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
if (response.code() != 200 || request.body() == null) {
//Request Exception
System.out.println("request fail");
} else {
String result = response.body().string();
JsonNode responseNode = JsonUtil.recoverJson(result);
if (responseNode.get("status").intValue() == 0) {
// Request successThe data is stored in the data node
System.out.println(responseNode.get("data"));
return;
}
// Request Fail msg node returns failure message
// View the Raybox error code document online to find the
corresponding error message.
System.out.println(responseNode.get("status"));
System.out.println(responseNode.get("msg"));
}
}

Problem Description
1. The request header's token, timestamp, and sign are all correct,
returning the prompt: "timestamp timed out."

Causes:If the system time difference between the caller and the box is too large, use the
interface to check the box's system time.

Solutions:

1. Both sides connect to the Internet for automatic calibration time


2. Call the Raybox system time interface and manually modify parameters to reduce the time
error (the timeout is 5 minutes).

Get Raybox System Time

==This interface does not require authentication.==

url: GET http://{Rayboxip}:8080/api/time

Interface Description:

Get Raybox System Time

Request Parameters:None

Example:http://10.1.133.197:8080/api/time

Return Results:

{
"status": 0,
"msg": "OK",
"data": "2020-09-03 19:26:59"
}
2. Inconsistent or missing field descriptions for parameters returned by
the request

Causes:Due to upgrades or inconsistent versions of the cutting software, there may be


discrepancies between the parameter content and the documentation.

Solutions: https://www.fscut.com/download/,Download the latest Raybox data file to view it.


If you have any questions, please contact a marketing person.

3.Get machine system status information interface field


description(CypCut)

SysState Code

0; //待机状态
1; //模拟状态
2; //点动状态
3; //回零状态
4; //回标记点状态
5; //回停靠点状态
6; //回原点状态
7; //走边框状态
8; //加工状态
9; //暂停状态
10; //继续状态
11; //前进状态
12; //后退状态
13; //定位状态
14; //进给,未使用

20; //执行PLC过程处理状态
21; //单点寻边状态
22; //绝对寻边状态
23; //相对寻边状态
24; //未使用
31; //红外单点寻边
32; //红外绝对寻边
33; //红外相对寻边
34; //板切断
41; //视觉寻边
42; //视觉校准
51; //焦点控制回原点
61; //交换工作台移动
52; //HighYag激光头回原点

100; //在闭环卡的自动调整界面开始自动调整后的状态
101; //自动清洁切割头
102; //自动润滑
200; //线程切换性能测试
201; //计算惯量
202; //PID调整状态
203; //单轴调整
204; //安全定位
205; //轴测量
206; //切割高度调试
207; //视觉稳定性测试
208; //定位到指定坐标
209; //PSO通信连接状态
210; //pso模拟编码器检测状态
212; //自动加工Mark点
215; //扩展轴的点动
266; //Mark点阵列输出
219; //忽略加工
260; //误差测定
261; //图像聚焦

You might also like