SETUP GUIDE

Integration of PCI-DAS1200 and DDA08/12

with Simulink and Wincon3

Manuals from ComputerBoards:
PCI-DAS1200, PCI-DDA08/12

Download PCI-DAS1200&DDA08/12 WinCon Drivers by Dan Block

1. Application upgrade

Matlab

  1. Go to the site: www.mathworks.com/downloads/index.cgi, download the patch file pcpatch.exe to "matlab\" directory and upgrade Matlab 5.2.0 to 5.2.1. Simulink and RTW will be upgraded at the same time.
  2. Run pcpatch.exe, and run patch521.exe.

Wincon

  1. Go to the site: www.wincon.quanser.com, Download the tlc_c.m file.
  2. Place this file in the MATLAB\TOOLBOX\RTW directory and Rebuild any models which do not show predefined plots.

Paths!

  1. Go to Wincon3\SetEnvVar to confirm the environment setup!!
  2. Set paths for:
    VC; MATLAB; Studio;
  3. In Matlab:
  4. "mex –setup" to set the path for VC.
  5. check the file "..matlab\rtw\c\wincon\wc95_pci.tmf" for working paths!!
  6. Check VC: vcvars32.bat in BIN.

2. Copy the files of the driver

Change the Win95 View/option into "show all files" before copying!

For Matlab

File Name Source Location Destination Notes
winlib.mdl dan:\matlab\rtw\toolbox c:\matlab\toolbox\rtw The latest
wc95_pci.tmf
danstime.tlc
danswncn.tlc
dan:\matlab\rtw\wincon c:\matlab\rtw\c\wincon modified:
07/28/98
11/17/98
pci12tad.tlc
pci12di.tlc
pci12da.tlc
pci08da.tlc
pci12tad.dll
pci12di.dll
pci12da.dll
pci08da.dll
dan:\matlab\rtw\devices c:\matlab\rtw\c\dos\devices tad: timer&ADC
di: digital input
da: 2 DACs
Base addresses in pci08da.tlc!!

For WinCon

File Name Source Location Destination Notes
pci12pp.h
pci1200.h
pci12da.h
pci12tad.h
pci12di.h
pci08pp.h
pci08da.h
dan:\wincon3\include c:\wincon3\include !!pci12pp.h!!
*.* dan:\wincon3\examples c:\wincon3\examples\examples  
danwraps.clb dan:\wincon3\lib c:\wincon\lib  

DDK

DDK = Device Driver Kit, related to Win95 P&P

File Name Source Location Destination Notes
*.* dan:\ddk\ c:\ddk\  

3. Check the register editor

for PCI-DAS1200

  1. Using start menu "Run: regedit" to check the Registry editor of Win95.
    Look for the PCI number under:
    My Computer:
    \HK_LOCAL_MACHINE\enum\PCI\VEN_1307&DEV_000F\BUS_00&DEV_0F&FUNC_00

    Confirm the current entry in file "pci12pp.h" is the same as it appears in the registry editor.
    Whenever the hardware is upgraded, the number will be changed. And so we have to modify the pci12pp.h file.
    Change the line 21 from:
    code = CM_Locate_DevNode(&device, "PCI\\VEN_1307&DEV_000F\\BUS_00&DEV_0B&FUNC_00",0);
    into
    code = CM_Locate_DevNode(&device, "PCI\\VEN_1307&DEV_000F\\BUS_00&DEV_0F&FUNC_00",0);
    CAUTION:
    Do NOT change anything in Registry Editor until the consequence is completely known as under control!
  2. for PCI-DDA08/12

Run "regedit" in Win95. Check the code under:
HKEY_LOCAL_MACHINE\Enum\PCI\VEN_1307&DEV_0022&SUBSYS_00211307&REV_02\BUS_00&DEV_0E&FUNC_00

4. Possible troublemakers

Sequence of channel enable in pci08da.h

  1. In the DAC channel enable module, the sequence has to be "from CH7 to CH0", otherwise the board will be automatically reset to "simultaneous" mode without known reason.
  2. The base address for DAC output
  3. Although the board has 4 base addresses, the BADR0 and BADR1 are reserved by the system. So, in the .tlc file, the "Baddr1" is in fact BADR3 on the datasheet.
    The latest driver in URBANA seems to have 5 base addresses!! remember to change the .tlc file!

Other special issues

Simulink and RTW setup

  1. Change the "threshold" in option from 2e-004 to 5e-006.

5. Modifications!

FILE LINE Before Modification Notes
matlab\ rtw\c\doc\ devices\pci12da.tlc 92, 117 and 148 "(value/204.8)…"
"((value - 0x7FF)/204.8)…" this will fix the 10v offset bug in DAC output.
wincon3\include\pci12pp.h 21 DEV_0B&FUNC_00
DEV_0F&FUNC_00" Update the vendor and device ID
FOR 9-16CH/SINGLE ENDED SETUP, 03/07/2001    
wincon3\ include\pci12tad.h 66 PCI1200_ADC_MODE3_10 PCI1200_ADC_MODE1_10 MODE3(differential) -> MODE1(single)
wincon3\ include\pci12tad.h 105 i<8 i<12 the number of channels scanned