Jump to content
The simFlight Network Forums

Encoders and keyboard hack


Recommended Posts

Dear all,

I use FSX, a registered version of FSUIPC 4.703 and the LevelD 767. I've been researching quite a lot and I've read the documentation provided with FSUIPC a couple of times.

I'm trying to make an encoder work while wiring it to an old keyboard I hacked. My encoders have three terminals, so with each detent, two keys are "pressed". Let's say my encoder is wired to both the "A" and the "B" key and that I want to control my altitude on my MCP with the encoder. I have made a mouse macro, with "ALT+" to increase the altitude and "ALT-" to decrease it.

If I assign the "A" key to "ALT+" and the "B" key to "ALT-", nothing happens, because the first always compensates for the latter, and the other way around. I then thought that I might work with flags. When turning counterclockwise, the encoder would always send "A" and then "B" at each detent. If "A" sets a flag, "B" could then trigger "ALT-" if the flag is set. At each detent, the flag is again set by "A" and then "B" triggers "ALT-". However, I hadn't thought of the same problem as before until trying it: when programming FSUIPC for both clockwise and counterclockwise, there is also this compensation and nothing happens on the MCP.

That's why I've come to ask for help: can anyone explain how I could make this work? Any reference to the manual, to something I might have missed (or misunderstood) is also appreciated.

Thanks!

Sébastien.

Link to comment
Share on other sites

  • 2 weeks later...

Hello all,

In the meanwhile, I've been digging in the LUA documentation. It seems like this could be done with a LUA script, but I'm not entirely sure on how to build the script. Any help is appreciated!

Thanks,

Basje.

Link to comment
Share on other sites

I'm trying to make an encoder work while wiring it to an old keyboard I hacked. My encoders have three terminals, so with each detent, two keys are "pressed". Let's say my encoder is wired to both the "A" and the "B" key and that I want to control my altitude on my MCP with the encoder. I have made a mouse macro, with "ALT+" to increase the altitude and "ALT-" to decrease it.

If I assign the "A" key to "ALT+" and the "B" key to "ALT-", nothing happens, because the first always compensates for the latter, and the other way around. I then thought that I might work with flags. When turning counterclockwise, the encoder would always send "A" and then "B" at each detent. If "A" sets a flag, "B" could then trigger "ALT-" if the flag is set. At each detent, the flag is again set by "A" and then "B" triggers "ALT-". However, I hadn't thought of the same problem as before until trying it: when programming FSUIPC for both clockwise and counterclockwise, there is also this compensation and nothing happens on the MCP.

I would think that with only two keys, A and B, won't both directions be indistinguishable or does the input always stop on a B going one way and A going the other? If, like most rotaries, you can't control the stopping position, the sequence wither way could be A B A B A or B A B A B ...

If it is always going to be A B one way and B A the other, then, yes, you could use flags. If these were button inputs it could be done easily with button flags, but FSUIPC provides no such programming facilities in the INI for button presses.

In the meanwhile, I've been digging in the LUA documentation. It seems like this could be done with a LUA script, but I'm not entirely sure on how to build the script.

Yes, assuming you do have identifiable sequences, it should be possible via Lua. Use the event.key function to let a function receive they keypresses and send the appropriate controls or whatever.

Regards

Pete

Link to comment
Share on other sites

Hello Pete,

Thank you for your reply. I'll try to figure something out with Lua and the event.key function. It'll keep me busy for a while, but I'm eager to learn. If I understand correctly, my "ALT+" mouse macro would be my function, which would be triggered when first A and then B is pressed? Then for "ALT-", this would be the other way around?

Have a nice day,

Basje

Link to comment
Share on other sites

Hello Pete,

I decided to start with something simple: have a simple keypress (e.g. "A") trigger one of my mouse macros (e.g. ) "AltInc" through Lua. I know there is an easier way to do this, through FSUIPC directly, but I thought that would teach me the basics of Lua programming. It was a process of trial and error, but eventually I made some code that seems to work:

function AltitudeIncrease(keycode, shifts) end

ipc.macro("LevelD767: ALTInc")

event.key(186, 8, "AltitudeIncrease") -- I use the ; key for this, since "A" is already assigned

However, I was doing some research in order to have a succession of keys (e.g. "A" and then "B") triggering the macro, but I wasn't able to find out how to do this. Could you please show me some directions?

Thanks!

Basje

Link to comment
Share on other sites

I decided to start with something simple: have a simple keypress (e.g. "A") trigger one of my mouse macros (e.g. ) "AltInc" through Lua. I know there is an easier way to do this, through FSUIPC directly, but I thought that would teach me the basics of Lua programming. It was a process of trial and error, but eventually I made some code that seems to work:

Well, it looks completely wrong, I'm afraid. Let's see:

function AltitudeIncrease(keycode, shifts) end

This does nothing at all, because there is no code between the function statement and the 'end'. So when it is called by the event, it does ... nothing at all. The whole point of a function is to do something, else you waste time and space.

ipc.macro("LevelD767: ALTInc")

This will execute once when the Lua is loaded. How are you running the Lua plug-in? If you think it is working, then I assume you assigned a keypress to it? You might as well assign the keypress directly to the macro!

event.key(186, 8, "AltitudeIncrease") -- I use the ; key for this, since "A" is already assigned

Because the function this calls does nothing (having no code in it), this line does nothing except waste time and space.

The whole point of using event.key is for the plug-in to detect the keys presses and execute the action. There would be no assignment in FSUIPC whatsoever. You'd have the plug-in loaded either by the [Auto] mechanism in the INI file, or by naming it ipcReady.lua (which s run automatically on FS initialisation, when ready to fly). Or you could have ipcReady.lua run it.

However, I was doing some research in order to have a succession of keys (e.g. "A" and then "B") triggering the macro, but I wasn't able to find out how to do this. Could you please show me some directions?

It's just a logical sequence: you'd reset a flag or variable first (eg KeySeen = 0), and have event.key lines for A and B. In the one function called by either, check 'KeySeen', if 0 just copy the keycode to KeySeen ("KeySeen = KeyCode") , otherwise check if KeySeen == the keycode for A and the new keycode is for B, if so do the A-B action, otherwise similarly check B-A, if so do the B-A action. for either reset KeySeen=0, but if neither just do KeySeen=KeyCode again.

However, I think you may need a bit more time looking at Lua examples first. See some of those supplied in the package installed for you in the FSUIPC Documents folder, and those contributed by users in the User Contributions sub-forum here.

Regards

Pete

Link to comment
Share on other sites

Well, it looks completely wrong, I'm afraid. Let's see:

ipc.macro("LevelD767: ALTInc")

This will execute once when the Lua is loaded. How are you running the Lua plug-in? If you think it is working, then I assume you assigned a keypress to it? You might as well assign the keypress directly to the macro!

You are right: I have assigned a keypress to the plug-in. Will delete that right away.

The whole point of using event.key is for the plug-in to detect the keys presses and execute the action. There would be no assignment in FSUIPC whatsoever. You'd have the plug-in loaded either by the [Auto] mechanism in the INI file, or by naming it ipcReady.lua (which s run automatically on FS initialisation, when ready to fly). Or you could have ipcReady.lua run it.

I've put it in the [Auto] section of fsuipc.ini.

It's just a logical sequence: you'd reset a flag or variable first (eg KeySeen = 0), and have event.key lines for A and B. In the one function called by either, check 'KeySeen', if 0 just copy the keycode to KeySeen ("KeySeen = KeyCode") , otherwise check if KeySeen == the keycode for A and the new keycode is for B, if so do the A-B action, otherwise similarly check B-A, if so do the B-A action. for either reset KeySeen=0, but if neither just do KeySeen=KeyCode again.

I'll do more research on that, thank you for putting me on the right track.

However, I think you may need a bit more time looking at Lua examples first. See some of those supplied in the package installed for you in the FSUIPC Documents folder, and those contributed by users in the User Contributions sub-forum here.

When looking at examples, all seems logic (and sometimes simple), but the situation is completely different when trying myself to make something work. I'll keep on searching and reading, thanks!

Basje.

Link to comment
Share on other sites

Dear Pete,

After having read the documentation again and studied some examples, and after multiple attempts yesterday and today, this is what I've come up with for now, based on what you suggested. I can't try it, because there's some part of the syntaxis I can't identify in the documentation and the examples (see comments), otherwise I would have tried first to see before bothering you. [Note: I've put a space between every "8" and ")" in order to avoid emoticons here. Also, the indents are gone.]

KeySeen=0 -- To make sure KeySeen is always reset first

function AltitudeChange(keycode, shifts)

if KeySeen == 0 do

KeySeen = keycode then

if KeySeen == (186, 8 ) and -- new keycode == (57, 8 ) - how should this be written?

then

ipc.macro("LevelD767: ALTInc") and KeySeen = 0

if KeySeen == (57, 8 ) and -- new keycode == (186, 8 ) - how should this be written?

then

ipc.macro("LevelD767: ALTDec") and KeySeen = 0

else KeySeen=keycode -- I do not understand why this is necessary

end

end

end

event.key(186, 8, "AltitudeChange") -- Coming after the function itself

event.key(57, 8, "AltitudeChange") -- Same remark

Would this be a step in the good direction? Thanks in advance for your kind help!

Basje.

Link to comment
Share on other sites

After having read the documentation again and studied some examples, and after multiple attempts yesterday and today, this is what I've come up with for now, based on what you suggested. I can't try it, because there's some part of the syntaxis I can't identify in the documentation

Unfortunately there are quite a lot of "syntax errors" which should have been quite clear:

(BTW use the 'code' quotes to preserve indents -- the <> button above your edit area)

	if KeySeen == 0 do[/CODE]

The syntax is 'if .... then', not 'do'.

[CODE] KeySeen = keycode then[/CODE]

I don't know what is intended here. You have a 'then', associated with,what? the last 'if'?

Is 'KeySeen = keycode' intended to be an assignment, which it is, or did you really mean == instead of =, for a comparison?

[CODE] if KeySeen == (186, 8 ) and -- new keycode == (57, 8 ) - how should this be written?[/CODE]

Since you only need to deal with two Keycodes -- 186 and 57, because these are the only ones trapped by the Events you added, the shift codes are not relevant. But, for information, the keycode and the shifts code are separate variables -- the (obscurely named?) values you've called 'keycode' and 'shifts' in the function definition (please look at it, the line starting 'function'). You can't compare both together, only one then the other. They are separate values, not joined in a way you can parenthesise like that.

[CODE] ipc.macro("LevelD767: ALTInc") and KeySeen = 0[/CODE]

This makes no sense. You execute a macro 'and' set 'keySeen = 0'? The 'and' is a logical condition, not an operation! What are you trying to do?

[CODE] if KeySeen == (57, 8 ) and -- new keycode == (186, 8 ) - how should this be written?[/CODE]

See comments above for the similar question. You are only needing to deal with the keycode, not the "shifts" as well, which are always 8 in any case.

[CODE] ipc.macro("LevelD767: ALTDec") and KeySeen = 0[/CODE]

Same odd syntax as commented above. I can't fix it for you because I've no idea what you really mean.

[CODE] else KeySeen=keycode -- I do not understand why this is necessary [/CODE]

You don't understand why KeySeen is used to keep a record of the last key seen? Why else it is existent? That's its whole purpose!

[CODE]event.key(186, 8, "AltitudeChange") -- Coming after the function itself
event.key(57, 8, "AltitudeChange") -- Same remark[/CODE]

Why the remarks?

Pete

Link to comment
Share on other sites

(BTW use the 'code' quotes to preserve indents -- the <> button above your edit area)

Thanks for the tip! Will try it right away.

	if KeySeen == 0 do[/CODE]

The syntax is 'if .... then', not 'do'.

I thought 'then' was not indicating a consequence, but only telling what comes next. I searched the Lua documentation about this, but I could only find a list with those keywords.

[CODE] KeySeen = keycode then[/CODE]

I don't know what is intended here. You have a 'then', associated with,what? the last 'if'?

Is 'KeySeen = keycode' intended to be an assignment, which it is, or did you really mean == instead of =, for a comparison?

If I understood your first indications well, KeySeen should be changed into the keycode, so yes, it is intended as an assigment. I hope the syntax is correct that way, if I omit the 'then' (see below)?

[CODE] if KeySeen == (186, 8 ) and -- new keycode == (57, 8 ) - how should this be written?[/CODE]

Since you only need to deal with two Keycodes -- 186 and 57, because these are the only ones trapped by the Events you added, the shift codes are not relevant. But, for information, the keycode and the shifts code are separate variables -- the (obscurely named?) values you've called 'keycode' and 'shifts' in the function definition (please look at it, the line starting 'function'). You can't compare both together, only one then the other. They are separate values, not joined in a way you can parenthesise like that.

I've killed the '8', everywhere, but not in the event.key lines, because the Lua Library file provided with FSUIPC doesn't mention explicitly it is optional, or am I wrong and can it be deleted also?

[CODE] ipc.macro("LevelD767: ALTInc") and KeySeen = 0[/CODE]

This makes no sense. You execute a macro 'and' set 'keySeen = 0'? The 'and' is a logical condition, not an operation! What are you trying to do?

I'm trying to reset KeySeen to 0. Basically, I have the same problem here as above where I said I don't know how to write the syntax for the second button press. If 'and' only is a logical operator, and 'then' indicates a consequence, what's the syntaxis for a succession over time? First, I want the macro executed, then I want KeySeen to be reset to 0 so as to get back to the inital situation.

[CODE] else KeySeen=keycode -- I do not understand why this is necessary [/CODE]

You don't understand why KeySeen is used to keep a record of the last key seen? Why else it is existent? That's its whole purpose!

I understand why we need KeySeen, but I don't understand why we need it to be set to the keycode after the 'else'. If my understanding is correct, we start by resetting KeySeen to 0, then it is set to 186 or 57, depending on the first key signal, but since the script only activates after the 186 or 57 key being pressed, and hence KeySeen will always be set at 186 or 57, it will never get to the 'else' part, because we have an 'if" for both the 186 and 57 keys. So why do we need it here to be set to the keycode?

[CODE]event.key(186, 8, "AltitudeChange") -- Coming after the function itself
event.key(57, 8, "AltitudeChange") -- Same remark[/CODE]

Why the remarks?

I've added those only for me, so that I wouldn't forget the function needs to be defined before the event.key lines.

So, if I interpret your comments correctly:

[CODE]
KeySeen=0

function AltitudeChange(keycode)
if KeySeen == 0 then
KeySeen = keycode
if KeySeen == (186) -- How should I write 'and if the key pressed after the 186 key is the 57 key', if I cannot use 'and'?
then
ipc.macro("LevelD767: ALTInc") and KeySeen = 0 -- What I intended to do is to execute the macro associated with keys 186 and then 57, and then reset KeySeen to 0
if KeySeen == (57) -- How should I write 'and if the key pressed after the 57 key is the 186 key', if I cannot use 'and'?
then
ipc.macro("LevelD767: ALTDec") and KeySeen = 0 -- What I intended to do is to execute the macro associated with keys 57 and then 186, and then reset KeySeen to 0
else KeySeen = keycode
end
end
end

event.key(186, 8, "AltitudeChange")
event.key(57, 8, "AltitudeChange")
[/CODE]

I truly wish to thank you for the time you are spending on this!

Basje.

Link to comment
Share on other sites

I've killed the '8', everywhere, but not in the event.key lines, because the Lua Library file provided with FSUIPC doesn't mention explicitly it is optional, or am I wrong and can it be deleted also?

No, it is not optional in the event.key. That would imply matching to the keycode irrespective of any shifts set, and there is no such facility. Where things are optional in library functions the documentation states so, and the assumed value resulting.

I'm trying to reset KeySeen to 0. Basically, I have the same problem here as above where I said I don't know how to write the syntax for the second button press. If 'and' only is a logical operator, and 'then' indicates a consequence, what's the syntaxis for a succession over time? First, I want the macro executed, then I want KeySeen to be reset to 0 so as to get back to the inital situation.

The syntax of a conditional test using if is

if <condition> then <action> end[/CODE]

I'm sure this is clear on the Lua website.

The condition might be compound, made up of separate tests joined by "and" or "or", with optional parentheses () to make things clearer or join otherwise ambiguous parts.

The action is a block of code which is performed if the condition is true. The code is executed in the order it is presented, if that's what you mean by 'over time'.

More fully 'if' statements can have 'else' actions too (or elseif for further alternative conditions, see later):

[CODE]if <condition> then <actiontrue> else <actionfalse> end[/CODE]

I understand why we need KeySeen, but I don't understand why we need it to be set to the keycode after the 'else'.

Because it then contains the last keycode actually seen, no matter what it was, so that the sequence you are looking for can be detected. That's the purpose of KeySeen - to not only mark that a key was seen but to remember if it was an A or a B. Else how will you ever detect the A-B or B-A sequence you need. It is only reset to 0 to start a new sequence once you've seen a A-B or B-A. Don't you see that this is logical and necessary?

If my understanding is correct, we start by resetting KeySeen to 0, then it is set to 186 or 57, depending on the first key signal, but since the script only activates after the 186 or 57 key being pressed, and hence KeySeen will always be set at 186 or 57, it will never get to the 'else' part, because we have an 'if" for both the 186 and 57 keys.

The two conditions should certainly NOT be just on 186 or 57, but 186 when the last key (keyseen) was 57, and vice versa. You are trying to detect A-B and B-A, not simply A or B as those alone tell you nothing.

So, if I interpret your comments correctly:

Sorry, you don't.

-- How should I write 'and if the key pressed after the 186 key is the 57 key', if I cannot use 'and'?

Who ever said you can't use 'and'? 'and' and 'or' are central to the idea of joint and alternative conditions! I see in your code you've used 'and' completely outside of any condition, which is wrong, but not where you want it, in the conditions!

I'm going to have to do it for you as I can't really afford any more time on this:

[CODE]
KeySeen=0

function AltitudeChange(keycode)
if keycode == 57 and KeySeen == 186 then
ipc.macro("LevelD767: ALTInc")
KeySeen = 0
elseif keycode == 186 and KeySeen == 57 then
ipc.macro("LevelD767: ALTDec")
KeySeen = 0
else
KeySeen = keycode
end
end

event.key(186, 8, "AltitudeChange")
event.key(57, 8, "AltitudeChange")
[/CODE]

Regards

Pete

Link to comment
Share on other sites

Hi Pete,

Thanks for your reply, time and help. I've tried it, but unfortunately, it doesn't seem to work. The log tells me the keys are not assigned and the command is passed on to FS. I guess this would be easier if I just bought another Bodnar card to have the encoders work. That would prevent me from needing the Lua scripts.

Regards,

Basje

Link to comment
Share on other sites

I've tried it, but unfortunately, it doesn't seem to work. The log tells me the keys are not assigned and the command is passed on to FS

Yes, of course. They aren't assigned. If they do something in FS you don't want you'd need to assign them to something innocuous. The Lua event doesn't stop the keys, it just calls your function when the keys are seen.

BTW keycode 186 is the ;: key, and 57 is the 9 key on the main keyboard. I assumed you'd changed from using A and B? Naturally the keycodes in the Lua must correspond to those sent from your contraption.

Pete

Link to comment
Share on other sites

186 and 57 are the correct keycodes for what I'm doing. The "A" and "B" were just easier examples to explain my problem. 186 and 57 is also what appears in the FSUIPC log.

I've deleted both keys from the default FS assignments and from any FSUIPC assignment. So the only thing that should do something is the Lua script, but nothing happens.

I have a macro file called "LevelD767.MCRO" with two macros called "ALTInc" and "ALTDec" that work if I assign a simple key to them in FSUIPC:

88=ALTInc=R1:Xe3a0*Xa1cc,19

89=ALTDec=R1:Xe4a0*Xa1cc,19

The Lua file itself is called "AltitudeChange.lua". FSUIPC.ini mentions the file twice (without the .lua extension): one time in the [Auto] section and one time in the [LuaFiles] section. I've tried changing that into [Auto.Level D Simulations B767-300ER] and [LuaFiles.Level D Simulations B767-300ER] (the name of the profile I'm using), FSUIPC changed the latter in [LuaFiles] again after reloading, but still, nothing happens in the simulator.

Link to comment
Share on other sites

I've deleted both keys from the default FS assignments and from any FSUIPC assignment. So the only thing that should do something is the Lua script, but nothing happens.

I have a macro file called "LevelD767.MCRO" with two macros called "ALTInc" and "ALTDec" that work if I assign a simple key to them in FSUIPC:

88=ALTInc=R1:Xe3a0*Xa1cc,19

89=ALTDec=R1:Xe4a0*Xa1cc,19

Ome thing. I notice there's a space in your macro calls:

 ipc.macro("LevelD767: ALTInc")[/CODE]

I'm not sure whether spaces are discarded -- it may be looking for macro names with a space too. Try removing the spaces in both macro calls.

In FSUIPC's logging options set the Lua logging option, so that it creates its own log.

Close FS, and edit your Lua program, adding this line in the function, before the first 'if ...' line:

[CODE]ipc.log("In function, keycode = " .. keycode .. " KeySeen = " .. KeySeen)[/CODE]

Show me both the FSUIPC log and the Log for the Lua plugin.

and [LuaFiles.Level D Simulations B767-300ER]

There's only ever one LuaFiles section. It simply gives FSUIPC the index number for every Lua file in your Modules folder. Those are only relevant when assigning a button or key to a Lua file, which doesn't apply in this case.

Pete

Link to comment
Share on other sites

I've deleted the spaces, but still, nothing happened. Then, I've added the line of code you told me:


KeySeen=0

function AltitudeChange(keycode)
ipc.log("In function, keycode = " .. keycode .. " KeySeen = " .. KeySeen)
if keycode == 57 and KeySeen == 186 then
ipc.macro("LevelD767:ALTInc")
KeySeen = 0
elseif keycode == 186 and KeySeen == 57 then
ipc.macro("LevelD767:ALTDec")
KeySeen = 0
else
KeySeen = keycode
end
end

event.key(186, 8, "AltitudeChange")
event.key(57, 8, "AltitudeChange")
[/CODE]

This is the FSUIPC log:

********* FSUIPC4, Version 4.703 by Pete Dowson *********

Reading options from "C:\FS Games\Microsoft Flight Simulator X\Modules\FSUIPC4.ini"

Trying to connect to SimConnect Acc/SP2 Oct07 ...

User Name="XXX"

User Addr="XXX"

FSUIPC4 Key is provided

WIDEFS7 not user registered, or expired

Running inside FSX on Windows 7 (using SimConnect Acc/SP2 Oct07)

Module base=61000000

Wind smoothing fix is fully installed

DebugStatus=15

219 System time = 12/01/2012 19:18:07

219 FLT path = "C:\Users\XXX\Documents\Flight Simulator X Files\"

219 FS path = "C:\FS Games\Microsoft Flight Simulator X\"

890 LogOptions=80000000 00000001

890 SimConnect_Open succeeded: waiting to check version okay

29235 Running in "Microsoft Flight Simulator X", Version: 10.0.61472.0 (SimConnect: 10.0.61259.0)

29235 Initialising SimConnect data requests now

29235 FSUIPC Menu entry added

29282 c:\users\XXX\documents\flight simulator x files\767 EBBR.FLT

29282 C:\FS Games\Microsoft Flight Simulator X\SimObjects\Airplanes\LVLD_B763\B767-300.AIR

147671 System time = 12/01/2012 19:20:35, Simulator time = 19:18:37 (18:18Z)

147780 Aircraft="Level D Simulations B767-300ER - Boeing House Colors N767S"

147921 Starting everything now ...

148997 Advanced Weather Interface Enabled

179526 Sim stopped: average frame rate for last 33 secs = 18.8 fps

192131 LogOptions changed, now C0000000 00000001

196078 KEYDOWN: VK=186, Waiting=0, Repeat=N, Shifts=0

196078 .. Key not programmed -- passed on to FS

196078 KEYDOWN: VK=57, Waiting=0, Repeat=N, Shifts=0

196078 .. Key not programmed -- passed on to FS

196219 KEYUP: VK=186, Waiting=0

196219 KEYUP: VK=57, Waiting=0

196265 KEYDOWN: VK=186, Waiting=0, Repeat=N, Shifts=0

196265 .. Key not programmed -- passed on to FS

196265 KEYDOWN: VK=57, Waiting=0, Repeat=N, Shifts=0

196265 .. Key not programmed -- passed on to FS

196343 KEYUP: VK=186, Waiting=0

196343 KEYUP: VK=57, Waiting=0

196343 KEYDOWN: VK=186, Waiting=0, Repeat=N, Shifts=0

196343 .. Key not programmed -- passed on to FS

196390 KEYDOWN: VK=57, Waiting=0, Repeat=N, Shifts=0

196390 .. Key not programmed -- passed on to FS

196437 KEYUP: VK=186, Waiting=0

196437 KEYUP: VK=57, Waiting=0

196484 KEYDOWN: VK=186, Waiting=0, Repeat=N, Shifts=0

196484 .. Key not programmed -- passed on to FS

196484 KEYDOWN: VK=57, Waiting=0, Repeat=N, Shifts=0

196484 .. Key not programmed -- passed on to FS

196531 KEYUP: VK=186, Waiting=0

196531 KEYUP: VK=57, Waiting=0

196531 KEYDOWN: VK=186, Waiting=0, Repeat=N, Shifts=0

196531 .. Key not programmed -- passed on to FS

196562 KEYDOWN: VK=57, Waiting=0, Repeat=N, Shifts=0

196562 .. Key not programmed -- passed on to FS

196609 KEYUP: VK=186, Waiting=0

196655 KEYUP: VK=57, Waiting=0

196655 KEYDOWN: VK=186, Waiting=0, Repeat=N, Shifts=0

196655 .. Key not programmed -- passed on to FS

196655 KEYDOWN: VK=57, Waiting=0, Repeat=N, Shifts=0

196655 .. Key not programmed -- passed on to FS

196749 KEYUP: VK=186, Waiting=0

196796 KEYUP: VK=57, Waiting=0

196796 KEYDOWN: VK=186, Waiting=0, Repeat=N, Shifts=0

196796 .. Key not programmed -- passed on to FS

196796 KEYDOWN: VK=57, Waiting=0, Repeat=N, Shifts=0

196796 .. Key not programmed -- passed on to FS

196874 KEYUP: VK=186, Waiting=0

196874 KEYUP: VK=57, Waiting=0

196921 KEYDOWN: VK=186, Waiting=0, Repeat=N, Shifts=0

196921 .. Key not programmed -- passed on to FS

196921 KEYDOWN: VK=57, Waiting=0, Repeat=N, Shifts=0

196921 .. Key not programmed -- passed on to FS

197108 KEYUP: VK=186, Waiting=0

197108 KEYUP: VK=57, Waiting=0

198200 KEYDOWN: VK=186, Waiting=0, Repeat=N, Shifts=0

198200 .. Key not programmed -- passed on to FS

198247 KEYDOWN: VK=57, Waiting=0, Repeat=N, Shifts=0

198247 .. Key not programmed -- passed on to FS

198730 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

198730 .. Key not programmed -- passed on to FS

198761 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

198761 .. Key not programmed -- passed on to FS

198808 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

198808 .. Key not programmed -- passed on to FS

198855 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

198855 .. Key not programmed -- passed on to FS

198902 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

198902 .. Key not programmed -- passed on to FS

198949 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

198949 .. Key not programmed -- passed on to FS

198995 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

198995 .. Key not programmed -- passed on to FS

199042 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

199042 .. Key not programmed -- passed on to FS

199073 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

199073 .. Key not programmed -- passed on to FS

199120 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

199120 .. Key not programmed -- passed on to FS

199167 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

199167 .. Key not programmed -- passed on to FS

199214 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

199214 .. Key not programmed -- passed on to FS

199261 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

199261 .. Key not programmed -- passed on to FS

199307 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

199307 .. Key not programmed -- passed on to FS

199354 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

199354 .. Key not programmed -- passed on to FS

199385 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

199385 .. Key not programmed -- passed on to FS

199432 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

199432 .. Key not programmed -- passed on to FS

199479 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

199479 .. Key not programmed -- passed on to FS

199526 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

199526 .. Key not programmed -- passed on to FS

199573 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

199573 .. Key not programmed -- passed on to FS

199619 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

199619 .. Key not programmed -- passed on to FS

199666 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

199666 .. Key not programmed -- passed on to FS

199666 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

199666 .. Key not programmed -- passed on to FS

199697 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

199713 .. Key not programmed -- passed on to FS

199744 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

199744 .. Key not programmed -- passed on to FS

199791 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

199791 .. Key not programmed -- passed on to FS

199916 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

199916 .. Key not programmed -- passed on to FS

199963 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

199963 .. Key not programmed -- passed on to FS

200009 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

200009 .. Key not programmed -- passed on to FS

200056 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

200056 .. Key not programmed -- passed on to FS

200103 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

200103 .. Key not programmed -- passed on to FS

200150 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

200150 .. Key not programmed -- passed on to FS

200181 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

200181 .. Key not programmed -- passed on to FS

200228 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

200228 .. Key not programmed -- passed on to FS

200275 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

200275 .. Key not programmed -- passed on to FS

200321 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

200321 .. Key not programmed -- passed on to FS

200368 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

200368 .. Key not programmed -- passed on to FS

200415 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

200415 .. Key not programmed -- passed on to FS

200462 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

200462 .. Key not programmed -- passed on to FS

200696 FS Control Sent: Ctrl=65765, Param=-10402

200727 FS Control Sent: Ctrl=65765, Param=-10662

213098 Sim stopped: average frame rate for last 21 secs = 21.9 fps

222099 LogOptions changed, now 00000000 00000001

245047 Sim stopped: average frame rate for last 23 secs = 22.8 fps

[Log closed by user request, and continued in new file]

256653 System time = 12/01/2012 19:22:24, Simulator time = 19:19:52 (18:19Z)

256653 *** FSUIPC log file being closed

Average frame rate for running time of 76 secs = 20.8 fps

Memory managed: 54 Allocs, 45 Freed

********* FSUIPC Log file closed ***********

When finishing my turn clockwise, the 57 key sometimes keeps on sending signals (like you can see in the log file). I currently inhibit that by turning it just one more detent, but I think I just need to have some more trying in order to avoid that.

Unfortunately, there seems to be no Lua log file. I first checked the 'Lua program logging' box in FSUIPC, then, noticing there was no log file, tried adding 'LogLua=Yes' to the .ini file, but still no luck. This log file should be in the Modules folder, right?

Regards,

Basje

Link to comment
Share on other sites

I've deleted the spaces, but still, nothing happened. Then, I've added the line of code you told me:

...

This is the FSUIPC log:

********* FSUIPC4, Version 4.703 by Pete Dowson *********

Ouch! Please please update your FSUIPC. The current version is 4.756. See the Download Links subforum. I didn't realise we might have been talking cross-purposes, as a lot has happened in the months since 4.703!

Unfortunately, there seems to be no Lua log file. I first checked the 'Lua program logging' box in FSUIPC, then, noticing there was no log file, tried adding 'LogLua=Yes' to the .ini file, but still no luck. This log file should be in the Modules folder, right?

Yes. Your Lua plug-in isn't loading, it isn't running. That's why it does nothing. How are you starting it?

Try the current version of FSUIPC, then get back to me -- I'd need to see your FSUIPC4.INI file.

Pete

Link to comment
Share on other sites

My FSUIPC version was stated in my original post, but I must apologize: I should have updated the module on my own initiative. This is the log file:

********* FSUIPC4, Version 4.756 by Pete Dowson *********

User Name="XXX"

User Addr="XXX"

FSUIPC4 Key is provided

WIDEFS7 not user registered, or expired

[Continuation log requested by user]

Running inside FSX on Windows 7

Module base=61000000

118124 System time = 12/01/2012 20:02:58, Simulator time = 20:02:09 (19:02Z)

118124 LogOptions changed, now C0000000 00000001

120339 KEYDOWN: VK=186, Waiting=0, Repeat=N, Shifts=0

120339 .. Key not programmed -- passed on to FS

120339 KEYDOWN: VK=57, Waiting=0, Repeat=N, Shifts=0

120339 .. Key not programmed -- passed on to FS

120479 KEYUP: VK=186, Waiting=0

120479 KEYUP: VK=57, Waiting=0

120479 KEYDOWN: VK=186, Waiting=0, Repeat=N, Shifts=0

120479 .. Key not programmed -- passed on to FS

120511 KEYDOWN: VK=57, Waiting=0, Repeat=N, Shifts=0

120511 .. Key not programmed -- passed on to FS

120604 KEYUP: VK=186, Waiting=0

120604 KEYUP: VK=57, Waiting=0

120651 KEYDOWN: VK=186, Waiting=0, Repeat=N, Shifts=0

120651 .. Key not programmed -- passed on to FS

120651 KEYDOWN: VK=57, Waiting=0, Repeat=N, Shifts=0

120651 .. Key not programmed -- passed on to FS

120745 KEYUP: VK=186, Waiting=0

120745 KEYUP: VK=57, Waiting=0

120776 KEYDOWN: VK=186, Waiting=0, Repeat=N, Shifts=0

120776 .. Key not programmed -- passed on to FS

120776 KEYDOWN: VK=57, Waiting=0, Repeat=N, Shifts=0

120776 .. Key not programmed -- passed on to FS

120869 KEYUP: VK=186, Waiting=0

120869 KEYUP: VK=57, Waiting=0

120916 KEYDOWN: VK=186, Waiting=0, Repeat=N, Shifts=0

120916 .. Key not programmed -- passed on to FS

120963 KEYDOWN: VK=57, Waiting=0, Repeat=N, Shifts=0

120963 .. Key not programmed -- passed on to FS

121041 KEYUP: VK=186, Waiting=0

121041 KEYUP: VK=57, Waiting=0

121088 KEYDOWN: VK=186, Waiting=0, Repeat=N, Shifts=0

121088 .. Key not programmed -- passed on to FS

121135 KEYDOWN: VK=57, Waiting=0, Repeat=N, Shifts=0

121135 .. Key not programmed -- passed on to FS

121181 KEYUP: VK=186, Waiting=0

121213 KEYUP: VK=57, Waiting=0

121259 KEYDOWN: VK=186, Waiting=0, Repeat=N, Shifts=0

121259 .. Key not programmed -- passed on to FS

121306 KEYDOWN: VK=57, Waiting=0, Repeat=N, Shifts=0

121306 .. Key not programmed -- passed on to FS

121400 KEYUP: VK=186, Waiting=0

121400 KEYUP: VK=57, Waiting=0

122757 KEYDOWN: VK=186, Waiting=0, Repeat=N, Shifts=0

122757 .. Key not programmed -- passed on to FS

122757 KEYDOWN: VK=57, Waiting=0, Repeat=N, Shifts=0

122757 .. Key not programmed -- passed on to FS

123272 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

123272 .. Key not programmed -- passed on to FS

123319 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

123319 .. Key not programmed -- passed on to FS

123365 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

123365 .. Key not programmed -- passed on to FS

123412 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

123412 .. Key not programmed -- passed on to FS

123459 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

123459 .. Key not programmed -- passed on to FS

123506 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

123506 .. Key not programmed -- passed on to FS

123537 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

123537 .. Key not programmed -- passed on to FS

123584 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

123584 .. Key not programmed -- passed on to FS

123631 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

123631 .. Key not programmed -- passed on to FS

123677 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

123677 .. Key not programmed -- passed on to FS

123724 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

123724 .. Key not programmed -- passed on to FS

123771 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

123771 .. Key not programmed -- passed on to FS

123802 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

123802 .. Key not programmed -- passed on to FS

123849 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

123849 .. Key not programmed -- passed on to FS

123896 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

123896 .. Key not programmed -- passed on to FS

123943 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

123943 .. Key not programmed -- passed on to FS

123989 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

123989 .. Key not programmed -- passed on to FS

124021 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

124021 .. Key not programmed -- passed on to FS

124067 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

124067 .. Key not programmed -- passed on to FS

124114 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

124114 .. Key not programmed -- passed on to FS

124161 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

124161 .. Key not programmed -- passed on to FS

124208 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

124208 .. Key not programmed -- passed on to FS

124255 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

124255 .. Key not programmed -- passed on to FS

124286 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

124286 .. Key not programmed -- passed on to FS

124333 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

124333 .. Key not programmed -- passed on to FS

124379 KEYDOWN: VK=57, Waiting=0, Repeat=Y, Shifts=0

124379 .. Key not programmed -- passed on to FS

129044 LogOptions changed, now 00000000 00000001

195407 Sim stopped: average frame rate for last 66 secs = 22.8 fps

206093 System time = 12/01/2012 20:04:26, Simulator time = 20:03:22 (19:03Z)

206093 *** FSUIPC log file being closed

Average frame rate for running time of 113 secs = 22.4 fps

G3D fix: Passes 12288, Null pointers 0, Bad pointers 0, Separate instances 0

Memory managed: 71 Allocs, 71 Freed

********* FSUIPC Log file closed ***********

This is my FSUIPC.INI:

[General]

UpdatedByVersion=4756

History=ILRCCQBT0JKTYJ7PUA3O9

MouseWheelTrim=No

MouseWheelTrimSpeed=1

JoystickTimeout=20

PollGFTQ6=Yes

BlankDisplays=No

FixControlAccel=No

FixMachSpeedBug=No

VisibilityOptions=No

OneCloudLayer=No

CloudTurbulence=No

CloudIcing=No

GenerateCirrus=No

SuppressCloudTurbulence=No

MaxIce=-4

MinIce=-4

UpperWindGusts=No

SuppressWindTurbulence=No

SuppressWindVariance=No

WindTurbulence=No

TurbulenceRate=1.0,5.0

TurbulenceDivisor=20,20,40,40

SuppressAllGusts=No

MaxSurfaceWind=0

WindLimitLevel=200

WindDiscardLevel=400

WindAjustAltitude=No

WindAjustAltitudeBy=2000

SmoothBySimTime=No

WindSmoothing=Yes

WindSmoothness=2

WindSmoothAirborneOnly=Yes

PressureSmoothness=0

TemperatureSmoothness=0

DisconnTrimForAP=No

ZeroElevForAPAlt=No

ThrottleSyncAll=No

WhiteMessages=No

ShowPMcontrols=No

SpoilerIncrement=512

MagicBattery=No

RudderSpikeRemoval=No

ElevatorSpikeRemoval=No

AileronSpikeRemoval=No

ReversedElevatorTrim=No

ClockSync=No

ClockSyncMins=5

ClearWeatherDynamics=No

OwnWeatherChanges=No

TimeForSelect=4

LoadFlightMenu=No

LoadPlanMenu=No

PauseAfterCrash=No

BrakeReleaseThreshold=75

SaveDataWithFlights=No

ZapSound=firework

ShortAircraftNameOk=No

UseProfiles=Yes

TCASid=Flight

TCASrange=40

AxisCalibration=No

DirectAxesToCalibs=No

ShowMultilineWindow=Yes

SuppressSingleline=No

SuppressMultilineFS=No

AxisIntercepts=No

DontResetAxes=No

GetNearestAirports=Yes

WeatherReadFactor=2

WeatherRewriteSeconds=1

CustomWeatherModify=No

SimConnectStallTime=1

LuaRerunDelay=66

Console=No

ConsoleWindow=125,125,802,544

DeleteVehiclesForAES=Yes

EnableMouseLook=No

AxesWrongRange=No

InitDelay=0

FSVersionUsed="Microsoft Flight Simulator X",10.0.61472.0

SimConnectUsed=10.0.61259.0

[JoyNames]

AutoAssignLetters=No

1=Saitek X52 Pro Flight Controller

1.GUID={D59C74D0-CAA5-11E0-8001-444553540000}

0=BU0836X Interface

0.GUID={81ADF9F0-CA4D-11E0-8001-444553540000}

[buttons]

ButtonRepeat=20,10

2=P1,5,C65570,0

[MacroFiles]

1=LevelD767

[AutoSave]

AutoSaveEnabled=No

Next=1

Interval=60

Files=10

SaveOnGround=No

[GPSout]

GPSoutEnabled=No

Port=COM0

Speed=4800

Interval=2000

PosTo6Decimal=No

Sentences=

[GPSout2]

GPSoutEnabled=No

Port=<none set>

Speed=4800

Interval=2000

PosTo6Decimal=No

Sentences=

[WideServer]

WideFSenabled=Yes

[sounds]

Path=C:\FS Games\Microsoft Flight Simulator X\Sound\

Device1=Primair geluidsstuurprogramma

Device2=Luidsprekers (Realtek High Definition Audio)

Device3=Realtek Digital Output (Realtek High Definition Audio)

[Profile.Level D Simulations B767-300ER]

1=Level D Simulations B767-300ER - Delta Air Lines (Old Livery)

2=Level D Simulations B767-300ER - American Airlines "oneworld" N395AN

3=Level D Simulations B767-300ER - Delta NC

4=Level D Simulations B767-300ER - Varig [DXT3]

5=Level D Simulations B767-300ER

6=Level D Simulations B767-300ER PW

7=Level D Simulations B767-300ER RR

8=Level D Simulations B767-300ER - Air France

9=Level D Simulations B767-300ER - Alitalia

10=Level D Simulations B767-300ER - British Airways

11=Level D Simulations B767-300ER - KLM Royal Dutch Airlines

12=Level D Simulations B767-300ER - North American Airlines

13=Level D Simulations B767-300ER - United Airlines (Old Livery)

14=Level D Simulations B767-300ER - Aeroflot VP-BAX

15=Level D Simulations B767-300ER - Air Berlin Winglet

16=Level D Simulations B767-300ER - Liberty Studios Delta Airlines

17=Level D Simulations B767-300ER - Liberty Studios"Continental Airlines"

18=Level D Simulations B767-300ER - United Airlines (Old Livery) - 000

19=Level D Simulations B767-300ER Winglet

20=Level D Simulations B767-300ER PW Winglet

21=Level D Simulations B767-300ER RR Winglet

22=Level D Simulations B767-300ER Winglet - Air Berlin Winglet

23=Level D Simulations B767-300ER Winglet - All Nippon Airways(JA619A)

24=Level D Simulations B767-300ER Winglet - United WL

25=Level D Simulations B767-300ER - United WL

26=Level D Simulations B767-300ER - Gulf Air

27=Level D Simulations B767-300ER - Qantas Airways

28=Level D Simulations B767-300ER - Qantas Airways - 000

29=Level D Simulations B767-300ER - South African Airways [DXT3]

30=Level D Simulations B767-300ER - Air Canada C-GGFJ

31=Level D Simulations B767-300ER - Qantas Freight VH-EFR

32=Level D Simulations B767-300ER - Boeing House Colors N767S

33=Level D Simulations B767-300ER - LOT Polish Airlines SP-LPC

34=Level D Simulations B767-300ER - Czech Airlines

35=Level D Simulations B767-300ER/GE - UPS Cargo

36=Level D Simulations B767-300ER THY

37=Level D Simulations B767-300ER Winglet - Air Berlin Winglet

38=Level D Simulations B767-300ER Winglet - All Nippon Airways(JA619A)

39=Level D Simulations B767-300ER Winglet - United WL

40=Level D Simulations B767-300ER Winglet - Finnair

41=Level D Simulations B767-300ER qantas GE Winglet

42=Level D Simulations B767-300ER - Star Alliance (Air Canada)

43=Level D Simulations B767-300ER - Delta Air Lines OOOC N116DL

44=Level D Simulations B767-300ER Winglet - AeroMexico NC Winglet

45=Level D Simulations B767-300ER Winglet - Boeing "Dreamliner" House Colors

46=Level D Simulations B767-300ER Winglet - Florida West International Airways N316LA

47=Level D Simulations B767-300ER Winglet - LAN cargo

[buttons.Level D Simulations B767-300ER]

0=P0,0,CM1:41,0

1=U0,0,CM1:41,0

2=P0,0,CM1:42,0

3=U0,0,CM1:42,0

4=P0,0,CM1:72,0

5=U0,0,CM1:73,0

6=P0,0,CM1:75,0

7=U0,0,CM1:74,0

8=P0,0,CM1:76,0

9=U0,0,CM1:77,0

10=P0,18,CM1:66,0

11=P0,18,CM1:66,0

12=U0,18,CM1:67,0

13=U0,18,CM1:67,0

14=P0,18,CM1:68,0

15=P0,18,CM1:68,0

16=U0,18,CM1:69,0

17=U0,18,CM1:69,0

18=P0,18,CM1:70,0

19=P0,18,CM1:70,0

20=U0,18,CM1:71,0

21=U0,18,CM1:71,0

22=P0,16,CM1:25,0

23=U0,16,CM1:25,0

24=P0,16,CM1:24,0

25=U0,16,CM1:24,0

26=P0,25,CM1:28,0

27=U0,25,CM1:28,0

28=P0,25,CM1:29,0

29=U0,25,CM1:29,0

30=P0,28,CM1:27,0

31=U0,28,CM1:27,0

32=P0,28,CM1:26,0

33=U0,28,CM1:26,0

34=P0,27,CM1:31,0

35=U0,27,CM1:31,0

36=P0,27,CM1:30,0

37=U0,27,CM1:30,0

38=P0,26,CM1:61,0

39=U0,26,CM1:61,0

40=P0,26,CM1:82,0

41=P0,26,CM1:82,0

42=U0,26,CM1:83,0

43=U0,26,CM1:83,0

44=P0,22,CM1:78,0

45=U0,22,CM1:79,0

46=P0,22,CM1:80,0

47=U0,22,CM1:81,0

48=P0,17,CM1:39,0

49=U0,17,CM1:39,0

50=P0,17,CM1:40,0

51=U0,17,CM1:40,0

52=P0,13,CM1:32,0

53=U0,13,CM1:32,0

54=P0,13,CM1:33,0

55=U0,13,CM1:33,0

56=P0,13,CM1:34,0

57=U0,13,CM1:34,0

58=P0,13,CM1:35,0

59=U0,13,CM1:35,0

60=P0,8,CM1:1,0

61=U0,8,CM1:1,0

62=P0,8,CM1:3,0

63=U0,8,CM1:3,0

64=P0,8,CM1:2,0

65=U0,8,CM1:2,0

66=P0,9,CM1:11,0

67=U0,9,CM1:11,0

68=P0,10,CM1:4,0

69=U0,10,CM1:4,0

70=P0,10,CM1:5,0

71=U0,10,CM1:5,0

72=P0,10,CM1:6,0

73=U0,10,CM1:6,0

74=P0,29,CM1:10,0

75=U0,29,CM1:10,0

76=P0,30,CM1:9,0

77=U0,30,CM1:9,0

78=P0,31,CM1:12,0

79=U0,31,CM1:12,0

80=P0,31,CM1:13,0

81=U0,31,CM1:13,0

82=P0,5,CM1:7,0

83=U0,5,CM1:7,0

84=P0,4,CM1:44,0

85=U0,4,CM1:44,0

86=P0,3,CM1:38,0

87=U0,3,CM1:38,0

88=P0,2,CM1:49,0

89=U0,2,CM1:49,0

90=P0,24,CM1:48,0

91=U0,24,CM1:48,0

92=P0,20,CM1:46,0

93=P0,20,CM1:46,0

94=U0,20,CM1:47,0

95=U0,20,CM1:47,0

96=P0,1,CM1:54,0

97=U0,1,CM1:54,0

98=P0,19,CM1:53,0

99=U0,19,CM1:53,0

100=P0,6,CM1:50,0

101=U0,6,CM1:50,0

102=P0,7,CM1:36,0

103=P0,7,CM1:36,0

104=U0,7,CM1:37,0

105=P0,21,CM1:55,0

106=U0,21,CM1:55,0

107=P0,14,CM1:60,0

108=P0,11,CM1:59,0

109=P0,23,C65752,0

110=U0,23,C65752,0

111=P1,1,CM1:23,0

112=U1,1,CM1:23,0

113=P1,7,K66,8

114=P1,4,CM1:15,0

115=P1,23,CM1:62,0

116=P1,8,CM1:92,0

117=P1,9,CM1:93,0

118=P1,10,CM1:94,0

119=P1,11,CM1:95,0

120=P1,12,CM1:97,0

121=P1,13,CM1:96,0

122=P0,15,CM1:91,0

124=P0,12,CM1:90,0

[Axes.Level D Simulations B767-300ER]

0=1Z,256,F,65765,0,0,0

[JoystickCalibration.Level D Simulations B767-300ER]

AllowSuppressForPFCquad=Yes

ExcludeThrottleSet=Yes

ExcludeMixtureSet=Yes

ExcludePropPitchSet=Yes

SepRevsJetsOnly=No

ApplyHeloTrim=No

UseAxisControlsForNRZ=No

FlapsSetControl=0

FlapDetents=No

ReverserControl=66292

Reverser1Control=66422

Reverser2Control=66425

Reverser3Control=66428

Reverser4Control=66431

MaxThrottleForReverser=256

AileronTrimControl=66731

RudderTrimControl=66732

CowlFlaps1Control=66162

CowlFlaps2Control=66163

CowlFlaps3Control=66164

CowlFlaps4Control=66165

SteeringTillerControl=0

MaxSteerSpeed=60

MapThrottle=Yes

Throttle1=-15473,-11572,-8062,16128

Spoilers=-16380,6761,14336,16380/16

SteeringTiller=-16380,-512,512,16380

[Profile.757Captain]

1=Captain Sim 757-200 FSX 10

[JoystickCalibration]

AllowSuppressForPFCquad=Yes

ExcludeThrottleSet=Yes

ExcludeMixtureSet=Yes

ExcludePropPitchSet=Yes

SepRevsJetsOnly=No

ApplyHeloTrim=No

UseAxisControlsForNRZ=No

FlapsSetControl=0

FlapDetents=No

ReverserControl=66292

Reverser1Control=66422

Reverser2Control=66425

Reverser3Control=66428

Reverser4Control=66431

MaxThrottleForReverser=256

AileronTrimControl=66731

RudderTrimControl=66732

CowlFlaps1Control=66162

CowlFlaps2Control=66163

CowlFlaps3Control=66164

CowlFlaps4Control=66165

SteeringTillerControl=0

MaxSteerSpeed=60

Throttle=-16193,16192

[buttons.757Captain]

0=P0,3,K77,9

1=U0,3,K77,9

3=P0,8,C65751,0

4=U0,8,C65751,0

5=P0,9,C65560,0

6=U0,9,C65560,0

7=P0,10,C66240,0

8=U0,10,C66240,0

9=P0,29,C66239,0

10=U0,29,C66239,0

11=P0,30,C66379,0

12=U0,30,C66379,0

13=P0,31,C66378,0

14=U0,31,C66378,0

15=P0,4,C65750,0

16=U0,4,C65750,0

17=P0,16,Cx05000AF8,x01

18=U0,16,Cx09000AF8,x01

19=P0,21,Cx05000B50,x03

20=U0,21,Cx05000B50,x03

21=P0,17,C65793,0

22=U0,17,C65793,0

23=P0,27,C66596,0

24=U0,27,C66596,0

28=P0,13,C65858,0

29=U0,13,C65858,0

[Keys.Level D Simulations B767-300ER]

11=N85,8,M1:98,0

13=72,8,M1:99,0

15=73,8,M1:100,0

17=65,8,M1:101,0

[Profile.Caravan]

1=Cessna Grand Caravan Paint1

2=Cessna Grand Caravan Paint2

3=Cessna Grand Caravan Paint3

4=Cessna Grand Caravan

[JoystickCalibration.Caravan]

AllowSuppressForPFCquad=Yes

ExcludeThrottleSet=Yes

ExcludeMixtureSet=Yes

ExcludePropPitchSet=Yes

SepRevsJetsOnly=No

ApplyHeloTrim=No

UseAxisControlsForNRZ=No

FlapsSetControl=0

FlapDetents=No

ReverserControl=66292

Reverser1Control=66422

Reverser2Control=66425

Reverser3Control=66428

Reverser4Control=66431

MaxThrottleForReverser=256

AileronTrimControl=66731

RudderTrimControl=66732

CowlFlaps1Control=66162

CowlFlaps2Control=66163

CowlFlaps3Control=66164

CowlFlaps4Control=66165

SteeringTillerControl=0

MaxSteerSpeed=60

Throttle1=-16193,-10000,-512,16192

MapThrottle=Yes

[buttons.Caravan]

0=P0,4,C65750,0

1=U0,4,C65750,0

2=P0,8,C65751,0

3=U0,8,C65751,0

4=P0,9,C65560,0

5=U0,9,C65560,0

6=P0,10,C66240,0

7=U0,10,C66240,0

8=P0,29,C66239,0

9=U0,29,C66239,0

10=P0,30,C66379,0

11=U0,30,C66379,0

12=P0,23,C65752,0

13=U0,23,C65752,0

14=P0,12,K51,9

16=P0,15,K50,9

17=P1,7,K66,8

[Profile.CitationX]

1=PIC Citation X Spain

[buttons.CitationX]

0=P0,8,C65751,0

1=U0,8,C65751,0

2=P1,5,C65570,0

3=U1,5,C65570,0

[Auto]

1=AltitudeChange

[LuaFiles]

1=AltitudeChange

-----------------------------

The Lua script is called 'AltitudeChange.lua' and is in my Modules folder. Still no Lua log though, I'm afraid.

Link to comment
Share on other sites

Aha! here's the reason your Lua is never running:

[Auto]

1=AltitudeChange

That needs to be

[Auto]

1=Lua AltitudeChange

The [Auto] section is for automatically running Macros -- Lua plug-ins are one type, but equally you could run your macros directly there too. FSUIPC needs to see the Lua prefix, as it does in the assignments, so it knows your meaning.

Regards

Pete

Link to comment
Share on other sites

Hi Pete,

That fixed it, thanks. The script works, but the hardware doesn't do its job like it's supposed to:

- I supposed I would always have two different signals when turning in the same direction. I've noticed sometimes, at the end of a turn, the encoder sends again the first of two signals. When I start turning again, this messes up everything.

- That's only when I'm lucky: most of the times, the first signal is indeed again given, but in a loop. Needless to say that this also isn't practical.

Thanks for all your help, but I guess the software can't fix it all.

I'll buy you a coffee if you're ever in the Brussels area!

Regards,

Basje

Link to comment
Share on other sites

That fixed it, thanks. The script works, but the hardware doesn't do its job like it's supposed to

I had wondered when you said what you'd done how it could work. The decoding of simple encoders with only two lines out needs thought, and trying to put it all through a keyboard encoder rather than a joystick button type interface looked a little freaky. All the encoders I've ever used had separate outputs pulsing up and down for each direction, which makes things dead easy. I guess they must be more expensive or more difficult to come across though.

For the simpler types, Bob Church summarised it quite nicely, and I'm sure he won't mind me quoting his words here:

"Normally the rotary encoders I've seen are set up to overlap the A and B

pulses by half a pulse width so the signals are out of phase with each

other half the time. A goes high, B goes high half a pulse width later,

then A goes low, again half a pulse width after that, and finally B goes

low after a fourth half pulse width. If you rotate the other way the edges

will reverse order, B will go high first, A second. If you only keep track

of the state of A or of B, you can't really tell which way it's rotating. A

will always be seen before B and B will always be seen before A.

You need to know if A was high or low when B went low, (pick an edge rather

than the pulse itself). Then to determine the direction you need to know if

the change on one pulse happened before or after the the other pulse. If A

falls before B, it's going one way. If B falls before A it's going the

other way".

Now if you could arrange that via a keyboard interface and still detect the edges by keypress and release type signals, I suppose you could handle it with a Lua plug-in. but there's a lot of Ifs there.

Check out the Leo Bodnar website. His cards aren't terribly expensive and are really (really!) easy to use.

Regards

Pete

Link to comment
Share on other sites

Pete,

I wasn't able to make the Lua plugin you eventually made for me. If it gets any more difficult, I think I'd need to spend a lot, but then really a lot, of time studying. I already own one of Bodnar's cards for my custom-made overhead panel. Those cards are indeed very easy to use. I'll consider that, thanks!

Basje

Link to comment
Share on other sites

A bit of info on encoders.

Have a read through on this post in the xplane forums,it give a bit of an insight into encoders, and particularly with leos card.

http://forums.x-plane.org/index.php?showtopic=44196

Also read the bit about whether the encoder is full, half or quarter wave. Makes a difference electrically, particularly with coding as well.

Link to comment
Share on other sites

A bit of info on encoders.

Have a read through on this post in the xplane forums,it give a bit of an insight into encoders, and particularly with leos card.

http://forums.x-plan...showtopic=44196

Also read the bit about whether the encoder is full, half or quarter wave. Makes a difference electrically, particularly with coding as well.

Thanks! I've freed four entries on my Bodnar card by getting rid of momentary switches (which I will connect to the keyboard I've hacked). The encoder was wired and configured in a second. Will try to make the same encoder work on two different gauges (ALT and VS) with a DPDT switch tomorrow, as explained on the 737ng.co.uk site. If all goes well, I'll order a new card to wire more encoders.

Thanks to both of you for your kind help and explanations!

Basje

Link to comment
Share on other sites

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.