LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read a trigger signal with the parallel port

I am writing a VI that needs to recieve a start trigger from an MRI scanner. The scanner sends a TTL to pin 13 of the parallel port (x378). I've tried to use the Port I/O vis but can't see the change in the status on the pin. The signal is really short in duration: 0.05ms. The engineer who supports the MRI suggested that it would be best to use an interrupt to get the signal. He alternatively mentioned that the parallel port should keep the change in status in the buffer so even if I was reading from the buffer I should be able to read it. I am new to using parallel ports in this way and I am also unsure what the port I/O actually does. Since I have yet to be able to see the change in status, I assumed that I was just ready the current status of the port, not out of a buffer. Is this true? Also, is there a way for me to use an interrupt from the parallel port? Again, I am new at this, so it is also possible that I am missing something basic. Any advice would be appreciated.

OS: Windows 2000
LV 7 (I also have access to LV8)

Thanks,
Rebecca
0 Kudos
Message 1 of 6
(3,173 Views)
i think your problem is with the port address 0x378 its for data port (pins 2 trough 9), you should use 0x379 to read what you want. Pin 13 is bit 4 see the image below

 


here are some links with info about the parallel port:

http://www.beyondlogic.org/spp/parallel.htm
http://www.geocities.com/nozomsite/parallel.htm


i hope it will help you 😉
0 Kudos
Message 2 of 6
(3,150 Views)
Thanks for the reply. I neglected to mention it in my first post, but I am using the base +1 to try to read pin 13 (as you suggested). I think the real problem is the short duration of the signal and the port I/O that I described in my original message. Another other suggestions or details? I am beginning to wonder if using an interrupt is even possible since I haven't seen anything indicating it is.

Thanks in advance!
0 Kudos
Message 3 of 6
(3,127 Views)
i haven't used hardware interrupts with labview, and i don't know if it is possible...

i  think you could use a peak detect circuit or a latch, to hold the signal in the port, other way would be reading the port as fast as you can, with a timed loop.

that's all i can say, good look 😉
0 Kudos
Message 4 of 6
(3,117 Views)

Hi Rebecca,

      No need to reply, these are mostly just comments and some possibly-useful web-links.

Pin 13 (Select) seems like an odd pin for this function - pin 10 (nAck) can be used to trigger IRQs.

A DB25 break-out dongle - for a really brute-force approach, route this signal to an input does support edge/events. Smiley Wink

A really thorough parallel-port info-page.

Cheers! Smiley Happy

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 5 of 6
(3,101 Views)
you can check "Parallel Port Read and Write Loop.vi" in examples it will help you

Help >> Find Examples >> Hardware Input and Output >> General


0 Kudos
Message 6 of 6
(3,086 Views)