parallel port communication in matlab through simulink

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

  • xheavenlyx
    xheavenlyx
    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.
  • Zentill.now
    Zentill.now
    thank u

    the information that you shared was of great help
    now iam workin on the DAQ block set as you said
  • xheavenlyx
    xheavenlyx
    Its good to hear that. Welcome. 😀
  • sorell13
    sorell13
    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
  • xheavenlyx
    xheavenlyx
    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. 😀
  • sorell13
    sorell13
    Thank you very much!
  • ned_student
    ned_student
    need to know simultaneous data sending to parallel port using matlab???

You are reading an archived discussion.

Related Posts

ths is gaurav agrawal.................kota.
Does any one has idea about Selenium(Automation Tool). I have only brief about this, and that too by just browsing over internet. But does any one has worked on this...
Datasheetpro.com - Search Electronic Components recently released Beta version of the Free data sheet search site for use by component and design engineers. The site includes over 2 million part...
Hi all want a short intro abot JTAG interface visit PCB design and post your doubts and suggestions. Thanks subbu
Hi, Im new to CE. would always like to be part of the knowledge sharing that would be taking place here at CE site.