Jump to content
The simFlight Network Forums
Dante

lua or fsuipc interface can not write pmdg offsets

Recommended Posts

Hi,
i will be very appreciated, if anybody answer me.

i cannot write to pmdg ngx offsets via fsuipc buttons(offset dword set) or lua script. 
but linda can write it, i tried. and offcourse :

[sDK]
EnableDataBroadcast=1

example lua like below:

--ipc.display("Result",)
--ipc.sleep(10000)

ipc.display("pmdg test",2)
ipc.sleep(1000)
while 1 do

--ipc.sleep(5)
ipc.writeUW(0x6535, 1)--at sw
ipc.sleep(5)
ipc.writeUW(0x6533, 1)--fd sw
ipc.sleep(5)
ipc.display(VSI)
ipc.sleep(3300)
ipc.writeUW(0x6535, 0)--
ipc.sleep(5)
ipc.writeUW(0x6533, 0)--
ipc.sleep(3300)

end

thanks from now..
modify_inline.gif
 
 

 

Share this post


Link to post
Share on other sites

In FSUIPC the block of PMDG offsets is read-only.

 

To write to the PMDG NGX you must send controls to the flight sim. The control numbers can be seen in the document called "PMDG_NGX_SDK.h" which comes with the PMDG SDK. The relevant section begins with the comment '// Control Events'.

 

To write controls in LUA use: ipc.control(n) or ipc.control(n, param).
 

Controls can also be bound directly to Keys and Joystick buttons in the FSUIPC interface.

 

Paul

 

Share this post


Link to post
Share on other sites

Hi Paul,

thank you very much for your help.

now i can write by ipc.param or fsuipc interface now.

but i can not read offsets.

example:

at arm sw offset is 6535 and i am trying to read but nothing.

 

could you help me please?

 

while 1 do
 
--ipc.sleep(5)
ipc.sleep(1000)
--ipc.control(70012,0)
VSI=ipc.readUW(0x6535)
ipc.display(VSI)
ipc.sleep(1000)
 
end
 

 

best regards..

Share this post


Link to post
Share on other sites

Offset 0x6535 is only 1 byte so you really need to use:

VSI = ipc.readUB(0x6535)

However I think you have another problem because using readUW (reading 2 bytes) will not produce nothing, it will just give you the wrong value.

 

I don't have any PDMG aircraft so I can't test this here myself.

 

Here are some things you can try:

 

1. Use the FSUIPC Logging tab to log the 0x6535 offset to the FSX Screen. Use the section on the right "Specific Value Checks". Enter the hex address and set the type to 'U8'. Tick the box to display to the FS Window.

 

If this shows the wrong value then there is something wrong with the link between FSUIPC and the PMDG aircraft.

 

If this is correct then there is something wrong with the LUA script.

 

 

2. Try reading one of the standard offsets in your LUA script, for example the pause indicator. (2 bytes)

 

ipc.readUW(0x0264)

 

If this shows 1 when you pause the sim and 0 when not paused then you will know your lua script is running properly.

If this doesn't work then the problem is with the lua script, or running the lua script, and not with the PMDG offsets.
 

 

3. Make sure you are using the latest version of FSUIPC (4.393n)

 

 

If you need more help, please let me know the result of tests 1 and 2. Also please describe the problem in more detail. For example are you getting a display window or not? Are you getting any value displayed? If so what is it? Are there any errors in the FSUIPC4.log file?

 

Paul

Share this post


Link to post
Share on other sites

Hi Paul!

thanks your reply.

i found enough times and i am looking right now and i can do it. 

 

because of unwork:

i installed again pmdg but i forget add this lines:

SDK 

EnableDataBroadcast=1

 
now it's working.

 

i learned many many things from you. thank you very much again.

 

best regards..

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • 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.