LB3 file format

15 Apr 2012


1. BASICS

(1)Records
LB3 file consist of records which are separated by comma or line-break.
Space, TAB and line-break before beginning of the record is ignored.

Ex.1 and Ex.2 have same meaning.

Ex.1
+BCD, N:10, M:20, -BCD

Ex.2
+BCD
N:10
M:20
-BCD

(2)Block
If the record begins with "+", It means the start of a block.
Following word after "+" is a label for the block.

The block is terminated by -label .

Block will be added with version up of the software.
If BSch3V or LCoV gets a beginning of an unknown label block, it skips until end of the block.

Ex.  bold - start of a block,  italic - end of a block
+ABC
+BCD, N:10, M:20, -BCD
+BCD, N:12, M:15, -BCD
-ABC


(3)Data record
A data record consist of a variable-ID and value. They are separated by colon.

Ex.   bold - variable-ID,  italic - value
RX:23

(4)Special characters in a record
In the value of the data record, characters listed below are replaced to %2 digit hexadecimal code.

Ex.

Actual value description in the record
1,000uF 20% 16V 1%2C000uF%2020%25%2016V


2. Structure of LB3 file

starts with
+BSCH3_LIB_V.1.0
and ends with
-BSCH3_LIB_V.1.0

It contains following variable and blocks.

variable contents
PROP Library property

block label contents
Pattern information +PTN
to
-PTN
Image data for a non-square shape component
It is refered from COMP block.
Component information +COMP
to
-COMP
Define component attrubute, pins.


3.  Detail of Block

(1)Pattern information block
starts with
+PTN
and ends with
-PTN

Pattern information block contains following variables and blocks.

variable contents
N Name. It is used when a component block refers a pattern.
X Width.
Y Height

block label contents
bit-patten +BMP
to
-BMP
Original encoded 1bit depth (monochrome)bitmap image.
  • 8 pixel align
  • 1character/4 pixel
    pixel value character
    0x0 @
    0x1 A
    0x2 B
    ... ...
    0xE N
    0xF O
  • Left MSB--Right LSB
Line data +L
to
-L
Line data block. It contains following variables.

variable contents
W Line width
S 0: normal line   1: Dash line
X Start point X
Y Start point Y
X End point X
Y End point Y
* There are 2 pairs of X and Y. First pair is for the start point.
Arc data +AR
to
-AR
Arc line data block. It contains following variables.
variable contents
W Line width
S 0: normal line   1: Dash line
X Center X
Y Center Y
R Radius
B Start angle.
It defines "3 o'clock angle" as "0 degree"
and it is described with degree * 16.
E End angle.
Polygon data +PG
to
-PG
Polygon data block. It contains following variables.
variable contents
W Line width
S 0: normal line   1: Dash line
F -1: not filled  1: Filled with it's line color.
N Number of vertex
X 1st vertex X
Y 1st vertex Y
X 2nd vertex X
Y 2nd vertex Y
... ...

*There are N(Number of vertex) pairs of X and Y.
Circle data +C
to
-C
Circle data block. It contains following variables.
variable contents
W Line width
S 0: normal line   1: Dash line
F -1: not filled  1: Filled with it's line color.
N Number of vertex
X the top-left point X of the circumscribed square
Y the top-left point Y of the circumscribed square
X the bottom-right point X of the circumscribed square
Y the bottom-right point Y of the circumscribed square
Text data +TX
to
-TX
Text data block. It contains following variables.
variable contents
X Position X
Y Position Y
A Align. OR'ed following horizontal value and viertical value
Horizontal value
0: Front of the text
1: Mid of the text.
2: Rear of the text

Vertical
0: Bottom of the text
4: Mid of the text.
8: Top of the text.
D 1: Horizontal  0: Vertical
S Text
FN Font name
FS Font size
FF B: Bold   I: Italic


(2)Component information block

starts with
+COMP
and ends with
-COMP

Component information block contains following variables and block

variable contents
N component name.
It is used on BSch3V.
X Horizontal size. Unit id grid (10pixel)
Y1 Vertical size. Unit id grid (10pixel)
B block/package
R default prefix
P Pattern name.
NOTE note
MFR Manufacturer
MFRPN Manufacturer part name
PKG Package name

block label contents
pin block +PIN
to
-PIN

variable contents
N Pin name
L Location.
It is consist of a prefix and a suffix
The prefix is T, B, L or R.
The suffin is a numeric varue, Offset from Top-Lest.
unit is a grid.
M M pin number.

*There are Block cout of M variables.
First M variable is for 1st block.
T Type:
S: place a pin number near by component frame.
N: Invert
C: Clock
       (N and C can be OR'ed
Z: Zero length pin
m: