Hi all,
I'm trying to use Scan from String to extract data from a string retrieved over a serial line to an Arduino that I programmed - meaning I know exactly what the strings look like. When I test the Scan from String with a minimal-working-example on an actual data string, it works fine. In the full VI however, it keeps throwing back Error 85 (arg1) already on the first iteration and I cannot find why.
The string ends with CR and contains data of multiple controllers, formatted as: ><name1>,<Kp>,<Ki>,<Kd><name2>,... An example string would be: >PRE, 1.000, 5.000, 0.000GAS, 1.000, 0.000, 0.000
Since the number of controllers is flexible, I use a while-loop to read the controller-data into an array of clusters - each cluster consisting of a string (name) and three floats (Kp, Ki, Kd) - using Scan From String. For each iteration, it scans the string for the sequence of %[A-Z],%f,%f,%f and continues on the last scan offset until the remainder string is empty.
I have tried not using the index but feeding the remainder string back into the loop/function, but that gave the same error - it always throws the error already on the first attempt. When I probe the input string and then copy it to the minimal-working-example, it works flawlessly...
Attached are the two VI's: one is the actual VI, with all the extra functionality with it. The second is a minimal-working-example with an actual datastring, and this works.
Am I missing something? Help would be appreciated!