• Hey Guest. Check out your NeoGAF Wrapped 2025 results here!

Is there a way to create a "virtual" parallel port in Windows?

Status
Not open for further replies.

Dylan

Member
Getting a bit desperate here so I'm resorting to GAF-begging.

In short, I'm programming a cognitive task which will need to send triggers through a parallel port. The computer that this program will ultimately run on is attached to an MRI scanner so my access to it is limited.

My laptop doesn't have a parallel port, so each time I test the code I have to edit out every part of the code that sends a trigger. (I'm using a particularly crappy language that doesn't let you just 'comment out' individual lines of code).

I'm looking for something that can emulate a parallel port, similar to a 'virtual DVD drive' which for which there are tons of software solutions. However, my google searching has been futile. Most solutions I've found are specific to adding a port to a Virtual Machine, but I'm not using a Virtual Machine, I'd like to fool my OS (Windows) into thinking there's a parallel port on my laptop.

Note that the triggers don't actually need to be received anywhere for my code to work, I just need the program to think that they are being sent.

I realize this is not the best place to ask, but I'm getting desperate. If any programmers have run into this situation before, please let me know how you solved it!

Thanks!
 
Could you just mock the class you use to interface with the Parallel Port? What language are you using?
 
Why do you need to fool your OS? Shouldn't it be enough to just fool your app?

Replace the component that obtains the hardware signal with a mock component that pretends to be it but instead sends signals from whichever fake source you want to send.
 
I don't see anything obvious myself. What sort of interaction would you need with this virtual port?

The only thing it needs to do is send a few bytes out. I'm not a software guy, I'm a cognitive neuroscientist so apologies for my severe lack of programming vocabulary.

I have 5 triggers each sending 16, 64, 96, or 128 bits of output. They will be received by the scanner in order to figure out what stimulus is being presented to the patient.

For my immediate purposes, all I need is for the program to think this output is being sent, so that it can run without running into a "port not detected" error and stopping the program.
 
If you can't modify the component of your app, try running in a virtual machine. VirtualBox can do it, or if you have a pro version of Windows you may be able to use Virtual PC.
 
Why do you need to fool your OS? Shouldn't it be enough to just fool your app?

Replace the component that obtains the hardware signal with a mock component that pretends to be it but instead sends signals from whichever fake source you want to send.

Yes exactly, use a mock object.
 
Could you just mock the class you use to interface with the Parallel Port? What language are you using?

Maybe, but I'm not really sure what you mean by "mock the class".

I'm using a language called Inquisit, which is designed for use in cognitive experiments, often using EEG and/or fMRI.

They do have their own support forums but unfortunately they operate during business hours only, and I'd like to get this licked tonight.
 
I'm guessing this isn't so much a programming language as much as some domain specific scripting that requires a specific application to run. Bite the bullet and install a VM it's actually not hard.
 
Basically, whatever function or command you use to send the signals out with, create a function that takes that data, doesn't do anything with it, but then returns to the main program loop with a "A-OK!" fooling the main program into thinking that it actually sent data since the "send_data" function finished with no errors.
 
I'm guessing this isn't so much a programming language as much as some domain specific scripting that requires a specific application to run. Bite the bullet and install a VM it's actually not hard.

Yes it's looking more and more like that's the way to go.

Thanks everyone for the help.

I'm still sort of surprised that an emulator doesn't exist, but I suppose there isn't much demand for it, especially nowadays.
 
It is interesting that there are a few Serial port emulators but I cannot find a parallel port emulator that does what I think you need. During college I actually had to build my own parallel port hardware, thank God it was actually for just one project ever
 
It is interesting that there are a few Serial port emulators but I cannot find a parallel port emulator that does what I think you need. During college I actually had to build my own parallel port hardware, thank God it was actually for just one project ever

My original solution was to simply edit the code so that my output port was a serial port (which I do actually have on this laptop).

But here's a noodle scratcher; the program I'm using doesn't detect my serial port, and when I check device manager, there is no "Port" entry listed at all, even though, every single day I attach this laptop to a projector using this serial port and it works completely fine. Strange...
 
My original solution was to simply edit the code so that my output port was a serial port (which I do actually have on this laptop).

But here's a noodle scratcher; the program I'm using doesn't detect my serial port, and when I check device manager, there is no "Port" entry listed at all, even though, every single day I attach this laptop to a projector using this serial port and it works completely fine. Strange...
That's because a VGA port is not the same thing as a serial port. If your laptop was mass market and made after 2005 there is like a 0% chance it has a serial port on it
 
My original solution was to simply edit the code so that my output port was a serial port (which I do actually have on this laptop).

But here's a noodle scratcher; the program I'm using doesn't detect my serial port, and when I check device manager, there is no "Port" entry listed at all, even though, every single day I attach this laptop to a projector using this serial port and it works completely fine. Strange...
Well, that's because that's a VGA port, not a Serial port. Laptops haven't had serial ports for well over a decade.

Edit: beaten.
 
That's because a VGA port is not the same thing as a serial port. If your laptop was mass market and made after 2005 there is like a 0% chance it has a serial port on it

Ah, good to know.

It's funny, in my old lab we had a room full of all this legacy mechanical hardware with switches and knobs; heavy machines which were built to sent one specific kind of signal to another machine. These became obsolete as PC hardware and software gained the ability to do all these jobs for us. Now we've hit a point where things like Parallel and Serial ports are no longer common, and even though USB is great for consumer purposes, it really isn't good for scientific experiments as the timing isn't as precise and reliable.

Makes me wish I was still dealing with the old clunky devices : )
 
You can still buy USB serial adapters. Wouldn't the driver spoof the serial port? And therefore wouldn't there be a serial/parallel adapter?


Edit: http://www.dell.com/en-us/work/shop...en1=A1326006:118526857269:901pdb6671:m&ven2=:


Seems like USB drivers could solve this in part.

I've looked into using USB for such experiments but unfortunately they simply aren't reliable in terms of millisecond-precise timing. For my immediate programming needs, unfortunately the program has no option to send triggers through USB.
 
Status
Not open for further replies.
Top Bottom