Dominik Posted October 7, 2022 Report Posted October 7, 2022 using LUA I can read PMDG offsets but I have a problem with CDU Screen Data offset 0x5400-0x57FF. Can anyone help me how to read these offsets correctly using LUA script. Thanks for any help. Dominik.
John Dowson Posted October 7, 2022 Report Posted October 7, 2022 How do you want to read this data, and what do you want to do with it? If you want to read all of the CDU data, you can do this using a multi-dimensional array. Something like: -- Define the size of the array - we will start are indeces at 0 to make offset calculation easier CDU_Colums = 24 - 1 CDU_Rows = 14 - 1 -- Initializing the array CDU_data = {} for i=0,CDU_Colums do CDU_data[i] = {} for j=0,CDU_Rows do CDU_data[i][j] = 0 end end -- Read the data: 0x5400 == 21504 in decimal for i=0,CDU_Colums do for j=0,CDU_Rows do CDU_data[i][j] = ipc.readUB(21504 + i + (j*(CDU_Colums+1))) end end I haven't tried this! John
Dominik Posted October 7, 2022 Author Report Posted October 7, 2022 5 hours ago, John Dowson said: How do you want to read this data, and what do you want to do with it? It uses LUA to read the offsets and write this data as text to a txt file. The second program reads this data from the txt file and sends it to the Arduino. My point is to use LUA to read the text lines on the CDU and save them as text in a txt file. Then the second program will read this data from the txt file and send it to the Arduino.
John Dowson Posted October 7, 2022 Report Posted October 7, 2022 1 minute ago, Dominik said: t uses LUA to read the offsets and write this data as text to a txt file. The second program reads this data from the txt file and sends it to the Arduino. My point is to use LUA to read the text lines on the CDU and save them as text in a txt file. Then the second program will read this data from the txt file and send it to the Arduino. The lua example I showed you should do the first part - you need to add the ability to write out the CDU_data array variable to a text file.
Dominik Posted October 7, 2022 Author Report Posted October 7, 2022 In the LUA code, I added print (CDU_data) to display this data in the console. CDU_Data is displayed as a string that is constantly changing. Do you need to format this data somehow after reading? In the attachment I am sending the log file. FSUIPC7_prev.log
John Dowson Posted October 7, 2022 Report Posted October 7, 2022 The data is as explained in the PMDG offset document - please see that to find out how to interpret the data.
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