Jump to content
The simFlight Network Forums

Skittles

Members
  • Content Count

    189
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Skittles

  • Rank
    Advanced Member
  • Birthday 01/01/1970

Contact Methods

  • Website URL
    http://www.anadrac.com/

Profile Information

  • Gender
    Male
  • Location
    Pine Grove, CA
  • Interests
    Flight Sims, Star Wars, Lego, Trains
  1. (Foot In Mouth) :oops: Had I known that, I would not have made a joke out of it.
  2. I have a few VB books, I mostly use the built-in help. I've never had to use these type of number/variables before so it's been a steep learning curve. As suggested I changed my receiving variable to a Double and what do you know? It's working! This humble feeling I have is powerful. I knew that an integer didn't contain decimal points and since I wanted a heading without a decimal, I thought that's what I needed. Now I really know what a floating-point is, because the "decimal point" can be anywhere. Well, that may not be accurate, but the analogy works for me. I want to thank you both, Pete and Paul. This lesson has been very valuable and I appreciate your patience. By the way, what happened to Mary?
  3. I also tried this... Dim Hi64bitValue As Double Dim Lo64bitValue As Double Dim dwResult As Long Dim Heading As Double If FSUIPC_Read(&H2B04, 4, VarPtr(Hi64bitValue), dwResult) Then If FSUIPC_Read(&H2B00, 4, VarPtr(Lo64bitValue), dwResult) Then If FSUIPC_Process(dwResult) Then Lo64bitValue = Lo64bitValue / (65536# * 65536#) Heading = Hi64bitValue + Lo64bitValue GF45Display(1).Caption = Format(Heading) So now I get 5.34152294420603E-315
  4. Gosh! I hate it when I make myself look stupid... Of course I can't use the Long type. There's an example I have, that reads the Latitude of the a/c. It uses the Currency type because it's a 64bit In my example they use the formulas... Latitude = Fake64Bit * 10000# Latitude = Latitude * 90# / (10001750# * 65536# * 65536#) They had to force it to Double to avoid Overflow. So by changing my receiving variable to Fake64bit as Currency and Heading as Double, using Heading = Fake64Bit * 10000# I get 4.64344496340982E+18 So now I just need to figure out what I need to do, to turn it into degrees. Thanks for the reality check!
  5. Lua's can be run... Automatically... from the [AUTO] section in the FSUIPC.ini or from the ipcready.lua file or Manually by assigning a button or from another lua file using the ipc.runlua command. If you don't have a ipcready.lua in your Modules folder, check the FSUIPC.ini If it's not in either place, I recommend adding the following to your FSUIPC.ini [Auto] 1=Lua filename where filename would be the name of the lua file without the extension
  6. Hello Mr. Dowson, I don't know who else to turn to. I know you're not familiar with VB but if something stands out... I'd like your thoughts if you have the time and inclination. I'm using VB to read FS Values through FSUIPC. I had another read section working once during an experiment, but now I'm getting none or strange results, so I can only conclude I've changed something somewhere. I've been double checking, making sure I'm using the correct Data Types If FSUIPC_Read(&H2B00, 8, VarPtr(RetResult), dwResult) Then At first glance, does this look right? I have the RetResult and dwResult as Long Here's the function... Function FSUIPC_Read(dwOffset As Long, dwSize As Long, pDest As Long, ByRef dwResult As Long) As Boolean The value I'm getting from RetResult is 2122637696 when the gryo is 359.65686 OR -1411192591 the the Gyro is 0.58321 I don't know what the VarPtr() does, but I get zero if I don't use it. Do you need to see all of the codes to get the context? I'd appreciate any ideas. Thanks for your time and efforts, Joe
  7. I didn't realize that. Now I know why it's a "scanner". I used the WM_QUIT. I'll give that a shot. That's what I thought, But I was looking in the wrong place. Thanks. I just needed a count of how many models are attached. Then don't waste your time with it, I'll use the Lua.
  8. Mr. Dowson, Is it possible to program the HidScanner to close automatically after it's written the log? Either hard coded or maybe with a command parameter? /close or /exit I've tried a PostMessage command to close the window... well the window "disappears" but the program continues to run. Currently, my new GoFlight-Lua Scripter can not detect the GF devices. So I thought, I would run the scanner and read the log into my program, counting the devices. But I have to manually close the HidScanner window. I hope you enjoyed your "time off". Thanks, Joe
  9. Since the GoFlight SDK is old and doesn't detect the newer modules, I wanted a way to detect what was installed and I noticed the TQ6 wasn't included. I understand that having it be a "normal" joystick and a "GF" joystick would create problems. I just wanted to make sure it wasn't a glitch. Thanks & no worries!
  10. Did you withdraw the TQ6 support from Lua? It's reporting I don't have one.
  11. I found this in the UIPC_SDK_VisualBasic readme... 'Convert String to Byte For intCount = 1 To Len(strMessage) strMessageB = strMessageB & ChrB(Asc(Mid(strMessage, intCount, 1))) Next intCount strMessageB = strMessageB & Chr(0) I figure it's taking a "character", turning it into an ASCII value and then returning the character as a byte. So I thought the reverse would be a byte, to ASCII to character. Function Convert_Byte2Str(byteMessage As String) Dim intCount As Integer Dim byteMessageB As String * 256 For intCount = 1 To Len(byteMessage) byteMessageB = byteMessageB & Chr(Asc(Mid(byteMessage, intCount, 1))) Next intCount Convert_Byte2Str = byteMessageB End Function Since I added the string size to the declaration, it's no longer crashing in the process routine. It's crashing when I tried to put the string into a "text" property. Or, in the code below, when the function Convert_Byte2Str(acName) puts the result into acName. Dim dwResult As Long Dim acName As String * 256 If FSUIPC_Read(&H3D00, 256, VarPtr(acName), dwResult) Then ' "Read" proceeded without any problems If FSUIPC_Process(dwResult) Then ' "Process" proceeded without any problems acName = Convert_Byte2Str(acName) <-------------------- CRASHES HERE StatusBar1.Panels(5).Text = acName Else ' Unable to "Process" MsgBox ("Processing: " & ResultText(dwResult)) End If Else ' Unable to "Read" MsgBox ("Reading: " & ResultText(dwResult)) End If I suppose it's a byte conversion problem? I've read I have to use a Byte Array? I'm still looking into if my VB uses ASCII or Unicode. I really don't want to tell you what version of VB I'm using... it's will probably raise your blood pressure... VB4. I did find STRConv which will convert from 2-byte Unicode to 1-byte ASCII, but it didn't seem to work. Assuming everything else I'm doing is correct. I think this is just over my head.
  12. Yep, I needed to specify the size. I'll take a look!Thank you so much!!!
  13. Hate to bother you again, I got this code from the UIPC_SDK_VisualBasic. I'm experimenting with "reading" data. I can read the clock, and in the first code block, I can read numbers... Like the "aircraft on the ground flag". Private Sub Form_Load() Dim dwResult As Long Dim acName As integer Main.Height = 11310: Main.Width = 15600 'Main.Left = (Screen.Width / Main.Width) / 2 'Main.Top = (Screen.Height / Main.Height) / 2 CenterForm Main FSUIPC_Connect If FSUIPC_Read(&H366, 2, VarPtr(acName), dwResult) Then ' "Read" proceeded without any problems If FSUIPC_Process(dwResult) Then ' "Process" proceeded without any problems StatusBar1.Panels(5).Text = acName Else ' Unable to "Process" MsgBox ("Processing: " & dwResult) End If Else ' Unable to "Read" MsgBox ("Reading: " & dwResult) End If End Sub But when I tried to get a string "Aircraft Name" my program crashes. Private Sub Form_Load() Dim dwResult As Long Dim acName As String Main.Height = 11310: Main.Width = 15600 'Main.Left = (Screen.Width / Main.Width) / 2 'Main.Top = (Screen.Height / Main.Height) / 2 CenterForm Main FSUIPC_Connect If FSUIPC_Read(&H3D00, 256, VarPtr(acName), dwResult) Then ' "Read" proceeded without any problems If FSUIPC_Process(dwResult) Then ' "Process" proceeded without any problems StatusBar1.Panels(5).Text = acName Else ' Unable to "Process" MsgBox ("Processing: " & dwResult) End If Else ' Unable to "Read" MsgBox ("Reading: " & dwResult) End If End Sub I didn't find any examples on reading strings. I could only assume a string size of 256 characters would be 256 bytes. The crash actually occurs in the "FSUIPC_Process" function. Any Ideas?
  14. Sorry about that... I Downloaded the latest FSUIPC_Documentation_Only but I guess I didn't copy it to my documentation folder in FS so I opened the wrong file... I'm up-to-date with 4.7 Thanks so much!
  15. FSI has a list of 1,603 offsets. It's a starting point. You're latest version of the "FSUIPC4 Status of IPC Offsets for FSX" is 4.40. Even though FSUIPC is at 4.7, I'm figuring it's still a complete list. I wouldn't imagine anything else being added since FSX not in production anymore. I'll spend time comparing my new list with what's in the doc.
×
×
  • 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.