beautypg.com

Tbksetprotocol – Measurement Computing TempBook rev.3.0 User Manual

Page 83

background image

TempBook User’s Manual

tbkCommand Reference (Standard API) 9-23

tbkSetProtocol

DLL Function

int tbkSetProtocol( int protocol)

C

tbkSetProtocol(int protocol);

QuickBASIC

BtbkSetProtocol% (ByVal protocol%)

Visual Basic

VBtbkSetProtocol% (protocol%)

Turbo Pascal

tbkSetProtocol( protocol:integer ):integer;

Parameters

protocol

One of the predefined protocol codes listed below (additional protocol codes may be described in the
README file).
Name

Description

Value

TbkProtocol8

8-bit I/O

1

TbkProtocol4

4-bit I/O

2

TbkProtocolFPort

Far Point F/Port EPP Interface

10

TbkProtocolSL

82360 SL EPP Interface

20

TbkProtocolSMC666

SMC 37C666 EPP mode

30

TbkProtocolEPPBIOS

EPP bios mode

40

TbkProtocolPastEPP

WBK20/21 Fast EPP mode

50

Returns

An error number, or 0 if no error.

See Also

tbkInit, tbkGetProtocol

Program References

tbkSetProtocol

specifies to the TempBook/66 driver the type of parallel-port implementation

and protocol that is available on the computer. The driver then attempts to configure the computer
and the TempBook/66 to communicate using the specified protocol. Since establishing the protocol
may affect the settings of the TempBook, tbkSetProtocol should only be invoked immediately
after tbkInit has established communications with and reset the TempBook. Switching protocols
during normal TempBook/66 operation is not recommended.

Two types of parallel port implementations are supported by the TempBook: standard and enhanced.
Standard parallel ports, using the TempBook/66 manufacturer’s proprietary protocols, are capable of
receiving data either 4 or 8 bits at a time. When possible, 8-bit operation is preferred (it is much
faster), but not all standard parallel ports support 8-bit data reception.

Enhanced parallel ports (EPP) include extra hardware that increases the rate of data transfer to 3 to
10 times the rate of a standard parallel port. Unfortunately, not every computer includes EPP
capability and attempting to use EPP on an incompatible computer may cause the TempBook/66
driver to access I/O locations which are not part of the printer port interface. Such accesses may
interfere with other operations and cause the computer to operate incorrectly. For this reason, EPP
operation must be explicitly requested by the program.

When the TempBook/66 is initialized by tbkInit, it is initially configured for a standard parallel
port protocol: either 8-bit, if possible, or the slower 4-bit protocol. After tbkInit has completed,
tbkSetProtocol

may be used to switch to another supported protocol.

If tbkSetProtocol is unable to establish communications using the specified protocol, then it
will try to establish communications using the standard port protocols, first 8-bit, then the slower 4-
bit. In such an event, tbkSetProtocol will not return an error indication unless it is unable to
establish any protocol.

In any case, tbkGetProtocol may be used to check the current operating protocol.