CrazyEngineers
  • Code for parallel port communication with matlab,.......

    dio = digitalio('parallel','LPT1')
    --> create an object

    data1 = addline(dio,0:7,0,'out') %Pin 2-9
    data2 = addline(dio,0,2,'out') %Pin 1
    data3 = addline(dio,1,2,'out') %Pin 14



    If i have to embed this code into the simulink block set and then run to communicate with the parallel port

    what should i do....

    expecting a reply to solve my problem


    thanks in advance --- zentill
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • xheavenlyx

    MemberFeb 17, 2008

    In simulink try to select the block for "Run MATLAB function" or something similar. Check help file on how to run matlab code from simulink.

    OR OR OR

    You could directly use the "Digital Output" Block under Data Aqussition Blockset to control the Parallel Port directly!!!! 😀 Its a better option if your project is completely in Simulink.
    Are you sure? This action cannot be undone.
    Cancel
  • Zentill.now

    MemberFeb 29, 2008

    thank u

    the information that you shared was of great help
    now iam workin on the DAQ block set as you said
    Are you sure? This action cannot be undone.
    Cancel
  • xheavenlyx

    MemberFeb 29, 2008

    Its good to hear that. Welcome. 😀
    Are you sure? This action cannot be undone.
    Cancel
  • sorell13

    MemberJul 26, 2008

    I have used that code to generate an output frequyency in matlab. I realised that with that commands the LPT port is not sufficiently fast. What should I do to increase the speed of the LPT port (i want to create a frequency greater than 50Hz to control a laser diode). thank you very much
    Are you sure? This action cannot be undone.
    Cancel
  • xheavenlyx

    MemberJul 26, 2008

    Well, I think you should use some analog device for the final frequency generator. Something like the 555 connected to the parallel port, and when you give the signal it shoots out a 50Hz(or greater) pulse whenever you want.

    OR OR

    The other good method, is use your headphone output! Most commercial sound cards can produce audio range till about 90kHz (human hearing 20Hz to 20kHz). So connect the headphone out to the base of an NPN amp. So the laser turns on at the same frequency you giving to your speakers (use a frequency generator or square wave generator in matlab) And follow through from there, hope you get the idea. 😀
    Are you sure? This action cannot be undone.
    Cancel
  • sorell13

    MemberJul 26, 2008

    Thank you very much!
    Are you sure? This action cannot be undone.
    Cancel
  • ned_student

    MemberJul 7, 2010

    need to know simultaneous data sending to parallel port using matlab???
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register