.
.
...for DOS
...for WINDOWS 3.1, 95, 98
...for LINUX

Hardware Description
back
HOME
.

DRIVERS FOR WINDOWS

Drivers for ISA PC cards
Drivers for USB interfaces

Using Windows as you application's operating system the card must be accessed through a driver. We are using a DLL to generate direct hardware access which is possible with Windows 3.1, 3.1.. and Windows 95/98. This method is very fast but the user has to ensure that only one application at a time has card access since Windows is not in control of that specific hardware device, the DMX interface.

Windows 3.1/3.11 users must use SLHDMX2.DLL (16-Bit version), while Windows 95/98 users must use SLHDMX33.DLL (32-Bit version). Please note, that applications written and compiled under Win 3.1/3.11 can also be run under Win 95/98.

Programs, examples and drivers are published "as is". Any modifications, in software and in hardware, which are related to technical progress, are reserved.

These pages will be updated on a regular basis.
last updated: 07-01-2001.

 WINDOWS 3.11   WINDOWS 95/98   WINDOWS Millennium   WINDOWS NT 


WINDOWS 3.1

For Windows 3.1/3.11 (16-Bit Windows) programming environments you must use SLHDMX2.DLL. The standard calling convention for DLL calls is referred to as Pascal calling convention. This calling schme is not available for newer Windows versions. Projects written and compiled under Windows 3.1 can be run under Windows 95 or Windows 98, but cannot be created there.
SLHDMX2.DLL    This DLL contains functions for automatic card detection, reading from and writing to the card and starting and stopping the DMX data transfer. Before using the card the appropriate card operating system SLHDMXnn.BIN has to be transferred into the card. This is a one-time procedure, please refer to chapter Hardware).
DETECT CARD ADDRESS   
Declare Function vbCardadr% Lib "SLHDMX2.DLL" (ByVal CardAdr%)
scans all PC slots and detects the card address. Calling this function with CardAdr=0 returns the first occupied card address. Calling the fuction with CardAdr=&H100 [&H120, &H140, &H160] only checks this address for the presence of a card and thus is suited for multi-card usage. If no card is found, the routine always returns Zero.
WRITE TO CARD   
Declare Sub vbWByte Lib "SLHDMX2.DLL" (ByVal CardAdr%,
	ByVal RAM%, ByVal Data%)
Writes a Byte to the card Data RAM. Parameters:
CardAdr:  Card Address in PC I/O area
RAM:   RAM Address on card (&H0000 ... &H1FFF)
Data:   Data byte (&H00...&HFF)
READ FROM CARD   
Declare Function vbRByte% Lib "SLHDMX2.DLL" (ByVal CardAdr%,
	ByVal RAM%)
eads a Byte from the card Data RAM. Calling parameters see vbWByte. Returns read Byte.
START DMX   
1512A, 1512B, 1512B-LC
   
Declare Function vbDMXStart% Lib "SLHDMX2.DLL" (ByVal CardAdr%)
Starts the DMX data transfer.
Call this routine using the card address. Routine returns Dummy value.
 
START DMX   
1512C
   
Declare Function vbDMXResOff% Lib "SLHDMX2.DLL" (ByVal CardAdr%)
Starts the DMX data transfer.
Call this routine using the card address. Routine returns Dummy value.
STOP DMX   
1512A, 1512B, 1512B-LC
   
Declare Function vbDMXStop% Lib "SLHDMX2.DLL" (ByVal CardAdr%)
Stops the DMX data transfer.
Call this routine using the card address. Routine returns Dummy value.
 
STOP DMX   
1512C
   
Declare Function vbDMXReset% Lib "SLHDMX2.DLL" (ByVal CardAdr%)
Stops the DMX data transfer.
Call this routine using the card address. Routine returns Dummy value.
READ PC MEMORY-   
Declare Function vbMemRead% Lib "SLHDMX2.DLL" (ByVal Segment%,
	ByVal Adresse%)
Reads a Byte from the PC memory.


WINDOWS 95
WINDOWS 98
WINDOWS ME

For Windows 95 and Windows 98 (32-Bit Windows) programming environments the SLHDMX33.DLL must be used. As 32-Bit Windows versions require a C calling convention when referring to DLL functions only this DLL must be used. Again, the DLL grants direct access to the PC card hardware and it is fully in the programmer's responsibility to make sure that only one task at a time is accessing the card.
SLHDMX33.DLL    This DLL contains functions to automatically detect the card, read from and write to the card and start or stop the DMX data transfer. Before using the DLL functions the card operating system SLHDMXnn.BIN must heve been transferred into the card, please refer to chapter Hardware and your card type for a description how to do this. More info can be derived from the numerous DMX PC-Card programming lessons published elsewhere.
DETECT CARD ADDRESS   
Declare Function vbCardadr Lib "SLHDMX33.DLL" Alias "vbCardAdr"
	(ByVal CardAdr%) As Integer
scans all PC slots and detects the card address. Calling this function with CardAdr=0 returns the first occupied card address. Calling the fuction with CardAdr=&H100 [&H120, &H140, &H160] only checks this address for the presence of a card and thus is suited for multi-card usage. If no card is found, the routine always returns Zero.
WRITE TO CARD   
Declare Sub vbWByte Lib "SLHDMX33.DLL" (ByVal CardAdr%,
	ByVal RAMAdr%, ByVal Kanal%))
Writes a Byte to the card Data RAM. Parameters:
CardAdr:  Card Address in PC I/O area
RAM:   RAM Address on card (&H0000 ... &H1FFF)
Data:   Data byte (&H00...&HFF)
READ FROM CARD   
Declare Function vbRByte Lib "SLHDMX33.DLL" (ByVal CardAdr%,
	ByVal RAMAdr%) As Integer
eads a Byte from the card Data RAM. Calling parameters see vbWByte. Returns read Byte.
START DMX   
1512A, 1512B, 1512B-LC
   
Declare Function vbDMXStart% Lib "SLHDMX33.DLL" (ByVal CardAdr%)
Starts the DMX data transfer.
Call this routine using the card address. Routine returns Dummy value.
 
START DMX   
1512C
   
Declare Function vbDMXResOff% Lib "SLHDMX33.DLL" (ByVal CardAdr%) 
Starts the DMX data transfer.
Call this routine using the card address. Routine returns Dummy value.
STOP DMX   
1512A, 1512B, 1512B-LC
   
Declare Function vbDMXStop% Lib "SLHDMX33.DLL" (ByVal CardAdr%)
Stops the DMX data transfer.
Call this routine using the card address. Routine returns Dummy value.
 
STOP DMX   
1512C
   
Declare Function vbDMXStop% Lib "SLHDMX33.DLL" (ByVal CardAdr%)
Stops the DMX data transfer.
Call this routine using the card address. Routine returns Dummy value.
READ PC MEMORY   
Declare Function vbMemRead Lib "SLHDMX33.DLL" (ByVal Segment%,
	ByVal Adresse%) As Long
Reads a Byte from the PC memory.


WINDOWS 95
WINDOWS 98
WINDOWS ME

A more general direct I/O port access under Windows 95 or Windows 98, respectively, is possible with WIN95IO.DLL. This library contains both 8-Bit (Byte) and 16-Bit (Word) Read and Write access. All functions are available royalty-free, please see the description which comes with the download file.
WIN95IO.DLL    his DLL contains functions for read and write access to PC port adresses and is thus suited to access all DMX PC interface cards - 1512A, 1512B, 1512B-LC and 1512C, as well as the SLH Printerport-Interface DMXPCP. Please note that writing to the card RAM may consist of up to three port accesses - set HighByte Address, set LowByte address, transfer Data byte. A more general step-by-step procedure can be found in chapter Hardware.
WRITE TO PORT   
Declare Sub vbOut Lib "WIN95IO.DLL" (ByVal nPort As Integer,
	ByVal nData As Integer)
Write a Byte to the port address. Parameters:
nPort:  Port address
nData:   Data Byte (&H00...&HFF)
READ FROM PORT   
Declare Function vbInp Lib "WIN95IO.DLL" (ByVal nPort As Integer)
	As Integer
Reads a Byte from the port address. Parameters see: vbOut.
Return value: Read Byte.


WINDOWS 95
WINDOWS 98
WINDOWS ME

An alternative solution for Windows 95 or Windows 98, repectively, is access to the card functions via OCX control element. Such a control element can easily be loaded into the Windows-based programming environment (Visual Basic, C++, Delphi) and then makes its functions available to the programmer as if they were standard language commands. To install and register the OCX with Windows the download file contains a complete SETUP installation routine.
SLHDMX.OCX    This OCX contains functions to automatically detect a card, read from and write to a card, start and stop the data transfer and support all card types 1512A, 1512B, 1512B-LC und 1512C. Four cards, even different card types, can be run simultaneously.

(to be continued)




WINDOWS 95
WINDOWS 98
WINDOWS ME
WINDOWS NT

Windows NT provides a complete encapsulation of hardware, thus accessing a card by means of a DLL is not possible. The driver concept for NT is known as "Virtual Device Drivers" or VxD.

A Virtual Device Driver (VxD) is encapsulating the hardware from the software and tells the software about the existence and properties of the hardware. A simple approach to overcome the need to design your own VxD is using a generic driver to access I/O ports. As the DMX PC cards only access I/O ports and do not require DMA or interrupt services this is an easy-to-solve task.

TVICPORT.ZIP    A universal driver named tvicport from Victor Ishikeev is available as shareware from
http://www.entechtaiwan.com/tools.htm
or you can download a copy directly from this site. The archive contains examples how to install and access the driver from VISUAL BASIC 6, DELPHI2, DELPHI3, DELPHI4, BORLAND C BUILDER 3.0, BORLAND C++ 5.x, MS VISUAL C++ 6.0. To access the DMX PC cards, simply apply the card access scheme as outlined in the Hardware section of this site. To install the TVICPORT drivers please refer to the text files included in the TVICPORT archive.

Example   

The code examples given below are coded for the 1512B-LC card. Please check your model and adjust accordingly. The routines are equivalent to the functions provided by the SLHDMXnn.DLL library for Windows 95/98, so you do not have to re-write your main program to make it compatible with Windows NT but simply replace the DLL calls with the functions described below. Though all examples are given in some BASIC dialect it should be fairly simple to adapt it to your preferred programming language.
DETECT CARD     DECLARE SUB dmxinit ()
Scans the PC slots for the presence of a card. Program ends if no card is found. If a card is found, the card address is returned, the card OS loaded into the card, the default parameters transferred into the card from a data array (variable array) and the card data RAM is cleared.
  cardadr = 0
  TVicPort1.OpenDriver

  FOR i = 0 TO 3
    TVicPort1.Port ( &H100 + &H20 * i) = 0
    TVicPort1.Port ( &H101 + &H20 * i) = 0
    TVicPort1.Port ( &H102 + &H20 * i) = &HAA
  NEXT i

  FOR i = 0 TO 3
    TVicPort1.Port ( &H100 + &H20 * i) = 0
    TVicPort1.Port ( &H101 + &H20 * i) = 0
    porttest = TVicPort1.Port (&H102 + &H20 * i)
    IF porttest = &HAA THEN cardadr = (&H100 + &H20 * i)
  NEXT i

IF cardadr = 0 THEN PRINT " No card found!": END
  PRINT "---------------------------"
  PRINT "Card Address: "; cardadr
  PRINT "---------------------------"

  ' *******************************************
  ' transfers the DMX operating system software
  ' into the card. Data are read from a file called
  ' SLHDMX12.BIN for card 1512B-LC or
  ' SLHDMX16.BIN for card 1512B respectively
  ' *******************************************
  OPEN "SLHDMX12.BIN" FOR INPUT AS #1
  i = 0
  WHILE NOT EOF(1)                              	    ' reads/transfers
    x$ = INPUT$(1, #1)					    ' operating system
    TVicPort1.Port(cardadr) = i AND 255                     ' address lowbyte
    TVicPort1.Port(cardadr + 1) = INT(i / 256)              ' address highbyte
    TVicPort1.Port(cardadr + 2) = ASC(x$)
    i = i + 1
  WEND
  PRINT "--------------------------------------------"
  PRINT "perating System  "; i; " Bytes loaded "
  PRINT "--------------------------------------------"

  FOR i = 0 TO 8                                       	     ' transfers parameters
    TVicPort1.Port(cardadr) = (i + &H7F0) AND 255            ' address lowbyte
    TVicPort1.Port(cardadr + 1) = INT((i + &H7F0) / 256)     ' address highbyte
    TVicPort1.Port(cardadr + 2) = dmxdef(i)                  ' default data value(s)
  NEXT i

  FOR i = &H0 TO &HFF                          		     ' set all channels = 0
    TVicPort1.Port(cardadr) = (i + &H400) AND 255            ' address lowbyte
    TVicPort1.Port(cardadr + 1) = INT((i + &H400) / 256)     ' address highbyte
    TVicPort1.Port(cardadr + 2) = 0                          ' data value
    TVicPort1.Port(cardadr) = (i + &H500) AND 255            ' address lowbyte
    TVicPort1.Port(cardadr + 1) = INT((i + &H500) / 256)     ' address highbyte
    TVicPort1.Port(cardadr + 2) = 0                          ' data value
  NEXT i

END SUB

START CARD     DECLARE SUB dmxstart ()
This example is for card 1512B-LC and card 1512B.
dummy = TVicPort1.Port(cardadr + 3)

END SUB

STOP CARD     DECLARE SUB dmxstop ()
This example is for card 1512B-LC and card 1512B.
TVicPort1.Port(cardadr) = 0

END SUB

WRITE TO CARD     DECLARE SUB dmxtrans (channel, value)
This example is for card 1512B-LC and card 1512B.
  IF kanal < 1 OR kanal > 512 THEN EXIT SUB                      ' error!
  IF value > 255 THEN EXIT SUB                                   ' error!

  TVicPort1.Port(cardadr) = (&H400 + kanal - 1) AND 255          ' address lowbyte
  TVicPort1.Port(cardadr + 1) = INT((&H400 + kanal - 1) / 256)   ' address highbyte
  TVicPort1.Port(cardadr + 2) = value                            ' data value
END SUB


PORT95NT.EXE    Another universal driver called DLPortIO can be downloaded from Scientific Software Tools, Inc. The driver is supplied as is, without any support given, and is free. Windows 95, 98 and Windows NT are supported. To download the latest file, visit their website at http://www.sstnet.com.

To access the card, different commands (buffered and unbuffered access, byte- and word level access) can be used. To do a byte transfer, use the commands:
DlPortReadPortUchar for read access and
DlPortWritePortUchar for write access.
The coding of the card functions should be done similar to the tvicport example given above. Also please refer to the hardware description of your card, which gives a point-by-point instruction scheme how to access the card.


Please report errors, omissions or addendums to Webmaster@pcdmx512.com. Thank you.

THE PCDMX
PROGRAMMER'S
NETWORK
New developments, drivers, tips and tricks are regularly posted on the PCDMX devnet. Post comments and questions, your examples and demos on the net - chances are, that someone has already solved your problem. Share yor experience with other users. Subscribe to the PCDMX developer's Network - it's FREE.


VBO Ad