Here's a design for an alternative command-response scheme, avoiding clocks altogether,
running at full speed, avoiding all timing considerations.
Imagine a new form of Ping Pong, played by one master player simultaneously against
4 players, named North, East, South, West respectively. The 4 opponents surround the master player,
one at each compass direction, at their own table (4 tables, arranged in a '+', player at center.)
This requires a big room.
But there is only one Ping Pong ball.
The master player launches his ball at player North's table
Player North rebounds to the master player.
The master player bounces the ball to player East.
Player East rebounds to the master player.
The master player bounces the ball to player South.
Player South rebounds to the master player.
The master player bounces the ball to player West.
Player West rebounds to the master player.
The master player bounces the ball to player North.
Player North rebounds to the master player.
The master player bounces the ball to player East.
Player East rebounds to the master player.
...
This game gives the master player a bit of a workout,
spinning clockwise while he plays, but there is no worry
about simultaneity or finding multiple balls on their way at once.
For your problem, the opponents would be branches of the Arduino's case statement
testing for mesure values and routing to the appropriate value response,
and the master player would be AI2 launching mesure codes one at a time at the Arduino
to satisfy your original post, using receipt of a response to trigger launch of the next request.
This design is sometimes called a round robin technique.
This can be programmed in AI2 using a master list of mesure(sic) codes, a sequence schedule list, a mesure code to Label component map,
a mesure code to filename map, and the Any Label block.
- The master mesure code list would be a permanent list of the mesure codes you would want to send each round.
- The sequence schedule list is a temporary list of the mesure codes that remain to be handled in the current round, depleted at item 1, and replenished (via copy list) when empty from the master mesure code list. Item 1 is the mesure code that has been sent but not yet responded to.
- The mesure code to Label component map is a constant 2 column table (list of lists) suitable for the lookup in pairs list block, with mesure codes in column 1 and corresponding Label components in column 2. It maps mesure codes into the Labels that should receive the anticipated response values from their corresponding mesure codes.
- The a mesure code to filename map is a constant 2 column table (list of lists) suitable for the lookup in pairs list block, with mesure codes in column 1 and corresponding File components in column 2. It maps mesure codes into the Files that should receive the anticipated response values from their corresponding mesure codes. Keeping multiple File components open might be faster than switching on File among multiple filenames.
- The Any Label block can be used at response receipt time to route the response into the corresponding Label.Text field. Likewise with an Qny File block, if mapping mesure codes to
I don't have a code sample for this handy.
ABG