Claude Troncy Posted August 11, 2015 Report Posted August 11, 2015 Bonjour Pete, I am trying using WideFS to detect the departure runway in use through the facility provide by the D000 offset. Here is my code. ipc.writeSTR(0xD000, "IIIIEIDW",8) timestamp = ipc.readUD(0xD008) while 1 do station = ipc.readSTR(0xD004,4) timestamp2 = ipc.readUD(0xD008) runway1 = ipc.readUB(0xD00C) runway_design1 = ipc.readUB(0xD00D) runway2 = ipc.readUB(0xD00E) runway_design2 = ipc.readUB(0xD00F) if timestamp2 ~= timestamp then if ((runway1 ~= 0) and (station == "EIDW")) then ipc.log(os.date() .. " Departure runway " .. runway1) end ipc.writeUD(0xD000, 0) ipc.writeSTR(0xD000, "IIIIEIDW",8) timestamp = ipc.readUD(0xD008) end ipc.sleep(5000) end When there is little traffic at the airport, I noticed that even if I saw a plane leaving it's gate for departure, the data returned at D00C was 0. Sure it is not a WideFS problem. I tried with Weatherset2 and the beahavior was exactly the same, that let me think that my code is correct. After making some tests, it seems that the data for runways are only populated if there is at the same time an AI arrival AND an Ai departure.. It should be an OR instead of AND. What do you think ? Best regards Claude
Pete Dowson Posted August 11, 2015 Report Posted August 11, 2015 When there is little traffic at the airport, I noticed that even if I saw a plane leaving it's gate for departure, the data returned at D00C was 0. Sure it is not a WideFS problem. I tried with Weatherset2 and the beahavior was exactly the same, that let me think that my code is correct. I assume you mean TrafficLook? WeatherSet doesn't read traffic or runways. After making some tests, it seems that the data for runways are only populated if there is at the same time an AI arrival AND an Ai departure.. It should be an OR instead of AND. What do you think ? There's actually no conditions in the code awaiting either event, spedcifically. When the information is available it is provided, no other conditions. There's never any reason for waiting for both conditions to be true. I don't know what is happening in your case, but i'd need more information. For instance, how are you using "Weatherset2" to check? Why not use FSInterrogate or FSUIPC's own logging to check? I'll investigate further with more information to follow, but I cannot at present see anything wrong. Pete
Claude Troncy Posted August 11, 2015 Author Report Posted August 11, 2015 I assume you mean TrafficLook? WeatherSet doesn't read traffic or runways. With TrafficLook, the runway is always filled in. As I understand in FSUIPC4 Offsets Status, WeatherSet2 read runways in use. The Weatherset2 program provided with FSUIPC makes use of this to show any runways currently assigned when AI traffic is active at a weather station selected by ICAO code. I will try FSInterrogate to check. Best regards Claude
Pete Dowson Posted August 11, 2015 Report Posted August 11, 2015 With TrafficLook, the runway is always filled in Ah, so the data, and WideFS is working in that respect. As I understand in FSUIPC4 Offsets Status, WeatherSet2 read runways in use. Really? I shall have to revisit my old programs. I don't recall weatherset providing runway data. Certainly it wasn't its purpose, it was only for me to test my weather reading and writing facilities -- WeatherSet (1) for the older "advanced weather interface" (pre-FS2004 compatible, and later), and WeatherSet2 for the "New Weather Interface" which extended from FS2004 to FSX and P3D. I presume, therefore, that you are saying your code has the same bug (?) as WeatherSet2, assuming there is one? I'd have to examine your code more thoroughly to understand this. Are you sure it isn't a matter of timing? At one glance you seem to be only scanning once each 5 seconds. Is that right? Wouldn't an event call based on offsets be more appropriate, or at least a one-second base for scanning like TrafficLook and WeatherSet? Pete
Claude Troncy Posted August 12, 2015 Author Report Posted August 12, 2015 Ah, so the data, and WideFS is working in that respect. I think, that TrafficLook find the runways from the table at D040 offset and Weathetset2 from D000 What I can say is that arrival and departure runways are always filled up at the same time. No arrival without departure, and no departure without arrival. That's why I thought of a problem between AND and OR. Cheers Claude
Pete Dowson Posted August 12, 2015 Report Posted August 12, 2015 I think, that TrafficLook find the runways from the table at D040 offset and Weathetset2 from D000 What I can say is that arrival and departure runways are always filled up at the same time. No arrival without departure, and no departure without arrival. That's why I thought of a problem between AND and OR. Okay. I've had a look, and with the D000 request area, it does wait for up to one second to see if can get both departures and arrivals in one answer, but after the timeout it gives neither if both aren't found. I'll change the timeout action to accept either, as you suggest. This will be in the next release (4.943), but I have some more things to do first. Hopefully it'll be before the weekend.or at the latest, during the weekend. Pete
Claude Troncy Posted August 12, 2015 Author Report Posted August 12, 2015 Thank you Pete. Take your time for the fix, I am not in a hurry. Best regards Claude
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