LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial read multiple sensors (Encoder+Accelerometer)

Solved!
Go to solution

@fendy90 wrote:

What do you mean by changing the data to "codes"? I try to format as "%f %f %f %f %f" and it seems not working out. 


No.  It is "\ Codes".  It is a display style for the string controls and indicators.  If you right-click on the string indicator you will see it.  It also helps if you show the display style as well (right-click on the string indicator then Visible Items->Dispaly Style).

 

If the spaces are not working, then the seperator is not a space.  It is something else.  So you really need to show the \ Codes in order to figure this out.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 11 of 15
(1,728 Views)

I still beleive that the Error 1 occurred at Scan From String (arg 1) is caused by an empty input string.

Or you have a NULL (\00) character as your first byte in your format string. Before your first '%f"

That is the only two way I have been able to reproduce your Error 1

 

Error 85 is what you get if the input string does not match the format string.

Serial Read.png

 

This works with no errors even without the space between the %f

If there is not a one to one match of number in the input string to %f in the format string you get an Error 85.

 

The only way that I have been able to reproduce the Error 1 is by passing in an empty string.

This throws an Error 1

EmptyString.png

 

Error 1.png

So I am sticking with the empty string causing the Error 1 or the NULL character in the format string

Omar
Message 12 of 15
(1,703 Views)
Solution
Accepted by topic author fendy90

I Opened your Encoder VI.

 

How do you know the VISA Read did not throw an error? You are not checking the error out.

If after the error popup you select STOP, you would never see the error from the VISA Read that is the cause of your Error 1

At lest add an indicator or put a probe on the Error out wire right after the VISA Read inside the True case.

 

You don't have NULL char in your format string so it must be an empty input string.

 

What is the point of passing in the Baud Rate into the byte count of the VISA read.

 

No need to use dynamic data types

Omar
Message 13 of 15
(1,690 Views)

Thank you 

0 Kudos
Message 14 of 15
(1,660 Views)

I finally got it, yes the error pop-out as the initial reading (the data) does not follow the format i initilaze in "Scan from String" . 

 

Thank you Omar II. 

0 Kudos
Message 15 of 15
(1,659 Views)