Hi Have a vi controlling a Keithley 236. It returns a string as a measurement value. I need to do some arithmetic on this and other values. I Can't do this when its a string but when I convert to a number I get a duff conversion. Any ideas?
What does the string look like? Is it a floating point number, like 1.23, or an exponential, like 10.4e3? If so, use the Fract/Exp String to Number conversion found in the strings palette. If the string contains other characters, you must take a subset of just the numerical expression. If the string is a hex representation of bytes, use the Type Cast function found in Advanced - Data Manipulation.
Besides the other comments, there's a driver available for this instrument that already has all of the string to number conversions. You can download it here. It's a pretty old driver (matches the age of the instrument, I guess) but it would provide a good starting point if you feel that you need to create your own.
maybe you have to change the initialization of your Keithley 236. They have some output options (with or without unit/status/etc). Use the output options with just the number, then the conversion should be no problem...
Best regards, GerdW
using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019