Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi Pete,

hope you have a nice christmas!

With the help of some topics here in the forum I managed to write values in the MCP Combo Display

As example here is the code for J41:

buffer = ipc.readLvar("L:AltSelAlt")/100
com.write(dev, string.format("ALT%03d", buffer), 8)

What I wonder know is, if it is possible to read a value out of the MCP Combo display?

Like in the example above writing to the ALT display, know reading the shown ALT out of the display...

I made several attempts with com.read but you know that I'm no programer, so this was without success...

Is this possible and if yes, how?

thanks very much,

Günter

Posted

Hi Günter,

principally it is possible to read from the MCP - but not directly. What you have probably seen is the JS41 Lua I posted which runs entirely without SerialFP and VSPE for virtual ports. That works great apart from the fact that you cannot read out the displays directly. I did not get that to work. I am not sure why that is but so far it only works if SerialFP is connected and you have a (non-free) version of something like VSPE running. VSPE creates virtual COM ports and the lua scripts are principally spying on the communication between SerialFP and MCP. SerialFP is regularly asking for the state of the MCP and that can be used in lua scripts.

So far I have been unable to recreate this without SerialFP and VSPE although I am quite sure that there is a way to be discovered to tell the MCP to release information.

For the time being I use an indirect way. I initialize the MCP at the start of my scripts with values of the aircraft and then update the aircraft values with the values in the display (does not work for all aircraft but most I have experimented with).

If I find a way to do reading from the MCP I will let you know.

Kosta

Posted

What I wonder know is, if it is possible to read a value out of the MCP Combo display?

VRi devices only send messages to the PC when something changes. I am pretty sure there is no way at all to request it to supply information. You'd have to read everything it sends and match it to what you are looking for.

Use the logging facilities mentioned to log the exchanges between SerialFP2 and the device and you'll see what I mean.

Regards

Pete

Posted

Thanks for your answers!

I have found out that even with the FSx standard planes the MCP is reading their AP values and updating then the MCP displays.

Thought there where an other way round possible...

But doesn't matter - was jus a thought.

Happy new year!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.