Jump to content
The simFlight Network Forums


  • Posts

  • Joined

  • Last visited

Everything posted by High-Octane

  1. Are there any manual explaining how FS Interrogate works? Basically, I am trying to understand how to figure out the offset values to determine which equation can work with my VBapplication. Let me know if you can help... Thanks in Advance
  2. VBKeyBus and Rickalty, Actuakky, I forgot to include codes from the previous topic. And this code: OilPress = OilPress / 298 OilPressAngle = OilPress Sorry about that, Bear with me, I'm still a VB/FSUIPC 'Dummy'. VBKeyBus, I have tried once on your methods with offset 3B60', it worked as well with offset '08BA'. But, Specifically I was looking for some help on elimiating multiple needles displaying at once. But Thank you anyway. Rickalty, Yes you did give that equation out to me from other topic. Its just that I forgot to include the code on this posted topic So its not like I ingore you or anything :) . I am familar with 'CLS' Command, that was the first attempt I've tried. And result I get is a blank displays. I had to delete it and try again on every place on my app. . So today, I went to Barnes and Noble book retailer, I read a book called Visual Basic Code Tips. One of these chapeter explaining on using CLS command. *Snap all like this, I got this popped in my head knowing where to place 'CLS' Commands. What I realize is that I had that 'CLS; command at the wrong place. I put that at the end (before End Sub). The last attempt I did was : If OilPress < 60 Then OilPressAngle = 0 - ((60 - OilPress) * 0.75) PicOil.CLS Else OilPressAngle = ((OilPress - 60) * 0.75) PicOil.CLS End If So finally, that come in end of stuggle for me. So before I want to close this topic. I want to thank you for you all of your help, I truly appreicate this.
  3. Guys, This probablly isn't a good place to ask on this forum. or yet... I couldn't think any of help regarding to what I have encountered and is trying to solve. Its been a week struggling for me. So I hope I can get help from you based on your experience, or from what you know. Now what I was doing is trying to get OIL PSI gauges needle to display corectly out from the picture box using VB6. Let say, I have succeed getting that to work, It shows needle changing based on values from offset, but a glitch here is, The needle duplicates when the values iscreased over 21 psi or Values decreased less than 21psi. Not only that, I dont get it a smooth fluxuating..it just skipped from one point to other. To give a clear explaination here, What Happen is that once PSI out from FS2002 given 0-21 psi, needles sits at one place (7 0'clock) and whateve given over 21 psi to max it skipped over to other point (9'o'C;ock) and stay there til I until I close my application. What appears to me thinking it has something to do with AutoRedraw.. IOr there is something else... Here is the code, (Thank to Richard for his help) mayne take a look and see what has been missing or what you can do to solve the issues that I have encountered Dim OilPress As Long Dim OilPressAngle As Long Dim dwResult As Long Call FSUIPC_Read(&H8BA, 2 , VarPtr(OilPress),dwResult) Call FSUIPC_Process(dwResult) If OilPress < 60 Then OilPressAngle = 0 - ((60 - OilPress) * 0.75) Else OilPressAngle = ((OilPress - 60) * 0.75) End If ' On the gauge, 60 psi is a needle angle of zero, or horizontal. The 0.75 ' is a factor to make the angle of the needle match the markings on the ' gauge face. This will be different for every gauge. OilPressAngle = OilPressAngle * (3.1412 / 180) ' Converts the angle from Radians to Degrees picOil.CurrentX = 1500 picOil.CurrentY = 750 ' Sets the center of the needle to the center of the gauge.' picOil is ' the picturebox that has the image of the gauge as its background picOil.Line Step(0 - (500 * Cos(OilPressAngle)), (0 - (500 * Sin(OilPressAngle))))-Step(0 - (250 * Cos(OilPressAngle)), (0 - (250 * Sin(OilPressAngle)))) ' Uses trig to calculate the start and end points of a line at an angle of ' OilPressAngle from 250 twips from the center of the gauge to 500 ' twips from the center of the gauge Let me know if you can help Thanks in advance
  4. Welcome Back Pete.... Hope you enjoyed your holiday
  5. Kafia... I've never used VB5 before, so I wouldn't know if codes for VB6 can work with VB5. Only way I can think of visiting VB fourms, show them the code example out of SDK and maybe some proficent VB user can help you adjust some codes from VB6 into VB5. I have seen them doing that before for others.(not out of SDK but general codes) Hope that help
  6. Hi Richard... First of all, How did you figure out the expression of 289? did you mean 298? because I divide 65535 into 16384 and I get 297 point something which round up to 298. Unless if I am wrong, could you explain your way of doing that, so I can learn it myself and not need to ask again for different offsets. Secondly, Thank you for the offset correction. Now I can see why I need to get a new pair of glasses :shock: :lol: Lastly, after making a few change Everything works perfect except for one little glitch. (The caption number works good, not the needle) Since I couldn't post Image on this forum out of paint program... I will go ahead and try my best explaining you in words. Let say you re looking at oil psi gauge like you re looking at clock. This would be easier for you to understand where needle is located at (IE: 7 o'clock....8 o'Clock and etc..) Okay, the glitch is....when Running FS2002-- flying the Cessna....The oil PSI starts at 21 PSI, the needle sit at 7 o'click. As I increased thrust.... viewing the caption display changing of 22psi and above until it reached to 60 psi, I assume that is standard PSI rate for most Cessnas. Anyway, after 22 PSI, The needle just skipped over at 9 o'clock and stay there with out changing position...I was expecting for it to fluxuate, without just skipping over (I wasn't epecting for perfect one, but close enough will do) And, not only that.. I am seeing double needles displaying inside the picture box at the same time, one would be at 7 o'clock and another at 9 o'clock. Either way, right after 22psi. or even if it get back at 21PSI. Only way to get it disappear is to close my app and reopen it to have one display of needle, if changing again it will just create double.I was assuming it has something to do with refreshing codes that hasn't declared yet, or do I need to do few adjustment in form properties for Picture Box? I hope you understand the way I explain you. Let me know if you did not. In case you want to observe code that may cause double needles or else. Dim OilPress As Long Dim OilPSIAngle As Long Call FSUIPC_Read(&H8BA, 2, VarPtr(OilPress), dwResult) Call FSUIPC_Read(dwResult) OilPress = OilPress / 289 OilPsiAngle = OilPress CapOil.Caption = Format(OilPress, "0") (The rest of drawing needle code stay the same)
  7. Richard, About Brackets.... Actually... on VB form code... I did not forget Bracket. I probablly mistyped it on this forum. So confirm.... Call FSUIPC_Read(&H8B8, 2, VarPtr(OilPress), dwResult ) :lol: But the Label and Needle is still "dead"... Later, running FSInterrogate I discover my expression were wrong... OILPress / 65536 which really should be *55 / 16384 for Engine 1 Oil PSI so how can I write that in code expression ? First attempt: OilPress = Format(OilPress / 16384, "0") :? Needle and Label chanegd at 37... but in set... No fluxuating or anything (like giving an answer of diving from values) I vertify it by turning off Master switch when running FS2002-- Normally needle would be at "0" , but on my application, there is no movement of neddles or any change of labels still same number at 37 so seem like I did write wrong codes or expressionm did I?? :D Thanks :D
  8. Richard, Disregard about e-mail I sent you last friday. Actually, I didnt really want to sent e mail. But for entire weekend, for Unknown reasons, I couldn't get through on this forum. Which leaves me no choice for question asked. Anyway, about needle... What I did last weekend, copied your codes into my application, just to figure out how that work. I finally understand how these work. Actually your help and Chris, forgot his last name... but he was one that creates speedometer with sliding bar changing values. Anyway... here the delcaration I typed along with your codes copied. Dim OilPress As Long Dim OilPressAngle As Long Call FSUIPC_Read(&H8B8, 2, VarPtr(OilPress), dwResult Call FSUIPC_Read(dwResult) OilPSI = (OilPress / 65536) CaoOIL.Caption = format(OilPress) If OilPress < 60 Then OilPressAngle = 0 - ((60 - OilPress) * 0.75) Else OilPressAngle = ((OilPress - 60) * 0.75) End If ' On the gauge, 60 psi is a needle angle of zero, or horizontal. The 0.75 ' is a factor to make the angle of the needle match the markings on the ' gauge face. This will be different for every gauge. OilPressAngle = OilPressAngle * (3.1412 / 180) ' Converts the angle from Radians to Degrees picOil.CurrentX = 1500 picOil.CurrentY = 750 ' Sets the center of the needle to the center of the gauge.' picOil is ' the picturebox that has the image of the gauge as its background picOil.Line Step(0 - (500 * Cos(OilPressAngle)), (0 - (500 * Sin(OilPressAngle))))-Step(0 - (250 * Cos(OilPressAngle)), (0 - (250 * Sin(OilPressAngle)))) ' Uses trig to calculate the start and end points of a line at an angle of ' OilPressAngle from 250 twips from the center of the gauge to 500 ' twips from the center of the gauge. Running with FS2002, and my App... I show needle displaying "dead", and is not moving when flying... I show label caption at 0.... and no changing nimber either... Apparently, either way I did wrong calculating or wrote it wrong, maybe you can do a few revising on code i implement Let me know Thanks in Advance
  9. Hi Richard First of all, Thank you for your help. I truly appreciate it. Well, yes...I dont have any problem getting data out of FSUIPC...But, only part of problem I am having is data that need calculation... . I really need to understand how to use it and solve it if bug occur with my app. I guess it take time to understand it with so many tries or pratices. Trig function look pretty easy to understand.... So basically, I would need to set DIM statement,CALL or IF FSUIPC with values, offset, and etc first before implement trig function. And thats it? did I get my thought right? Again Thank you
  10. Hello people, As of now, my plan.... Is to try to implement codes on Gauges with needle for VB6. and have it working with FSUIPC. And Lately, For a week, I've been visiting around search page and doing a lot of search. Query: 'VB6 GAUGES; GAUGE WITH NEEDLE AT RUNTIME; ROTATING SHAPE OBJECTS AT RUNTIME' and ETC Unfortunately, The answer I always get is, Search Query not matched, or a topic similar to the words. So, I kindly ask for help to anyone who experienced on Gauge code implement and get it working sucessful with FSUIPC... .....Meaning, I would probablly need some assitance to find certain websites containing with good tutorial, Maybe your suggestion for a starter... Any help from you would be much appreciated. Thanks in Advance
  11. Guys, I'm working wn Altitude using VB6 And I have encountered some problem on calcluation Or did I write string incorrect?? Let take a look at yje string I wrote: Acknowledge: Altitude, Offset Value H570, 8 data bit String I wrote: Dim Fake64bit As currency Dim Altitude As Double Dim dwResult As Long If FSUIPC_Read(&H570, 8, VarPtr (Fake64bit), dwResult) Then Alritude = Fake65bit * 10000# Altitude = Altitude *360#/ (65536# * 65536#) Altlbl.caption = (Fake64) End If Running FS2002/My form Creation I get: FS2002:Alt 306 My form: 8729354 something Obviously, I did wrong on calucation... can anyone tell me me what did I do wrong?? Thanks in advance
  12. Perhaps, anyone here can help me out for clarfication on Calcluations, not only that, but a proper way implementing code lanuage on calculations. I spend the whole day trying to figure it out and not one :evil: DARN :evil: thing has gone through my head yet. One example: Offset=02CC User=Whiskey Compass BitSize=8 I believe double float has something to do with 64-bit integers, and Visual Basic 6 probably not be able to compile itt, However, from my understanding... I would need to spilt it seprately into 32-bit if I am correct. So from my assumpuation it means I calcuate : 360.0/(65536.0*65536.0) =83.8 something 270.0/(65536.0*65536.0)=213,8 something 180.0/(65536.0*65536.0)=41.9 something 90.0/(65536.0*65536.0)=20.9 some Language implement I assume: If FSUIPC_Read(&H2CC, 8, VarPtr(Compass),dwResult) Then If FSUIPC_Process(dwResult) Then lblCmp.caption = Format (Compass,(dHi), 360.0/(65536.0*65536.0) (Compass,(dHi), 270.0/(65536.0*65536.0) (Compass,(dLo), 180.0/(65536.0*65536.0) (Compass, (dLo), 90.0/(65536.0*65536.0) Did I calculate it right? How about implementing? If not, a better claification from you would be appreicated. One more thing, are there any Offset values for Altitude (not in slew or pause state) for FS2002???
  13. Rucgard, Duly noted, I am gonna give a try. Thanks for the help.
  14. Armando, Thanks for the input... I did thought of that first place but wasn't sure how to implement it. With your help it worked. Thanks again Buddy Richard I have tried to find such place to put DIM statement: DIM ISpeed as long somewhere else before timer but I couldn't think of any... Would I need to include: Private Sub Click() DIM ISpeed As long DIM dwResulr As Long end sub This was the first try I did, and instead of that I get an error defined. Richardo, Armando, or anyone Now I suppose, Value of 1= on 0=off (for landing light, strobes, warning light or etc) could be implement as: LandingLight.Label = Format(LLInd 1,0,"0") or something? Any ideas??
  15. Yes, I thought so.... Problem is, I dont know where to add 128... would that be CALL FSUIPC_READ(&H2BC, 4, VarPtr(ISpeed(128)), deResult) or what do I need to input to get acturate IAS ?? -Arthur
  16. Guys, To let you know... The only part of VB languages/codes that I am expert is based on office use such as: Excel, database entries, calcuations, and etc. BUT I have no knowledge on implementing for game or enterainment related programs and may need all of your help to use it for my future benefit. So PLEASE bear with me especially with all of "probablly" stupid asked question. I am only try to learn here. So after Registered FSUIPC and WideFS.... I did a few experiment creating form layout with one Label box and of course one button box (to end connection with FSUIPC/FS2002 to prevent from it crashing). The Label Boz which left blank will display (IAS) Indicated Air Speed with Offset Value of 02BC (found on FSUIPC Manual). So, let take a look at below of codes tor language I wrote: FORM CODES: Private Sub btnDiv_Click() Unload IStation End Sub -------------------------------------------------------------- Private Sub Form_Unload(Cancel As Integer) FSUIPC_Close End Sub --------------------------------------------------------------- Private Sub Timer1_Timer() Dim ISpeed As Long Dim dwResult As Long Call FSUIPC_Read(&H2BC, 4, VarPtr(ISpeed), dwResult) Call FSUIPC_Process(dwResult) IASpeed.Caption = ISpeed End Sub And I did a little revison on General.BAS module. GENERAL BAS Module Option Explicit Public ResultText, SimulationText Sub Main() Dim dwResult As Long ' set VB "constant" string refs dynamically now ready for result 'messages ResultText = Array("Okay", _ "Attempt to Open when already Open", _ "Cannot link to FSUIPC or WideClient", _ "Failed to Register common message with Windows", _ "Failed to create Atom for mapping filename", _ "Failed to create a file mapping object", _ "Failed to open a view to the file map", _ "Incorrect version of FSUIPC, or not FSUIPC", _ "Sim is not version requested", _ "Call cannot execute, link not Open", _ "Call cannot execute: no requests accumulated", _ "IPC timed out all retries", _ "IPC sendmessage failed all retries", _ "IPC request contains bad data", _ "Maybe running on WideClient, but FS not running on Server, or wrong FSUIPC", _ "Read or Write request cannot be added, memory for Process is full") SimulationText = Array("Any", "FS98", "FS2K", "CFS2", "CFS1", "FLY", "FS2002", "FSNEXT", "FSYETANOTHER") ' initialize important vars for UIPC comms - call only once! FSUIPC_Initialization ' Try to connect to FSUIPC (or WideFS) If FSUIPC_Open(SIM_ANY, dwResult) Then ' Connected to simulator (visible in the form's caption) IStation.Caption = IStation.Caption & ResultText(dwResult) ' Enable the timer which is actually reading the FS clock time IStation.Timer1.Enabled = True Else ' Unable to "Connect" IStation.Caption = IStation.Caption & "Can't connect: " & ResultText(dwResult) End If IStation.Show End Sub So I full comple it, No error indicated.. I run FS2002.. and I had succesful connection.. between Form I created to FS2002. So that would make a first check mark on few step-by-step agendas. Now there is a problem: From FS2002 I show IAS at '248' knots.... From the form I created, I show IAS was at '31997' Something is wrong, so what may be wrong? Isn't that because I wrote wrong language? I confirmed offset was correct.... What did I forget to add? what do I need to do to solve this problem getting IAS from the form to be matched with FS2002 ? Thanks in Advance Arthur
  17. Peter, After reading your documents on updated FSUIPC, regarding to paying for register keys... I have no problem or oppose to this. But this concludes to question I am concerned of. I understand, in order to get register key for accredit or selling purpose I must pay for it. But at my situation, I was going to build instrutor staion myself. What on it, I would want PFD/ND, gauges, and etc... or maybe I could draw some image and set up box where values can be displayed over the imagie using Visual Basic. And this would not be for selling purpose.. do I still get to pay for register key?? please clarify this. Much Appreciated Arthur
  18. Can offset, from FS or such a list from FSUIPC apply on Visual Basic 6 or C++ language. What I am planning on is build up PFD and instructor station. Using VB6 would creates ActiveX Objects. also I am trying to figure out how to get language, values and etc commnunicating via FS2002. Let me know if you know something.
  19. I am currently in progress creating own FD/ND display using Visual Basic Active X or COM control. (Please don't tell Enricho Schratti, I didn't want to offend him. At least I have his software :lol: ) I am at few step away from the final part. The only part that I have not completed is a language, it took me days to figure out how I could get my project to work with FS. Just until I read Peter Dowson manual I finally get a little concept, but could not determined how to use it as of yet. From the FSUIPC manual "FSUIPC for programmers". based on tables of each functions and values shown as: TAS--True Airspeed as Knots *128 --value: 02B8 Now from my VB written language: speed.Airspeed[=Value] Due to my implementation by understanding combination between VB and FS I would need someone to verify if that is the correct methods. Reminder: I am using VB6 ActiveX control to creating FD.OCX and it requires VB Language to get it working. Value from FS and VB Language in combination: speed.Airspeed[=02b8] ?? Please let me know...Thanks Note: The project I am about to create is not for sale or selling purpose. Its for me to use some practice or gaining experience on programming skills. -Arthur ProjectB767
  • 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.