BABA767 Posted December 12, 2022 Report Posted December 12, 2022 Hello everybody, does anyone know how to derive the name of a VOR/NDB composed of 3 letters? FSUIPC provides the relative offsets for example VOR1 Identity is reported in the offset 3000 which is composed of 6 bytes but I don't understand how to get the letters from the string. Thanks for your help.🙃 Valerio
John Dowson Posted December 12, 2022 Report Posted December 12, 2022 3 hours ago, BABA767 said: does anyone know how to derive the name of a VOR/NDB composed of 3 letters? FSUIPC provides the relative offsets for example VOR1 Identity is reported in the offset 3000 which is composed of 6 bytes but I don't understand how to get the letters from the string. How are you trading the offset? For example, in lua you would use    n = ipc.readSTR(offset, length) John Â
BABA767 Posted December 12, 2022 Author Report Posted December 12, 2022 Hi John, I read the offset by SIOC (iocp console) and see a string of bits but I'm trying to figure out how to get the identified VOR (or NDB) in letters.. cheers, V.
John Dowson Posted December 13, 2022 Report Posted December 13, 2022 I can't help with SIOC - maybe try asking how to read/use a string with SIOC on opencockpits. John
BABA767 Posted December 15, 2022 Author Report Posted December 15, 2022 ..just add a photo to show what I would like to understand; in practice on the offset 3000 I read a bit string with the decimal value next to it but I don't understand the relationship between the string and the VOR ident in the example highlighted the Ident corresponds to the letters OST. In lua I would read the same string? Valerio
John Dowson Posted December 15, 2022 Report Posted December 15, 2022 1 hour ago, BABA767 said: .just add a photo to show what I would like to understand; in practice on the offset 3000 I read a bit string with the decimal value next to it but I don't understand the relationship between the string and the VOR ident in the example highlighted the Ident corresponds to the letters OST. Every variable type is a sequence of bits, whether it is a string, an integer, a floating point number or any other type. You just have to read it as a string. Each letter is one byte / 8 bits:   O = 0x4F (Virtual Key Code) = 01001111   S = 0x53 = 01010011   T = 0x54 = 01010100 And so the string OST in binary is (in reverse order - how strings are stored) :    010101000101001101001111 which is what your picture shows. And 010101000101001101001111 as an integer is 5526351, also as your picture shows. 1 hour ago, BABA767 said: In lua I would read the same string? As I said, to read it as a string in lua you would use    n = ipc.readSTR(offset, length) John
BABA767 Posted December 16, 2022 Author Report Posted December 16, 2022 3 hours ago, John Dowson said: Every variable type is a sequence of bits, whether it is a string, an integer, a floating point number or any other type. You just have to read it as a string. Each letter is one byte / 8 bits:   O = 0x4F (Virtual Key Code) = 01001111   S = 0x53 = 01010011   T = 0x54 = 01010100 And so the string OST in binary is (in reverse order - how strings are stored) :    010101000101001101001111 which is what your picture shows. And 010101000101001101001111 as an integer is 5526351, also as your picture shows. John this is exactly the explanation I was looking for! I didn't know how to interpret the string, maybe it is reported in the FSUIPC manual anyway, problem solved😊 thank you! V. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now