peterk54 Posted February 9, 2015 Report Posted February 9, 2015 Dear Peter I'm really sorry to come back on this NWI - METAR Interface. There are several topics on this and most end by no real success, especially in VB6. I know VB6 is not used much anymore, unfortunattely I can't change. As we can read/write everything else with FSUIPC as documented except the weather NWI at &HB000 / &HC000 and the "Detecting runways in use" at &HD000, our non-understanding must be caused by principal techniques doing wrong rather the VB6 programming itself. Further please do not forget for us English is not the mother language. We Swiss have to translate from Swiss German (our dialect, in this I think) to German, than from German to English, and back. So sometimes translating may be an issue as well. 1. observation :???: We can not get any data back from FSX in &HB000 / &HC000 blocks either by Byte-array's, strings or other variables. We can see the data in FSInterrogate2std. 2. observation :oops: We can not write any data into in &HB000 / &HC000 blocks. We can't see the data changing in FSInterrogate2std. Confused :evil: Confusing is i.e. once it is stated write complete structure only, else write "GLOB" or "NW_CLEAR" in some location. What is correct ? Further we are not clear with the signature (can I set one number and use it for ever ...?) and time-stamp (just wait 2 seconds until next read not ok ?) VB6 translation :idea: We setup the structures translated into VB6 and are almost sure to be correct. Strings must be converted from Byte-arrays charakter by charakter with ASC(xx) Conversion unsigned etc. solved in VB6 Please / Steps :razz: Please explain steps by steps simple, i.e. ------- Start ------- Write "NW_CLEAR" into &Hxxx, 4 bytes Write "GLOB" into &Hxxx, 4 bytes Process write Read "Whatever" from &Hxxxx, 8 bytes ------- Wait 2 seconds or read "timestamp" until changed ------- next step ------- and so on. Sorry Pete, normally I'm thought not to be so complicated und more clever ... You still are in holidays, do not hurry ! Best regards Peter
Pete Dowson Posted February 9, 2015 Report Posted February 9, 2015 We can not get any data back from FSX in &HB000 / &HC000 blocks either by Byte-array's, strings or other variables. We can see the data in FSInterrogate2std. You really need someone who can help you with VB6. It is obviously a prgramming problem. You do realise, I hope, that, if my memory serves me correctly, VB6 treats all numbers as 32-bit signed numbers. So your &HB000 may become &HFFFFB000 because of sign extension when used in the FSUIPC interface calls? I've seen this problem many times, but not for a long long while (back to FS98 or FS2000 days, the time VBn was much used). I think, but you'll need to check, that you append another & at the end to stop the sign extension. Check though. I don't have any VB6 references. That would apply to both reads and writes of course. Confusing is i.e. once it is stated write complete structure only, else write "GLOB" or "NW_CLEAR" in some location. What is correct ? The complete structure is used when using the binary structured data. If you are writing and reading METAR strings then of course you do not use any of that EXCEPT to set the Weather station ID, like "GLOB", before wrting the METAR, or (in a separate command) to clear weather, or whatever command you want to execute. Further we are not clear with the signature (can I set one number and use it for ever ...?) and time-stamp (just wait 2 seconds until next read not ok ?) Here I can only really repeat what it says in the ReadMe document. Signatures are only used to deal with the problems of different programs trying to read different weather stations at the same time. If you don't expect anyone else to be using the NWI then you can just set it to zero and keep it zero. You can in any case check the ICAO against the one you requests when you see the timestamp changed and so can read the new entries. This is wrong: Write "NW_CLEAR" into &Hxxx, 4 bytes Write "GLOB" into &Hxxx, 4 bytes Process write Read "Whatever" from &Hxxxx, 8 bytes The NW_CLEAR is a command to clear the weather. You send that on its own. Writing GLOB sets the ICAO for whatever you want to do next. It does nothing by itself. You need to read or write something. What are you trying to do? Clear the weather and read the clear weather later? The procedures are written step by step in the ReadMe text file in more detail that I can go into here. What do you want me to do, just reproduce it all here? Pete
peterk54 Posted February 9, 2015 Author Report Posted February 9, 2015 Dear Pete Suffix & (&H0000 or &H0000&) We will investigate. We never used the suffix &. Seems that VB3 and earlier handled small vaulues not as long to economise on memory. VB6 should not make any difference. Structure or single variables So to set the airport / ICAO just need to send the string, not entire NewWeather structure Signature and timestamp Until now no risk other programm disturbs. So we just disregard and do not read/set at this time. I'm just reading again thru documents ... Target 1. Get weather / METAR of DEP airport and ARR airport of the flight 2. If we succeed set weather global for the flight / actual moment Thanks Pete ! :razz: Peter
Paul Henty Posted February 10, 2015 Report Posted February 10, 2015 Hi Peter, Many years ago I used to work with VB6 professionally and I know the NWI/METAR facilities in FSUIPC as I have them working in my .NET DLL. If you like, I could look at your code and see if I can spot any errors and give you some guidance. You can PM me. Paul
peterk54 Posted February 10, 2015 Author Report Posted February 10, 2015 Dear Pete & Paul :razz: :idea: With your help I could find 2 errors in my definitions (shame on my :oops: ) and write the code as described by Paul. I get the METAR strings out now !!! I can send GLOB as ICAO and get the global weather back. Now I go further Many thanks and best regards Peter
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now