JSON Toolkit for LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error connecting to GPIB driver or device.

I am not able to use toolkit due to the attached error. It says it's due to NI 488.2 driver. But I have tried to switch to 17.6, 18.5 and 19.0 of the driver, I still get the same issue. The error is reported on Parse JSON.vi

0 Kudos
Message 1 of 4
(4,222 Views)

in this way it is very hard to understand... if your code is very big, may you attach the section that generates the error?

0 Kudos
Message 2 of 4
(4,206 Views)

Hi TengWu,

 

Unfortunately the error reporting in the i3-json library can be misleading. The library uses error code zero for all errors. The important part of the error is the message "String parsing fail: Bad escape char".

 

This occurs if you have a string in your JSON with an invalid escape character. For example the following JSON:

["string one", "string two", "invalid \? escape character"]

 

The third string in the array has the character sequence \? which is invalid in a JSON string. The valid escape character sequences can be seen in the string section on http://www.json.org/ reproduced as follows:string.gif

 

So valid character escape sequences in a string are \", \\, \/, \b, \f, \n, \r, \t or \uXXXX where XXXX is 4 hexadecimal digits

To make the above JSON valid we have to escape the \ character as \\ which can be seen in the following:

["string one", "string two", "invalid \\? escape character"]

 

You may want to use a JSON validator to ensure your JSON is valid. You can search online for a JSON validator to test your use case.


Milan
0 Kudos
Message 3 of 4
(4,177 Views)

To be successful, you need to use the secure link

https://api.openweathermap.org/data/2.5/weather?zip= .

Also, you need to create your own  free API key on the website https://home.openweathermap.org. 



It is not at all a GPIB or VISA related error. :-))

0 Kudos
Message 4 of 4
(3,310 Views)