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

Handle undocumented values in StatInfoText veneer. #15

Open
MRIIOT opened this issue Jul 31, 2021 · 1 comment
Open

Handle undocumented values in StatInfoText veneer. #15

MRIIOT opened this issue Jul 31, 2021 · 1 comment

Comments

@MRIIOT
Copy link
Contributor

MRIIOT commented Jul 31, 2021

var current_value = new
{
mode = new
{
automatic = _autText[input.response.cnc_statinfo.statinfo.aut]
},
status = new
{
run = _runText[input.response.cnc_statinfo.statinfo.run],
edit = _editText[input.response.cnc_statinfo.statinfo.edit],
motion = _motionText[input.response.cnc_statinfo.statinfo.motion],
mstb = _mstbText[input.response.cnc_statinfo.statinfo.mstb],
emergency = _emergencyText[input.response.cnc_statinfo.statinfo.emergency],
alarm = _alarmText[input.response.cnc_statinfo.statinfo.alarm]
}
};

So basically StatInfoText just takes the integer value from Focas call and gets the string representation based on index. In this case automatic:5 would have become automatic:TeachIN. The original exception points to an index in one of the arrays that does not exist. We just don't know which one or what the value was.

2021/07/27 12:21:59.191|ERROR|[m9_doosan_puma] Collector sweep failed at segment PATH. System.IndexOutOfRangeException: Index was outside the bounds of the array.
at l99.driver.fanuc.veneers.StatInfoText.AnyAsync(Object input, Object[] additionalInputs) in /home/ts/git/c10n/fanuc-driver/fanuc/veneers/StatInfoText.cs:line 102

  1. Change it back to await Apply(typeof(fanuc.veneers.StatInfoText), "stat_info");,
  2. turn up the logging in nlog.config <logger name="*" minlevel="Trace" writeTo="fileTarget,consoleTarget" />,
  3. and post driver.log after the exception.

This will give us the info needed to troubleshoot, because we'll get the raw output from Focas before it hits the StatInfoText veneer.

_logger.Trace($"[{_machine.Id}] Platform invocation result:\n{JObject.FromObject(nr).ToString()}");

@MRIIOT
Copy link
Contributor Author

MRIIOT commented Jul 31, 2021

Look at documented differences in cnc_statinfo2 and cnc_statinfo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant