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.
need to read Persist Array value from c# program
Moderators: TomKerekes, dynomotion
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: need to read Persist Array value from c# program
See here for how to read an integer persist variable from KFLOP. As in:
HTH
Code: Select all
int D = KM.GetUserData(11); // Get persist variable 11
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
Re: need to read Persist Array value from c# program
Thank you Tom, have a nice day,
Tiziano
Tiziano