Ladder99 / fanuc-driver

Configurable Fanuc Focas data collector and post processor.
Apache License 2.0
74 stars 25 forks source link

`fanuc/{machine}/paths` output interpretation #30

Closed tukusejssirs closed 1 year ago

tukusejssirs commented 3 years ago

On a machine with two paths (based on topics like fanuc/{machine}/axis_names/1 and fanuc/{machine}/axis_names/1 having /{path} appended), the payload of fanuc/{machine}/paths is as follows:

{
  "observation": {
    "time": 1631120552467,
    "machine": "m1",
    "type": "source",
    "name": "paths",
    "marker": {}
  },
  "source": {
    "method": "cnc_getpath",
    "invocationMs": 0,
    "data": {
      "path_no": 0
    }
  },
  "state": {
    "time": "00:00:03.1754173",
    "data": {
      "path_no": 1,
      "maxpath_no": 2
    }
  }
}

state.data.path_no in this payload is ambiguous: why does it have a value of 1, when obviously it should be 2? Is it counted from 0? Or should I take state.data.maxpath_no into account instead?

This particular machine is Doosan PUMA 2600SYB II with Fanuc Series 0i-TD with the following data gathered using fanuc/{machine}/sys_info/{path}:

// fanuc/{machine}/sys_info/1
"state": {
  "time": "00:00:05.1019818",
  "data": {
    "loader_control": false,
    "i_series": true,
    "compound_machining": false,
    "transfer_line": false,
    "model": "MODEL D",
    "max_axis": 32,
    "cnc_type": "Series 0i",
    "mt_type": "T series with 2/3 path control",
    "series": "D6F1",
    "version": "40.0",
    "axes": 5
  }
}

// fanuc/{machine}/sys_info/2
"state": {
  "time": "00:00:05.8838324",
  "data": {
    "loader_control": false,
    "i_series": true,
    "compound_machining": false,
    "transfer_line": false,
    "model": "MODEL D",
    "max_axis": 32,
    "cnc_type": "Series 0i",
    "mt_type": "T series with 2/3 path control",
    "series": "D6F1",
    "version": "40.0",
    "axes": 1
  }
}
MRIIOT commented 3 years ago

https://docs.ladder99.com/focas-api/misc/cnc_getpath.xml

Reads the current selected path number which is the target path of the Data window functions.

This function returns the currently targeted path for other functions which are path dependent, and returns the maximum number of paths for this machine.

tukusejssirs commented 3 years ago

According to that link, path_no is counted from 0; is that so in fanuc-driver too or you add 1?

I presume that maxpath_no is counted from 1.

tukusejssirs commented 3 years ago

A subquestion: is there a chance that fanuc/{machine}/sys_info/1 and fanuc/{machine}/sys_info/2 would provide different data in state.data (besides axes)? In all machines with two paths that I have access, are all of those properties in state.data same (except for axes).

Maybe I am too concerned, but I think fanuc-driver provides the same data twice. IMHO all properties from state.data (except for axes) are properties (metadata) of the entire machine, not a path. Only axes are path-related from the given properties.

tukusejssirs commented 3 years ago

It might be a good idea a provide a topic with the machine-related metadata (not related to a single axes or path or whatever else), like:

"data": {
  "loader_control": false,
  "i_series": true,
  "compound_machining": false,
  "transfer_line": false,
  "model": "MODEL F",
  "max_axis": 32,
  "cnc_type": "Series 0i",
  "mt_type": "Lathe",
  "series": "D6G1",
  "version": "34.0",
  "max_paths": 2  // [fanuc/{machine}/paths].state.data.maxpath_no
  // ... and probably some other metadata
}
MRIIOT commented 2 years ago

state.data.maxpath_no

I call cnc_getpath to get the total number of paths.

According to that link, path_no is counted from 0; is that so in fanuc-driver too or you add 1?

Paths start at 1.

https://github.com/Ladder99/fanuc-driver/blob/12301dad1ca31ccb6e3dafcfcfbdf13bfede95c2/fanuc/collectors/Basic02.cs#L105-L107

It might be a good idea a provide a topic with the machine-related metadata

Yes, we should include output from cnc_sysinfo somewhere.

tukusejssirs commented 2 years ago

Yes, we should include output from cnc_sysinfo somewhere.

As I already told you privately:

It contains some data which I call machine metadata. I think all machine-related information that never (or very rarely) changes should be in a single topic. So yes, I think it should be a separate topic.

Something like fanuc/{machine}/metadata? Or choose a better name. :wink:

MRIIOT commented 1 year ago

sys_info/1 can be treated as the topic to retrieve machine metadata.