NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Share data (basically array of an array) between a C# dll and TestStand

Dear all,

 

Working with CAN communication, I am trying send an array of CAN message objects between my C# dll and TestStand.

 

The message object is a struct:

 

public struct MessageForTestStandBis
{
public Int64 msgSize;
public String msgID;
public String msgName;
public String msgNode;
public String[] timestamp;
public SignalForTestStand[] signals;
}

 

And the message object contains an array of signals, a signal is defined as:

 

public struct SignalForTestStand
{
public UInt16 sigStartBit;
public UInt16 sigLength;
public Decimal[] sigValue;
public Double sigLimitMinimum;
public Decimal sigLimitMaximum;
public Decimal sigFactor;
public Decimal sigOffset;
public String sigName;
public String sigUnit;
public String sigByteOrder;
public Int32 countOfBytesContainingData;
public UInt16 indexOfTheStartByte;
public UInt16 indexOfTheEndByte;
}

 

When trying to get an array of MessageForTestStandBis into TestStand, I am getting this error:

 

Lchar_0-1661960121942.png

 

But I did create the SignalForTestStand type and MessageForTestStandBis type with the "Create custom data" button from the function and I am sure both types are created properly.

At first, with MessageForTestStandBis type, TestStand had created automatically an array of Containers for the "Signals" field but I have manually changed it into an array of SignalForTestStand.

 

If I try to get only the array of SignalForTestStand with another function into TestStand, it works good.

If I remove the array of SignalForTestStand from the MessageForTestStandBis, then I can also successfully get an array of MessageForTestStandBis into TestStand.

However it seems impossible to transfer the array of MessageForTestStandBis when each MessageForTestStandBis includes an array of SignalForTestStand.

 

I can of course get both arrays (MessageForTestStandBis (without signals) and SignalForTestStand) separately and build them again together into TestStand but it's quite an ugly solution and more time consuming which is an important matter for my application.

A colleague of mine has told me it's not possible to transfer an array of an array between a C# dll and TestStand (which is basically what I am trying to do). 

I would like to check with the NI community whether someone knows if and how it would be possible?

 

Best regards,

Ludovic

0 Kudos
Message 1 of 2
(741 Views)

AFAIK, you cannot pass complex data structures between C# dll and TestStand

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 2
(721 Views)