Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

secelapsed fehler invalid data type [[0011]0[_SEC]]

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Various
View previous topic :: View next topic  
Author Message
gwabbel

Bascom Member



Joined: 02 May 2010
Posts: 2

germany.gif
PostPosted: Sat Jan 26, 2019 1:16 pm    Post subject: secelapsed fehler invalid data type [[0011]0[_SEC]] Reply with quote

Hi all,

i have found an error in bascom version 2.0.8.1 - if you do a syntax check the following code will produce an error by refering to the functions secofday() and secelapsed(var_long). The error is: invalid data type [[0011]0[_SEC]] although the variables are of the right type (long).

bascom code:

$framesize = 200
$swstack = 200
$hwstack = 200

'Microcontrollertyp festlegen
$regfile = "m328pdef.dat"

'Taktfrequenz 16MHz extern
$crystal = 16000000
'Baudrate 38400 , 8,N,1
$baud = 38400

Dim Sekunde As Long
Dim Timestamp As Long


Do

Timestamp = Secofday()
Wait 5
Sekunde = Secelapsed(timestamp)

If Sekunde > 30 Print "Hallo"

Loop
End

Has anyone an idea what I'm doing wrong?

Many thanks for an answer!
Back to top
View user's profile
enniom

Bascom Member



Joined: 20 Oct 2009
Posts: 537

PostPosted: Sun Jan 27, 2019 3:26 pm    Post subject: Reply with quote

.

Where is Config Clock?

Then try
Code:
Timestamp = Syssec()
 

E
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5915
Location: Holland

blank.gif
PostPosted: Mon Jan 28, 2019 10:19 am    Post subject: Reply with quote

i see that the help not clearly mention that you need to use CONFIG CLOCK in order to use the date/ time functions.
Please see help about CONFIG CLOCK and add it to your code.

_________________
Mark
Back to top
View user's profile Visit poster's website
gwabbel

Bascom Member



Joined: 02 May 2010
Posts: 2

germany.gif
PostPosted: Fri Feb 01, 2019 5:16 pm    Post subject: Reply with quote

.... thank you ! now it works!

regards
Georg
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Various All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum