Jump to content
The simFlight Network Forums

Configuring Delays for Offsets


Recommended Posts

I am trying to program my APU panel. I have two switches -- a MASTER latching type switch and a START/STOP momentary switch. The MASTER switch has a single LED -- ON and the START/STOP switch has two LEDs -- START and RUN. I am using the following offsets for the START/STOP switch

  1. Down: 0B58 Set Variable = 0 (to turn the APU on with a push of the switch)
  2. Up: 0B58 Set Variable = 0
  3. Down: 0B58 Set Variable = 5 (to turn the APU off with a second push of the switch)

This works just fine however, this switch should not be operable unless the MASTER is in the down (ON) position. So how can I inhibit the operation of the START/STOP switch until the MASTER is in the down (ON) position and stop the APU with the MASTER switch in the UP (OFF) position?

LEDs

According the the LEAR45 manual, pushing the momentary START/STOP switch initiates the start cycle of the APU and illuminates the START light in the switch. When the output of the APU reaches 75% the START light goes out and the RUN light is illuminated.

I can get the START light to illuminate with offset 0B58 Set Variable = 0 and the RUN light with offset 0B53 setbit. What I need to do is turn OFF the START light after say 10 seconds and then delay the RUN light by 12 seconds.

Thanks

Alan

Link to comment
Share on other sites

This works just fine however, this switch should not be operable unless the MASTER is in the down (ON) position. So how can I inhibit the operation of the START/STOP switch until the MASTER is in the down (ON) position and stop the APU with the MASTER switch in the UP (OFF) position?

You don't mention how these are programmed, so it is difficult to advise. Are you writing a program, as it sounds like by your mentioning of "0B58". Or is this all by assignments in FSUIPC? If it's the latter than you can make the operation of one switch conditional on another by adding the conditions in the assignment lines in the FSUIPC INI file. The advanced user's guide tells you all about conditions.

I can get the START light to illuminate with offset 0B58 Set Variable = 0 and the RUN light with offset 0B53 setbit. What I need to do is turn OFF the START light after say 10 seconds and then delay the RUN light by 12 seconds.

You'll need a program to do that. It would be a short Lua plug in. You could sort the whole thing out with a little plug-in.

Regards

Pete

Link to comment
Share on other sites

As the switches are programmed in InterfaceIT via WideClient can a Lua script still be used?

Yes.. The WideClient support for Lua plug-ins includes most, but not all of the features in the FSUIPC implementation, plus some additional features. The documentation explicitly says which does and does not apply.

The only entry options I see in Interface IT are for Offsets.

Sorry, I don't know what you are talking about. What is "Interface IT"?

Pete

Link to comment
Share on other sites

Pete

InterfaceIT is a software package from Flight Deck Solutions. It's used to program the functions of the switches and LEDs attached to their interface cards. It has various options including Update FSUIPC for Down (On) and Up (Off) for the switch functions. That is where I entered the Offset 0B58 which I got from the FSUIPC Offset listing for APU start using Set Variable with a value of 0 (the guide says any value of zero turns the APU on and a value of more than zero turns the APU off). This works fine as the APU starts and stops with the switch programmed this way. InterfaceIT doesn't allow for Lua scripts which is why I asked of the switch and LED functions could include conditions. I will read up on adding these to the INI file to get the switches to work as needed.

The real issue is the LED programming as I didn't see a way to add a delay to the RUN light offset. If this could be done through adding something to the entry in the INI file and then adding a condition to the START light offset such that it is turned off when the RUN light offset is sent, then the lights would work as required.

Hope that makes some sense.

Thanks

Alan

Link to comment
Share on other sites

InterfaceIT is a software package from Flight Deck Solutions. It's used to program the functions of the switches and LEDs attached to their interface cards. It has various options including Update FSUIPC for Down (On) and Up (Off) for the switch functions. That is where I entered the Offset 0B58 which I got from the FSUIPC Offset listing for APU start using Set Variable with a value of 0 (the guide says any value of zero turns the APU on and a value of more than zero turns the APU off). This works fine as the APU starts and stops with the switch programmed this way. InterfaceIT doesn't allow for Lua scripts which is why I asked of the switch and LED functions could include conditions.

If the driver you are using writes and reads offsets directly then there's no where to include conditions except in that driver. You'd need to ask FDS. When I was answering I was assuming you were using FSUIPC buttons and switches assignments, where conditions can of course be assigned.

I will read up on adding these to the INI file to get the switches to work as needed.

You can't do it in the INI if there are no assignments in the INI!

The real issue is the LED programming as I didn't see a way to add a delay to the RUN light offset. If this could be done through adding something to the entry in the INI file and then adding a condition to the START light offset such that it is turned off when the RUN light offset is sent, then the lights would work as required.

I think you are stuck with getting the driver (InterfaceIT) to do all this, unless you write a Lua plug in to handle it. You'd have the Lua program intercept the write to the offset (event.intercept function), then do its thing.

Pete

Link to comment
Share on other sites

Pete

I found an option in InterfaceIT that lets me assign keystrokes that FSUIPC recognizes under KeyPresses. I was reading up on Compound Button Conditions in the Advanced User Guide but the samples show joystick and button numbers, can I use KeyPresses instead?

For instance to only allow switch X (for which I have assigned key presses ctrl+2) to operate when switch Y (for which I have assigned key presses ctrl+1) has been pressed, should I use this under the INI entry for switch X? This sample is from your guide and I assume that the n denotes the number for each condition that I enter.

n=CP(+ctrl1)ctrl2

n=CU(+ctrl1)ctrl2

Thanks

Alan

Link to comment
Share on other sites

I found an option in InterfaceIT that lets me assign keystrokes that FSUIPC recognizes under KeyPresses. I was reading up on Compound Button Conditions in the Advanced User Guide but the samples show joystick and button numbers, can I use KeyPresses instead?

Sorry, no, there aren't any conditional facilities for keypresses. Don't forget key presses can be used in combinations already. How is one to differentiate Ctrl+Shift+X from alt + Y? The combined pressing of all those would be Ctrl+Shift+Alt+X+Y. Furthermore the matrix on keyboards often wouldn't allow X and Y at the same time.

Buttons and switches are different in that they are each separate and can all be on or off at the same time. Therefore conditional processing makes sense for those.

The only possible way out using buttons is to program your interface to operate the virtual buttons via offsets 3340 onwards. There are 288 bits there, each representing the state of one "virtual button" or switch.

Regards

Pete

Link to comment
Share on other sites

Pete

You may have pointed me to an area that will work for me. For one of my switches I used offset 3360, Word Setbit value 0 for ON and Clearbit value 0 for OFF and that switch is recognized in Buttons + Switches as Joy# 64 Btn# 0 However I can't seem to program any other switches using offset 3360. I'm not sure how to increment the button numbers -- I tried using 1 for clearbit and Setbit but that didn't work.

Thanks

Alan

Well I tried various values and using 2 for clearbit and Setbit gave me Btn# 2 and using 4 for clearbit and Setbit gave me Btn# 4 and using 8 for clearbit and Setbit gave me Btn# 8 etc.

Link to comment
Share on other sites

You may have pointed me to an area that will work for me. For one of my switches I used offset 3360, Word Setbit value 0 for ON and Clearbit value 0 for OFF and that switch is recognized in Buttons + Switches as Joy# 64 Btn# 0 However I can't seem to program any other switches using offset 3360. I'm not sure how to increment the button numbers -- I tried using 1 for clearbit and Setbit but that didn't work.

I think you have something wrong there. The Clrbits and Setbits controls only change the bits which occur in the parameter. A parameter of 0 has no bits! So nothing is changed.

Also, 3340 bit 0 would be Joy# 64 Btn# 0, the bits in byte 3360 are 32 x 8 = 256 bits later (3360 - 3340 = 0020 which is 32 bytes in decimal, 2 x 16). So all the bits in byte 3360 are Joy# 72 buttons 0-7.

It's all quite simple. Each byte contains 8 bits, so represents 8 buttons. Bit 0 - bit 7. The first byte, at 3340 is joy 64 buttons 0 - 7, the next, 3341 is still joy 64, buttons 8-15, and so on. Each joystick has 32 buttons.

The parameters used give the bit VALUE to be changed, not the bit number. Values of bits are 1, 2, 4, 8, ... 128, in each byte.

Please read the FAQ subforum thread on bits, bytes and numbers.

Pete

Link to comment
Share on other sites

Pete

I got the two switches programmed okay but my Compound Button Conditions INI entry doesn't seem to work. This is what I have in my INI file. P64 J0 is supposed to inhibit P64 J4 from operating until it is pushed. Is my syntax wrong or is the condition in the wrong place?

43=P64,4,C66706,1

44=P64,0,C1126,0

45=CP(+j64,b0)j64,b4

Thanks

Alan

Link to comment
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...
 Share

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