TMStartSession Overview Group

**This function is provided for compatibility with TMEX version 2.XX. TMEX 3.10 (and above) applications should use the TMExtendedStartSession function. **

The TMStartSession API call takes as an argument a port number "port" of the 1-Wire network to be used. It returns the session handle number if the session has been established, and 0 to indicate that the 1-Wire network is busy with another session in progress. A session handle should be used and then as soon as possible ended with TMEndSession. The session handle is good indefinitely if no other application attempts to start a new session on that 1-Wire network. The session handle can become invalid under the following circumstances:


the session handle has not been used for at least 1 second
a request for the same 1-Wire network has been made


the handle has been used in the last second
the handle is over 35 seconds old
a request for the same 1-Wire network has been made

long far pascal TMStartSession(

short PortNumType      // Port number and type to get a session to

For a description of the above types, see the TMEX Type Descriptions.



Specifies the port number in the least significant byte and the port type number in the most significant byte. The range for either one is 0 to 15.

Return Value

>0 => session on port given session_handle returned

=0 => port not available, it is being used by another application

<0 => TMEX Session Error Return Codes

Code Example

See Also

TMExtendedStartSession, TMValidSession, TMEndSession