Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fanuc/{machine}/stat_info/{path}: Potentially missing properties #36

Open
tukusejssirs opened this issue Oct 28, 2021 · 3 comments
Open
Labels
focas-tests get intimate with focas

Comments

@tukusejssirs
Copy link
Contributor

According to the docs of cnc_statinfo, there are four groups based on the Fanuc series:

  • all Fanucs should provide this data (base for other groups and all of these are already published):

    • run (Status of automatic operation);
    • edit (Status of program editing);
    • motion (Status of axis movement,dwell);
    • mstb (Status of M, S, T, B function);
    • emergency (Status of emergency);
    • alarm (Status of alarm);
  • Series 15/15i (I don’t have access to such machines):

    • aut (AUTOMATIC mode selection);
    • manual (MANUAL mode selection);
    • write (Status of writing backupped memory);
    • labelskip (Status of label skip);
    • warning (Status of warning);
    • battery (Status of battery).
  • Series 30i/31i/32i, 0i-D/F:

    • hdck (Status of manual handle re-trace);
    • tmmode (T/M mode selection);
    • aut (AUTOMATIC/MANUAL mode selection).
  • Series 16/18/21, 16i/18i/21i, 0i, Power Mate i, PMi-A:

    • tmmode (T/M mode selection);
    • aut (AUTOMATIC/MANUAL mode selection).
  • Series 16i/18i-W:

    • aut (AUTOMATIC/MANUAL mode selection).

I suggest to support them all.

Note that some have two separate bytes (or bits?) for automatic and manual mode, others a single one.

Moreover, I suggest to modify the data structure a bit:

"data": {
  "alarm": "(No alarm)"
  "battery": "???",
  "edit": "****(Not editing)",
  "emergency": "(Not emergency)",
  "hdck": "???",
  "labelskip": "???",
  "mode": "automatic"  // automatic | manual
  "mode_type": "MDI"   // Change the property name if you find a better name
  "motion": "***",
  "mstb": "***",
  "run": "STOP",
  "tmmode": "???"
  "warning": "???",
  "write": "???",
}

Just a note: I have access to machines with the following Fanuc versions. I can test this on them.

Fanuc series Fanuc model Paths
Fanuc Series 0i-TD MODEL D 1
Fanuc Series 0i-TD MODEL D 2
Fanuc Series 0i-TF MODEL F 1
Fanuc Series 0i-TF Plus MODEL F 1
Fanuc Series 31i MODEL B 1
@MRIIOT
Copy link
Contributor

MRIIOT commented Feb 1, 2022

These are the two structures available.

fanuc-driver/fanuc/fwlib.cs

Lines 3319 to 3354 in 12301da

#if FS15D
/* cnc_statinfo:read CNC status information */
[StructLayout(LayoutKind.Sequential,Pack=4)]
public class ODBST
{
[MarshalAs(UnmanagedType.ByValArray,SizeConst=2)]
public short[] dummy; /* dummy */
public short aut; /* selected automatic mode */
public short manual; /* selected manual mode */
public short run; /* running status */
public short edit; /* editting status */
public short motion; /* axis, dwell status */
public short mstb; /* m, s, t, b status */
public short emergency; /* emergency stop status */
public short write; /* writting status */
public short labelskip; /* label skip status */
public short alarm; /* alarm status */
public short warning; /* warning status */
public short battery; /* battery status */
}
#else
/* cnc_statinfo:read CNC status information */
[StructLayout(LayoutKind.Sequential, Pack = 4)]
public class ODBST
{
public short dummy; /* dummy */
public short tmmode; /* T/M mode */
public short aut; /* selected automatic mode */
public short run; /* running status */
public short motion; /* axis, dwell status */
public short mstb; /* m, s, t, b status */
public short emergency; /* emergency stop status */
public short alarm; /* alarm status */
public short edit; /* editting status */
}
#endif

@MRIIOT MRIIOT added use-case User use case for data to be collected. focas-tests get intimate with focas and removed use-case User use case for data to be collected. labels Feb 1, 2022
@tukusejssirs
Copy link
Contributor Author

It is already an improvement, but we still miss some other controller model data. 😉

I suggest to add into the structure comment (e.g. /* cnc_statinfo:read CNC status information */) also the controller models which support that particular if branch. FS15D might be enough for you, but I still suggest to comment the code properly.

A nitpick: you still don’t use same code style: on L3321 use write Pack=4 (and L3324 SizeConst=2), in L3341 Pack = 4.

@MRIIOT
Copy link
Contributor

MRIIOT commented Feb 1, 2022

fwlib.cs does need to be refactored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focas-tests get intimate with focas
Projects
None yet
Development

No branches or pull requests

2 participants