Jump to content
The simFlight Network Forums

Paul Henty

Members
  • Posts

    1,652
  • Joined

  • Days Won

    74

Everything posted by Paul Henty

  1. Hi, It sounds like you're developing on a 64bit OS and have your Visual Studio project set to target any processor type (the default setting). This is the usual cause of this error. You must set your project to target only x86 processors. (See the Build tab in the project properties window). My DLL is 32 bit only and cannot be linked into a 64 bit app. (It can't be compiled to run as a 64bit DLL because it will not be able to talk to FSUIPC which is running in a 32-bit program (FS)). Paul
  2. On the main forum page, there should be a button at the top of all the topics that says 'Stop Watching Forum'. It's next to the 'start new topic' button. Paul
  3. The Key is only one part of the registration. All three parts must be identical to that shown on SimMarket. The Name, Email and the Key. If you spell you name differently for example or enter a different email address then it will fail. Another common problem is that the date set on the PC is earlier than the date you purchased the Key. Paul
  4. Hi Bob, I don't know of a pre-built tool, but you might want to look at the LUA scripting language that's integrated into FSUIPC now. It has facilities to read and write from FSUIPC offsets and also to read and write data to/from the serial port. You'll need to learn the LUA language but there are plenty of examples provided with FSUIPC and the syntax is very simple. It might be easier than using a compiled language like VB, C# or C++ etc. See this thread for the details: Latest LUA Package for FSUIPC You'll need a registered version of FSUIPC to use the LUA facilities. I've never really used LUA so I wouldn't be able to help with the specifics, but others here (and Pete when he gets back from holiday) will be able to help. Paul
  5. OK, that sounds fine then. It was just something to check as the most likely cause of the 'already open' error. Paul
  6. All I would suggest is to make sure that all your calls to Process() are wrapped in a Try..Catch block. In the Catch for the FSUIPCException type, make sure you call the FSUIPCConnection.Close() method after reporting the failure. This will enable your application to re-open the connection again. Paul
  7. I think the program is using my .NET DLL. It's looks like my error message. The first error (#12) is thrown under the same circumstances as the C source; that is, the GetLastError() being other than 0. So it's the same error, just my wording "Error sending message" along side the original C SDK enum value. The "Already Open" message is almost certainly because my DLL thinks the connection is still open after it failed. In other words, when the application caught the first "Error sending message" exception it didn't call FSUIPCConnection.Close() to close the now bad connection. Therefore any attempt to open the connection again will result in the "Already open" error you are seeing. I could add some extra information to that first exception to return the result of GetLastError(). This may help identify what the underlying problem is. Let me know if you want me to do that, or if there is any other way I can help. Paul
  8. If you mean you want to run your application as a proper FS module, inside the FS application itself, then the short answer is you can't. You need to write modules in C or C++, I don't know anyone who has written one in C# or VB.NET. There may be a way of doing it but it would require the use of the FSX SDK if it's at all possible. Even if you could get a module working, you cannot use my DLL to communicate with FSUIPC. My DLL uses the external FSUIPC interface. Proper modules need to use the internal FSUIPC interface. However, if you just want to create a menu item in FS that does something then look at offset 0x2FE0. Paul
  9. Hi Pete, I'm looking at the output files from MakeRwys.exe. In the RC5.CSV there is a Threshold Offset value. Please can you explain what this is? Also for the Taxiways file T5.CSV the description of the lines is: ICAO,TaxiwayName,MinimumWidthMetres,PointList ... In a typical line I can see some single numbers highlighted below. I can't work out what they might be. KBUR,,15.24,34.195736,-118.359337,5,15.24,34.196102,-118.359322,1,0.00 There also seems to be more than one width and the last number is always 0. Could you please explain a bit more about the data in this file? Thanks, Paul
  10. You're welcome. No need to apologise. It's good to hear you're OK. Paul
  11. FSUIPC has a facility at offset 0x2900 that sends FS controls to the AI traffic. The documentation describes its use, although it is not clear which FS controls work with AI traffic. You will need to experiment. To delete an AI Plane you can send control 0xFFFF. The example code for this is below. The ID for the AI Plane can be found using the ID property of the AIPlaneInfo class using my DLL. See my documentation and the sample application for getting AI Traffic information. Alternatively Pete's TrafficLook.exe program will show you AI traffic with the ID in the 'REF' column. Note these are shown as positive numbers when they are actually negative. The same sample code can be used to send any other controls you want. Just change the control number and assign a parameter if required. Dim aiControl_ID As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)("AIControl", &H2900) Dim aiControl_Control As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)("AIControl", &H2904) Dim aiControl_Param As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)("AIControl", &H2908) Private Sub deleteAIPlane(ByVal aiPlaneID As Integer) aiControl_Control.Value = &HFFFF ' special DELETE control aiControl_Param.Value = 0 ' no Parameter for delete aiControl_ID.Value = aiPlaneID ' Always write the ID value AFTER the control and paramter FSUIPCConnection.Process("AIControl") End Sub Paul
  12. Hello Tinsukou, Using the New Weather Interface in FSUIPC is much more complicated than reading normal offsets, especially with a language like VB.NET. An example would take anyone many hours to write and test. I do plan to put an easy method of reading and writing weather in my DLL (like I have done with AI Traffic) but I don't know when I will have time to do this. Sorry I can't help with this at the moment. Paul
  13. Example of setting the local or UTC time from VB.NET... Dim zmin As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("time", &H23C) Dim zhour As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("time", &H23B) Dim second As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("time", &H23A) Dim hour As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("time", &H238) Dim min As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("time", &H239) Private Sub btnSetTime_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSetLocalTime.Click ' set Local time to 20:33:05 hour.Value = 20 min.Value = 33 second.Value = 5 FSUIPCConnection.Process("time") ' OR set UTC (zulu) time to to 20:33:05 'zhour.Value = 20 'zmin.Value = 33 'second.Value = 5 'FSUIPCConnection.Process("time") End Sub Paul
  14. Hello Tinsukou, You don't need to use arrays here, just use 'Byte's. Also call the process() after assigning the values to the time offsets: Dim zmin As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("time", &H23C) Dim zhour As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("time", &H23B) Dim second As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("time", &H23A) Dim hour As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("time", &H238) Dim min As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)("time", &H239) Private Sub btnSetTime_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSetLocalTime.Click ' set Local time to 20:33:05 hour.Value = 20 min.Value = 33 second.Value = 5 FSUIPCConnection.Process("time") ' OR set UTC (zulu) time to to 20:33:05 'zhour.Value = 20 'zmin.Value = 33 'second.Value = 5 'FSUIPCConnection.Process("time") End Sub Paul
  15. Hi Jack, Pete is away at the moment but I can answer your question as I also use two Saitek Yokes. FSUIPC has facilities to do exactly want you want. In fact it can do better than what you want because it allows you to actually use the two yokes at the same time. The largest moving deflection of the two yokes is sent to the flight sim. To use this facility you need to assign the axes of both Yokes in FSUIPC (on the Axes tab). Assign them both to "Direct to FSUIPC Calibration" and select the correct axis (ie, Elevators and Ailerons). Then you just calibrate the axes as normal on the calibration tab of FSUIPC. You must also make sure that the yokes are NOT assigned in FSX itself. For more details on how to use the tabs see the FSUIPC user guide, especially the section called "Axis Assignments". Paul
  16. Emmanuel, Pete is away for a bit so I thought I'd chip in here in case you're not clear how to proceed. It looks like you're using the old-school c# SDK so my advice is based on that. Some of the offsets you are trying to write (e.g. 0x3101) are only 1 byte long. You are declaring your KeySwitch variable as Int32 which is fine for Master Avionics at 2E08 (because that is 4 bytes) but not for 3101. You are accidentally writing subsequent offsets (3101, 3102, 3103 and 3104) at the same time. You need to declare another variable as 'byte' and use that in the _Write() method. This will invoke the correct overload and only write 1 byte to FSUIPC, not the 4 your are currently writing with the Int32 variable. So it will be something like: byte altswitch; //Variable declaration for 1 byte offsets altswitch = 0; // Or 1 result = fsuipc.FSUIPC_Write(0x3101, altswitch, ref token, ref dwResult); result = fsuipc.FSUIPC_Process(ref dwResult); For 2 Byte offsets your data must be passed in a variable of type 'short'. If you've not written much FSUIPC code you might want to look at my FSUIPC Client DLL for .NET. It's much easier to use than the SDK you are using and supports all FSUIPC offsets. The SDK you are using doesn't handle any floating point or string offsets and doesn't do unsigned integers. (However, I do have code that can add such support if you really want to carry on using it). My DLL also comes with a user guide that explains what type of C# variables to use for each type of FSUIPC offset. The DLL is free and can be downloaded from the 'Downloads' sub-forum: FSUIPC Client DLL For .NET Paul
  17. Hi Hansel, This thread was about AI traffic information. You seem to want information about the currently loaded aircraft. &H3160 is for currently loaded aircraft. I don't know where you can get the full aircraft model. Maybe Pete can help you with this. All the features in the 1.4Beta version of my DLL are in the current official 2.0 release. This is available in the downloads sub forum: FSUIPC Client DLL For .NET 2.0 Paul
  18. OK I've just looked at the FSUIPC Programmer's guide - the problem is not with the conversion code but with your offset declaration. You say you've declared it as an Integer (4 bytes), but the docs say it's only 2 bytes. So you need to declare it as a 2-byte integer or 'Short' in VB. See my User Guide for a table of what VB types to use for the various offset lengths and types. At the moment you are getting data from 0x898 and the next offset as well (0x89A) all rolled into one value. So you need this: Dim fs1n1 As Offset(Of Short) = New Offset(Of Short)(&H898) Paul
  19. I think that's what happening here. The literals you are defining in this line are all integers because you haven't told VB otherwise: Dim eng1n1 As Double = (fs1n1.Value * 100 / 16384) So everything to the right of the equals is happening as integers, not double floating points. If you set the literals to be doubles then the VB compiler will convert the integer value from fs1n1.Value to a double first. Then all the maths is done as doubles. So try this: Dim eng1n1 As Double = (fs1n1.Value * 100D / 16384D) Paul
  20. Hi, Writing to offsets using my DLL is very clearly explained in the User Guide supplied with the DLL. It is also demonstrated in the example application. Please take some time to go through the materials supplied and learn how the DLL works. Briefly, you need to declare the offset (usually at the form or class level): private Offset<short> NWICommand = new Offset<short>(0xC800, true); (Note that the type is 'short' because the offset is a two-byte integer (see the NewWeather.h file in the FSUIPC SDK). Also the offset should be 0xC800, not 0x0800 (Autopilot Approach Hold) as shown in your sample code.) NW_CLEAR represents the value 3 (see the NewWeather.h file in the FSUIPC SDK) so we'll declare that as well at the form (or class) level: private readonly short NW_CLEAR = 3; Then in your program you just assign the value to the offset and call Process(). private void ClearWeather() { NWICommand.Value = NW_CLEAR; FSUIPCConnection.Process(); } In a real application you would probably want to keep the weather offsets in their own groups. Grouping is also explained in the User Guide. Paul
  21. If you are using my Client DLL (as opposed to the older C# SDK) here is some information about using it in multiple threads: The FSUIPCConnection class only supports one connection per instance of WideClient.exe. Once the connection is open you can call into the FSUIPCConnection static class from any thread. The Process() call is thread-safe - if two threads call it at the same time the second is blocked until the process on the first is complete. By using the offset groups you can process different groups of offsets in different threads at different timing intervals. Paul
  22. You are all very welcome :smile: Your thanks are very much appreciated. Paul
  23. 2.0 is the latest, it only came out about two weeks ago. Paul
  24. Hello to all you DLL users. I've finally managed to officially release the next version of the DLL. :smile: See the first page of this thread for the details and to download. This is Version 2.0. It incorporates all the updates that have been part of the unreleased 1.4 Beta versions that a few people have. If you are using one of the 1.4 versions I recommend you upgrade to 2.0. I wish you all a happy and prosperous 2011. Paul
×
×
  • 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.