Init and Exit Processing

Driver Init/Exit

The API function library uses device drivers to access the board. Therefore, init processing to use the device driver, and exit processing when you are done using it.

Here, for the sake of explanation, it is described as TimInit → TimWait → TimExit, but in fact, TimInit is performed at the start of use, and TimExit is performed at the end (usually when the application is terminated) only once.
 

Programming Example in Visual Basic .NET

Dim Ret As Integer                                      // Return value
Dim DeviceName As New String("", 256)       // Store device name
Dim ProductName As New String("", 256)      // Store product name

// Initialize
Ret = TimInit(DeviceName,ProductName)

// Wait 1ms
Ret = TimWait(1000);

// Exit
Ret =TimExit()

Programming Example in Visual C#

int Ret;                        // Return value
string DeviceName;      // Store device name
string ProductName;     // Store product name

// Initialize
DeviceName = "";         // Automatically determine the device to use
Ret = timerw.Init(ref DeviceName, out ProductName);

// Wait 1ms
Ret = timerw.Wait(1000);

// Exit
Ret = timerw.Exit();

Programming Example in Visual C++ (MFC)

long Ret;                             // Return value
char DeviceName[256];       // Store device name
char ProductName[256];      // Store product name

// Initialize
strcpy(DeviceName, "");      // Automatically determine the device to use
Ret = TimInit(DeviceName, ProductName);

// Wait 1ms
Ret = TimWait(1000);

// Exit
Ret =TimExit();