This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

template for generic drivers
#2
Hi,

Maybe someone has an idea, based on the above template. I have this TCP device which the LM is controlling. In this case you set a color light value. The light changes to the requested value by cycling through values and returning back a status for each light change. Now there is one caveat, I can bring this light on from the off state to a particular color with the exception of white. When I turn on white it will cycle through to the last light color that was previously on and then the what value has to be resent to get it to change. The time taken to change between any color is variable, changing from one color to another is not always the same. The number of times I receive a the status that the light is changing color is inconsistent.

For example, I wish to turn the light to white and the last color the light was on with was green.

SEND GOTO WHITE

1 sec later, received LIGHT IS GREEN
1.1 sec later, received LIGHT IS GREEN
0.5 sec later, received LIGHT IS GREEN
2 sec later, received LIGHT IS GREEN
1 sec later, received LIGHT IS GREEN
1.5 sec later, received LIGHT IS GREEN

NOW I SEND GOTO WHITE

Now for some light colors I may have to wait for 42 responses before I can change to white.

My idea is to create some kind of timer every time a status is received. This gets cancelled on receiving a new status. When the timer is reached then send the request to change to white.

Now my question is how can I realize this when working with my template. Using Sleep is not really an option because whilst the status of the light is coming back there can be other status values coming back. Is there a way to delay a non blocking function call with the option to cancel it in LUA?

Thanks,


Roger
Reply


Messages In This Thread
template for generic drivers - by rocfusion - 16.06.2017, 23:40
RE: template for generic drivers - by rocfusion - 01.07.2017, 22:29
RE: template for generic drivers - by admin - 04.07.2017, 05:59
RE: template for generic drivers - by admin - 04.07.2017, 17:33

Forum Jump: