You are not logged in.
Pages: 1
Topic closed
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
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
Pages: 1
Topic closed