BAPITCP - Implementation specifics
1.Introduction
This document describes implementation specific details of the TCP/IP to BAPI gateway
server implemented by mocom software, Aachen.
BAPITCP was designed to meet the BAPI and the “TCP/IP to Bitbus” standards. In case
these standards conflict, the BAPI standard meaning has been implemented.
2.Structure BitbusOpenData
The BAPI (and the TCP/IP to Bitbus) standard define an optional and implementation
specific parameter of BitbusOpenMaster(), BitbusOpenSlave() functions, the
BitbusOpenData structure. For mocom softwares implementation of BAPI and BAPITCP
(TCP/IP to BAPI gateway server) this data structure is used (in bapi.h):
typedef PACKED_STRUCTURE struct {
INT32 len; /* fill in the length of the structure
before calling BitbusOpen(), on return it
contains the length of copied data */
char name[10]; /* device name string: IPCBITxx, USBBITxx, COMxx */
char serno[7]; /* ELZET80 serial number: IPC123 */
} GNU_PACKED_STRUCTURE BitbusOpenData;
This parameter is optional. If you want to get the information you must append the len of
the BitbusOpenData structure to your data. The return value will then contain the
complete BitbusOpenData strucure filled with device information.
2.1.Example - BitbusOpenMaster() with the optional BitbusOpenData parameter
Function Code 0x0001 – Call BitbusOpenMaster (Client BAPI Server)
0000 0x6C 0x1F Header key (magic number): 8044 = 0x1F6C
0002 0x08 0x00 Size of header: 8 bytes
0004 0x10 0x00 Size of message parameters: 16 bytes = 0x0010
0006 0x01 0x00 Function Code 0x0001
0008 ‘A’ ‘P’ Application Name = “APPL” (situation specific example)
000A ‘P’ ‘L’
000C 0x00 ‘B’ Bitbus Device = “BBUS0” (BAPITCP supports only
“BBUS0” device)
000E ‘B’ ‘U’
0010 ‘S’ ‘0’
0012 0x00 0x15 BitbusOpenData.len (optional): 21 byte = 0x00000015
0014 0x00 0x00
0016 0x00 0x00 Last byte is a filler
Function Code 0x0002 – Get return of BitbusOpenMaster (Client BAPI Server)
0000 0x6C 0x1F Header key (magic number): 8044 = 0x1F6C
0002 0x08 0x00 Size of header: 8 bytes
0004 0x1A 0x00 Size of message parameters: 26 bytes = 0x001A
0006 0x02 0x00 Function Code 0x0002
0008 0x84 0xBB Handle to Bitbus = 0x4000BB84
000A 0x00 0x40
000C 0x15 0x00 BitbusOpenData.len = 0x00000015
000E 0x00 0x00
0010 0x4E 0x45 BitbusOpenData.name = “NETA7”
0012 0x54 0x41
0014 0x37 0x00
0016 0x00 0x00
0018 0x00 0x00
001A 0x4D 0x55 BitbusOpenData.serno = “MUS022”
001C 0x53 0x30
001E 0x32 0x32
0020 0x00 0x00 Last byte is a filler
Handle, BitbusOpenData.name and BitbusOpenData.serno content are situation specific
examples.
3.References
(a)BITBUS APPLICATION PROGRAMMERS INTERFACE (BAPI)
http://www.bitbus.org/dnl/bapi.pdf
(b)A modest proposal for a TCP/IP to Bitbus Gateway
http://www.bitbus.org/dnl/TCPIP_BAPI.pdf
(c)bapi.h