08-14-2015 04:35 AM
Here is the result if im using baudrate up to 115200, You may see the substring format are not according to the format that i set in "scan for string". This error will always pop-out everytime i try to run VI.
Thanks
08-14-2015 09:13 AM
You clearly have a meaningful string at 115000 Baud, you just are having problems with Scan from String. The silly \s "spaces" are the problem. Try this --
Bob Schor
08-14-2015 09:30 AM
@Bob_Schor wrote:
You clearly have a meaningful string at 115000 Baud, you just are having problems with Scan from String. The silly \s "spaces" are the problem.
The indicator was already using the \ Codes. So you don't need to convert the spaces into "\s". You just need to use actual spaces in the Scan From String.
08-14-2015 09:34 AM
fendy90 wrote:
Argument 3 is throwing the error. The last VI you posted had 5 items in your Scan From String. Your read data only has 3. So you should change your format string to be "%f %f %f". No need to mention the end of line characters since that is what is causing your error (the function is looking for a space to end the third item and found a carriage return).
08-14-2015 09:42 AM
Hi,
it is like my data input in substring is intermittent as it read data from the sensor. That's why it throws error in "scan from string". If i used a slower baudrate up to 14400. It seems like the data input stabile and no error for formating
08-14-2015 09:48 AM
When i force to continue the error, this is what i get from all the input data in substring. It seems like the input data is not stabile.
08-14-2015 10:02 AM
From your posted example, your encoder values are counting down at a 125ms sample rate. Using my previous posted VI, “Encoder_Accelerometer_Final_Sync_V2_A.vi”, change the logic to check for counting down encoder values and the RPM calculations will work.
If Previous Encoder rolled over or hasn’t changed
Then Delta Enc =(2048-Encoder1)+Previous Encoder
Else Delta Enc = (Previous Encoder – Encoder1)