CONTROL OF MED INPUT/OUTPUT MODULES FROM OTHER LANGUAGES

Similar documents
SHUTTLE BOX FOR ACTIVE & PASSIVE AVOIDANCE MED-APA INSTALLATION GUIDE. DOC-015 Rev Copyright 2013 All Rights Reserved

STANDALONE PCI INTERFACE PACKAGE

SMARTCTRL INTERFACE MODULES

TRIADIC PACKAGE WIRING GUIDE. DOC-194 Rev Copyright 2012 All Rights Reserved

ROTA-ROD TREADMILLS ENV-577 FOUR STATION RAT AND ENV-577M FIVE STATION MOUSE USER S MANUAL. DOC-056 Rev Copyright 2012 All Rights Reserved

CONTEXTUAL CONDITIONING

ACTIVITY WHEEL WITH ELECTRONIC DRAG

OPEN FIELD ACTIVITY HARDWARE

USB INTERFACE SYSTEM DIG-703A / DIG-703B PRODUCT MANUAL. DOC-114 Rev 1.7. Copyright 2013 All Rights Reserved

ULTRASONIC VOCALIZATION DETECTOR TEST PACKAGE

USB MICROPHONE PACKAGE

USB OPEN FIELD ACTIVITY HARDWARE

PULSER (PLUS) PRIZMATIX

VIDEO ZERO MAZE ASSEMBLY INSTRUCTIONS. instrumentation and software for research. DOC-014 Rev Copyright 2013 All Rights Reserved

MED SCREEN IMAGE DOWNLOADER

STOP SIGNAL REACTION TIME

VARIABLE SCHEDULE MED-STATE NOTATION TM PROCEDURE. SOF-700RA-18 Manual DOC-139 Rev Copyright 2009 All Rights Reserved

SOFTCR PRO SOF-722 USER S MANUAL. DOC-204 Rev Copyright 2016 All Rights Reserved. Med Associates, Inc. P.O. box 319 St. Albans, Vermont 05478

OPERANT CONDITIONING LAB PACKAGE

THE SMART CUMULATIVE RECORDER FOR WINDOWS

MPC2XL DATA TRANSFER UTILITY FOR MED-PC USERS SOF-731 USER S MANUAL. DOC-036 Rev Copyright 2012 All Rights Reserved

WATER MAZE VIDEO TRACKING

Western Reserve Controls, Inc PXB241 User s Manual

ADVANCED SYRINGE PUMP

BEHAVIORAL SOFTWARE & PRODUCTS CATALOG

Application Note. PowerStar 5/6 - LabView VI Integration

FAQ. For ICPDAS DCON (I-7000/8000/87K) series modules [Version 1.0]

Team Solutions, Inc. TE5100 PCI/PXI 100 MHz Signal Generator. Programming Manual

Introduction to the DLL for the USB Interface Board K8061

$U6RIW,QWHUQDWLRQDO. Modbus Driver for Windows 95/98/NT/2000/XP 8VHUV0DQXDO 0RGEXV,QWHUIDFH. 9HUVLRQ Page 1

Gen5 File Export Creating a File to Export to LIMs/LIS

How to use JS Automation I/O driver

E2ISP DLL Using the DLL in your applications

Orifice Flow Meter

Getting Started with LabVIEW

LAP-B(PCI/C-PCI) GPF LAP-B Communications Driver Software for for Windows. Help for Windows.

MOTENC-Lite 4-Axis PCI Motion & I/O Control Board. Reference Manual Rev 1.1, June 20, Copyright 2005 VITAL Systems Inc

To successfully use the technique explained below you must have AnadigmDesigner2 and Microsoft Visual C++ ver 6.0

Investintech.com Inc. Software Development Kit: PDFtoImage Function Library User s Guide

Meilhaus Electronic Manual ME E. Digital I/O Board for ISA Bus

Investintech.com Inc. Software Development Kit: PDF-to-Excel Function Library User s Guide

DPF-0401 Windows driver software for USB expansion I/O products

PCI Win32 Driver Software

M24LRXX datasheet M24LRXX tool kit user guide (UM0853) Configuring your ISO reader to support the M24LRXX application note (AN3163)

ME-94, ME-95, ME E

MOXA Sync Board API Programmer s Manual

M ICROSTAR LABORATORIES TM

Release Notes. MapBasic Version Contents:

UM0401 User manual. User manual for eight bit port expander STMPE801 demonstration board. Introduction

Real Time Operating Systems Application Board Details

Input / Output (IO) Control Boxes

Investintech.com Inc. Software Development Kit: ImagetoPDF Function Library User s Guide

Develop Your Own Function and Function Block

Investintech.com Inc. Software Development Kit: PDFtoXML Function Library User s Guide

PCI Software Manual [for Windows 95/98/NT/2000/XP]

PCI-DIO02. User s Manual

Developer s Guide. AccuVote Central Count System Image Processing DLL

PP004 Parallel Port-Based DSPT 6001 / 6002 CAMAC CONTROLLER REFERENCE MANUAL Revised 03/18/07

MPPC module. Function Specifications (mppcum1a) Version 1.0. K29-B60901e

P&E Microcomputer Systems, Inc. P.O. Box 2044, Woburn, MA 01888, USA

Investintech.com Inc. Software Development Kit: PDF-to-HTML Function Library User s Guide

Instructions for TSCLIB.DLL functions

Plugin API. Revision

System Monitoring Library Windows driver software for Classembly Devices

MOTENC Axis PCI Motion & I/O Control Board. Reference Manual Rev 1A, April Copyright 2004 VITAL Systems Inc

SDK-S User Manual K-21-A ( ) 1 Copyright 2013 B&W Tek, Inc.

PCI-AIO02. User s Manual

VMISFT-RFM2G. Drivers for Windows NT, 2000, 2003 Server and XP Operating Systems Installation Guide Document Number # Rev.

GraphLink cable emulator software. Special project work by David Eriksson. Tutor Håkan Gründer.

Documentation EtherCAT Sniffer Library for LabVIEW 1.0

USB_IO_for_VB6.dll User Guide

PCIe-SER01. User s Manual. PCIe-SER01 user s Manual (Rev 1.0)

PCI-AIO01. User s Manual

Quick Start Manual. For ICPDAS DCON (I-7000/8000/87K) series modules Series [Version 1.0]

Using NI-488.2M Software with 32-Bit Delphi Applications

Features. High-Speed Analog Input Board for PCI AD12-16U(PCI)EH. High-Speed & Resolution Analog Input Board for PCI AD16-16U(PCI)EH

Development kit for DATAMAN 520 Programmer s Guide Version 2.00

MODEL PCI-DIO-48(S) USER MANUAL

VIDEO MONITOR SOF-842 USER S MANUAL. DOC-124 Rev Copyright 2014 All Rights Reserved. Med Associates Inc. P.O. Box 319 St. Albans, Vermont 05478

Programming for Engineers Pointers

KC Web API Programmer Reference

Understanding the DLCALL Function

SMART Self-Test Reference for P400e SATA SSDs

Assembler Programming. Lecture 10

AD16-16(PCI)EV. Features. High-Resolution Analog Input Board for PCI AD16-16(PCI)EV 1. Ver.1.01

AD12-16(PCI)EV. Features. Analog Input Board for PCI AD12-16(PCI)EV 1. Ver.1.01

TCPDAQ.DLL Help Table of Contents

EZ-Red Power I/O module for PC See for other manuals

C-BUS MODULE WINDOWS DLL USAGE GUIDE

Quick Start Guide. EVBUSB2SER board for USB-to-serial bridge. Ready Play Solutions

OME-SERIES DATA ACQUISITION CARDS

UFG-10 Family. Frame Grabbers. Easy Programming Guide. Windows

Lecture 4 DLLs and Custom Hardware Programming

How to configure the Matlab interface

AIO UE3-PE. Features. 1MSPS 12-bit Analog I/O Board for PCI Express AIO UE3-PE 1. Ver.1.01

Simple Scope application example. Using the Cleverscope DLL with C or Delphi

CALIBRE. I2C Communications Adapter Windows 95 / 98 Driver Manual ICADLL/95 Issue /07/1999

Static Analysis I PAOLO PALUMBO, F-SECURE CORPORATION

Windows Device Driver and API Reference Manual

Writing a Client Application for Genesis II Contributors: Chris Sosa Last Modified: 06/05/2007

Transcription:

instrumentation and software for research CONTROL OF MED INPUT/OUTPUT MODULES FROM OTHER LANGUAGES SOF-732-3 USER S MANUAL DOC-149 Rev. 1.1 Copyright 2014 All Rights Reserved Med Associates Inc. P.O. Box 319 St. Albans, Vermont 05478 Phone: 802.527.2343 Fax: 802.527.5095 www.med-associates.com

notes - i -

Table of Contents Chapter 1 DIG-704 Inputs and Outputs... 4 Chapter 2 PortRead... 5 Chapter 3 PortWrite... 7 Appendix A Contact Information... 9 - ii -

- 3 -

CHAPTER 1 DIG-704 INPUTS AND OUTPUTS The DIG-704 driver controls when and how the outputs are turned on and when the inputs are read. The Dynamically Linked Library (DLL) 704IO.DLL provides the user with the ability to talk to the DIG-704 driver. There are two functions contained in the 704IO.DLL that the user can call from within their program, PortRead and PortWrite. The 704IO.DLL needs to be placed in the appropriate folder so that the calling program can find it when necessary. The correct folder is operating system dependent: Windows 98 Windows 2000 Windows XP Windows 7 (32 & 64 bit) C:\Windows\System C:\WINNT\System32 C:\Windows\System32 C:\Windows\System32 For Visual Basic 6.0 users the module 704IO.bas is provided. provided demonstrating how to use the functions. Also an example project is For Delphi users the header file 704IO.hed is provided. For C++ users the header file 704IO.h and library 704IO.lib is provided. Each of the above files contains the PortRead and PortWrite function declarations, which need to be included with the desired program. Figure 1 Sample Program - 4 -

CHAPTER 2 PORTREAD Visual Basic Declaration Declare Function PortRead Lib "704IO.dll" (ByVal Rack As Integer, ByVal Port As Integer, ByVal Offset As Integer) As Integer Delphi Declaration Function PortRead(Rack, Port, Offset : Integer) : Integer; stdcall; external '704IO.dll' name 'PortRead'; C++ Declaration Extern "C" short WINAPI EXPORT PortRead(short Rack, short Port, short Offset); The PortRead function returns the value read from the specified Rack, Port, and Offset. It contains the following parameters: Rack: Valid values 1 4 This is the Rack number that the input card is installed in. It is possible to have up to four DIG-704 PCI cards in the computer, and each DIG-704 PCI card is connected to its own Rack via a ribbon cable. Use MED Test to determine the appropriate Rack number for the input card. In most cases it will be 1. If MED Test does not provide the option of changing the Rack number, then it is Rack 1. Port: Valid values 780 795 This is the Port number of the input card that needs to be read. The Port number for the input card is set using either a jumper or switch on the card itself. SmartCtrl TM and Standard Input cards by default start at Port 780 and increment by one for each additional card. For example, the first SmartCtrl card would have an input Port of 780, the second SmartCtrl card would have an input Port of 781, etc. SuperPort Input cards use a default Port value of 789. While it is possible to change the input Port on a SuperPort card it is recommended that it be left at the default value. Offset: Valid values -1 254 This is the Offset number of the input card that needs to be read. On some cards (i.e. SuperPort Input cards) the Offset number is set by a jumper on the card itself. SmartCtrl and Standard Input cards use an Offset value of -1. This value is hard coded and cannot be changed. SuperPort Input cards by default start at Offset 0 and increment by 2 for each input card. Also each SuperPort Input card has two Offset values per card. This means that there are two input Bytes that can be read on every SuperPort Input card. For example the first SuperPort Input card would have an Offset value of 0 for the first Byte and 1 for the second Byte. The second SuperPort Input card would have an Offset value of 2 for the first Byte and 3 for the second Byte, etc. - 5 -

The return value from the PortRead function is an Integer. A value of 0 means that all inputs were off and a value of 255 means that all inputs were on. The number indicates which inputs or Bits were on at the time the value was read: Input # Bit # 1 1 2 2 3 4 4 8 5 16 6 32 7 64 8 128 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 = 255 If more than one input is on at the time of the reading, then the values will be added together to come up with the resulting number. Example: 133 = 1 + 4 + 128 and means that inputs 1, 3, and 8 were on at the time of the reading. Example: Value = PortRead(1, 780, -1) Read the value from Rack 1, Port 780, Offset -1. (Note: The Rack, Port, and Offset values are the default values for the first SmartCtrl or Standard Input card.) - 6 -

CHAPTER 3 PORTWRITE Visual Basic Declaration Declare Sub PortWrite Lib "704IO.dll" (ByVal Rack As Integer, ByVal Port As Integer, ByVal Offset As Integer, ByVal Value As Integer) Delphi Declaration Procedure PortWrite(Rack, Port, Offset, Value : Integer); stdcall; external '704IO.dll' name 'PortWrite'; C++ Declaration Extern "C" void WINAPI EXPORT PortWrite(short Rack, short Port, short Offset, short Value); The PortWrite function writes the Value specified to the Rack, Port, and Offset provided. It contains the following parameters: Rack: Valid values 1 4 This is the Rack number that the output card is installed in. It is possible to have up to 4 DIG-704 PCI cards inside the computer. Each DIG-704 PCI card is connected to its own Rack via a ribbon cable. Use MED Test to determine the appropriate Rack number for the output card. In most cases it will be 1. If MED Test does not provide the option of changing the Rack number, then it is Rack 1. Port: Valid values 780 795 This is the Port number of the output card that needs to be written to. On some cards (i.e. SuperPort and Standard Output cards) the Port number is set using a jumper on the card itself. Standard Output cards by default start at Port 780 and increment by one for each additional card. For example the first Standard Output card would have an output Port of 780, the second Standard Output card would have an output Port of 781, etc. SmartCtrl cards use an output Port value of 792. This value is hard coded and cannot be changed. SuperPort Output cards use a default Port value of 792. While it is possible to change the output Port on a SuperPort Output card it is recommended that it be left at the default value. Offset: Valid values -1 254 This is the Offset number of the output card that needs to be written to. On some cards (i.e. SmartCtrl and SuperPort Output cards) the Offset number is set by a jumper or red switch on the card itself. Standard Input cards use an Offset value of -1. This value is hard coded and cannot be changed. - 7 -

There are four types of SmartCtrl cards (DIG-715, DIG-716, DIG-715A, and DIG-716B), however all of the cards work the same way when writing to them. By default SmartCtrl cards start at Offset 0 and increment by 2 for each card. Two of the SmartCtrl cards (DIG-715 and DIG-716) only have one output Byte that can be written to. In this case the even Offset number is always used to address the card. For example the first SmartCtrl card would have an Offset value of 0, the second SmartCtrl card would have an Offset value of 2, etc. Two of the SmartCtrl cards (DIG-715A and DIG-716B) have two output Bytes that can be written to. In this case two Offset numbers are used to address the desired Byte. For example the first SmartCtrl card would have an Offset value of 0 for the first Byte and1 for the second Byte. The second SmartCtrl card would have an Offset value of 2 for the first Byte and 3 for the second Byte, etc. SuperPort Output cards by default start at Offset 0 and increment by 2 for each output card. Also each SuperPort Output card has two Offset values per card. This means that there are two output Bytes that can be written to on every SuperPort Output card. For example the first SuperPort Output card would have an Offset value of 0 for the first Byte and 1 for the second Byte. The second SuperPort Output card would have an Offset value of 2 for the first Byte and 3 for the second Byte, etc. Value: Valid values 0 255 This is the Value that is to be sent to the specified Rack, Port, and Offset. A Value of 0 would turn off all outputs and a Value of 255 would turn on all outputs. There are eight outputs available at each Port/Offset. To turn on an output you have to specify which Bit in the Byte to turn on: Output # Bit # 1 1 2 2 3 4 4 8 5 16 6 32 7 64 8 128 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 = 255-8 -

To turn on multiple outputs with one command just add the Bit values together and send that as the Value. Example: 2 + 16 + 64 = 82 and would result in outputs 2, 5, and 7 being turned on. Example: PortWrite(1, 792, 0, 10) Write the Value 10 to Rack 1, Port 792, Offset 0. This will result in outputs 2 and 4 being turned on. (Note: The Rack, Port, and Offset values are the default values for the first SmartCtrl or SuperPort Output card.) APPENDIX A CONTACT INFORMATION Please contact for information regarding any of our products. Visit our website at www.med-associates.com for contact information. For technical questions, email support@med-associates.com. - 9 -