TMExtendedStartSession Code Example

long session_handle;
short PortNum = 1, PortType = 1;

/* attempt to get a session on Port */
session_handle = TMExtendedStartSession(PortNum,PortType,NULL);

if (session_handle > 0)
{
    /* call TMEX API function with session_handle */
    ...
}
else if (session_handle == 0)
{
    /* port not available */
    ...
}
else if (session_handle == -1)
{
    /* failure, indicated type does not have a driver */
    ...
}

/* relinquish port */
TMEndSession(session_handle);