LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to transfer structure contains structure to .net assembly in LabVIEW?

I’v read some good posts here, like http://forums.ni.com/t5/LabVIEW/How-do-you-create-a-cluster-in-C-for-use-in-a-NET-assembly/m-p/84392.... I don't have problem on getting structure contains structure from .net assembly, but I could not pass a structure contains structure to a .net assembly in LabVIEW. The detailed description follows:

 

I’m trying to pass information to a .net assembly which takes a parameter of structTest, but failed. Somebody please shed light on the problem. A simple demo LV vi is most preferred.

 

The definition of structTest is as following:

Structure structTest

    Dim int32TestProcedureIpn As Int32

    Dim strTestProcedureRev As String

    Dim strTestProcedureDesc As String

    Dim bPassed As Boolean

    Dim strOperatorName As String

    Dim strComments As String

    Dim arstResults As structStepResult() (Here is issue)

End Structure

 

arstResults is an array used to keep test results of each test step. Each test step results is defined as following:

 

Structure structStepResult

    Dim int32StepNo As Int32

    Dim strFailureDesc As String 'can be test step description

    Dim bPassFail As Boolean

End Structure

 

Thanks a million!

0 Kudos
Message 1 of 4
(3,686 Views)

Hi y20708,

 

Please refer to this link and this one.

 

Best,

 

CarmenC.

0 Kudos
Message 2 of 4
(3,654 Views)

Thank you very much CarmenC.

 

I realized that I mixed up type identifier. Eventually I decided to split the structure parameter and modified the test results from array to arraylist (.net assembly was modified first). My LabVIEW program to assign value to parameter is like the following:

New Bitmap Image.jpg

 

Because the .net assembly performs other tasks, when they did not work, I found out that LabVIEW copies the assembly to user's AppData folder and made System.Reflection.Assembly.GetExecutingAssembly().Location returns unexpected information. Hope this could be help to someone.

0 Kudos
Message 3 of 4
(3,631 Views)

New Bitmap Image.jpgI found the image could not be viewed clearly and only know how to post a full picture. Smiley Happy

 

Message 4 of 4
(3,629 Views)