LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LPT Port read

Hi,
 
I am using  the "in port.vi" in labview to check if a printer is hooked to any of  my lpt ports before I send a print command to them. it is working but it freezes every now and then. my lpt port addresses are 0378 (local on mother board), AC00, and B400 ( located on a pci card). I noticed that the data type on the base address inoput of the vi  is u16 wich i need u32 for the base addresses for the lpts on the pci board. does any one know a fix for this.??
 
thank you
 
windows XP
labview 8.0
 
0 Kudos
Message 1 of 7
(3,669 Views)
I do not know of a VI in LV that can accept 32-bit addresses.  Unfortunately the documentation for the "In Port.vi" says "This VI accepts only 16-bit addresses", so hopefully someone else can post a work-around.  Wish I could be more help!
 
0 Kudos
Message 2 of 7
(3,641 Views)
Why do you say you need 32-bit addressing? "AC00" and "B400" are 16-bit addresses.
0 Kudos
Message 3 of 7
(3,635 Views)

smercurio_fc,

Thank you for your response. The Address control of the in port.vi max is set to 32676 dec or 7FFF hex. this is what threw me off. I changed that and was able to enter my addresses Ac00 and B400. the vi is not freezing but the executable is still freezing. I added a wait to my loop and kept increasing it  (to 15 ms ) until I was able to get rid of the freezing problem. the thing is, iam adding this to super program that is doing lots of stuff and i dont want to slow everything down with this. is there a way i can activate an application every 15ms or so without slowing the whole loop??

 

thanks for the help

0 Kudos
Message 4 of 7
(3,627 Views)
Without knowing anything else about what your VI does or how this is supposed to plug into your "super program", I'd suggest using a timed loop, a construct that's available in LabVIEW 7. Check the online user manual and examples that ship with LabVIEW on  its general use.
0 Kudos
Message 5 of 7
(3,617 Views)

" is there a way i can activate an application every 15ms or so without slowing the whole loop??"


To specifically answer this question, I've attached an image of something you can try. It's not the best solution, but it's quick and dirty, and might help 'solve' the problem in the short run.

Message Edited by Novatron on 06-06-2006 03:00 PM

0 Kudos
Message 6 of 7
(3,616 Views)
thanks, that helped, i used the get time/date Vi instead which will prevent me from having any tick count roll-up problems. the weired thing is that the program is still freezing after running for a long period of time. I havent timed the period yet. to verify this wasnt from my program i wrote a simple while loop with a wait timer (15 ms) . it seems to run fine then if I leave it inactive for a while i will come back and find out that it is freezing. the cpu usage is very low and the memory usage is low too. iam using windows xp sp2 and labview 8. any suggestions??
0 Kudos
Message 7 of 7
(3,603 Views)