Skip to content

Commit 674b572

Browse files
authored
Merge pull request #35 from Fluigent/version-21.2.0.0
Update SDK to version 21.2.0.0
2 parents f89c488 + 91a327e commit 674b572

File tree

63 files changed

+252
-130
lines changed

Some content is hidden

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

63 files changed

+252
-130
lines changed

C#/Examples/Basic Get Instruments Info/Program.cs

+22-44
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ static void Main(string[] args)
2727
// List all found controllers serial number and type
2828
for (var index = 0; index < controllersCount; index++)
2929
{
30-
Console.WriteLine($"Detected instrument at index: {index}{Environment.NewLine}" +
31-
$"Controller SN: {instruments[index].serialNumber}{Environment.NewLine}" +
32-
$"Type: {instruments[index].type}{Environment.NewLine}");
30+
Console.WriteLine($"Detected instrument at index: {index}");
31+
Console.WriteLine($"Controller SN: {instruments[index].serialNumber}");
32+
Console.WriteLine($"Type: {instruments[index].type}{Environment.NewLine}");
3333
}
3434

3535
// Initialize only specific instrument controllers here
@@ -47,85 +47,63 @@ static void Main(string[] args)
4747

4848
// Get total number of initialized TTL channel(s)
4949
(errCode, ttlChannelsCount) = fgtSdk.Fgt_get_TtlChannelCount();
50-
Console.WriteLine($"Total number of TTL channels: {ttlChannelsCount}{Environment.NewLine}");
50+
Console.WriteLine($"Total number of TTL channels: {ttlChannelsCount}");
5151

5252
// Get total number of initialized TTL channel(s)
5353
(errCode, valveChannelsCount) = fgtSdk.Fgt_get_valveChannelCount();
54-
Console.WriteLine($"Total number of valve channels: {valveChannelsCount}{Environment.NewLine}");
54+
Console.WriteLine($"Total number of valve channels: {valveChannelsCount}");
55+
56+
Console.WriteLine("");
5557

5658
// Get detailed information about all controller(s)
5759
List<fgt_CONTROLLER_INFO> controllerInfos;
5860
(errCode, controllerInfos) = fgtSdk.Fgt_get_controllersInfo();
5961

6062
for (var index = 0; index < controllersCount; index++)
6163
{
62-
Console.WriteLine($"Controller info at index: {index}{Environment.NewLine}" +
63-
$"SN: {controllerInfos[index].SN}{Environment.NewLine}" +
64-
$"Firmware: {controllerInfos[index].Firmware}{Environment.NewLine}" +
65-
$"ID: {controllerInfos[index].Id}{Environment.NewLine}" +
66-
$"Type: {controllerInfos[index].InstrType}{Environment.NewLine}");
64+
Console.WriteLine($"Controller info at index: {index}");
65+
Console.WriteLine(controllerInfos[index]);
66+
Console.WriteLine("");
6767
}
6868

6969
// Get detailed information about all pressure channels
7070
List<fgt_CHANNEL_INFO> pressureChannelInfo;
7171
(errCode, pressureChannelInfo) = fgtSdk.Fgt_get_pressureChannelsInfo();
7272
for (var index = 0; index < pressureChannelsCount; index++)
7373
{
74-
Console.WriteLine($"Pressure channel info at index: {index}{Environment.NewLine}" +
75-
$"Controller SN: {pressureChannelInfo[index].ControllerSN}{Environment.NewLine}" +
76-
$"Device SN: {pressureChannelInfo[index].DeviceSN}{Environment.NewLine}" +
77-
$"Firmware: {pressureChannelInfo[index].Firmware}{Environment.NewLine}" +
78-
$"Position: {pressureChannelInfo[index].Position}{Environment.NewLine}" +
79-
$"Index: {pressureChannelInfo[index].Index}{Environment.NewLine}" +
80-
$"ID: {pressureChannelInfo[index].IndexId}{Environment.NewLine}" +
81-
$"Type: {pressureChannelInfo[index].InstrType}{Environment.NewLine}");
74+
Console.WriteLine($"Pressure channel info at index: {index}");
75+
Console.WriteLine(pressureChannelInfo[index]);
76+
Console.WriteLine("");
8277
}
8378

8479
// Get detailed information about all sensor channels
8580
List<(fgt_CHANNEL_INFO channelInfo, fgt_SENSOR_TYPE sensorType)> sensorChannelsInfo;
8681
(errCode, sensorChannelsInfo) = fgtSdk.Fgt_get_sensorChannelsInfo();
8782
for (var index = 0; index < sensorChannelsCount; index++)
8883
{
89-
Console.WriteLine($"Sensor channel info at index: {index}{Environment.NewLine}" +
90-
$"Controller SN: {sensorChannelsInfo[index].channelInfo.ControllerSN}{Environment.NewLine}" +
91-
$"Device SN: {sensorChannelsInfo[index].channelInfo.DeviceSN}{Environment.NewLine}" +
92-
$"Firmware: {sensorChannelsInfo[index].channelInfo.Firmware}{Environment.NewLine}" +
93-
$"Position: {sensorChannelsInfo[index].channelInfo.Position}{Environment.NewLine}" +
94-
$"Index: {sensorChannelsInfo[index].channelInfo.Index}{Environment.NewLine}" +
95-
$"ID: {sensorChannelsInfo[index].channelInfo.IndexId}{Environment.NewLine}" +
96-
$"Type: {sensorChannelsInfo[index].channelInfo.InstrType}{Environment.NewLine}" +
97-
$"Sensor type: {sensorChannelsInfo[index].sensorType}{Environment.NewLine}");
84+
Console.WriteLine($"Sensor channel info at index: {index}");
85+
Console.WriteLine(sensorChannelsInfo[index].channelInfo);
86+
Console.WriteLine($"Sensor type: {sensorChannelsInfo[index].sensorType}{Environment.NewLine}");
9887
}
9988

10089
// Get detailed information about all ttl channels
10190
List<fgt_CHANNEL_INFO> ttlChannelsInfo;
10291
(errCode, ttlChannelsInfo) = fgtSdk.Fgt_get_TtlChannelsInfo();
10392
for (var index = 0; index < ttlChannelsCount; index++)
10493
{
105-
Console.WriteLine($"TTL channel info at index: {index}{Environment.NewLine}" +
106-
$"Controller SN: {ttlChannelsInfo[index].ControllerSN}{Environment.NewLine}" +
107-
$"Device SN: {ttlChannelsInfo[index].DeviceSN}{Environment.NewLine}" +
108-
$"Firmware: {ttlChannelsInfo[index].Firmware}{Environment.NewLine}" +
109-
$"Position: {ttlChannelsInfo[index].Position}{Environment.NewLine}" +
110-
$"Index: {ttlChannelsInfo[index].Index}{Environment.NewLine}" +
111-
$"ID: {ttlChannelsInfo[index].IndexId}{Environment.NewLine}" +
112-
$"Type: {ttlChannelsInfo[index].InstrType}{Environment.NewLine}");
94+
Console.WriteLine($"TTL channel info at index: {index}");
95+
Console.WriteLine(ttlChannelsInfo[index]);
96+
Console.WriteLine("");
11397
}
11498

11599
// Get detailed information about all valve channels
116100
List<(fgt_CHANNEL_INFO channelInfo, fgt_VALVE_TYPE valveType)> valveChannelsInfo;
117101
(errCode, valveChannelsInfo) = fgtSdk.Fgt_get_valveChannelsInfo();
118102
for (var index = 0; index < valveChannelsCount; index++)
119103
{
120-
Console.WriteLine($"Valve channel info at index: {index}{Environment.NewLine}" +
121-
$"Controller SN: {valveChannelsInfo[index].channelInfo.ControllerSN}{Environment.NewLine}" +
122-
$"Device SN: {valveChannelsInfo[index].channelInfo.DeviceSN}{Environment.NewLine}" +
123-
$"Firmware: {valveChannelsInfo[index].channelInfo.Firmware}{Environment.NewLine}" +
124-
$"Position: {valveChannelsInfo[index].channelInfo.Position}{Environment.NewLine}" +
125-
$"Index: {valveChannelsInfo[index].channelInfo.Index}{Environment.NewLine}" +
126-
$"ID: {valveChannelsInfo[index].channelInfo.IndexId}{Environment.NewLine}" +
127-
$"Type: {valveChannelsInfo[index].channelInfo.InstrType}{Environment.NewLine}" +
128-
$"Valve type: {valveChannelsInfo[index].valveType}{Environment.NewLine}");
104+
Console.WriteLine($"Valve channel info at index: {index}");
105+
Console.WriteLine(valveChannelsInfo[index].channelInfo);
106+
Console.WriteLine($"Valve type: {valveChannelsInfo[index].valveType}{Environment.NewLine}");
129107
}
130108
}
131109
else
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

C#/fgt_sdk_csharp/Structs/fgt_CHANNEL_INFO.cs

+17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using fgt_sdk.Enums;
2+
using System;
23

34
namespace fgt_sdk.Structs
45
{
@@ -21,5 +22,21 @@ public struct fgt_CHANNEL_INFO
2122
public uint IndexId;
2223
/** Type of the instrument */
2324
public fgt_INSTRUMENT_TYPE InstrType;
25+
/// <summary>
26+
/// Prints the struct fields
27+
/// </summary>
28+
/// <returns></returns>
29+
public override string ToString()
30+
{
31+
return string.Join(Environment.NewLine, new string[] {
32+
$"Controller SN: {ControllerSN}",
33+
$"Device SN: {DeviceSN}",
34+
$"Firmware: {(Firmware >> 8) & 0xFF:x}.{Firmware & 0xFF:x2}",
35+
$"Position: {Position}",
36+
$"Index: {Index}",
37+
$"ID: {IndexId}",
38+
$"Type: {InstrType}",
39+
});
40+
}
2441
}
2542
}

C#/fgt_sdk_csharp/Structs/fgt_CONTROLLER_INFO.cs

+14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using fgt_sdk.Enums;
2+
using System;
23
using System.Runtime.InteropServices;
34

45
namespace fgt_sdk.Structs
@@ -17,5 +18,18 @@ public struct fgt_CONTROLLER_INFO
1718
public uint Id;
1819
/** Instrument type */
1920
public fgt_INSTRUMENT_TYPE InstrType;
21+
/// <summary>
22+
/// Prints the struct fields
23+
/// </summary>
24+
/// <returns></returns>
25+
public override string ToString()
26+
{
27+
return string.Join(Environment.NewLine, new string[] {
28+
$"Controller SN: {SN}",
29+
$"Firmware: {(Firmware >> 8) & 0xFF:x}.{Firmware & 0xFF:x2}",
30+
$"ID: {Id}",
31+
$"Type: {InstrType}",
32+
});
33+
}
2034
}
2135
}

C#/fgt_sdk_csharp/fgt_sdk.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
<Authors>Fluigent</Authors>
66
<Product>Fluigent Software Development Kit</Product>
77
<Description>C# Software Development Kit for Fluigent instruments</Description>
8-
<Version>21.1.0.0</Version>
8+
<Version>21.2.0.0</Version>
99
<PackageTags>Microfluidics, Control</PackageTags>
1010
<Platforms>AnyCPU;x64;x86</Platforms>
1111
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
12-
<AssemblyVersion>21.1.0.0</AssemblyVersion>
12+
<AssemblyVersion>21.2.0.0</AssemblyVersion>
1313
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
1414
<Copyright>Copyright (c) Fluigent 2021</Copyright>
1515
<RepositoryUrl>https://github.com/Fluigent/fgt-SDK</RepositoryUrl>
1616
<PackageProjectUrl>https://www.fluigent.com/</PackageProjectUrl>
17-
<FileVersion>21.1.0.0</FileVersion>
17+
<FileVersion>21.2.0.0</FileVersion>
1818
</PropertyGroup>
1919

2020
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">

C++/Examples/Basic Get Instruments Info/Basic Get Instruments Info.cpp

+13-20
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ int main()
6565

6666
// Get total number of initialized TTL channel(s)
6767
Fgt_get_TtlChannelCount(&ttl_number);
68-
std::cout << "Total number of TTL channels: " << int(ttl_number) << std::endl << std::endl;
68+
std::cout << "Total number of TTL channels: " << int(ttl_number) << std::endl;
6969

7070
// Get total number of initialized valve channel(s)
7171
Fgt_get_valveChannelCount(&valve_number);
@@ -75,49 +75,42 @@ int main()
7575
Fgt_get_controllersInfo(controller_info);
7676
for (unsigned char loop = 0; loop < controller_number; loop++)
7777
{
78-
std::cout << "Controller info at index: " << int(loop) << " SN: " << controller_info[loop].SN
79-
<< " Firmware: " << controller_info[loop].Firmware << " ID: " << controller_info[loop].id
80-
<< " type: " << controller_info[loop].InstrType << std::endl;
78+
std::cout << "Controller info at index: " << int(loop) << "\n"
79+
<< controller_info[loop] << "\n\n";
8180
}
8281

8382
// Get detailed information about all pressure channels
8483
Fgt_get_pressureChannelsInfo(pressure_info);
8584
for (unsigned char loop = 0; loop < pressure_number; loop++)
8685
{
87-
std::cout << "Pressure channel info at index: " << int(loop) << " ,Controller SN: " << pressure_info[loop].ControllerSN
88-
<< " DeviceSN: " << pressure_info[loop].DeviceSN << " firmware: " << pressure_info[loop].firmware
89-
<< " position: " << pressure_info[loop].position << " index: " << pressure_info[loop].index
90-
<< " ID: " << pressure_info[loop].indexID << " InstrType: " << pressure_info[loop].InstrType << std::endl;
86+
std::cout << "Pressure channel info at index: " << int(loop) << "\n"
87+
<< pressure_info[loop] << "\n\n";
9188
}
9289

9390
// Get detailed information about all sensor channels
9491
Fgt_get_sensorChannelsInfo(sensor_info, sensor_type);
9592
for (unsigned char loop = 0; loop < sensor_number; loop++)
9693
{
97-
std::cout << "Sensor channel info at index: " << int(loop) << " ,ControllerSN: " << sensor_info[loop].ControllerSN
98-
<< " DeviceSN: " << sensor_info[loop].DeviceSN << " firmware: " << sensor_info[loop].firmware
99-
<< " position: " << sensor_info[loop].position << " index: " << sensor_info[loop].index
100-
<< " ID: " << sensor_info[loop].indexID << " InstrType: " << sensor_info[loop].InstrType << " sensor SensorType: " << sensor_type[loop] << std::endl;
94+
std::cout << "Sensor channel info at index: " << int(loop) << "\n"
95+
<< sensor_info[loop] << "\n"
96+
<< "Sensor type: " << sensor_type[loop] << "\n\n";
10197
}
10298

10399
// Get detailed information about all TTL channels
104100
Fgt_get_TtlChannelsInfo(Ttl_info);
105101
for (unsigned char loop = 0; loop < ttl_number; loop++)
106102
{
107-
std::cout << "TTL channel info at index: " << int(loop) << " ControllerSN: " << Ttl_info[loop].ControllerSN
108-
<< " DeviceSN: " << Ttl_info[loop].DeviceSN << " firmware: " << Ttl_info[loop].firmware
109-
<< " position: " << Ttl_info[loop].position << " index: " << Ttl_info[loop].index
110-
<< " ID: " << Ttl_info[loop].indexID << " InstrType: " << Ttl_info[loop].InstrType << std::endl;
103+
std::cout << "TTL channel info at index: " << int(loop) << "\n"
104+
<< Ttl_info[loop] << "\n\n";
111105
}
112106

113107
// Get detailed information about all valve channels
114108
Fgt_get_valveChannelsInfo(valve_info, valve_type);
115109
for (unsigned char loop = 0; loop < valve_number; loop++)
116110
{
117-
std::cout << "Valve channel info at index: " << int(loop) << " ,ControllerSN: " << valve_info[loop].ControllerSN
118-
<< " DeviceSN: " << valve_info[loop].DeviceSN << " firmware: " << valve_info[loop].firmware
119-
<< " position: " << valve_info[loop].position << " index: " << valve_info[loop].index
120-
<< " ID: " << valve_info[loop].indexID << " InstrType: " << valve_info[loop].InstrType << " valve ValveType: " << valve_type[loop] << std::endl;
111+
std::cout << "Valve channel info at index: " << int(loop) << "\n"
112+
<< valve_info[loop] << "\n"
113+
<< "Valve type: " << valve_type[loop] << "\n\n";
121114
}
122115

123116
// Close session

C++/fgt_SDK_Cpp/dlls/fgt_SDK.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
*
77
* Title: fgt_SDK.h
88
* Purpose: Functions API for Fluigent instruments
9-
* Version: 21.1.0.0
10-
* Date: 05/2021
9+
* Version: 21.2.0.0
10+
* Date: 07/2021
1111
*============================================================================*/
1212

1313
#ifndef _FGT_SDK_H
@@ -116,7 +116,7 @@ typedef struct
116116
{
117117
/** Serial number of this channel's controller */
118118
unsigned short ControllerSN;
119-
/** Firmware version of this channel (0 if not applicable) */
119+
/** Firmware version of this channel in BCD (0 if not applicable) */
120120
unsigned short firmware;
121121
/** Serial number of this channel (0 if not applicable) */
122122
unsigned short DeviceSN;
@@ -135,7 +135,7 @@ typedef struct
135135
{
136136
/** Serial number */
137137
unsigned short SN;
138-
/** Firmware version */
138+
/** Firmware version in BCD */
139139
unsigned short Firmware;
140140
/** Index */
141141
unsigned int id;
-8.09 KB
Binary file not shown.
-31.3 KB
Binary file not shown.
-42.5 KB
Binary file not shown.
0 Bytes
Binary file not shown.
-35.5 KB
Binary file not shown.
0 Bytes
Binary file not shown.

C++/fgt_SDK_Cpp/fgt_SDK_Cpp.cpp

+28
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*============================================================================*/
1313

1414
#include <iostream>
15+
#include <cstdio>
1516
#include "fgt_SDK_Cpp.h"
1617

1718
/*============================================================================*/
@@ -157,6 +158,33 @@ std::ostream& operator<<(std::ostream& str, fgt_SWITCH_DIRECTION direction)
157158
return str;
158159
}
159160

161+
std::string format_firmware_version(unsigned short bcd_version)
162+
{
163+
char buf[10]{};
164+
std::snprintf(buf, 10, "%x.%02x", bcd_version >> 8, bcd_version & 0xff);
165+
return std::string(buf);
166+
}
167+
168+
std::ostream& operator<<(std::ostream& str, const fgt_CONTROLLER_INFO& info)
169+
{
170+
str << "SN: " << info.SN << "\n"
171+
<< "Firmware: " << format_firmware_version(info.Firmware) << "\n"
172+
<< "Unique ID: " << info.id << "\n"
173+
<< "Type: " << info.InstrType;
174+
return str;
175+
}
176+
177+
std::ostream& operator<<(std::ostream& str, const fgt_CHANNEL_INFO& info)
178+
{
179+
str << "Controller SN: " << info.ControllerSN << "\n"
180+
<< "Device SN: " << info.DeviceSN << "\n"
181+
<< "Firmware: " << format_firmware_version(info.firmware) << "\n"
182+
<< "Position: " << info.position << "\n"
183+
<< "Unique ID: " << info.indexID << "\n"
184+
<< "Type: " << info.InstrType;
185+
return str;
186+
}
187+
160188

161189
/** Manage pressure error and status, display details
162190
* Change this function for custom error management, returned fgt_ERROR_CODE can directly be used in main application

C++/fgt_SDK_Cpp/fgt_SDK_Cpp.h

+6
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ std::ostream& operator<<(std::ostream& str, fgt_VALVE_TYPE valveType);
5151
/** fgt_SWITCH_DIRECTION: switch direction for rotating switches */
5252
std::ostream& operator<<(std::ostream& str, fgt_SWITCH_DIRECTION direction);
5353

54+
/** fgt_CONTROLLER_INFO: displays data on controller instruments */
55+
std::ostream& operator<<(std::ostream& str, const fgt_CONTROLLER_INFO& info);
56+
57+
/** fgt_CHANNEL_INFO: displays data instrument channels */
58+
std::ostream& operator<<(std::ostream& str, const fgt_CHANNEL_INFO& info);
59+
5460
/** Manage pressure error and status, display details
5561
* Change this function for custom error management, returned fgt_ERROR_CODE can directly be used in main application
5662
* This functions calls Fgt_get_pressureStatus and displays error details */

Fluigent SDK.pdf

213 Bytes
Binary file not shown.

LabVIEW/dlls/fgt_SDK.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
*
77
* Title: fgt_SDK.h
88
* Purpose: Functions API for Fluigent instruments
9-
* Version: 21.1.0.0
10-
* Date: 05/2021
9+
* Version: 21.2.0.0
10+
* Date: 07/2021
1111
*============================================================================*/
1212

1313
#ifndef _FGT_SDK_H
@@ -116,7 +116,7 @@ typedef struct
116116
{
117117
/** Serial number of this channel's controller */
118118
unsigned short ControllerSN;
119-
/** Firmware version of this channel (0 if not applicable) */
119+
/** Firmware version of this channel in BCD (0 if not applicable) */
120120
unsigned short firmware;
121121
/** Serial number of this channel (0 if not applicable) */
122122
unsigned short DeviceSN;
@@ -135,7 +135,7 @@ typedef struct
135135
{
136136
/** Serial number */
137137
unsigned short SN;
138-
/** Firmware version */
138+
/** Firmware version in BCD */
139139
unsigned short Firmware;
140140
/** Index */
141141
unsigned int id;

LabVIEW/dlls/fgt_SDK_32.dll

-35.5 KB
Binary file not shown.

LabVIEW/dlls/fgt_SDK_64.dll

-42.5 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

LabVIEW/sourceCode/VIs/dir.mnu

-561 Bytes
Binary file not shown.
Binary file not shown.

MATLAB/Toolbox/SDK/Fluigent/+LowLevel/private/fgt_SDK_32_prototype.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function [methodinfo,structs,enuminfo,ThunkLibName]=fgt_SDK_32_prototype
22
%FGT_SDK_32_PROTOTYPE Create structures to define interfaces found in 'fgt_SDK'.
33

4-
%This function was generated by loadlibrary.m parser version on Wed May 26 15:48:12 2021
4+
%This function was generated by loadlibrary.m parser version on Tue Jul 13 15:27:11 2021
55
%perl options:'fgt_SDK.i -outfile=fgt_SDK_32_prototype.m'
66
ival={cell(1,0)}; % change 0 to the actual number of functions to preallocate the data.
77
structs=[];enuminfo=[];fcnNum=1;
Binary file not shown.

0 commit comments

Comments
 (0)