Quantcast
Channel: MCS Electronics Forum
Viewing all articles
Browse latest Browse all 20643

BASCOM-AVR : VAL (str to val) problem : NEWTOPIC

$
0
0
Hi! I have encoutered some strange behaviour when converting string to value, using VAL function like this: (in main loop): [code:1:9f1c621847]Dim Artikel_name As String * 6 Dim Artikel_address As Word Dim X1dcl As Single Readeeprom Artikel_name , Artikel_index X1dcl = Val(Artikel_name) [/code:1:9f1c621847] Artikel_name is stored in EEPROM and is not being changed - it 's a 6 character string "1.0dcl". The X1dcl variable should then be around 0.99999995, but the problem is, that sometimes it goes up to a strange numbers (56, 123000.99 ). Seting Const _valcheck = 1 and reading Err does not return anything. I use Xmega128a1, and the only interrupt is timer/counter interrupt each 20ms. In the ISR I only do some adc conversion and I/O manipulation. Is there any known isue with the VAL function ? Performing val on a string like "1.0dcl" should actualy not work at all, but it does the same as if extracting first 3 chars ( "1.0" ) and then do the val. BR Andrej [b:9f1c621847][color=red:9f1c621847](BASCOM-AVR version : 2.0.7.6 )[/b:9f1c621847][/color:9f1c621847]

Viewing all articles
Browse latest Browse all 20643

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>