Unexpected behavior setting negative values with SimVar.SetSimVarValue() in Javascript

I’m currently trying to set values through ROTOR_LATERAL_TRIM_SET and
ROTOR_LONGITUDINAL_TRIM_SET. Both events claim that they can take an input
value of +/- 16384. When passing a positive value it behaves as expected, such
as the below: SimVar . SetSimVarValue ( “K:ROTOR_LONGITUDINAL_TRIM_SET” ,
“number” , 1638 ); When trying to set any negative value, it does not behave
correctly. It seems to instead set a large or maximum positive value, since
reading the appropriate A: var will return a value of 16384. I’m not sure if
this bug is limited to these two events or is a wider issue, but the two key
events affected here are of importance to me.

Hello @MV-JimStewart From what I can see, that’s a bug on our side. It will be
reviewed. Unfortunately, I can’t think of any workaround. Regards, Sylvain

It’s review will be appreciated, as it’s a block on certain features on a
couple of our projects. Many thanks.

Hi @MV-JimStewart, Do you get a valid value in the sim if you use the two’s
complement for negative numbers? In other words, if you’re trying to send in
-656, in JS you would do (~656) + 1 (that’s a tilde there, not a negative
symbol). I seem to recall there being a signing issue for some things, but I
also have some memory of us being able to work around it in that way. Hope it
helps, Matt

Hello @MV-JimStewart This should no longer be a problem starting with SU13.
Please test it again when the flighting begins and let us know if that’s ok
for you. Regards, Sylvain