LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 85 occured at Scan from String (arg 1)

Solved!
Go to solution

Running into an issue I haven't been able to solve yet. Trying to communicate with a Sierra Instruments flowmeter. The flow meter has no issue communicating with its intended software, so I know it is not a driver or cable issue. I have attached a reference on the command overview. Also attached is my VI and screenshots. My comm settings are correct.

0 Kudos
Message 1 of 14
(1,389 Views)

Hi Parker,

 

We don't have your instrument, so for us to help you, you need to tell us what are the bytes expected in return of your command, or at least attach the datasheet.

 

Regards,

Raphaël.

0 Kudos
Message 2 of 14
(1,378 Views)

Hi Rapheal,

 

According to the datasheet, each command has a length of 2 bytes. The response to the command is also 2
bytes. The low byte is always transmitted/received first followed by the high byte.

 

Thanks!

0 Kudos
Message 3 of 14
(1,374 Views)

Hi derek,

 

why do you think you could use ScanFromString here?

 


@parker300 wrote:

According to the datasheet, each command has a length of 2 bytes. The response to the command is also 2
bytes. The low byte is always transmitted/received first followed by the high byte.


Use StringToU8Array, index the bytes as needed and do whatever you want to do with them…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 14
(1,344 Views)
Solution
Accepted by topic author parker300

This device is using hex/binary/raw data formats.  So...

1. You need to turn the Termination Character OFF

2. The Scan From String will not work.  Use Unflatten From String instead.

 

The Scan From String is expecting ASCII text.  But your device is sending the data in its raw format.


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
Download All
Message 5 of 14
(1,340 Views)

For future readers, here is the part of the datasheet that describes the command and answer:

 

raphschru_1-1689256525590.png

 

 's solution implements that perfectly.

0 Kudos
Message 6 of 14
(1,331 Views)

Crossrulz,

 

Thanks for the help. When I copy your code, I get this error 74 message, saying my data is corrupted. Do you know the root of this?

 

 

Download All
0 Kudos
Message 7 of 14
(1,301 Views)

Regardless, setting a default data to littoral "%x", leaving the format specifier blank, (default specifier %f) then, passing in an hex codes string is just as wrong as you can be!

 

 

 You could use Scan from String with a %x format specifier and a default value of 0 AS U16 or I16 then use swap bytes.  However,  the Unflatten From String is more scaleable.


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 14
(1,298 Views)

@parker300 wrote:

Crossrulz,

 

Thanks for the help. When I copy your code, I get this error. Do you know the root of this?

 

 


You tried to unflatten to an array of integers rather than a scalar integer. Worse, you are only getting two character on your read String and you might need to read 4 e.g "6209" equals 0d 2402

 Probe the read string! Is it "6209" or "c\t" ,lowercase c horizontal tab,

 

Tim must be decaffeinated today.


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 14
(1,263 Views)

@JÞB wrote:

@parker300 wrote:

Crossrulz,

 

Thanks for the help. When I copy your code, I get this error. Do you know the root of this?

 

 


You tried to unflatten to an array of integers rather than a scalar integer. Worse, you are only getting two character on your read String and you might need to read 4 e.g "6209" equals 0d 2402

 Probe the read string! Is it "6209" or "c\t" ,lowercase c horizontal tab,

 

Tim must be decaffeinated today.


1. I don't drink coffee, so I'm always decaffeinated.

2. Look at the data sheet.  It clearly states the response is 2 bytes.  The example is showing the two bytes in hexadecimal, showing the combination, and what the decimal equivalent would be to make it more human readable.  Further, in \ Codes it should show "b\t", a lower case b and a tab.

3. Looks like Jay is the one who needs coffee.


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 10 of 14
(1,236 Views)