Skip to content

Commit be7b550

Browse files
Merge pull request #26 from Fluigent/ips-support
Added support for IPS for each language. Updated manual
2 parents 7b199d2 + c5ef619 commit be7b550

File tree

95 files changed

+1319
-245
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+1319
-245
lines changed

C#/Examples/Advanced Custom Sensor Regulation/Advanced Custom Sensor Regulation.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp2.2</TargetFramework>
5+
<TargetFramework>netcoreapp3.0</TargetFramework>
66
<RootNamespace>Advanced_Custom_Sensor_Regulation</RootNamespace>
77
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
88
</PropertyGroup>

C#/Examples/Advanced Features/Advanced Features.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp2.2</TargetFramework>
5+
<TargetFramework>netcoreapp3.0</TargetFramework>
66
<RootNamespace>Advanced_Features</RootNamespace>
77
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
88
</PropertyGroup>

C#/Examples/Advanced Features/Program.cs

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ static void Main(string[] args)
8080
Console.WriteLine($"Read sensor calibration: {table}");
8181

8282
// Change sensor calibration
83+
// WARNING: For IPS use only when current pressure is 0 mbar. This function will set current pressure as a reference point. Enum parameter fgt_SENSOR_CALIBRATION is irrelevant for IPS
8384
fgtSdk.Fgt_set_sensorCalibration(0, fgt_SENSOR_CALIBRATION.H2O); // Note that if calibration is not supported, an error is thrown
8485
Console.WriteLine($"Setting sensor calibration to {fgt_SENSOR_CALIBRATION.H2O}...");
8586
Thread.Sleep(1000); // As for pressure calibration, this step needs few moments before read values are correct. Same error is thrown.

C#/Examples/Advanced Parallel Pressure Control/Advanced Parallel Pressure Control.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp2.2</TargetFramework>
5+
<TargetFramework>netcoreapp3.0</TargetFramework>
66
<RootNamespace>Advanced_Parallel_Pressure_Control</RootNamespace>
77
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
88
</PropertyGroup>

C#/Examples/Advanced Specific Multiple Instruments/Advanced Specific Multiple Instruments.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp2.2</TargetFramework>
5+
<TargetFramework>netcoreapp3.0</TargetFramework>
66
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
77
</PropertyGroup>
88

C#/Examples/Basic Get Instruments Info/Basic Get Instruments Info.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp2.2</TargetFramework>
5+
<TargetFramework>netcoreapp3.0</TargetFramework>
66
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
77
</PropertyGroup>
88

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>netcoreapp3.0</TargetFramework>
6+
<RootNamespace>Read_Sensor_Data</RootNamespace>
7+
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<ProjectReference Include="..\..\fgt_sdk_csharp\fgt_sdk.csproj" />
12+
</ItemGroup>
13+
14+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Threading;
4+
using fgt_sdk;
5+
using fgt_sdk.Enums;
6+
using fgt_sdk.Structs;
7+
8+
namespace Basic_Read_Sensor_Data
9+
{
10+
class Program
11+
{
12+
/// <summary>
13+
/// This example shows how to retrieve a data from the sensor channel
14+
/// Hardware setup: One or more connected devices with sensor channel(s) or standalone sensor device(s).
15+
/// </summary>
16+
/// <param name="args"></param>
17+
static void Main(string[] args)
18+
{
19+
fgt_ERROR_CODE errCode;
20+
21+
// Initialize session with all detected Fluigent instrument(s)
22+
// This step is optional, if not called session will be automatically created
23+
errCode = fgtSdk.Fgt_init();
24+
25+
if (errCode == fgt_ERROR_CODE.OK)
26+
{
27+
int sensorChannelsCount;
28+
// Get total number of initialized sensor channel(s)
29+
(errCode, sensorChannelsCount) = fgtSdk.Fgt_get_sensorChannelCount();
30+
Console.WriteLine($"Status: {errCode} ### Total number of sensor channels detected: {sensorChannelsCount}");
31+
32+
List<(fgt_CHANNEL_INFO channelInfo, fgt_SENSOR_TYPE sensorType)> sensorChannelsInfo;
33+
// Get information about the connected sensor channel(s)
34+
(errCode, sensorChannelsInfo) = fgtSdk.Fgt_get_sensorChannelsInfo();
35+
Console.WriteLine($"Status: {errCode} ### Retrieved information about {sensorChannelsInfo.Count} sensor channel(s)");
36+
37+
// Display the sensor(s) general information in console
38+
foreach (var channel in sensorChannelsInfo)
39+
{
40+
uint index = channel.channelInfo.Index;
41+
Console.WriteLine($"{Environment.NewLine} ### Index: {index}{Environment.NewLine}" +
42+
$" ### Device SN: {channel.channelInfo.DeviceSN}{Environment.NewLine}" +
43+
$" ### Firmware: {channel.channelInfo.Firmware}{Environment.NewLine}" +
44+
$" ### ID: {channel.channelInfo.IndexId}{Environment.NewLine}" +
45+
$" ### Type: {channel.channelInfo.InstrType}{Environment.NewLine}" +
46+
$" ### Sensor type: {channel.sensorType}{Environment.NewLine}");
47+
48+
string unit;
49+
// Retrieve the sensor unit
50+
(errCode, unit) = fgtSdk.Fgt_get_sensorUnit(index);
51+
Console.WriteLine($"Status: {errCode} ### Sensor {index} unit {unit}");
52+
53+
float pmin, pmax;
54+
// Get information about the sensor range
55+
(errCode, (pmin, pmax)) = fgtSdk.Fgt_get_sensorRange(index);
56+
Console.WriteLine($"Status: {errCode} ### Sensor {index} range from {pmin:0} to {pmax:0} {unit}");
57+
58+
float value;
59+
// Read sensor data
60+
for (int i = 0; i < 5; i++)
61+
{
62+
// Retrieve value from sensor
63+
(errCode, value) = fgtSdk.Fgt_get_sensorValue(index);
64+
Console.WriteLine($"Status: {errCode} ### Sensor {index} returned value {value:0.0} {unit}");
65+
66+
// Add a small delay between value read
67+
Thread.Sleep(200);
68+
}
69+
}
70+
}
71+
else
72+
{
73+
Console.WriteLine($"Status: {errCode} ### Please make sure that your hardware setup matches this example's requirements and that all instruments are connected to the computer");
74+
}
75+
76+
fgtSdk.Fgt_close(); // Close session
77+
78+
Console.WriteLine($"{Environment.NewLine}Close this console by pressing enter");
79+
Console.ReadLine();
80+
}
81+
}
82+
}

C#/Examples/Basic Sensor Regulation/Basic Sensor Regulation.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp2.2</TargetFramework>
5+
<TargetFramework>netcoreapp3.0</TargetFramework>
66
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
77
</PropertyGroup>
88

C#/Examples/Basic Set Pressure/Basic Set Pressure.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp2.2</TargetFramework>
5+
<TargetFramework>netcoreapp3.0</TargetFramework>
66
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
77
</PropertyGroup>
88

0 commit comments

Comments
 (0)