Switch Hardware and Software

cancel
Showing results for 
Search instead for 
Did you mean: 

visa cannot currently access it error

I'm new to the LabVIEW. I connected the NI instrument simulator to the serial port of PC. I opened MAX and clicked on COM1 and opened VISA test panel and clicked on "Validate" and got the following error:
 
Could not open a VISA session to "ASRL1::INSTR"
VISA error code 0xBFFF0072
The resource is valid, but VISA cannot currently access it.
 
The setting of the NI instrument simulator was as follows:
Baud rate : 9600
Data bits: 8
Parity: None
Stop bits: 1
Flow control: None.
 
Anyone know what was wrong?
 
Thanks
 
0 Kudos
Message 1 of 21
(30,205 Views)
On the VISA Test Panel, I clicked on the "Write" and the Return Count was 6 and Return Status was 0. But for Read, Return Status is "BFFF0015".
 
I tried on the another PC, the Baud rate displayed 115200 but the other machine displayed 9600.
 
Any clue what could be wrong?
0 Kudos
Message 2 of 21
(30,197 Views)
Are you an administrator? What version of NI-VISA are you using? Does NI-SPY work?

Logan S.
0 Kudos
Message 3 of 21
(30,182 Views)

No I'm not adminstrator. I'm a newcomer to LabVIEW. I'm learning LabVIEW from LV Basic I CD. There's a exercise about serial communication but there are no demo for it. I used the example Basic Serial Write and Read.vi but got

Error -1073807246 occurred at Property Node (arg 1) in VISA Configure Serial Port (Instr).vi->Basic Serial Write and Read.vi

Possible reason(s):

VISA:  (Hex 0xBFFF0072) The resource is valid, but VISA cannot currently access it.

When I tried HyperTerminal I did see echo typed character. I don't know NISpay.

Setting I used:

baud: 9600

data bits: 8

parity: none

stop bits: 1

flow control: hardware

 

 

 

0 Kudos
Message 4 of 21
(30,183 Views)
I'm using VISA 3.4.1 and LabVIEW 8.
0 Kudos
Message 5 of 21
(30,176 Views)
I'm using VISA 3.4.1 and LabVIEW 8.
0 Kudos
Message 6 of 21
(30,176 Views)
Output from NI Spy:
                                                                                Status
viParseRsrc(0x020945a8,"COM1",4,1)                     0
VISA SetAttribute("COM1", TMO_VALUE, 10000)     0xBFFF0072
VISA Close("COM1")                                                  0x3FFF0082
0 Kudos
Message 7 of 21
(30,176 Views)
So this may be a silly question, but are you sure that you have a COM port on your machine? If you open up Measurement and Automation Explorer or MAX from Start >> Programs >> National Instruments, you should see a tree structure in the left hand side of the window. Expand "My System" and "Devices and Interfaces" and check in "Ports" to see if COM1 is listed. If it is, great. If not, then the first thing we need to do is get you a serial port. If it is, please perform a serial loopback test on the port, by opening a VISA session (right click "COM1" and select "Open VISA Session), and performing reads and writes. If you can't do this, then there is something wrong with your serial port.

Logan S.
0 Kudos
Message 8 of 21
(30,160 Views)

Thanks for your suggestion. The loopback test was working fine(I saw what I typed) from HyperTerminal by inserting the unmodified end of the cable into the serial port and the other cable end have the RX/TX pins shorted using paper clip. Also the COM1 listed under MAX-Devices and Interfaces-Ports.

I opened COM1 VISA Test Panel->Basic I/O->Write, Buffer showed *IDN?\n. Execute returned Return Count: 6, Return Status: 0.

Clicked on Read showed Count: 1024 and Execute showed Return Count: 0 and Return Status: xBFFF0015.

Here I attached the NI-SPY result. Thanks

0 Kudos
Message 9 of 21
(30,160 Views)
I don't think that error is a big deal - it's just a timeout value. The important thing is that you actually read back the data that you sent. Here's why - by default, when you open up a VISA Session to the COM port, no termination settings are enabled, for reads or writes. So when you attempted a read of 1024 bytes, it's ok to get a timeout, so long as we did get back *IDN?\n. Unfortunately, with a .jpg of a spy capture, I can't tell if that is the case or not.

If it's ok, try it one more time, except this time, rather than trying to read back 1024 bytes, try to read back only the specific number of bytes that were sent. So if you want to send *IDN?\n, try to read back only 6 bytes. If this works, then we know that the COM port is at least accessible from VISA, without error. Then we can go back to these other errors that you are getting in your program.

Logan S.
0 Kudos
Message 10 of 21
(30,149 Views)