FranklinJS Posted September 12, 2011 Report Posted September 12, 2011 Peter or anyone, I saw this topic a possible solution to the problem of software I'm developing. Through the tutorial could identify the variables used in the Feelthere ERJ195. Now left me a question, how could I detect when these FSUIPC variable was modified? What I mean is, like FSUIPC can log an action in a case such as variable L: EmbLandLt = 0, referring to the Landing Light, yet use FSUIPC as I could in my program and do the same?
FranklinJS Posted September 13, 2011 Author Report Posted September 13, 2011 I'm a bit confused by your question. If you want to see when L:Vars change, there's a Lua plug-in provided in the Examples installed by FSUIPC which logs L:Vars and their changes in real-time to an overlain Lua display window. It's called "log lvars.lua". If you are instead referring to internal FS values, not local gauge variables, then you can monitor the relevant offsets using the FSUIPC monitoring facilities in the Logging section. You'll need to find the appropriate offsets and their types from the documents provided in the FSUIPC SDK. For instance the lights are all individual bits in a word (U16) at offset 0D0C. Regards Pete Thanks for the quick response Peter, maybe I'm confusing things a bit. What I was wondering is this: Using FSUIPC programmatically to start logging LUA local variables during the simulation and from there I read this log and see what was changed or fired. The FSUIPC has control over this log? or can monitor what is being displayed in the window if I want to retrieve this information?
Pete Dowson Posted September 13, 2011 Report Posted September 13, 2011 What I was wondering is this: Using FSUIPC programmatically to start logging LUA local variables during the simulation and from there I read this log and see what was changed or fired. The FSUIPC has control over this log? or can monitor what is being displayed in the window if I want to retrieve this information? Sorry, I'm even more confused now. You are writing a program, and instead of reading the L:Vars yourself you want FSUIPC or Lua to read them and log them in such a way that your program can access them? Perhaps you should tell me what your aim is so I can understand, because it doesn't make sense to me at present. Sorry, but I'm out now, not back till late morning. Regards Pete
FranklinJS Posted September 14, 2011 Author Report Posted September 14, 2011 Sorry, I'm even more confused now. You are writing a program, and instead of reading the L:Vars yourself you want FSUIPC or Lua to read them and log them in such a way that your program can access them? Perhaps you should tell me what your aim is so I can understand, because it doesn't make sense to me at present. Sorry, but I'm out now, not back till late morning. Regards Pete Peter, I'm sorry for that. Your confusion is due to my ignorance on the subject. Well, I need to read and monitor changes in variables LUA, as well as the FSUIPC log records the same. I figured I could use FSUIPC as an interface to the monitoring of local variables LUA. I'm using C #, and is the little I know. How could I read and monitor variables as LUA need?
Pete Dowson Posted September 14, 2011 Report Posted September 14, 2011 Peter, I'm sorry for that. Your confusion is due to my ignorance on the subject. Well, I need to read and monitor changes in variables LUA, as well as the FSUIPC log records the same. I figured I could use FSUIPC as an interface to the monitoring of local variables LUA. I'm using C #, and is the little I know. How could I read and monitor variables as LUA need? You could write your program in Lua. That's one way. Otherwise you could write a short Lua program, based on the one called "Log Lvars", but write the values you are reading to free FSUIPC offsets (those from 66C0 to 66FF inclusive are available for general use). Then your program could read them via the FSUIPC interface. Or the Lua program could write them to a file which you could read. Regards Pete
FranklinJS Posted September 15, 2011 Author Report Posted September 15, 2011 Peter, I take a study and see what I can do. You clarified the idea in my mind. Thank you, Franklin
FranklinJS Posted September 22, 2011 Author Report Posted September 22, 2011 Peter, I take a study and see what I can do. You clarified the idea in my mind. Thank you, Franklin Hello Peter, I have once again use their help, the forum seemed to be having trouble connecting those days. Well, to the point, I was able to monitor multiple switches using LVARS. However, some did not appear in the log. These appear in the log FS Controls. There is an offset that allows me to send / run a control. Is there any way to monitor the firing of FS Controls? As you can monitor the LVARS? For example when the monitor to give BATTERY_SW_SET 69833 was fired?
Pete Dowson Posted September 22, 2011 Report Posted September 22, 2011 Hello Peter, I have once again use their help, the forum seemed to be having trouble connecting those days. Well, to the point, I was able to monitor multiple switches using LVARS. However, some did not appear in the log. These appear in the log FS Controls. There is an offset that allows me to send / run a control. Is there any way to monitor the firing of FS Controls? As you can monitor the LVARS? For example when the monitor to give BATTERY_SW_SET 69833 was fired? Enable event logging in FSUIPC Logging options. Please move to the Support Forum for Support questions, not this FAQ subforum which is for stockpiling useful information for everyone, not questions. Thanks. Pete
FranklinJS Posted October 12, 2011 Author Report Posted October 12, 2011 Enable event logging in FSUIPC Logging options. Please move to the Support Forum for Support questions, not this FAQ subforum which is for stockpiling useful information for everyone, not questions. Thanks. Pete Peter, i try use this: local varEmbAcPump1 = ipc.readLvar("L:EmbAcPump1") if varEmbAcPump1 == 0 then ipc.writeSD(0x660F, 0) else if varEmbAcPump1 == 1 then ipc.writeSD(0x660F, 1) else ipc.writeSD(0x660F, 2) end The Offset return an integer with value 16777474, not 0 or 1 or 2, what am I doing wrong?
Pete Dowson Posted October 12, 2011 Report Posted October 12, 2011 The Offset return an integer with value 16777474, not 0 or 1 or 2, what am I doing wrong? I've taken the liberty of moving your portions of the FAQ informative thread into the main Support Forum, as this is where they belong and where you should expect answers. The FAQ subforum is meant to be a repository of answers, not a series of support questions. I've moved it without waiting because I am off on holiday soon and was worried it wouldn't be answered. Your value 16777474 is, in hex, 0x01000102, which indeed does have the value 2 in Byte 660F. You appear to be writing a Double Word (SD = signed 32-bit integer), which is possible but odd with such an odd offset like 660F. I would guess that whatever is using the 3 bytes after 660F is changing them from the 00 00 00 you are writing. Without any other idea of what you are doing, or what 660F - 6612 are used for I can't really help further, but I'm suspecting that you really want to write and read a single byte (SB or UB) not 4 bytes as you are now. This seems likely when you see what you are reading: 02 in 660F 01 in 6610 00 in 6611 01 in 6612 They all look like byte values for switches or other settings to me! Regards Pete
FranklinJS Posted October 12, 2011 Author Report Posted October 12, 2011 Peter, I change to SB and change my type in C# code for Byte, works fine. Thanks.
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