New/Different way to use Avars with two indexes

The TBM interior xml has code like the following 16 (A:1:BUS CONNECTION ON:15,
Bool) l0 != if{ 16 15 (>K:2:ELECTRICAL_BUS_TO_BUS_CONNECTION_TOGGLE) }

For example to check the state of the connection between a “circuit.45” and
the “bus.2” it would be written as follows:

2 (>A:BUS LOOKUP INDEX, Number) (A:CIRCUIT CONNECTION ON:45, Bool) The SDK
has an example of the BUS_LOOKUP INDEX as a separate Avar I don’t see an
explanation of how to set up 16 (A:1:BUS CONNECTION ON:15, Bool) Specifically
this A:1:simvar syntax. Can you please provide a description of this use in
the SDK docs? SimVars and Keys section of the RPN documentation?

Hello @DA40CGDFQ

2 (>A:BUS LOOKUP INDEX, Number) (A:CIRCUIT CONNECTION ON:45, Bool) 

and

2 (A:1:CIRCUIT CONNECTION ON:45, Bool)

are equivalent expressions. The former was used when we had no way of passing
extra parameters. We would set a lookup var before reading. The second is a
slightly improved syntax where you indicate the number of extra parameters
before the simvar name and pass them directly. It can be used for the
following simvars: BUS CONNECTION ON BATTERY CONNECTION ON ALTERNATOR
CONNECTION ON CIRCUIT CONNECTION ON EXTERNAL POWER CONNECTION ON BUS BREAKER
PULLED BATTERY BREAKER PULLED ALTERNATOR BREAKER PULLED CIRCUIT BREAKER PULLED
EXTERNAL POWER BREAKER PULLED All of this will be added to the documentation.
Regards, Sylvain

@FlyingRaccoon - To query this a bit further, would there be a way to use this
to pass extra parameters in order to use these with input event presets? I’m
thinking primarily of the parameter.

I’m totally confused which of those parameters in the ‘parameter count’ and
which are argument #1, argument #2, argument #3 etc. If the ‘2’ before the
simvar name is the parameter count in the example from FlyingRacoon, what’s
the ‘16’ in the example found by DA40CDGFQ. Is the ‘extra parameters’ count
the number of arguments minus one? If it’s parameter_count
(A:arg1:VAR_NAME:arg2, units) how would that extend to 3 arguments? Is the new
use of the var WITHOUT a ‘>’ still a WRITE ?

The A:1 is the syntax to use. It will always be A:1. The example 2
(A:1:CIRCUIT CONNECTION ON:45, Bool) The 2 is the bus lookup index and the 45
is the circuit the bus is to be connected to. 2 (>A:BUS LOOKUP INDEX, Number)
So it’s two parts combined. In RPN 2 is pushed to Avar Bus Lookup Index stack
(A:CIRCUIT CONNECTION ON:45, Bool) and 45 is used for the circuit, to connect
to bus 2

Hello @MV-JimStewart ****can’t be used for these simvars at the moment. This
is also a problem with JS, SimConnect and Gauge API where these simvars can’t
be read. The issue is being discussed internally. @B21 The digit after A:
indicates the number of additional arguments that will be passed. In a similar
way to what’s done with K events. Regards, Sylvain

What is the code to set the A var?? #BUS_INDEX# (>A:BUS LOOKUP INDEX, Number)
#VALUE# (>A:BATTERY BREAKER PULLED:1, Bool) or #BUS_INDEX# #VALUE# (>A:BUS
LOOKUP INDEX, Number) (>A:BATTERY BREAKER PULLED:1, Bool) or #VALUE#
#BUS_INDEX# (>A:BUS LOOKUP INDEX, Number) (>A:BATTERY BREAKER PULLED:1, Bool)