TReK .NET Framework  5.3.2
Telemetry/Command API
Telemetry_Dotnet_Example/Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Telemetry_Dotnet_Example
{
class Program
{
//For this program to work:
//add the following statment above: using trek
//add this reference file to your project: trek_telemetry_dotnet_api.dll
//don't forget to add the other DLLs in the folder with your .exe file
static void Main(string[] args)
{
var callFunction = new Program();
callFunction.Get_Next_Converted_Double_Value();
}
public void Get_Next_Converted_Double_Value()
{
String msid = new String("MSID038".ToCharArray());
String apid = new String("7".ToCharArray());
UInt32 number_samples = 10;
String[] status = new String[number_samples];
int return_code = -1;
int[] token = new int[3];
Double[] val = new Double[number_samples];
token[0] = token[1] = token[2] = 0; // token should always be initialized to 0.
return_code = trek_user_api.Get_Next_Converted_Double_Value(PACKET_TYPE.Pdss_Payload, msid, apid, DATA_MODE.Real_Time, out number_samples, SENSING.No_Sense, token, out val, out status);
//Check return to see id command sent successfully
if (return_code == (int)TREK_USER_API_RETURN_CODES.api_SUCCESS)
{
Console.WriteLine("Success getting information");
Console.ReadKey();
}
else if (return_code == (int)TREK_USER_API_RETURN_CODES.api_MORE_DATA_AVAILABLE)
{
Console.WriteLine("Success getting information. More Data Available");
Console.ReadKey();
}
else
Console.WriteLine("Error getting information {0}", return_code);
Console.ReadKey();
}
}
}