|TMS International BV|
Porting your program from PortiSerial to TMSi SDK
This TMSi SDK version 7 is the successor of the WDM driver 6.* AND
Portiserial.dll. The latter is used to provide an application interface
for TMSi frontends that communicate using a Bluetooth interface.
TMSi SDK version 7 is build from scratch to provide an easier way to connect to all TMSi frontends, and to unify access methods over different communication interfaces (WLAN, Bluetooth and USB).
As a result, there are huge differences between TMSi SDK version 7 and the existing PortiSerial.dll, which makes it impossible to just recompile your current software to use this TMSi SDK version 7.
Bluetooth driverThe TMSiSDK.dll works with the Microsoft Bluetooth stack ONLY. As Windows only allows one Bluetooth stack to be installed on the system, this means that a currently installed non-Microsoft Bluetooth stack needs to be deinstalled first. This can be done by removing a currently inserted Bluetooth stick, and deinstallating the non-microsoft Bluetooth driver (such as the Toshiba or Widdcom stack). Then re-insert your Bluetooth stick and install the Microsoft Bluetooth stack.
For internal Bluetooth devices, remove the device using the Windows Device Manager and deinstall the Bluetooth stack. However, we have not tested it , and can not garantee that is will work properly. If your internal Bluetooth devices refuse to work with the Microsoft Bluetooth stack, use the Device Manager to disable the device, and use the TMSi supplied Bluetooth device.
First install the TMSi SDK on your PC using the CD delivered with you frontend. Please follow the instructions in the installation manual carefully.
After installation, the TMSiSDK.dll is located in the
C:/Windows/system32 directory. The TMSi SDK also includes the
TMSiSDK.h include file, which contains definitions of all structures
and prototypes of all functions. This file is not installed, but
must be copied from cd to the directory in which you have your
The TMSi SDK files are created using Visual Studio 2010 on a Windows 7 64-bit platform, and are compiled for Windows 7 and 8.1.
In order to test if you can compile, link, and run the SDK, first
use the example code on the CD to see if you can communicate with the
frontend. Because the example code has been tested thoroughly, it is
likely that any error
that occurs during compilation, linking and running is due to
a misconfiguration in your development environment.
WARNING: If you run
the ExampleCode.exe without Visual Studio 2010 installed, loading the
TMSiSDK.dll will fail. In that case, install vcredist_vs2010_x86.exe
from the ExampleCode directory.
If the test with the example code has been successful, you can start
with writing code for this version of the SDK.
The concept of the SDK is that you start the library with the
communication method (WLAN, Bluetooth, USB), perform the desired
reading samples from memory card) and close the library. For each
communication interface you need to start the library, but it is
to start several libraries parallel to each other, with each library
using a different communication interface. In order to select a device,
call GetDeviceList() to get a list of available devices.
The error handling of the library is designed to be as uniform as
For each function that returns a Boolean FALSE, you can call the
GetErrorCode() function to retrieve the specific error code for that
The order in which you need to call functions from the SDK, and the naming of those functions is different from the function names of PortiSerial.dll.
PortingThe PortiSerial.dll and PortiSerialSDK.dll are written in C++ with a COM interface. The TMSiSDK.dll is written in C code, and does not have a COM interface. Also, it does not need to be registered using regsvr32. The PortiSerial.dll used the Bluetooth stack from the driver CD of the Bluetooth dongle supplied by TMSi. The TMSiSDK.dll uses the Microsoft Bluetooth stack ONLY. If you do not use the Microsoft Bluetooth stack, it is not possible to detect TMSi Bluetooth frontends, and the function will fail.
The functions put_ComPort() and get_Comport() are not needed anymore. The functions GetDeviceList() and Open() are used to find a Bluetooth frontend, Close() is used to close a Bluetooth frontend.
InitilizeSerialPortAndFrontend() can be replaced by Open() and SetSignalBuffer().
get_Caption() can be replaced by GetSignalFormat().
put_Caption() has no equivalent function.
StartAcq() can be replaced by Start(). The sample rate must be set in SetSignalBuffer() before calling Start().
StopAcq() can be replaced by Stop().
GetSampleRecordAsVariant() can be replaced by GetSamples(). GetStationairSampleRecords() has no equivalent function.
KeepSerialPortInUse() has no equivalent function, as the TMSiSDK.dll performs this function itself.
ReleaseSerialPort() is replaced by Close().
TestBlock() has no equivalent function.
The functions GetFrontendNrOfChannels(), get_FrontendNrOfChannels(), get_FrontendSerialNumber(), get_FrontendId(), get_FrontendHardwareVersion(), get_FrontendSoftwareVersion(), get_FrontendCommandBufferSize(), get_FrontendSendBufferSize() are replaced by GetFrontEndInfo().
get_SampleRate() has no equivalent function.
put_SampleRate() has no equivalent function.
GetRawData() has no equivalent function.
ResetRawData() has no equivalent function.
Refer the functions part of the SDK documentation for a full description of the functions.
During installation on a 32 bit platform, the TMSiSDK.dll is installed in the %windir%\System32 directory.
During installation on a 64 bit platform, the 64 bit TMSiSDK.dll is
installed in the %windir%\System32 directory and the 32 bit
TMSiSDK32bit.dll is installed in the %windir%\SysWOW64 directory.
more information on how Windows handles 32 bit applications and DLLs
on 64 bit platforms.
Because the Microsoft installer enforces unique names for all files, it is not possible to use the TMsiSDK.dll name in both directories.