Parallel state machine and global timers

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Parallel state machine and global timers
#1
Hi Josh, I have two questions:

1. Can I have multiple state machines running in parallel? E.g. one state machine controls lick tube, water delivery, and the other state machine controls sound and speakers.

2. For global timers, how do I know how much time has elapsed since that timer is on at a given moment (say the start of a specific state). For each state, how do I know how long that state took from its start to its end.

Thank you very much

Ziyi Zhu
Reply
#2
Hi Ziyi,

Only one state machine can run at a time. However, certain tasks can be handled by global timers, independent of the flow through states. For instance, you can set a channel linked to the timer, and the state of the channel when the timer starts and stops (e.g. for a digital output channel, setting 'OnsetValue' to 1 will drive the line high when the timer starts, also see code examples here).

Global timer start and stop events are logged and timestamped by the state machine. Separately, each state change is timestamped. From your data, you should be able to recover the onset time of each state, and the onset and offset time of each global timer.

-Josh
Reply
#3
(09-16-2019, 02:21 PM)Josh Wrote: Hi Ziyi,

Only one state machine can run at a time. However, certain tasks can be handled by global timers, independent of the flow through states. For instance, you can set a channel linked to the timer, and the state of the channel when the timer starts and stops (e.g. for a digital output channel, setting 'OnsetValue' to 1 will drive the line high when the timer starts, also see code examples here).

Global timer start and stop events are logged and timestamped by the state machine. Separately, each state change is timestamped. From your data, you should be able to recover the onset time of each state, and the onset and offset time of each global timer.

-Josh

Thank you very much! I was able to figure it out according to your advice!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)