Decimal String to Number | Arduino Compatible Compiler for LabVIEW Discussions | Forum

Avatar
Please consider registering
guest
sp_LogInOut Log In sp_Registration Register
Register | Lost password?
Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Feed Topic RSS sp_TopicIcon
Decimal String to Number
August 30, 2015
8:52 am
Avatar
BernardK
UK
Member
Members
Forum Posts: 5
Member Since:
August 29, 2015
sp_UserOfflineSmall Offline

I want to convert a character string to a numeric using the decimal string to numeric function. The target is an Atmega2560 and the compiler is V1.0.0.18. LabView is V2014.

The examples below indicate my findings. If the input string starts with the first numeric character and the offset is 0, the conversion works correctly. If the input string starts with a non numeric character and the offset is set to 1 the conversion does not work.

The conversion fails when run on the target board, however the routine works correctly when checked in the LabView development environment.

Is this an incorrect use of the function?

DStN-25.pngImage EnlargerDStN-L25.pngImage Enlarger

sp_PlupAttachments Attachments

Target - Atmega2560. Compiler - V1.0.0.18. LabView - V2014

August 30, 2015
2:54 pm
Avatar
Steffan
Admin
Forum Posts: 408
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

Please take a look at the help documentation on this primitive in the user manual (String Palette section).  Unfortunately, the offset input is not handled at this time.  You should be able to use String Subset to get just the numeric portion of a string before conversion, which is essentially the same thing as using an offset.

String Palette

-Decimal String to Number

NOTE: Offset input is ignored.

-Fract/Exp String to Number

NOTE: Offset and use system decimal point inputs are ignored.

August 30, 2015
10:22 pm
Avatar
BernardK
UK
Member
Members
Forum Posts: 5
Member Since:
August 29, 2015
sp_UserOfflineSmall Offline

Yes, that works OK.

Target - Atmega2560. Compiler - V1.0.0.18. LabView - V2014

Forum Timezone: UTC 0
Most Users Ever Online: 100
Currently Online:
3
Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
miche91: 33
scottj: 28
scadao: 23
Member Stats:
Guest Posters: 5
Members: 202
Moderators: 0
Admins: 3
Forum Stats:
Groups: 1
Forums: 2
Topics: 266
Posts: 1222
Newest Members:
pujacontrol
Administrators: geadmin: 22, filipealtoe: 96, Steffan: 356