Skip navigation links - Goto navigation bar

Functions in VVIO.dll

Table of contents - Design - Not only electronics - Mail - IT

VVIO.dll is a MS-Windows Dynamic Link Library destined to facilitate the support of home-made hardware devices; it allow you to write interfaces to hardware with any language supporting 32 bit DLL, included those that, as Microsoft Visual Basic and Borland Delphi, do not have instructions of input/output.

Who will need this software ?


This DLL will work in two deeply different modalities, one adapted for any Windows systems and a more specific one for Windows based on "NT technology". The functionalities and the interface to the high level code remain however identical.

Windows (all versions)

You can use this modality on all windows version, from Windows95 to Windows XP; it is based on the I/O mechanism from LabWindows/CVI; in some cases, this is a slow way.

For the use of the DLL in this modality it is not necessary any installation: you only need to copy the DLL where your program resides or in the system folder (windows\system32 or winnt\system32). It is necessary to install before the LW/CVI run time engine.

Windows NT, 2000, XP

Using Windows versions derived from WinNT the access to hardware devices is optionally made also through VVIO.SYS device driver. Without any high level code modification in some cases large increase of performances are possible.

In order to use this modality it is necessary to install the device driver VVIO.sys and to use, at the beginning of your code, the function of activation. It is necessary to install before the LW/CVI run time engine.


The DLL is written using LabWindows/CVI, an ANSI C compiler, but is usable with any language supporting  32 bit DLLs. Some of my design are distributed with sample code in Visual Basic and LabWindows/CVI (see this table)

You will find binary and source code source, free of charge but with use conditions I pray you to read with attention.

When the DLL is loaded, it shows a copyright window. If it annoys you, you can read at the end of the page.


Starting here, a short description of functions in VVIO.dll using C syntax. Visual Basic users will find also the VVIO.bas file with the same functions prototype using VB syntax.

You will find the list of returned error codes in errorVVIO.h file : all errors codes are minor then zero.

VVIO.dll: global function

void VVIO_DLL_SetNtMode (void) 

Try to set NT mode for NT/2000/XP, for higher performance. This is an optional function, default mode work with all windows version.

If function fails (wrong OS, no VVIO.sys installed, wrong VVIO.sys version...) a pop-up windows is show and program will continue as default mode.

void VVIO_DLL_SlowDown (short int slow)

Slow down I/O operation. This function is required required using high speed LPT and low spped external hardware as opto-isolated or I2C devices.

Argument:

Note: this function set a global parameter but you can change it "o the fly".

VVIO.dll: generic input /output

short int VVIO_DLL_in (int addr)

Read a byte from device on address addr. No test is performed and this function should be used carefully: random use may hangs-up PC!

Arguments:

Return the byte read from the port (0... 255)

void VVIO_DLL_out (int addr, short int data)

Write a byte to hardware address. No test is performed and this function should be used carefully: random use may hangs-up PC!

Arguments:

VVIO.dll: using parallel port

short int VVIO_DLL_LPT_GetNumberFromBios (short int *lpt1, short int *lpt2, short int *lpt3)

Return  numbers and address of parallel port form BIOS. Note that some BIOS can't see PCI port. 

Arguments:

Return numbers of LPT (0... 3). Negative return code means error.

short int VVIO_DLL_LPT_Lock (short int lpt)

This function try to lock LPT for other process. I think this function will not work on all windows version (but no problems if you use it!).

Argument:

short int VVIO_DLL_LPT_Inizialize (short int lptnum, int lptaddr)

Set some internal variables required for using parallel port. You need to invoice this function only one time at the begin of your program and before any VVIO_DLL_LPT_xxx() function call.

Arguments:

short int VVIO_DLL_LPT_GetStatus (short int lpt)

Read five bit from status register.

Arguments:

Return a 16 bit word (but only 5 are valid), where any single bit reflect LPT pin status:
 0, 0 , 0 , 0, 0, 0 , 0 , 0 busy, ack, paper_out, select, error, 0, 0, 0.

If return code < 0, an error code has been generated.

Note: bit values reflect pin status ("1" means high voltage level), not register status.

short int VVIO_DLL_LPT_WriteData (short int lpt, short int data)

Write date (eight bit) on parallel port lpt.

Arguments:

short int VVIO_DLL_LPT_WriteControl (short int lpt, short int strobe, short int linefeed, short int inizialize, short int select)

Write four bit to control register

Arguments:

VVIO.dll: mini-datalogger functions

short int VVIO_DLL_MAX147_Inizialize(short int lptnum, short int lptaddr) 

Power-on the circuit and set-up some internal variables. Execution time is a bit long (100 ms) because it needs some settling time. You need to invoice this function only one time at the begin of your program and before any VVIO_DLL_MAX_xxx() function call.

Arguments:

short int VVIO_DLL_MAX147_GetVolt (short int lptnum, short int ch, double *volt)

Read a voltage from a single mini-datalogger channel. Your program should calculates effects of Ra and Rb.

Arguments:

short int VVIO_DLL_MAX147_GetSamples (short int lptnum, double volt[]) 

Read voltages from all mini-datalogger channels. Your program should calculates effects of Ra and Rb.

Arguments:

VVIO.dll: iso-buffer related functions

short int VVIO_DLL_CD4094_Inizialize (short int LPT, short int lptAddr) 

Set up hardware and internal variables for a generic circuit based on iso-buffer.

Arguments:

short int VVIO_DLL_CD4094_Write (short int LPT, short int ch, short int data, short int immediate)

Write a 16 bit word to a generic circuit based on iso-buffer.

Arguments:

short int VVIO_DLL_CD4094_18245 (short int LPT, short int ch, short int dacInput1, short int dacInput2, short int immediate)

Write data to a LMD18248 based hardware (as example, see micro- step driver).

Arguments:

short int VVIO_DLL_CD4094_NextStepBipolar (short int LPT, short int ch, short int microstep, short int immediate) 

The motor do a single rotation step equals to one or more micro-step. For motor continue rotation you should invoice this function at regular interval. See micro-step driver for more details about hardware.

Arguments:

short int VVIO_DLL_CD4094_NextStepUnipolar (short int LPT, short int ch, short int motor, short int step, short int immediate)

The motor do a step or half step. For motor continue rotation you should invoice this function at regular interval. See step driver for more details about hardware.

Arguments:


How to collaborate with me...

When DLL is loaded a copyright windows is showed. To avoid this little trouble is enough to comment out a single line in source code...

In this, there are two problems:

To have a legal DLL without copyright splash screen, I need just a bit of your time: help me to improve VVIO project! You will add my copyright note with your-own copyright note or elsewhere you want. 

To help me, you can:

Obviously if your contribute is relevant, I'll add your name to contributors list.


All the files in VVIO project are contained in VVIO.tgz compressed file.

license The use license
basicVVxx.x Source files
DLL\ The DLL for windows
SYS\ The device driver for windows NT / 2000 / XP

These circuits are supported from VVIO project:

The documentation is available to the following pages


IT - Home page - Table of contents - Privacy policy - E-mail

XHTML 1.0 Strict - CSS 3