Jump to content
The simFlight Network Forums

CaptnKebec

Members
  • Posts

    11
  • Joined

  • Last visited

About CaptnKebec

  • Birthday 01/01/1970

Contact Methods

  • Website URL
    http://www.mbsystem1.com/flightsim.htm

Profile Information

  • Location
    Longueuil, Quebec, Canada

CaptnKebec's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi Pete, I read in a earlier thread, that there whas a bug in FS2004 where we can't write any value above 1700.0 that will "stick". I'm writing a application for my external radio stack and I get exactly that bug, any frequency above 1700.0 I write with FSUIPC is showing with FSUIPC but not on the panel and then FSUIPC reads the panel value resetting the original value before the change. Is there was some development in that bug, did you found a workaround or I just have to loop at 1600.0 and not support higher frequency?? Thanks
  2. Hi Pete, I resolved the problem. All I had to do is convert the decimal value to hex, do the increase or decrease, reconvert it to decimal and write to FSUIPC. That's weird, but it works! Thanks for the hints.
  3. Hi Pete, Best wishes for your eyes problem. I made a little software for my radio stack and special knobs who are pressing switches to change value (turn right, press a up switch, turn left, press a down switch) the program works fine except for a strange behavior. When I use the switches to go up everything is fine but when I use it to go down, the values just keep circling in a 6 loop. Ex. 9093, 9092, 9091, 9090, 9089, 9088 and then back to 9093 Here's how the program works With each press of the down switch: 1- Reads the COM1 value from FSUIPC and put it in a variable 2- Decrease the value by one in the variable 3- Writes the COM1 value to FSUIPC It's the same for the up switch excep it increase the value. And I know you hate VB but it's written in that language!! Any clue why it's OK for up and not for down??? Thanks Michel
  4. I've tried it but this method strips the zeros, example if the actual reading is 105 i'm getting 15. With a little work I could simplify the code, but now it's working and I'll concentrate on the input from my switches (hope it's gonna be more easy). Thanks a lot
  5. It's not in the compiling since I didn't compile it yet, I was just in the interpreter and running it to see if it works. It's just VB I think, it's not the first time I see strange things in this language, but I already use to much languages, I don't want to learn C or another language yet, so I'm dealing with the "weird" VB. Thanks Cheers Michel
  6. Hi, Got it finally!! Pete please don't be mad at me, I was reading your response but didn't understand. As you can see in the code below, with VB it's a lot of work to extract a single value, well thank's a lot for your help. Here's the code to make it work: Dim dme_txt As String dim dm(4) as string If FSUIPC_Read(&HC33, 5, VarPtr(tmp), dwResult) Then If FSUIPC_Process(dwResult) Then aa = hex(tmp) dm(1) = Chr(CLng("&h" & Right(aa, 2))) dm(2) = Chr(CLng("&h" & Mid(aa, 5, 2))) dm(3) = Chr(CLng("&h" & Mid(aa, 3, 2))) dm(4) = Chr(CLng("&h" & Left(aa, 2))) dme_txt = dm(1) & dm(2) & dm(3) & dm(4) End If End If msgbox(dme_txt)
  7. So I was right for the name the first time and wrong in my correction!! Sorry again. OK, now here's the exact code line I use for testing the output Dim dme_txt As String If FSUIPC_Read(&HC33, 5, VarPtr(dme_txt), dwResult) Then If FSUIPC_Process(dwResult) Then MsgBox (dme_txt) End If End If The string I get is 808333630 if I use the logic Pete describe, I should have 5 byte so it's 80 83 33 63 0, how can I convert this to the real data?
  8. Mr Dawson, I keep calling you Peter! I've noticed your name is PETE. I'm just beginning in the sim community and I already noticed that your work is everywhere! So I should have known your name better! Sorry about that! Michel
  9. Oups sorry Peter, you're right, the data type can be anything with the read statement of FSUIPC, it effectivly need the address of that variable and that's why in VB we use VarPrt to get that address and pass it to FSUIPC. The thing is, I defined a string variable and put it in FSUIPC using VArPrt and I get those strange numbers, when an offset returns a number or a boolean the result I get is OK but when it's string the data is incoherent?? There must be a way in VB to get the right result (I hope). I'm not to familiar with C, but if I have no choice I'll make a small exe ic C to do the job or re-write my prog completly in C. Thanks Peter and sorry for the misleading comment.
  10. JD, The code you wrote is OK, I've already succeeded to get COM, NAV, ADF and XPRD data with a similar code because all those offsets are numbers and not character. What I'm unabled to do is get something right with a offset who is returning character string. The offsets for DME (0C29,0C2E, 0C33, 0C38) are 5 bytes strings as Peter mention. I can't put a string type in the FSUIPC_read call because it need a long type, and even if I convert the result to string I still get those strange numbers. Did you succeeded to read a string value in VB? Thanks, Michel
  11. Hi, I use VB to read data from the radio panels, I succeeded for all COM and NAV, ADF and XPDR. I try to read DME distance and speed and getting strange number as results (808333630) I found a thread explaining how to read it with C in this forum but I'm unable to do it in VB, does anyone have a clue how to do it?? Thanks Michel
×
×
  • 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.