08-11-2008 05:19 AM
08-11-2008 05:58 AM
Hi If you mean by single bit control you can always use a read modify write of the parrallel data. i.e if you want to modify bit 3 then you read the LPT port (8 bits) then Exclusively OR it with 8'b00001000. That would then flip bit 3. Or if you want to read a specific bit just mask it with the appropriate number etc.
Craig
08-11-2008 06:37 AM
08-11-2008 07:22 AM - edited 08-11-2008 07:28 AM
OOPS: I just re-read your post and noticed the following: i can share the same port under running 2 individual program without affect each other.
What you can do if you are running two seperate VI's that need to communicate with the one parallel port is to create a sub-vi that will be called by both. The sub-vi would take care of the actual transactions to the parallel port. You would need to read the status (bits) of the port to know what pattern you can write to it before actually doing so. Additionally, you may need to implement a semaphore to prevent the other program from accessing the port while the first one is doing a transaction. An Action Engine may be a good approach to implement the solution.
R
PS: I will leave the original reply although it may not be helpful.. But contains good info..
Original reply:
Yes it is possible to control a single bit, because I had to implement something similar to your project back in 2003..
You didn't mention that you were familiar with the Parallel Port and LabVIEW, so you may want to have a look at the parallel port examples.
Open LV, Under "Help", select "Find Examples", and do a search under parallel (search tab & enter "parallel").
You will find 2 examples (maybe you already did this..)
1. Parallel Port Additional Data Register
2. Parallel Port Read & Write Loop.
Run either one. You should be able to set and read the port. There is a description in the example how to do this. Look at the "LEDs".
If you look at the first example, under the "IO connector Status" tab, you will find the D-sub pinout. If you run it, it will give you the present status of your pins.
They recommend using the Standard mode (SPP) setting in your PC's BIOS.
If you run the 2nd example, you can write & readback your parallel port. Try this FIRST before attempting to communicate with your relays. The examples can help to determine which bits to read and write so that only one bit gets affected when setting the relay.
Hope this helps,
R
08-11-2008 08:50 AM
08-11-2008 08:52 AM - edited 08-11-2008 08:52 AM
08-11-2008 10:49 AM
You are correct. As you mentionned, you need to read the current status and set the next bit(s) to change the single bit you are interested in. 😉
craigc wrote:
I am pretty sure that there is no way to control individual bits of the parrallel port.
08-11-2008 07:44 PM
Hi Craigc & Joe,
Thanks for your great help. Overall, in parallel port, it cannot control the individual bit untiln now. BTW, if LabVIEW can be solved later on, It is the great improvement for all.
Regards,
Steve
08-11-2008 10:49 PM