08-01-2018 03:17 PM - edited 08-01-2018 03:18 PM
I told you that you can't concatenate! Also because of your empty rows, if you can't do anything about making sure the device doesn't send them, then you have to ignore them if they come through.
See attached modifications to the heart of the code.
You should also get rid of the wait function as the rate the data is read by the VISA Read will control the pacing of the loop.
08-02-2018 05:49 AM - edited 08-02-2018 05:49 AM
To find out what's going on, first deactivate the usage of termination characters on read operations and then request something like 1000 characters from the VISA Read. This will give you a dump of whatever the device is sending.
If there isn't a clear termination character you can use for this data, then you'll have to implement a parser for the information from several VISA Reads.
Knowing the exact form of your data is important in finding out a robust scheme for reading it. Stupid question, but I presume your response fromt he device isn't constant length?
08-03-2018 03:24 PM
So, this works better. However when I open the excel sheet that all the data is exported to, I mainly get NaN for oxygen concentration. How do I set up the program to have continuous concentration readings in the excel file?
08-03-2018 03:48 PM
@jamiva wrote:
@Augspurger wrote:
I get a long string of data (A213 DO/RDO,X41255,3.04,ABCDE,07/28/18 00:13:17,30989,CH-3,DO,6.56,mg/L,78.4, % sat,1423.2, nA, 22.8, C,22.8, C,742.0,mmHg, 0.0,ppt,17.666,nA/%Sat,M300,#1)
So, how do I go about justing getting the number I need? This case is't 6.56 mg/L
Don't know if it's the best way, but this one way to do it using Match Regular Expression.
There is an old joke that goes like this:
Programmer: I have a problem
SR Programmer: Just use a regex!
Programmer: Now, I have two problems!
But, it works!
08-06-2018 07:57 AM
That is exactly what I've been doing and it's not giving me a continuous reading. Out of every 10 cycles I only get one actual number, otherwise it's NaN or 0.