Main Page | Features | Central Services | csv-Files | Types | Transfer | Access | API-C | API-.NET | API-Java | Examples | Downloads
page generated on 18.05.2024 - 04:45
Public Member Functions | List of all members
tine.TTaggedStruct Class Reference

Represents a TINE tagged structure. More...

Public Member Functions

 TTaggedStruct (object tstruct)
 The primary constructor for a TINE tagged structure. More...
 
 TTaggedStruct (object tstruct, string tstag)
 The primary constructor for a TINE tagged structure. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ TTaggedStruct() [1/2]

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.

Parameters
tstructis 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 ...
// this will register the tagged structure
TTaggedStruct tts = new TTaggedStruct(sineInfoTable); // will use the struct name 'SineInfo' as the tagged structure name
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, "");

◆ TTaggedStruct() [2/2]

tine.TTaggedStruct.TTaggedStruct ( object  tstruct,
string  tstag 
)
inline

The primary constructor for a TINE tagged structure.

Using this constructor will assign the structure's 'tag' name according to the tag parameter passed. If a null or empty string is passed then the constructor reverts to its simpler form using 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.

Parameters
tstructis a .NET structure which will be examined and converted into a TINE tagged structure.
tstagis a structure tag name to be assigned to the structure registered.

Example:


The documentation for this class was generated from the following file:

Impressum   |   Imprint   |   Datenschutzerklaerung   |   Data Privacy Policy   |   Declaration of Accessibility   |   Erklaerung zur Barrierefreiheit
Generated for TINE API by  doxygen 1.5.8