In my soft IOC a waveform record reads a string of numeric data from an instrument in ASCII format separated by ','. This string varies in length from one reading to the next. I use genSub to convert the ASCII data to floating point data. I bring the ASCII data into genSub via INPA, for which I set FTA="CHAR".
I discovered that if a shorter string follows a longer string, in INPA the new string data is followed by the remainder of the previous string! I fixed that by using memset() function after the string was converted. Is this a design behavior of genSub? Is there a better way to get rid of leftover data from previous read than I am doing?
My IOC is coded with asyn and streamdevice. I suppose I should look at how to use stream device to convert the data. I use genSub not only to convert the data but also to scale the data and correct for an offset, both of these are read from the instrument, prior to reading the waveform data.
Thanks,
Zen