VI Explorer Source code

The Source of this php-vi-Explorer project code can be found at GitHub

Short description

A .VI File is a container based file format. All parts (I call them "Block"s) have names like "BDPW" or "FPHx" (the "x" stands for letter that indicates the version of this Block eg. "a" or "b").
Every Block can (not very often) hold several subblocks (actually I don't know why).
Some Blocks are compress with ZLIB (PHP: gzcompress()).
(see clLabView.php)

Block diagram

The block diagram is stored in "BDHx"-block. It uses a binary tree format to store hierarchy structures. They use a kind of "xml-tags" to open and close objects.

(see clObjFile.php for the binary format and clBDHx.php)

Front panel

The binary format is the same as of the block diagram but with slightly different types.

(see clObjFile.php for the binary format and clFPHx.php)


For the different color-modes for the icons there are different Blocknames (e.g. "icl8", "icl4", "ICON"). The images are stored as binary bitmaps.

(see clIcon.php)

Version of the File

The Version of the .VI file is stored in the "LVSR" and the "vers"-blocks.

(see clLVSR.php)

Terminals / Connections

All terminals used by the .VI and the terminals of the .VI itself are stored in the "VCTP"-block. The VCTP contains bottom-up objects. This means that objects can inherit from previous defined objects. So to define a cluster they first define every element and than add a cluster-object with a index-table containing all previously defined elements used by the cluster.
(see clVCTP.php)

Password protection

Every .VI-File has the "BDPW"-Block that contains three 16-Byte binary md5 hashes.

The first hash is the md5 of the password used to "protect" the block diagram.
The second is made from the first combined with the two blocks "LIBN", "LVSR" and since LV2012 a salt.
The third hash is created from the second and the Block diagram "BDHc"-block

The salt is made from three 32-bit-integers. These numbers represent the count of the connections of the terminal by types (numbers, strings, paths) used by the vi file (see [Terminals / Connections]).

(see clBDPW.php - function getHash() )