LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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


@pincpanter wrote:


The unit Reference Manual says the serial interface is TTL and not RS-232.

A standard RS-232 USB adapter would not work.


Well there are two options. Newer devices have a build in USB type B connector. If you have an older device you should use the dedicated 2231A-001 USB Adapter device that you can get for the device. Standard RS-232 to USB converters will indeed not work with this.

Rolf Kalbermatter
My Blog
0 Kudos
Message 21 of 34
(2,852 Views)

Hi!!

 

I´m trying to make a program in which I need to read data from TPG 261. I tried many different programs but it always stucks when reading information after you send to the devide the command. 

 

I decided then to prove the comunication in the Measurment & Automation Explorer (MAX), and after trying to open Visa Test Panel, it shows this error: VISA: (Hex 0xBFFF0072) The resource is valid, but VISA cannot currently access it.

 

I´ve checked the port configuration, and apparently im not using this device with any other program.

 

How can I fix this problem? Might it be a hardware problem?

 

Thanks!!

 

Regards,

 

Download All
0 Kudos
Message 22 of 34
(2,808 Views)

I just managed to use the Test Panel of the Measurment & Automation Explorer (MAX), but in the labview program the problem persists. It shows and error when reading information from the devide.

 

Any idea on what can be happening? Im trying many different programs which should work because some of them worked in other computers with other devices. 

 

Thanks!!

Download All
0 Kudos
Message 23 of 34
(2,804 Views)

Those two pictures proof nothing. In MAX you issued twice a Write of the command "PRX\n" and "PRN\n" and both succeeded. As can be seen in your program, the single VISA Write sending the "PR1\n" command succeeded too! The problem with both of these is that a successful write command does NOT mean that the device received the command and even less that it understood it and did something with it. It only means that VISA has passed the string to the serial port device driver and that driver has promised that it is sending out the data!

 

Then in your VI you try to send a "\05" which succeeds too, but nothing is read. That can be for many reasons.

 

First step if you absolutely insist in posting pics instead of the actual VI, would be to enable the Radix display for those string constants. That would at least allow to check that you do send the backslash control characters, rather than the literal text for them!!

 

After that, remove the completely unneccessary loop around the VISA Read and instead make sure you configure the session to use the proper termination character. Then you can connect a constant to the VISA Read that is bigger than the maximum number of characters that can ever be returned by the device.

 

Last but not least, post a link to the Programmers Manual for your device!

Rolf Kalbermatter
My Blog
0 Kudos
Message 24 of 34
(2,799 Views)

Hi Rolf!

 

First of all, thank you!

 

I´m novice in LabView. I tried to change the things you told me, but I don´t know what you mean with "enable Radix display" and "configure the session to use the proper termination character".

 

I post here the Vi file and the manual for the device (between page 65 and page 70 is the information we are looking for).

 

Thank you again!!

 

Regards,

 

Download All
0 Kudos
Message 25 of 34
(2,783 Views)

You are slowly getting there.

Right click on the string constants and select Visible Items->Display Style.

There appears a symbol in front of the string. Click on that and select "\ Codes Display"

Now you can enter the string as you tried to with the backslashes and LabVIEW will send out that actual character code instead of the literal text.

 

So you want to send out "PR1\r\n" but you should not flush the receive buffer after that. At the time the Flush is executed the device had not even time to decode the command let alone send the acknowledgement string, so you want to place a VISA Read there that reads lets say 16 byte. You can discard this string or check that it actually contains "\06\r\n". After that you can send the enquiry command "\05" and then receive the string. But PR1 will not return two measurements as you try to decode.

 

Simply pass the returned string to a Scan From String using the format string "%.;%d,%f".

 

Rolf Kalbermatter
My Blog
0 Kudos
Message 26 of 34
(2,761 Views)

Hi Rolf,

 

I tried what you told me but the program does not read anything, and the error while reading persists.

I have tried to simplify the program as much as possible just to check that it receives the strings correctly but I can´t even read the "\06\r\n" command. 

Do you have any idea what might be happening?

 

I´m really thankful for your help! 🙂

 

Regards,

Download All
0 Kudos
Message 27 of 34
(2,736 Views)

The program looks now ok. And then there remains two things!

 

Baudrate: Are you sure the device is configured for 9600 baud?

Cable: Those pesky RS-232 cables can be a nuisance. RS-232 stands inofficially simply for "resolder pin 2 to 3 and 3 to 2".😁

Rolf Kalbermatter
My Blog
Message 28 of 34
(2,729 Views)

If I'm not mistaken, yes, I think this device is set to 9600 baud. Also for 19200 or 38400. This information can be found on page 12 of the manual.

 

So could the problem be with the RS232 cable? Could it be broken?

 

Thanks a lot!!!!!

0 Kudos
Message 29 of 34
(2,722 Views)

@bortx wrote:

 

So could the problem be with the RS232 cable? Could it be broken?


That's something only you can answer. There is a pin description in the manual. Now you need to check the standard pin connection on your PC RS-232 port and taking a signal beeper or resistance meter check that the correct pins are connected together.

 

9pin DB-Sub connector on the PC side:

 

41es6z7VslL.jpg

Rolf Kalbermatter
My Blog
0 Kudos
Message 30 of 34
(2,687 Views)