Announcement

REXYGEN forum has been moved. This one is closed.
Head over to the new REXYGEN Community Forum at https://forum.rexygen.com.

Looking forward to meeting you there!
 

#1 2016-11-26 16:01:35

farcouet@yahoo.es
Member
Registered: 2016-10-11
Posts: 6

sleep function within rexlang

Hi,

I have been trying to use the sleep function in the rexlang block (so I can write to I2C wait and then perform a read for the ADC).

My problem is that I get the following error when compiling:
Error compiling file 'ads1115.c' (line 75): function 'sleep' is not declared
Error 125: The configuration validation error occured in:
Error 126:     Validation error -220 (REXLANG compilation error) in the pin 'pool_task.ADS1115:srcname'


I am not sure to understand why as the sleep function is supposed to exists in Rexlang. I am not sure what I am doing wrong.
Thanks,
Fred

Documentation:
void Sleep(seconds)
Stop execution of the block’s algorithm (and whole task) for defined time. Shortest possible time is about 0.01s, but depend on platform.

Offline

#2 2016-11-28 10:18:55

tomáš čechura
Administrator
Registered: 2016-02-22
Posts: 371

Re: sleep function within rexlang

Hi Fred,

the functions in REXLANG are case sensitive - try to use Sleep(seconds) instead of sleep(seconds).

Please, be aware that the Sleep function will stop whole task - so it will artificially extend the sampling period. It can be critical for some sort of applications. I would suggest to use some simple switching logic witihn REXLANG so that every odd tick you will perform write and every even tick read command.

Cheers, Tomas

Offline

Board footer

Powered by FluxBB