05-22-2019 07:16 PM
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
05-23-2019 12:43 AM
in this way it is very hard to understand... if your code is very big, may you attach the section that generates the error?
06-12-2019 12:52 PM - edited 06-12-2019 12:53 PM
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:
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.
03-15-2021 09:59 AM - edited 03-15-2021 10:27 AM
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. :-))