LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reading from a parallel port

Hi,

      I want to use the outport vi to write onto the data register of the parallel port.I am using Labview 6.1  on Windows XP platform.It  gave me the following error:

 "Capability not supported .VI was stopped at code interference node 0x1BC of subvi outport.vi”

 

What does this mean?

Also when I used the inport vi to read from the parallel port it gave the following error:

 

"Capability not supported .VI was stopped at code interference node 0x1D8 of sub vi inport.vi"

 

Also while executing these vi’s  I did not connect anything at the port.Is it necessary?

Should I write something in the control register first before I perfom these operations?

 Please help at the earliest.Thank you.

 

 

0 Kudos
Message 1 of 8
(3,818 Views)
With 6.1, you can't use the inport/outport functions on a protected OS such as NT,2K, or XP. NI has a set of replacement functions that you can download from here. You other option is to use VISA.
0 Kudos
Message 2 of 8
(3,800 Views)

Hi,

     Thanks for the quick reply.I downloaded the hwaccess library you suggested and I also got the new inport and outport VIs.I just ran a simple program to output a binary value say 5Ehex at the parallel port data register.The program runs without showing me any errors (thanks to you!) but when i measured the voltage at the data pins it was FFhex.The next time I ran the program to output the value 00hex it just showed me 00hex at the output.When I ran the VI subsequently the value did not change from zero.I don't know why this is happening.

I also have another question....to read the data placed at the data pins do I have to output something at the control register first?I am using the parallel port in the ECP/EPP mode.

I had downloaded a VI to write to the parallel port from the NI website but it gave me a time out error.But i figured that it might me easier to use the inport and outport VIs as I know the register addresses.

Any help is appreciated.

 

0 Kudos
Message 3 of 8
(3,765 Views)
I've been trying to find an old article in the developer zone that had some information on the different parallel port settings and what you needed to do in order to get outport to work in ECP or EPP mode. I haven't been able to find it yet. You can give it a try yourself (search for parallel port) and maybe you'll have better luck. I think it had to do with grounding one of the pins on the port but that's all I remember. Maybe someone else with a better memory than I do will see this post and help.
0 Kudos
Message 4 of 8
(3,760 Views)

Hi,

     thankyou for all your help.I really hope someone else helps me out soon!

0 Kudos
Message 5 of 8
(3,756 Views)
See if the information here helps. There have been lot of posts on using the parallel port. You might also search the forum for those.
0 Kudos
Message 6 of 8
(3,741 Views)

hi,

i wrote a simple program to write and read from the data reg of parallel port using the outport and inport vi's of the accesshw library.it runs without giving me any errors.but does not show be the value i have written either.i am attaching the program.let me know if you can find something wrong with the program.thanks!

0 Kudos
Message 7 of 8
(3,705 Views)

Hi msrit,

I took a look at your code and it looks fine from what I can see.  I did find some information about bidirectional parallel ports that may be affecting you -

With some models of parallel ports the data lines can be read the same way we read the control lines, by driving them to high logic so they will take on the value of an external signal. However, most parallel ports require that you set the direction bit for input. This is bit 5 in the Control register (base+2). If the port is capable of it, setting the direction bit high has the effect of making the lines tri-state so it can be driven externally. Sometimes it is also necessary to toggle bit 6 high or low. However, it should be noted that some manufacturers actually lock these bits so that software cannot change them. An example is shown below in Figure 7.


Figure 7. Using data lines for input.



To test whether your data lines can be used for input, try the following:

  1. Set bit 5 of the control register high (at base address+2).
  2. With nothing connected to the port, write a couple of values to the data port, and read each back after you write it.


If the reads DON'T match the writes, your port is probably bidirectional. Setting C5 disabled the data outputs and you're reading the open inputs of the data-port buffer.

If the reads DO match the writes, your port isn't bidirectional. The data outputs are still enabled, you're reading back what you wrote, and you won't be able to read external signals.

If it is possible to use your data lines for input, then you just need to set control register bit 5 high and read from the value of the data lines at the base address.

I hope this helps!


Regards,
Anna M.
National Instruments
0 Kudos
Message 8 of 8
(3,668 Views)