Data corruption using inter instrument variable

Discuss suspected bugs with other users and Sim Innovations Staff

Moderators: russ, Ralph

Post Reply
Message
Author
User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Data corruption using inter instrument variable

#1 Post by Sling »

Seems to be a weird bug in beta 55.

Create a blank instrument and run the following script. Watch for the result of a and b at a8388608. Like I said weird. It seems there is an offset around 2^23. This had me going for quite a while.

If you leave it running past this point it becomes ok again.

Now swap the commented line for the one above it and run again. This has been driving me mad and makes no sense to me at this late hour. Can someone explain the output this generates because I must not be thinking straight.

Code: Select all

test_var_id = am_variable_create("test_var", "INT", 0)

test = 2
am_variable_write(test_var_id, 1)

function get_am_vars(test_dr)

    print("b" .. test_dr)

end

function loop()

    test = test * 2
--    test = (test * 2) - 10
    print("a" .. test)
    am_variable_write(test_var_id, test)

end

variable_subscribe("AM", "test_var", "INT", get_am_vars)

timer_start(0, 1000, loop)

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Data corruption using inter instrument variable

#2 Post by Sling »

Also just noticed that it also goes wrong at a32768 i.e. 2^15. I'm confused.

User avatar
Corjan
Posts: 2936
Joined: Thu Nov 19, 2015 9:04 am

Re: Data corruption using inter instrument variable

#3 Post by Corjan »

Hi,


I have the same issue here, so that is always a good start :)
It is probably a bug in the protocol between Air Manager and the flight simulator. I'll look into it.


I'll keep you posted,

Corjan

User avatar
Corjan
Posts: 2936
Joined: Thu Nov 19, 2015 9:04 am

Re: Data corruption using inter instrument variable

#4 Post by Corjan »

Hi,


Seems like it is fixed. There was a byte ordering problem deep in the system.
Will do some more testing before releasing it since this effects more parts of the code. It will be included in the next BETA.


Thanks for pointing this out!

Corjan

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Data corruption using inter instrument variable

#5 Post by Sling »

Thanks for the update and what a relief, I thought I was going mad before I discovered the 🐜.

I assume you are only referring to case 1 in my example. If so any chance you could explain case 2 with the subtraction to me because that makes no sense to me even without the inter instrument error. It must be something simple I'm missing.

Post Reply