samuelventura / athasha

Automation Now
MIT License
0 stars 0 forks source link

Laurel consecutive output writes delay #76

Open samuelventura opened 2 years ago

samuelventura commented 2 years ago

Since reading required a 5ms delay between commands, I was expecting the same for several accumulated outputs to written one after the other.

Using demo03:

r = :timer.tc(output.setter, [master, value])
IO.inspect(r)

["bd8bf08e-76a2-4429-a2e8-4a7c4b41b604 Valley Reset", "bd8bf08e-76a2-4429-a2e8-4a7c4b41b604 Peak Reset", "bd8bf08e-76a2-4429-a2e8-4a7c4b41b604 Alarm Reset"] |> Enum.each(fn id -> Bus.dispatch!({:write, id}, 1) end)

["bd8bf08e-76a2-4429-a2e8-4a7c4b41b604 Valley Reset", "bd8bf08e-76a2-4429-a2e8-4a7c4b41b604 Peak Reset", "bd8bf08e-76a2-4429-a2e8-4a7c4b41b604 Alarm Reset"] |> Enum.each(fn id -> Bus.dispatch!({:write, id}, 0) end)

{355484, {:ok, 1}}
{349823, {:ok, 1}}
{351980, {:ok, 1}}

Conclusion, output commands are slow (~350ms) and require no programmatic delay.