Replies: 2 comments 1 reply
-
tjensen, I'm trying to use FSUIPC to set 0x3110 to control the MCP Mach readout on the PMDG 777. I have everything else working but this one is erratic and it is the only 4 byte FLT32 variable I'm trying to set. mach_value = 830 f.write([(0x3110, "L", (mach_value << 32) | base + OFFSET_MACH)]) Do you have any ideas how I can set this successfully? Jim H. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Tim,
Thanks for the reply! I did some playing around with struct pack and unpack before your comment to try to format the integer properly but ended up back at square one. It actually turns out that the SDK shows the float value being set by a 2 digit integer but read as a 32 bit float. I need to contact the publisher (PMDG) and find out why. Thank you for your help in the meantime!
Jim Hunt
Sent from Mail for Windows
From: Tim Jensen
Sent: Saturday, December 2, 2023 8:26 PM
To: tjensen/fsuipc
Cc: James Hunt; Mention
Subject: Re: [tjensen/fsuipc] Sending Controls/Events (Discussion #14)
@snizbatch I know nothing about MCP Mach and PMDG 777 so this is just a guess...
If mach_value needs to be a 32-bit float, then I presume you need to encode it properly in the upper dword.
Try changing:
mach_value = 830
to:
import struct
mach_value = struct.unpack("L", struct.pack("f", 830))[0]
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Controls (aka "Events") are sent via offset 0x3110:
So, to send
8700
to control84137
, you could do this:Or, you could write a generic function to send controls:
Beta Was this translation helpful? Give feedback.
All reactions