10-26-2006 03:09 PM
10-26-2006 03:24 PM
10-27-2006 04:58 AM
True, but what I was hoping for is to actually access the Parallel port pins as I/O pins. I just need 3 pins, Two as outputs only and One as input only. On top that I am not really that good and experienced in LabView. It would be great if anyone can show me an example of how to do this. Also I am using Windows 2000 at university (in the Laboratory where I'm doing the project) and I read on one of the NI pages that to access the parallel port pins as I/O on Windows 2000 in particular I'm going to have to download an update (or something of that sort).
Thank You
10-27-2006 08:56 AM
Hi,
the links on the LAVA forum actually give you the example code that should get you up and running.
The key thing about the parallel port is it's a "port" so it has to be treated by writing to the entire port at once.
I would recommend having one section of code that deals with the writing to the parallel port, and you can read it first then, mask out the pins you don't want to write to, and then write it back with the new data in it (so read the port, then AND that value with a mask value, so 10111111 for the second pin, then OR the result of that with the status you want to drive the new pin and write that value out).
If you try to do this from multiple places in your code that could execute at the same time, you could end up with a race condition (so the read occurs, then the write occurs somewhere else whilst the logic you're performing on the first one goes through, and then you end up writing the wrong value) - you can get around this with locks if necessary (sempahores).
Hope that helps
Thanks
Sacha Emery
National Instruments (UK)
10-27-2006 09:00 AM - edited 10-27-2006 09:00 AM
Message Edited by smercurio_fc on 10-27-2006 09:01 AM
10-27-2006 09:10 AM
Hi,
find attached a simple Test with LPT - Port ( !! comments in Diagram !! ) made with LabVIEW 7.1.1
This should give an idea, how to talk to your application. But I think you should have found a lot of this stuff,
if you would have searched for " Parallel Port " in this forum.
Regards
Werner
10-28-2006 04:58 PM
10-30-2006 03:44 AM - edited 10-30-2006 03:44 AM
Message Edited by SachaE on 10-30-2006 09:48 AM
10-30-2006 11:33 AM
Thats actually exactly what I'm doing, but I am gonna make the software so that it does 1 thing at a time. Meaning that even though Im controlling another motor through GPIB and the Lock-in-amplifier (sr510), I am using the event structures do select which should be controlled first. So, when I try to move the motor that I'm controlling through the Parallel port then the software will only be concetrated on that piece, i.e. I will only run the appropriate coding that only deals with parallel port, allowing me to keep monitoring the port the whole time untill I catch the Hall effect signal. Once the circular disc (using cogs) is placed on the required position than I start controlling the other devices, which is the rest of the coding. I'm not sure if this is the correct approach to it, since I'm short of budget as well, but I thought that this might be the best solution of what I've got to work with here.
If its OK with you guys I can upload the whole code here so that atleast you can check if there are any spotted mistakes. My main concern about the whole code is the timing, since this is critical when I do data aquisiton from the Lock-in-amplifier. I used the Property nodes alot of times, and I dont know if that is any good. So if anyone is interested and has some time look at the code than please let me know so I can upload it, and it will help me alot.