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

Hardware Description
back
HOME
.

DRIVERS FOR DOS

Using DOS as programming environment for applications using the DMX PC-Cards is pretty simple, because all programming languages offer direct I/O hardware access commands.

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: 5.9.1999.


Please check the HARDWARE department to find the instructions for accessing your specific card.

Using DOS the PC I/O area is directly accessible. All programming languages feature specific IN and OUT, or INPORT and OUTPORT resp., commands to access plug-in hardware. Please refer to the command list and syntax of the programming language to find out more about I/O commands offered by your preferred language.

Nevertheless it might be advisable to contruct some higher-level subroutines or functions for card access. The code below is an example how to do this.


BASIC   

All subsequent routines are written for card type 1512B-LC; minor changes are necessary for other card types. Please refer to the hardware description of your specific card.
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
  FOR i = 0 TO 3
    OUT &H100 + &H20 * i, 0
    OUT &H101 + &H20 * i, 0
    OUT &H102 + &H20 * i, &HAA
  NEXT i

  FOR i = 0 TO 3
    OUT &H100 + &H20 * i, 0
    OUT &H101 + &H20 * i, 0
    porttest = INP(&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
    OUT cardadr, i AND 255                      ' Address lowbyte
    OUT cardadr + 1, INT(i / 256)               ' Address highbyte
    OUT cardadr + 2, ASC(x$)
    i = i + 1
  WEND
  PRINT "--------------------------------------------"
  PRINT "perating System  "; i; " Bytes loaded "
  PRINT "--------------------------------------------"

  FOR i = 0 TO 8                                ' transfers Parameters
    OUT cardadr, (i + &H7F0) AND 255            ' Address lowbyte
    OUT cardadr + 1, INT((i + &H7F0) / 256)     ' Address highbyte
    OUT cardadr + 2, dmxdef(i)                  ' Default Data value
  NEXT i

  FOR i = &H0 TO &HFF                           ' Set all channels = 0
    OUT cardadr, (i + &H400) AND 255            ' Address lowbyte
    OUT cardadr + 1, INT((i + &H400) / 256)     ' Address highbyte
    OUT cardadr + 2, 0                          ' Data value
    OUT cardadr, (i + &H500) AND 255            ' Address lowbyte
    OUT cardadr + 1, INT((i + &H500) / 256)     ' Address highbyte
    OUT 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 = INP(cardadr + 3)

END SUB

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

END SUB

WRITE TO CARD     DECLARE SUB dmxtrans (kanal, 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!

  OUT cardadr, (&H400 + kanal - 1) AND 255          ' Address lowbyte
  OUT cardadr + 1, INT((&H400 + kanal - 1) / 256)   ' Address highbyte
  OUT cardadr + 2, value                            ' Data value
END SUB


READ FROM CARD     DECLARE FUNCTION dmxread (kanal)
This example is for card 1512B-LC and card 1512B.
  IF kanal < 1 OR kanal > 512 THEN EXIT SUB         ' Error!

  OUT cardadr, (&H400 + kanal - 1) AND 255          ' Address lowbyte
  OUT cardadr + 1, INT((&H400 + kanal - 1) / 256)   ' Address highbyte
  DMXREAD= INP(cardadr + 2)                         ' Data value
END SUB



Please report errors, omissions or addendums to Webmaster@pcdmx.com