Welcome to Cockpitbuilders.com. Please login or sign up.

March 28, 2024, 03:25:55 AM

Login with username, password and session length

PROUDLY ENDORSING


Fly Elise-ng
114 Guests, 0 Users
Members
Stats
  • Total Posts: 59,639
  • Total Topics: 7,853
  • Online today: 130
  • Online ever: 582
  • (January 22, 2020, 08:44:01 AM)
Users Online
Users: 0
Guests: 114
Total: 114

COUNTDOWN TO WF2022


WORLDFLIGHT TEAM USA

Will Depart in...

Recent

Welcome

Reading switch inputs and assigning functions

Started by iwik, April 05, 2011, 12:37:00 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

iwik

Hi Tyler,
Module arrived today, 5 days delivery to New Zealand is great.
Module looks well constructed, nice compact wee unit. Soldering quality is very good.
What is easiest way to configure the inputs to activate something in Fsim. I played with the software commands and had successfully activated stuff in Fsim.
i suppose ones needs to get out Visual basic to do some serious stuff. Really just experimenting at the moment.
Keep up the good work, product looks good.
Regards
Les.
P.S The led nearly blinded me, sure lets you know things are alive.


Tyler Reed

hey, thanks for the input on the card.

I just got to work, so I will give some thoughts on writing up something for getting started and get something posted.

Thanks,
Tyler
- Tyler Reed

iwik

Thanks,
No hurry, know what its like getting things of the ground.
les

Tyler Reed

ok, just to try to get you going...

You will want to use the wizard on the start page to add a new card with the type of R1 and serial number of 1 if you have not done so already.

If you plug the card into your usb, you should notice the icon for the card's tab will have a green flag on it, and the log should say something about the card being connected.  The beta software has a bug where sometimes it thinks it is another card and ignores it, so if the little flag is still red, try another usb port or shutdown and restart the software.  I will have that bug fixed in the next release of the software.

On the input tab you should see inputs 1 - 30, if you want to name them so you know where they are going, you can right click on the name and hit edit.

On the input scripts tab there is a drop down of all 30 of the inputs.  Each input has 2 states, Up and Down.  For most scripts you will probably want to stick with down.  Down gets fired once the button is pushed, or the toggle switch is activated, and Up get fired once the button is released or the toggle switch is switched off.

For an example, lets call our Input #1 "Parking Brakes", now under Input scripts we will see "Input 1 Button Down (Parking Brakes)" and "Input 1 Button Up (Parking Brakes)".  Lets select Button Down.  So when the button is pushed, or the toggle switch is on, i will want to have the parking brakes on, and when the button is up or toggle is off i want the parking brakes off.  So according to page 15 of the offsets manual, 0BC8 is the offset for parking brakes, with a value of 0 for off and 32767 for on.

Sample Code for Parking Brakes, Button Down
Host.SendValue("0BC8", 32767)

Sample Code for Parking Brakes, Button Up
Host.SendValue("0BC8", 0)

So this switch will need to be "on" when the software starts, but that can be reversed just as easily so if the button is pushed the brakes are off, and so on.  Now to test this with an actual switch, take a toggle or push button switch and wire one of the wires to the "Gnd" screw on the board and the other to input #1 on the board.  With flight sim running and FSUIPC open and everything working as it should, that button will now work the parking brakes.

Also, if you leave the software on the Input Configuration mode, the red dot will go green when an input is activated.  good for debugging stuff.  I should also mention that the blue flag icon called "Debug Mode" will make it so the card will not run any of the scripts that send commands to fsuipc, so if you are labeling your inputs, debug mode will prevent your plane from acting weird as you are pushing a bunch of buttons.

Hopefully this will help you get going.  With the example above, just swap out the offset address and value for any of the other offsets.  I will also hopefully add more to the manual tonight and im looking to do some videos with some screen capture software.

Thanks,
Tyler
- Tyler Reed

iwik

Thanks Tyler,
I was missing how you tied the inputs to a function. I missed the point that each input has
a little script added.
I like the that idea. Off to work now, will give it a go tonight.
Les

Tyler Reed

Cool, Well let me know how it goes and if you have any other questions.

I'm still working on the manual between my job and Fire Department stuff.  I need more hours in the day :D

Thanks,
- Tyler Reed

iwik

Hi Tyler,
Making some progress, unable to get a switch to operate on a Fsx panel.
Here is what is happening.
I written the script for Pitot heat and when i operate the nominated switch ther is no response in Fsim.
I can go to input script screen and select input 1 Button Up and press the left green button
and the switch will go up.If i select Button 1 down and press the same button the switch in Fsim will go down. This proves the Script is working and it can be transferred to Fsim.
If i look at the input 1-30 button screen, button 1 will turn green when pressed and if i look at the debug log it shows Input one Going between True for on and False for off.
Can you suggest anything else, or have i got to do anything else to get buttons recognised.
Thanks
Les

Tyler Reed

Just a quick thought, did u hit the save button after putting the code in the box.  Im still working on it, but the save button has to be hit before changing to another input from the drop-down list of the code will be lost.
- Tyler Reed

iwik

#8
Tyler,
Yes have saved it, tried again this morning and still the same. Ive had a look at the debug mode and when i press the green button the debug log says ive sent a command to FSUIPC.
When i opeartea switch from the hardware it justsays true when closed and False when opened.
Hope this helps. By the way i operate Win 7 64 Bit.
No hurry, im still experimenting so have a life outside of Fsim, its not life or death for me.
Regards
Les
P.S i notice when pressing the green button it takes about 2 seconds before the switch operates
in Fsim. Is this normal

Tyler Reed

ok, thank you for the debug info.  There might be a bug in the software.  I am going to setup a card here and check everything over and will let you know what I find.
- Tyler Reed

iwik

Thanks,
Its Sat morning here,so if you want me try anything for u just let me know.
Les

Tyler Reed

Hey, got some good news

I figured out that there is a bug in the software I was able to reproduce the problem that you are experiencing, so I am working on a quick bug fix and will send you a link to download it when I fix the error.  Later tonight i will rebuild the setup file and update it on the website with a news post to go over this bug that was found.  Thank you for helping me in finding this bug.
- Tyler Reed

iwik

Hi Tyler,
Great news, as soon as you have the fix let us know.
Thanks again.
Les

iwik

Hi Tyler,
Well done programmed two switches, 1 and 30 all ok.
Just one comment, no criticism, ther is a delay of two seconds between opearting the switch and Fsim reponding. Can this be reduced?.
Thanks again for a simple way of programming switches, and im sure the flexability will be there further down the track.
Les

Bob Reed

Hi Les. Is the card on the FS computer or in the network? I just tried it on a 32bit Win7  with the card and FS on the same system and there is virtually no delay what so ever.

Tyler Reed

hey,
Thanks for letting me know that you got it working.  I will be releasing the same thing i sent you when i get home later when i can build it into the installer.  Well that is one bug down, many more to go :)

As for the delay.  I am working on a way to shave a little bit off, however I think that some of that delay might be caused in part by FSUIPC if you are using Wide FS over the network.  Bob and I will be doing some tests to try to pin point it all down.

Thank you once again for all your input and help in getting our software going.
- Tyler Reed

Bob Reed

Quote from: iwik on April 08, 2011, 01:46:48 PM
Hi Tyler,
Well done programmed two switches, 1 and 30 all ok.
Just one comment, no criticism, ther is a delay of two seconds between opearting the switch and Fsim reponding. Can this be reduced?.
Thanks again for a simple way of programming switches, and im sure the flexability will be there further down the track.
Les

Ok Less. I just ran a test. 64 bit win7 FS9 the client Win7 64 bit running wideclient and the SmartSimtech control panel. We are seeing no delay. Please give us your setup.

iwik

Hi Bob,
Running Win 7 64 bit  fsx fsuipc 4 and SmartSim Tech Control panel all on same pc.
Les

Tyler Reed

Hey, what are the specs of your computer? Processor and Ram?
- Tyler Reed

Tyler Reed

Also,
We are setting up FSX with WideFS to test it with FSX.  All our testing has been done with FS9
- Tyler Reed

Tyler Reed

i created a youtube video of our setup if you wanted to see that...
http://www.youtube.com/watch?v=Ag494UV7Nhs

Thanks,
Tyler
- Tyler Reed

iwik

specs
Intel® P9700 45nm "Montevina" Core™2 Duo 2.8GHz w/6MB L2 On-die cache - 1066MHz FSB 25 watt with 4gb Ram
les

Tyler Reed

Hey Les,
Sounds like your computer is fine, just wanted to make sure you had enough ram and stuff to rule that out.
I found my FSUIPC4 key, so we are getting FSX all setup to try it with that.  We will let you know our results here shortly.

Thanks,
Tyler
- Tyler Reed

iwik


iwik

Hi Tyler,
Problem fixed by updating FSUIPC dll to 4.669. i had only 4.60a installed.
A point i have noticed is that if the card is not recognised and fsx is running i am not able to establish contact with the card again even if i reload Simtech Control panel. To regain access to the card i have to exit fsx and reload Simtech Control panel followed by Fsim.
Just a small point i thought you may like to know.
Regads
Les

Like the Website ?
Support Cockpitbuilders.com and Click Below to Donate