Save the mastering data ($DMR_GRP)
Read $DMR_GRP[1].$MASTER_COUN and the reference counts of every Fanuc robot from sysmast.va, and keep them with a date before a battery or a motor change.
Before a battery change or a motor change on a Fanuc robot, you want the master counts at hand. Integrators often record them on every robot they work on, as a first step. The SDK reads them from sysmast.va of every robot and keeps them with a date.
This page only reads the mastering data. Mastering a robot is done on the teach pendant, by a qualified person, with the method of the FANUC manual of your robot.
The variables
| Variable | Type | Meaning | File |
|---|---|---|---|
$DMR_GRP[g].$MASTER_COUN[a] | INTEGER | Master count of axis a of group g | sysmast.va |
$DMR_GRP[g].$MASTER_DONE | BOOLEAN | Mastering done | sysmast.va |
$DMR_GRP[g].$REF_POS[a], $REF_COUNT[a] | REAL, INTEGER | Reference position and reference count of axis a | sysmast.va |
$DMR_GRP[g].$REF_DONE | BOOLEAN | Reference position done | sysmast.va |
An axis without a motor reads 0. The SDK gives these values with GetSysmastFile().DmrGrp[g - 1]: MasterCoun, MasterDone, RefPos, RefCount, RefDone.
Keep the mastering data of a robot
The code keeps a dated copy of sysmast.va, as it is, then prints the counts of group 1. Run it on each robot of the plant, for example once a week, and keep the files.
parameters.Ftp.Enable = true;robot.Connect(parameters);// Keep the listing of the robot with the date, as it isrobot.Ftp.DirectFileHandling.DownloadFileFromController($"{ip}-{DateTime.Now:yyyy-MM-dd}-sysmast.va", "md:/sysmast.va");// Read it: $DMR_GRP[1] is DmrGrp[0], axis 1 is index 0SysmastFile mastering = robot.Ftp.KnownVariableFiles.GetSysmastFile();DmrGrpVariableType group1 = mastering.DmrGrp[0];Console.WriteLine($"MASTER_DONE={group1.MasterDone} REF_DONE={group1.RefDone}");for (int a = 0; a < group1.MasterCoun.Length; a++)Console.WriteLine($"J{a + 1}: MASTER_COUN={group1.MasterCoun[a]} REF_COUNT={group1.RefCount[a]}");}}
The .NET and Python arrays start at 0: $DMR_GRP[1] is DmrGrp[0] and axis J1 is index 0.
A copy taken before the intervention is the one that counts. Compare it with an older copy: when the counts differ, the robot was probably mastered again in between.
When the old counts are useful
- The pulse coders lost their power (flat battery) and nothing moved mechanically: the technician can use the recorded counts, with the procedure of the manual.
- A motor or a pulse coder was changed: the old counts are no longer valid. The robot must be mastered again.
Cautions
sysmastbelongs to one robot. Never load thesysmastfile of another robot: the axes of this robot would lose their calibration.sysmastholds more than the counts. Keep the whole file, not only the numbers printed by the code.- The SDK reads the
.valisting. A pendant backup with only.svfiles cannot be read on the PC: downloadsysmast.vaby FTP, as the code does.
Without code
TouchUp, the robot workbench for VS Code, keeps the mastering values of each Fanuc backup that holds a readable sysmast.va. The command TouchUp: Show Mastering (Fanuc) shows the master count, the reference position and the reference count of each axis from the last backup, with its date. TouchUp only reads them: it never writes the mastering of a robot. See Mastering of a Fanuc robot.