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:
But I did create the SignalForTestStandtype and MessageForTestStandBistype with the "Create custom data" button from the function and I am sure both types are created properly.
At first, with MessageForTestStandBistype, 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 SignalForTestStandwith another function into TestStand, it works good.
If I remove the array of SignalForTestStandfrom the MessageForTestStandBis, then I can also successfully get an array of MessageForTestStandBisinto TestStand.
However it seems impossible to transfer the array of MessageForTestStandBiswhen 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