02-26-2014 04:23 AM
Salve a tutti,
ho questa classe in C#:
public class GUIRequest
{
private Client Clnt;
public GUIRequest()
{
this.Clnt = new TerminalEngine.Client(true);
}
public void CallAccountRequest(string ID)
{
this.Clnt.getRFAccount().AccountRequest(ID);
Clnt.getRFAccount().SendResponse2BLLabview += new RFAccount.SendResponse2BLLabviewHandler(ReceiveIdentificationResponse); //to check if it is the right place
}
public void ReceiveIdentificationResponse(object sender, OtherClasses.IdentificationResponse e)
{
if (SendResponse2Labview != null)
{
OtherClasses.IdentificationResponse argument = new OtherClasses.IdentificationResponse();
argument.UserName = e.UserName;
this.SendResponse2Labview(this, argument);
}
}
public void provamethod(int a)
{
int b = a;
}
public delegate void SendResponse2LabviewHandler(object o, IdentificationResponse e);
public event SendResponse2LabviewHandler SendResponse2Labview;
}
Quando vado ad usare la dll di questa classe in labview, come prima cosa uso il constructor node Successivamente, prendo un invoke node ed ho il seguente problema: non vedo metodi da utilizzare. Stranamente, se provo a commentare il metodo ReceiveIdentificationResponse, magicamente riesco a vedere (e quindi usare) gli altri due metodi. Quindi mi viene il dubbio che usando un metodo che ha come parametri (object sender, OtherClasses.IdentificationResponse e),crea qualche problama labview. In pratica questo metodo che crea problemi viene usato da C# (non da labview) per generare un evento che labview dovrà raccogliere.
Sapete aiutarmi per favore?
Grazie in anticipo,
Chiara
02-26-2014 06:45 AM
Ciao Chiara,
cosa succede rendendo il metodo privato?
Marco
02-26-2014 08:06 AM
Grazie Marco. Funziona 🙂