From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview problem invoke node event

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

0 Kudos
Message 1 of 3
(2,168 Views)

Ciao Chiara,

cosa succede rendendo il metodo privato?

 

Marco

0 Kudos
Message 2 of 3
(2,146 Views)

Grazie Marco. Funziona 🙂

0 Kudos
Message 3 of 3
(2,135 Views)