Represents a TINE tagged structure. More...
Public Member Functions | |
| TTaggedStruct (object tstruct) | |
| The primary constructor for a TINE tagged structure. | |
Represents a TINE tagged structure.
A tagged structure is a user-defined data type that can carry any set of TINE data types (including other tagged structures) as an atomic unit.
| tine::TTaggedStruct::TTaggedStruct | ( | object | tstruct | ) | [inline] |
The primary constructor for a TINE tagged structure.
Using this constructor will assign the structure's 'tag' name from the .NET structure's class name and the field names from the associated field names. But note: A structure's 'tag' name as well as the field names within a TINE tagged structure cannot exceed 16 characters. An alternative is to pass a null object and assign the structure's tag name and fields manually.
| tstruct | is a .NET structure which will be examined and converted into a TINE tagged structure. |
Example:
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] public unsafe struct SineInfo { public float amplitude; public float frequency; public float noise; public float phase; public int numberCalls; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] public char[] description; }; private const int NUM_DEVICES = 10; private SineInfo[] sineInfoTable = new SineInfo[NUM_DEVICES]; // intermediate code omitted ... TTaggedStruct tts = new TTaggedStruct(sineInfoTable); myeqm = new TEquipmentModule("DotNetSine", "DNTEQM", 10, sineqm, sinini, sinbkg, 1000, sinexi); TDataType dtout = new TDataType(8192,Formats.CF_FLOAT,null); myeqm.RegisterPropertyInformation("Sine", dtout, null, Access.CA_READ, ArrayType.AT_TRACE, 8192, "[-512:512 V]Sine Curve", PRP_SINE, ""); dtout = new TDataType(10, Formats.CF_FLOAT, null); TDataType dtin = new TDataType(1, Formats.CF_FLOAT, null); myeqm.RegisterPropertyInformation("Amplitude", dtout, dtin, Access.CA_READ | Access.CA_WRITE, ArrayType.AT_CHANNEL, 10, "[-512:512 V]Sine Curve Amplitude", PRP_AMPLITUDE, ""); myeqm.RegisterPropertyInformation("Frequency", dtout, dtin, Access.CA_READ | Access.CA_WRITE, ArrayType.AT_CHANNEL, 10, "[1:20 Hz]Sine Curve Frequency", PRP_FREQUENCY, ""); myeqm.RegisterPropertyInformation("Phase", dtout, dtin, Access.CA_READ | Access.CA_WRITE, ArrayType.AT_CHANNEL, 10, "[0:6.28]Sine curve Phase", PRP_PHASE, ""); myeqm.RegisterPropertyInformation("Noise", dtout, dtin, Access.CA_READ | Access.CA_WRITE, ArrayType.AT_CHANNEL, 10, "[0:50 V]Sine curve Noise", PRP_NOISE, ""); // a property using the registered tagged structure: dtout = new TDataType(10, Formats.CF_STRUCT, "SineInfo"); dtin = new TDataType(1, Formats.CF_STRUCT, "SineInfo"); myeqm.RegisterPropertyInformation("SineInfo", dtout, dtin, Access.CA_READ | Access.CA_WRITE, ArrayType.AT_UNKNOWN, 10, "Sine curve Information", PRP_INFO, "");
1.5.8