OK decodifica modi del CNC!
This commit is contained in:
@@ -1130,6 +1130,10 @@ namespace IOB_UT
|
||||
/// </summary>
|
||||
ND = 0,
|
||||
/// <summary>
|
||||
/// AUTOMATICO
|
||||
/// </summary>
|
||||
AUTO,
|
||||
/// <summary>
|
||||
/// EDIT (MEMORY EDIT)
|
||||
/// </summary>
|
||||
EDIT,
|
||||
@@ -1146,10 +1150,30 @@ namespace IOB_UT
|
||||
/// </summary>
|
||||
HANDLE_INC,
|
||||
/// <summary>
|
||||
/// HOME
|
||||
/// </summary>
|
||||
HOME,
|
||||
/// <summary>
|
||||
/// JOG (MANUAL CONTINUOUS FEED)
|
||||
/// </summary>
|
||||
JOG,
|
||||
/// <summary>
|
||||
/// JOG MAN
|
||||
/// </summary>
|
||||
JOG_MAN,
|
||||
/// <summary>
|
||||
/// JOG_INC
|
||||
/// </summary>
|
||||
JOG_INC,
|
||||
/// <summary>
|
||||
/// PROFILE
|
||||
/// </summary>
|
||||
PROFILE,
|
||||
/// <summary>
|
||||
/// SEMI
|
||||
/// </summary>
|
||||
SEMI,
|
||||
/// <summary>
|
||||
/// THND (TEACH IN HANDLE)
|
||||
/// </summary>
|
||||
THND,
|
||||
|
||||
+63
-42
@@ -556,12 +556,20 @@ namespace IOB_WIN
|
||||
|
||||
parentForm.sIN = Semaforo.SV;
|
||||
|
||||
stopwatch.Restart();
|
||||
// possiamo leggere tutto da qui che contiene status, mode e last_nc_error
|
||||
//oData = new Cndex.GETINFO1DATA();
|
||||
var ncInfo = OSAI_ref.NcInfo1(ref oData);
|
||||
// time rec
|
||||
if (utils.CRB("recTime"))
|
||||
{
|
||||
TimingData.addResult(currIobConf.codIOB, "GETINFO1DATA", stopwatch.ElapsedTicks);
|
||||
}
|
||||
stopwatch.Stop();
|
||||
|
||||
lgInfo(string.Format("Lettura completa NCINFO1DATA{0} lastNcError={1}{0}status={2}{0}substatus={9}{0}mode_select={3}{0}main_progr_name={4}{0}speed_ov={5}{0}progr_speed={6}{0}real_speed={7}{0}real_feed={8}{0}", Environment.NewLine, oData.last_nc_error, oData.status, oData.mode_select, oData.main_progr_name, oData.speed_ov, oData.progr_speed, oData.real_speed, oData.real_feed, oData.substatus));
|
||||
|
||||
#if false
|
||||
lgInfo(string.Format("Lettura completa NCINFO1DATA{0} lastNcError={1}{0}status={2}{0}substatus={9}{0}mode_select={3}{0}main_progr_name={4}{0}speed_ov={5}{0}progr_speed={6}{0}real_speed={7}{0}real_feed={8}{0}", Environment.NewLine, oData.last_nc_error, oData.status, oData.mode_select, oData.main_progr_name, oData.speed_ov, oData.progr_speed, oData.real_speed, oData.real_feed, oData.substatus));
|
||||
#endif
|
||||
|
||||
|
||||
#if false
|
||||
@@ -988,22 +996,11 @@ namespace IOB_WIN
|
||||
{
|
||||
try
|
||||
{
|
||||
// leggo tutto da 0 a 43...
|
||||
int memIndex = 0;
|
||||
// controllo modalità lettura memoria
|
||||
stopwatch.Restart();
|
||||
#if false
|
||||
OsaiMemRW(R, FANUC.MemType.G, memIndex, ref MemBlockG);
|
||||
if (utils.CRB("recTime"))
|
||||
{
|
||||
TimingData.addResult(currIobConf.codIOB, string.Format("R{0}-G-AREA", MemBlockG.Length), stopwatch.ElapsedTicks);
|
||||
}
|
||||
#endif
|
||||
|
||||
stopwatch.Stop();
|
||||
// verifico modo con valore corrente, se cambia aggiorno...
|
||||
#if false
|
||||
CNC_MODE newMode = decodeG43(MemBlockG[43]);
|
||||
|
||||
|
||||
#if true
|
||||
CNC_MODE newMode = decodeModeOsai(oData.mode_select);
|
||||
if (newMode != currMode)
|
||||
{
|
||||
// aggiorno!
|
||||
@@ -1014,7 +1011,7 @@ namespace IOB_WIN
|
||||
string sVal = string.Format("[CNC_MODE]{0}", descrMode);
|
||||
// chiamo accodamento...
|
||||
accodaFLog(sVal, qEncodeFLog("CNC_MODE", descrMode));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
catch (Exception exc)
|
||||
@@ -1025,6 +1022,46 @@ namespace IOB_WIN
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Decodifica del MODE selezionato
|
||||
/// </summary>
|
||||
/// <param name="mode"></param>
|
||||
/// <returns></returns>
|
||||
protected CNC_MODE decodeModeOsai(int mode)
|
||||
{
|
||||
CNC_MODE answ = CNC_MODE.ND;
|
||||
switch (mode)
|
||||
{
|
||||
case 1:
|
||||
answ = CNC_MODE.MDI;
|
||||
break;
|
||||
case 2:
|
||||
answ = CNC_MODE.AUTO;
|
||||
break;
|
||||
case 3:
|
||||
answ = CNC_MODE.SEMI;
|
||||
break;
|
||||
case 4:
|
||||
answ = CNC_MODE.JOG_MAN;
|
||||
break;
|
||||
case 5:
|
||||
answ = CNC_MODE.JOG_INC;
|
||||
break;
|
||||
case 6:
|
||||
answ = CNC_MODE.PROFILE;
|
||||
break;
|
||||
case 7:
|
||||
answ = CNC_MODE.HOME;
|
||||
break;
|
||||
case 8:
|
||||
answ = CNC_MODE.HANDLE_INC;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// decodifica il modo dai valori del byte G43
|
||||
@@ -1078,40 +1115,24 @@ namespace IOB_WIN
|
||||
{
|
||||
Dictionary<string, string> outVal = new Dictionary<string, string>();
|
||||
stopwatch.Restart();
|
||||
#if false
|
||||
CncLib.Focas1.ODBDY2_1 answ = OSAI_ref.getAllDynData();
|
||||
#endif
|
||||
if (utils.CRB("recTime"))
|
||||
{
|
||||
TimingData.addResult(currIobConf.codIOB, string.Format("PROC-DYN-DATA"), stopwatch.ElapsedTicks);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
#if false
|
||||
string actf = answ.actf.ToString();
|
||||
string acts = answ.acts.ToString();
|
||||
string actf = oData.real_feed.ToString();
|
||||
string acts = oData.real_speed.ToString();
|
||||
outVal.Add("DYNDATA", string.Format("FEED {0}#SPEED_RPM {1}", actf, acts));
|
||||
|
||||
if (utils.CRB("SendFeedSpeed"))
|
||||
{
|
||||
outVal.Add("FEED", actf);
|
||||
outVal.Add("SPEED_RPM", acts);
|
||||
//outVal.Add("NUM_ALARM", numAlarm);
|
||||
//outVal.Add("NUM_ALARM", numAlarm);
|
||||
outVal.Add("ACT_TOOL", oData.actual_tool.ToString());
|
||||
}
|
||||
#endif
|
||||
if (utils.CRB("SendAxPos"))
|
||||
{
|
||||
// salvo le posizioni...
|
||||
#if false
|
||||
CncLib.Focas1.FAXIS posAx = answ.pos;
|
||||
int[] currPosAbs = posAx.absolute;
|
||||
int i = 0;
|
||||
foreach (var item in currPosAbs)
|
||||
{
|
||||
i++;
|
||||
outVal.Add(string.Format("POS_{0:00}", i), item.ToString());
|
||||
}
|
||||
#endif
|
||||
// salvo info assi...
|
||||
outVal.Add("AX_SEL", oData.ax_sel.ToString());
|
||||
outVal.Add("NUM_AX_SEL", oData.num_ax_sel.ToString());
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
|
||||
Reference in New Issue
Block a user