Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Unknown string error when using keithley 24xx using LabviewNXG

Solved!
Go to solution

I am using a GPIB-USB-B cable to communicate with a Kiethley 2430. The Labview version I have is the NXG and I downloaded the relevant 24xx drivers from the ni website. The NI MAX is able to detect the instrument and read and write to/from it.

The problem happens when I run one of the vis (ReadMultiple for example). The vi initiates and turns the instrument on but gets stuck in the "Fetch (Measurements).gvi" and shows an execution error (attch image) with the following explanation: "LabVIEW: (Hex 0x68B) The input string contains one or more invalid UTF-8 string sequences".

Does anyone have any idea what might be going on? Could the error be because I am using the older version of the GPIB cable (GPIB-USB-B) versus the HS or HS+ versions? Has anyone else used the B cable with Keithley and run it successfully with Labview?

0 Kudos
Message 1 of 8
(4,511 Views)
Solution
Accepted by topic author cg1234

Hi

The error is probably happening because NXG is using an other type of string then LabVIEW.

NXG uses Unicode where it is possible that a string contains more bytes for one character.

The error you mention is impossible in LabVIEW. In LabVIEW byte arrays and strings are easily converted in each other. because characters always take one byte and all bytes are defined.

 

It definitely is not the cabling.

I suggest to work this year in LabVIEW (even in 32 bits LabVIEW)  and maybe switch when NXG is a bit more stable.

I do like NXG for students but not yet for production.

greetings from the Netherlands
Message 2 of 8
(4,503 Views)

Thank you! That was genius- Labview 2018 worked!! 



 

0 Kudos
Message 3 of 8
(4,490 Views)

Hi, I have the exact same problem here. I did some research into it and I can say it is the problem of the Fetch (Measurement).gvi in the drive package. The VISA Read function has some problem there and is causing this issue. If you change the output of VISA Read from String to Byte Array and use Byte Array to String function to convert it, the problem will be gone. However, After doing this, I found that the data that was read in from the buffer was not correct any more. I tried using the sweep function and set the range between 1 and 2 V and the voltage data which was read in had several abnormal numbers, such as -85.32, -353.529

0 Kudos
Message 4 of 8
(4,485 Views)

Hi, you are right about it. 

However, I found something more interesting about this issue. I installed both NXG 3.0 and 2.0 on an desktop. I opend the 24XX drive package for NXG 2.0 using NXG 2.0. Everything was working well. Then I saved it as a project in NXG 2.0 and opened it in NXG 3.0 with no problem. When I run it, the problem happened. I did some research on it and my conclusion was that the VISA Read function had some problems. When choosing String as output, error happened. When choosing Byte Array as output and convert it to string by Byte Array to String function, no error but the data read in was not correct. 

0 Kudos
Message 5 of 8
(4,482 Views)

As you can see in the solution, it is not VISA but the NXG string functions hat generate the problem.

Not that the string functions are wrong but they use UNICODE strings meaning that a character can contain more bytes. So you have to read now a byte array instead of a string with VISA.

There is an article about Unicode strings 

https://forums.ni.com/t5/NI-Blog/Designing-LabVIEW-NXG-How-Unicode-Benefits-You/ba-p/3886228

read this and find out

greetings from the Netherlands
0 Kudos
Message 6 of 8
(4,467 Views)

Thanks for correcting me. I did try reading bytes from VISA Read and convert to string using the Byte Array to String function in NXG 3.0 and it worked with no error. However, the final data I got from doing this is not correct. For example, when I set the source meter to output a 1V voltage. When reading the buffer, the voltage is about 1.78V. Do you have any idea what might cause this problem?

0 Kudos
Message 7 of 8
(4,463 Views)

If you read the article I linked to, you can understand the problem.

greetings from the Netherlands
0 Kudos
Message 8 of 8
(4,444 Views)