odrezet77 Posted April 4, 2015 Report Posted April 4, 2015 Hi, As I am discovering the use of Arduino boards, I would like to show the tail number of my Aircraft on a LCD display, connected to the Arduino board. The offset I need should be 0x313C. Using Link2FS to communicate with FSX/FSUIPC and Arduino, I get this value : 60710508774988 ... And I don't know how to handle this value to display a string ... I googled this for a long time and ... Still no idea ... May someone help me ? Oliver.
Pete Dowson Posted April 4, 2015 Report Posted April 4, 2015 The offset I need should be 0x313C. Using Link2FS to communicate with FSX/FSUIPC and Arduino, I get this value : 60710508774988 ... And I don't know how to handle this value to display a string ... The value IS a string already, up to 12 characters, in ASCII, one character per byte, and it is meaningless to convert the first few bytes to a decimal number as you have done for some reason! It might not even be just a number in character form. Flight numbers can have airline codes, like "BAW1455". Pete
odrezet77 Posted April 5, 2015 Author Report Posted April 5, 2015 Ok Pete, Thank you for your quick reply. Unfortunately, Link2FS does not provide "String" type from FSUIPC. I have to find another way. Linda, maybe. Happy Easter ! :razz:
Pete Dowson Posted April 5, 2015 Report Posted April 5, 2015 Unfortunately, Link2FS does not provide "String" type from FSUIPC. I have to find another way. Linda, maybe. You could have a small Lua file, run as part of an [Auto] section in the INI, to read the string, extract the number (presumably discarding the alpha characters?) converting it to binary, and placing the result in a user offset (in the range 66C0-66FF). You'd use the "event.offset" function to keep things updated automatically. Not handling strings seems to be a rather big deficiency in Link2FS. There is quite a lot of information in such a form, like the DME readouts for VOR/ILS beacons. Pete
odrezet77 Posted April 9, 2015 Author Report Posted April 9, 2015 Trying to play with tail numbers, I tried this : Read each offset from 313c to 3148 (those affected to ATC id) ... For this aircraft tail number (FSX cessna default) N760PL :I get these values :313c - 78 - N313d - 55 - 7313e - 54 - 6313f - 48 - 03141 - 76 - P3142 - 48 - 0So, no matter the tail number : Offset 3142 is always 0 (zero) as a terminator ... I'm using FSUIPC 4.937 registered. Edit : Same behavior with 4.939.
Pete Dowson Posted April 9, 2015 Report Posted April 9, 2015 Trying to play with tail numbers, I tried this : Read each offset from 313c to 3148 (those affected to ATC id) ... For this aircraft tail number (FSX cessna default) N760PL : I get these values : 313c - 78 - N 313d - 55 - 7 313e - 54 - 6 313f - 48 - 0 3141 - 76 - P 3142 - 48 - 0 So, no matter the tail number : Offset 3142 is always 0 (zero) as a terminator ... I'm using FSUIPC 4.937 registered. Edit : Same behavior with 4.939. Yes, despite FSUIPC allowing for more characters (12), and SimConnect SDK documentation stating it is up to 10 characters, I think SimConnect limits it to 6 including zero terminator. Sorry, I don't know why, but FSUIPC4 is presenting you with all it receives. Here's the SDK definition of the variables FSUIPC is reading: Offset 3160 ATC TYPE Type used by ATC String (30) Offset 3500 ATC MODEL Model used by ATC String (10) Offset 313C ATC ID ID used by ATC String (10) Offset 3148 ATC AIRLINE Airline used by ATC String (50) Offset 3130 ATC FLIGHT NUMBER Flight Number used by ATC String (6) Because FSUIPC is using the original offsets from FS9 and before, its lengths are different -- 24, 24, 12, 24, 12 respectively, so in the cases of ATC TYPE and ATC AIRLINE it may be truncating, but in the other cases it will be zero filled where SimConnect stops. Pete
odrezet77 Posted April 9, 2015 Author Report Posted April 9, 2015 Okay, it seems to be clear . So, may your solution should work despite your answer ? You could have a small Lua file, run as part of an [Auto] section in the INI, to read the string, extract the number (presumably discarding the alpha characters?) converting it to binary, and placing the result in a user offset (in the range 66C0-66FF). You'd use the "event.offset" function to keep things updated automatically.
Pete Dowson Posted April 9, 2015 Report Posted April 9, 2015 Actually, I just noticed. Sorry, I didn't read your message carefully enough. You were wrong: look 313c - 78 - N313d - 55 - 7313e - 54 - 6313f - 48 - 0 =============<<<<<<<<<< 3140?3141 - 76 - P3142 - 48 - 0 where is 3140? I've checked here and I get the whole tail number. Please do your checks using FSInterrogate. Pete
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