Jump to content
The simFlight Network Forums

fatcharlie

Members
  • Posts

    19
  • Joined

  • Last visited

About fatcharlie

  • Birthday 01/01/1970

Contact Methods

  • MSN
    fatcharlieuk@msn.com
  • Website URL
    http://www.bbmfc.org.uk

Profile Information

  • Location
    Hove, E. Sussex
  • Interests
    Flying, Planes, Flying, Simulators, Flying, er... did I mention Planes?

fatcharlie's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi Guys, thanks again for the help! Paul, I'll post the script when I can transfer it back over to this machine - it's on the FS machine at the mo. Thomas - I have been using the rotariy encoders with Leo's board for some time, but have never managed to get them to react quickly when I turn the knob quickly. A search on this forum showed there are others who've had the same issues, and cured it with a Lua script. When i turn my encoders quickly they actually slow down - the best way to change a value quickly is to turn the knob slowly. I hope that makes sense? I'd love to know what encoders Pete uses - he seems to say he has no problem there? Thanks, Roger.
  2. Hi Paul. Thanks again for your help - much appreciated. I've had a look at the thread you suggested and it has helped somewhat. Having had a look at things I'm beginning to understand the script better - I've been going through it and referring to the Lua library pdf as supplied with the download from this forum. I'm stuck on the line mask = logic.Shl(1, Rotaries[j]) I know it means you shift Rotaries[j] left by one, and compare that with Diff later, but i can't see the logic myself... I just can't for the life of me see what it's doing - can you (or anyone else reading this) shed any light? I have two separate scripts now, rotaries.lua and rotaries2.lua, which successfully get input from the two BU0836X cards and send them to separate Virtual Joystick numbers 64 and 65. I did this by remming out the lines -- if logic.And(j,15) == 0 then -- buttonbit = 1 -- offset = offset + 4 -- end ... thus preventing the script from jumping to the next Virtual Joystick - effectively just limiting it to one. I then modified the line offset = 0x3340 to read offset = 0x3344 for the second script. I now have Virtual Joystick responses for both BU0836X cards, from Virtual Joiystick numbers 64 and 65. So far so good. The issue I have now is that I get a "fast" button every time I click the encoder round by one detent. If I do it slowly, it follows with a "slow" button. So, if I turn the encoder knob quickly, it changes the valie of the Auotpilot Speed Offset by 10. If i move the knob slowly, it changes it by 11, lol! I'm struggling with the values for FastTimeLimit and Pollrate, plus of course Leo's card allows me to change the duration of the pulse sent by the encoder. I'm hoping to find the 'sweet spot' where it all works beautifully...
  3. Paul, thanks so much for helping! OK I thought that was probably it - and indeed tried exactly that, but FSUIPC saw the actual buttons, not the virtual ones. Since I believe the script is running, then I'm guessing I haven't got the assignments correct in the Rotaries { } table. My buttons show as 1,2 3,4 5,6 7,8 and 12,13 in Leo's Encoders configuration program. I've got them all defined as 1:1 and with a slow turn they go one degree (or one knot, 100ft etc.) with each click. I said in my first (rational) post that I'm allowing for the fact that FSUIPC numbers the buttons from 0 and not 1. So I think my roatries entry should read: Rotaries {0,1,2,3,4,5,6,7,11,12) - would that be correct? Also, I have two of Leo's BU0836X cards attached, so I'm numbering them 0 and 1 in the Device = entry. Again, would that be correct? Thanks again for your kind help :-) Roger.
  4. OK so the frustration has abated somewhat. I think I am definitely getting the script to run. I've started FSUIPC logging and it does not tell me "could not open HID" Instead it tells me it's waiting for input from rotaries.lua, so I'm assuming the script is running. As far as I can tell, the script waits for input from a 'real' joystick (or in this case a BU0836X card) and outputs it to one of the 'Virtual' Joysticks, which start at Offset 0x3340 Right. How do I ensure the script is going to get the input from the 'real' joystick? At the beginning of the script, one defines the Vendor and Product - I have "Bodnar" and "BU0836X" in these entries. Then we have the entry for "Device= ". The notes in the script say "-- Multiple devices of the same name need increasing Device numbers"... and "-- Use separate Lua plug-ins for separate cards!" I have two BU0836X cards connected,so I've created a second Lua script called rotaries2.lua. In rotaries.lua I have the Device = 0 and in roatraies2.lua I have Device = 1. My reasoning here is that if numbering starts at 0 I'll catch the card with at least one of the scripts! Then we have "Rotaries = { 1,2,3,4,5,6,7,8}" - I am assuming this table refers to the 'real' joystick button numbers. So my BU0835X has button numbers starting at 1, whereas FSUIPC starts the numebring at 0. I've allowed for this in my script, giving the "Rotaries = " table numbers one-less than those of the actual card. So if the card has two buttons defined as an encoder, and they are 12 and 13, in the "Rotaries = " table I have {... 11, 12...} The next section of the script is not clear to me but I think it polls the device defined at the top of the script and compares the state of the buittons with the previous state. If my undestanding explained above is correct, then at this stage when I turn the encoder attached to buttons 12 and 13 of the BU0836X card (defined as 11 and 12 for FSUIPC), then the script will 'see' that change of state. After this, I get lost - how does the script send information back to FS? Offset 0x3340 is the first of the 'virtual' joysticks, so somehow the script is writing values to the 'buttons' of the virtual joystick - but which button, and how do I tell FSUIPC what to do when that 'button' is pressed? Help...?
  5. Oh dear! I've spent the day trying to understand this but failed miserably. I'm sure it's simple, but how to get this .lua script to work on my system is evading me. So, I need a kind soul to show me, step-by-step, how to get rotaries.lua to work. I've searched lua tutorials online till I'm blue in the face, downloaded lua IDE's akimbo, but it's still opaque to me. It's not as if I'm uninitiated in the programming world. I can program in VB, Basic, SIOC etc. But I can't find a lua tutorial which makes sense to me. OK, rant over. Please can someone help me run through the rotaries.lua script and understand how ti works? Thanks, Roger.
  6. Wow. Lots in there - will have a look at it soon. Thanks for the input :-)
  7. Well I've had 107 views but no replies. Maybe the answer isn't so simple. I'm looking at an idea like this: 1) Write a prog (I use Visaul Basic 2008) which can open and host a Multiplayer session for FS9 2) This prog interfaces with the main FS computer and extracts the AI traffic data from the tables 3) It then shows the AI traffic as multiplayer aircraft to the other computers on the network Thus on your WidevieW setup, you get synchronised traffic across all screens. Possible?
  8. Hello all. I gather from the stickies that Pete's on holiday, so a question to all. (Welcome back, Pete, when you return - saw the video of your cockpit - very nice!) I know this topic has been thrashed to death, so apoligies for bringing it up again! However, it's a simple question, I hope. I run FS9 acros three computers to run three outside views and some screens for instruments. I use Wideview to get the left-forward and right-forward views. As has been documented, discussed and proved, Wideview cannot synchronise AI traffic across the network in FS9. I know it can in FSX, but my setup is straining to provide decent framerates in FS9 so an upgrade is not on the cards. So my question is this: "Why can't a programme be written which would extract the AI traffic info from the main FS computer, and then inject it as multiplayer traffic onto the other two?" I have used FSInterrogate to look at the AI traffic tables in FS9 and they seem to update in real time. So the data which shows the movement of AI traffic on the main FS machine is available to my novice understanding. There has been a large amount of discussion about this topic in the past, hence the phrasing of my question "why can't...?", rather than "is it possible to...?" So, I'm clearly missing something obvious. But what is it? Thanks, Roger.
  9. Heh! I wondered if anyne would get the joke about Peter, Paul and Mary! Hi to Paul as well. Sorry to hear about your having been thrown off a horse - an animal which is uncomfortable in the middle and dangerous at both ends, according to Noel Coward... If you're going to get yourself thrown off things, make sure the person throwing you has arranged for a soft landing as well.... ;-P Anyway it appears I have been trying to reinvent the wheel, what with FSCaptain and FS2Crew out there. But with you guys' help I _have_ learned how to interface a program with FS9, so at least if I come up with anonther idea I'll know how to do things! Thanks again, Roge.
  10. Pete wrote: BTW, looking back, if you have an FSUIPC_Open call to make a connection and you are also using Paul's DLL to make a connection, you will likely have a clash in any case. I think you should either stick to the standard FSUIPC VB example methods, or use Paul's DLL. Don't mix methods. Roger replies: That was it! I had been trying to use both. I've now got somewhere! Thanks. For info, using only the FSUIPCDotNetClient1.3 from the FSUIPC SDK, what I have done is this: 1) I wrote a program which works fine when it's totally internal to Visual Basic 2008 Express. 2) I wanted to replace the checkboxes in the program with actual values from Flgith Sim 2004. 3) I wrote 'Imports FSUIPC' at the top of my program. 4) I made the association to the fsuipcClient.dll as described in the Readme under the heading: Installation (Step-by-Step for Visual Studio) 5) I then copied and pasted the relevant parts of the FSUIPCClient Example for opening the link to FS and also heavily used the examples for getting data. 6) I had to chenge the lien: MessageBox.Show(ex.Message, AppTitle, MessageBoxButtons.OK, MessageBoxIcon.Error) to: MsgBox(ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error) I dunno why it wouldn't allow AppTitle, but otherwise it all works fine. Result - I have a messagbox which says "Battery Switch is 1" or "Battery Switch is 0" depending on whether I switch it on or off in Flight Sim! To those of you who eat Codeflakes for breakfast, this may not appear all that world-shaking, but I have to say I'm experiencing my very own "Hello World" moment and am quite excited! Thanks Peter for your patient help , and thanks Paul for writing the DotNetClient stuff in the first place. best to thank Mary as well, just in case... Cheers, Roger.
  11. Hi Peter, FS Interrogate and Traffic look seem to be working fine. I flipped the battery switch and it changed from 0 to 1 on re-scanning in FSI. Traffic look appears to be pickin gup at least one other aircraft. Here's a sample of the log (yes, it gets big very quickly doesn't it!) 9957825 WRITE0 0DDC, 2 bytes: 22 00 9957825 READ0 7B81, 1 bytes: 00 9957856 READ0 3210, 4 bytes: FF B4 00 00 9958059 READ0 3210, 4 bytes: FF B4 00 00 9958137 READ0 7BE9, 1 bytes: 00 9958261 READ0 3210, 4 bytes: FF B4 00 00 9958464 READ0 3210, 4 bytes: FF B4 00 00 9958636 READ0 7BE9, 1 bytes: 00 9958667 READ0 3210, 4 bytes: FF B4 00 00 9958870 READ0 3210, 4 bytes: FF B4 00 00 9959073 READ0 3210, 4 bytes: FF B4 00 00 9959135 READ0 7BE9, 1 bytes: 00 9959275 READ0 3210, 4 bytes: FF B4 00 00 9959478 READ0 3210, 4 bytes: FF B4 00 00 9959634 READ0 7BE9, 1 bytes: 00 9959681 READ0 3210, 4 bytes: FF B4 00 00 9959837 READ0 0BC8, 2 bytes: FF 7F 9959837 WRITE0 0DDE, 2 bytes: 01 00 9959837 READ0 3D00, 256 bytes: 42 6F 65 69 6E 67 20 37 33 37 2D 38 30 30 20 41 9959837 69 72 20 53 63 68 65 66 66 65 6C 00 00 00 00 00 9959837 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9959837 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9959837 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9959837 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9959837 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9959837 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9959837 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9959837 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9959837 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9959837 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9959837 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9959837 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9959837 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9959837 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9959837 WRITE0 0DDC, 2 bytes: 22 00 9959837 READ0 7B81, 1 bytes: 00 9959884 READ0 3210, 4 bytes: FF B4 00 00 9960087 READ0 3210, 4 bytes: FF B4 00 00 9960133 READ0 7BE9, 1 bytes: 00 9960289 READ0 3210, 4 bytes: FF B4 00 00 9960492 READ0 3210, 4 bytes: FF B4 00 00 9960492 WRITE0 3210, 2 bytes: FF FF 9960633 READ0 7BE9, 1 bytes: 00 9960695 READ0 3210, 4 bytes: FF FF 00 00 9960898 READ0 3210, 4 bytes: FF FF 00 00 9961101 READ0 3210, 4 bytes: FF FF 00 00 Thanks, Roger.
  12. Hi all, well I'm gradually working my way through it! I have been posting in various threads, but I think I've found the right one - with Pete's guidance - thanks Pete! To recap: I am trying to write a program in Visual Basic 2008 Express, which will run through a verbal checklist for the Boeing 737 800. It does so by automatically calling each challenge (by playing a '.wav' file) then either giving the correct response, or waiting 5s and recalling the challenge if the item is not in the required state. I've got it working to my satisfaction purely within VB8, by representing the 'required state' as a checkbox. If I check the box (either before, or immeiately after, the challenge) the response is given appropriately. If I leave the box uncehcked, the program will wait and then re-issue the challenge. I can run down the list of checkboxes and check them at random - the program will still run past all the checked ones and wait at the unchecked box. Great! Now all I have to do is get rid of the checkboxes and replace them with actual FSUIPC offsets. here's what I've done: 1) Opened up the FSUIPC_shell.sln from the UIPC_SDK VB .Net Shell Revision 2.004.zip in the FSUIPC SDK 2) Added the 'Imports FSUIPC' line to the start of the prog 3) modified the first few lines like this: Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim dwResult As Integer FSUIPC_Initialization() If (Not FSUIPC_Open(SIM_ANY, dwResult)) Then MsgBox("FSUIPC not found, application will close") End Else : MsgBox("fsuipc found") My.Forms.Form2.Show() My.Forms.Form2.BringToFront() End If So far so good - if FS is running, I get the "FSUIPC found" message, if not, I get the "not found" message. It also opens Form2 and brings to to the front. The I added the following code out of the example: Try ' Attempt to open a connection to FSUIPC (running on any version of Flight Sim) FSUIPCConnection.Open() ' Opened OK Catch ex As Exception ' Badness occurred - show the error message MsgBox(ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error) End Try This is where I'm not having such success! I'm getting the "FSUIPC Error #7: FSUIPC_ERR_VERSION. Incorrect version of FSUIPC." message mentioned elsewhere in this thread. I downloaded and registered the newest version of FSUIPC and had another go. I've followed Peter's instructions: The .dll signature is OK I've renamed the FSUIPC.key file to FSUIC.key.old so it gets missed But I'm still getting the message when I try to open the connection. Any ideas? I realise I may have missed something totally obvious, being akin to a cretin when it comes to programming! Thanks, Roger.
  13. OK, I have realised that the FSUIPC Client DLL for DotNet needs to be included. I have also realised I have to include the Imports FSUIPC line in my prog. I'm now struggling with getting the FSUIPCConnection.Open() command to work - I'll let you know how it goes! Anybody out there? :-) Roger.
  14. Hello to anyone who's successfully gotten offset info using Visual Basic 2008 Express. Help! I have no idea what I'm doing... well, to be exact, only the sketchiest idea of what I'm doing. I have written a little prog in VB8 which runs a verbal checklist for a Boeing 738. Basically it uses short .wav files to issues the challenges from the checklist, than asseses the state of the item called. If it's in the required state, the prog plays the .wav file for the appropriate response. If not, the prog waits 5 seconds and re-issues the challenge. At the moment, I have no interface to FS9 - the 'appropriate state' is simulated by a checkbox within VB8. i.e. when the prog plays the challenge, I check the checkbox and it responds properly. I can play around with things and the prog still reacts properly - eg. I can go through the checklist items and 'check' random items. the prog will give the response for items which are checked, but wait at the items not checked. The logic of the prog is working as I want, but now I need to be able to use the FSUPC interface for VB.Net to extract the data. My logical programming is OK - I grew up with the original BASIC programming language, so I have a general grasp of that, but I don't really know how to get VB8 to talk to FS9. What I've done so far: 1) downloaded the FSUIPC SDK 2) opened the UIPC_SDK VB .Net Shell Revision 2.004.zip and run the .sln 3) Carried out the upgrade asked-for by VB8 4) where VB8 was giving an error message for the Public Const items, because they did not have an 'As' entry, I have added 'As Object' 5) ran the debug on this Amazingly, it sems to work. I added a second form and asked the prog to open it on loading Form 1. I also added a couple of message boxes ("fsuipc found" and "fsuipc not found, application will exit"). The second form opens and if FS9 is running, I get the "fsuipc found" message, if not I get the ""not found" message. Yay! So after all that, how do I get , say, the value of the offset for the battery switch (281C)? I understand I have to use the FSUIPC_Get function, but I have no idea of the syntax required. What i want to do is: If Battery Switch = 1 then 'or, whatever value represents the "on" state play response.wav endif Sorry for long post, but I felt the need to fill you in on the background - I hope it all makes sense. Cheers, Roger.
×
×
  • 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.