LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

acces parallel port under win2k with visa and cvi

hi,
i need to send lot of data to a device connected to my parallel port (win2k), it's working well with inp and outp but it is quite slow, so i try the VISA Library.
Using visa with ASRL10::INSTR is faster, but i would like to know how can i check for busy state and others control/status register states under the visa lib.
Also I would like to know how to set timeout for write operation. At the moment i set :
viSetAttribute (deviceHandle, VI_ATTR_TMO_VALUE, 2000);
but if the device is not connected when i send my data using :
viWrite (deviceHandle, dataBuffer, sizeofData, &RtCount);
program blocks and it takes around 10 minutes before getting an error 0xBFFF003E (could not perform operation because I/O error). I woul
d like to obtain a much more rapid error advice.
Thanks in advance for help or suggestions.

Fred!
0 Kudos
Message 1 of 2
(2,931 Views)
"Fred,

Unfortunately, you cannot access the standard parallel port registers from VISA. The way to do this is to use the inp/outp functions as you have been doing. To address your other issue of a 10 minute timeout, the VI_ATTR_TMO_VALUE is the minimum timeout; the NI spec specifies that the driver may use a longer timeout. Ten minutes seems rather long, however. You can also troubleshoot this in Measurement and Automation explorer; try to write to your parallel port by expanding the "ports" section, clicking on LPT1 (or whatever), and clicking "Open VISA Session". You should be able to do reads and writes in there. Are you sure that the viWrite is the method that's hanging? Have you tried this in a simple CVI project to make sure that nothing else is interacting
with the VISA stuff? What does your cable to your device look like, are you shorting any lines? (or driving them high or low?)


Scott"
0 Kudos
Message 2 of 2
(2,931 Views)