need to read Persist Array value from c# program
Posted: Thu Dec 03, 2020 11:19 pm
Dear Tom,
i write a c program running on kflop ,it fill some Persist Array data and i need to read it from a c# program running on windows.
tha code is a part of your example program :
---------------------------------------------------------------
if (Connected && KM.WaitToken(100) == KMOTION_TOKEN.KMOTION_LOCKED)
{
KM_MainStatus MainStatus;
try
{
MainStatus = KM.GetStatus(false); // we already have a lock
KM.ReleaseToken();
XPos.Text = String.Format("{0:F1}", MainStatus.Destination[0]);
YPos.Text = String.Format("{0:F1}", MainStatus.Destination[1]);
// Diametro.Text = string.Format("GetPersistDec11 {0}", index); <-- i'm not able to write the rigth code,"Diametro" is declared in the code.
}
catch (DMException ex) // in case disconnect in the middle of reading status
{
KM.ReleaseToken();
MessageBox.Show(ex.InnerException.Message);
}
}
else
{
Connected = false;
}
thank you very much
Tiziano F.
i write a c program running on kflop ,it fill some Persist Array data and i need to read it from a c# program running on windows.
tha code is a part of your example program :
---------------------------------------------------------------
if (Connected && KM.WaitToken(100) == KMOTION_TOKEN.KMOTION_LOCKED)
{
KM_MainStatus MainStatus;
try
{
MainStatus = KM.GetStatus(false); // we already have a lock
KM.ReleaseToken();
XPos.Text = String.Format("{0:F1}", MainStatus.Destination[0]);
YPos.Text = String.Format("{0:F1}", MainStatus.Destination[1]);
// Diametro.Text = string.Format("GetPersistDec11 {0}", index); <-- i'm not able to write the rigth code,"Diametro" is declared in the code.
}
catch (DMException ex) // in case disconnect in the middle of reading status
{
KM.ReleaseToken();
MessageBox.Show(ex.InnerException.Message);
}
}
else
{
Connected = false;
}
thank you very much
Tiziano F.