10-08-2012 09:34 AM
I am making dlls in microsoft visual studio and then using in Labview 8.6 successfully. I used to give different inputs to the dll using Labview and it used to work fine. But now I need to take out the output from dll. For that I used the return type in the method that is used in invoke node. My function in C# is like this now:
public static short[] ToList(Int16[,] arrayData)
but i can not get the output from the dll in the labview. If i want to look at the output, i can just see whatever I've given in input but when I tried to run the same program from visual studio, it works fine. What might be the problem? What shall i do to get the output? Plz help. I've also attached a labview program.
10-09-2012 04:32 PM
The invoke node for the ToList method is only displaying one input parameter, but your function contains two inputs and an output. Methods called using the invoke node will contain inputs with connections on the left and outputs with connections on the right. Therefore, it is expected behavior that the output of arrayData will be the same as the input you have provided to it. Normally the name of the function in the invoke node will output the return value of the function.
Did you create a Class Library Project initially or change the project settings afterward?
LabVIEW supports .NET 2.0 compatible assemblies (through .NET 3.5). LabVIEW may not support all features of the .NET 4.0 Framework What is yout target framework under Project Properties?
Can you view the outputs of other methods?
10-10-2012 12:22 AM
My function contains only one input parameter. You can see in the fxn declaration and also the return type.
public static short[] ToList(Int16[,] arrayData)
{
return reducedArray.ToArray();
}
So in my knowledge, in the left hand side, there should be input for arrayData and in the right side there should be the ouput reducedArray but I can just see the same array data in the right hand side as well.
I created the Class Library project from initial state and my target framework is .net 3.5. I tried to use other method instead of ToList() but the results were same. What shall I do next? please help...
10-10-2012 05:03 PM
The returned value reducedArray is not the same as the output of arrayData. This value would show up as an output for "ToList". The input arrayData has an output terminal just in case you need to pass those same input values on to another method or function.
For example, I created the following method: public static short[] add(Int16[,] x). As shown in the picture below, the name of the method (add) is where the returned value is output.
I would receommend creating a new assembly by making a new class library project and copying your code.