Results 1 to 4 of 4

Thread: read data from port

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2005
    Posts
    18

    read data from port

    i want to read data that comes from digitizer(used in weigh-bridge) and display that value in a textbox.

    can anyone help ?


    Awaiting

    ashish

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,104

    Re: read data from port

    How is the digitizer connected to the computer, serial port? Also, what language?
    My usual boring signature: Nothing

  3. #3

  4. #4
    Addicted Member
    Join Date
    Jan 2007
    Location
    Iran
    Posts
    237

    Re: read data from port

    I think:

    Port.def file:
    Code:
    LIBRARY Port
    DESCRIPTION DLL FOR I/O PORT
    EXPORTS
    Outp @1
    Inp @2
    Port.cpp file:
    Code:
    #include "conio.h"
    short _stdcall Outp(int PortAddress,int PortData)
    {
    short Dummy;
    Dummy=(short)(_outp(PortAddress,PortData));
    return(Dummy);
    }
    short _stdcall Inp(int PortAddress)
    {
    short PortData;
    PortData=(short)(_inp(PortAddress));
    return(PortData);}
    in VB:
    Private Declare Function Outp Lib “Port.dll” (Byval PortAddress as Integer,Byval PortData as Integer) as Integer
    Private Declare Function Inp Lib “Port.dll” (Byval PortAddress as Integer) as Integer

    Reading:
    Portvalue = Inp(Port_Number)

    Y.P.Y

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width