Jump to content
The simFlight Network Forums

eviljonbob

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by eviljonbob

  1. I have been looking at doing the same thing to visualize some data from another application. It would be great to hear how you are going with this! I tried Netpipes as well early last year, but got distracted on another project. Let us know!
  2. Hi Chris, Thanks for your constructive assistance. I changed aircraft and tried your code with mine. It still gave both inner and middle as true at the same time, however with the addition of: If iMkr Then If mMkr Then mMkr = False End If End If The markers behaved correctly. If it works on your system without this code, then it must be a glitch in mine. Your code is a lot simpler and works. I have learnt a lot from this exchange (some good, some bad). Thanks for your time. E
  3. I had another look at FSInterrogate and the parameters are quite interesting. I think I know what is going on now. I knew that there was an overlap when I was getting both the inner and middle markers showing true so I handled that by saying in my code that if the inner marker is on and the middle marker is on, the inner marker has priority. As I fly over, I get to a certain point over the inner marker (0BAC), when the middle marker (0BAE) goes low and the 32 bit (4 Byte?) column in the 0BAA offset shows 65536. (See the second attached image). At this point, the lights on my parallel port start going wonky. I obviously need to do some logic to handle this event. It would be great to get access to that 4 byte area to see if it was anything but 0 and the inner marker light was on, then it is on until 0BAC is false. I was sort of assuming that because FSInterrogate can read these figures, that I could as well. If this isn't possible, then I can live with the inner marker light acting up. I hope that this will help other people in any case. It is an exercise to allow me to understand this better even if the OMI lights aren't used often. E :?
  4. Hi Chris, Thanks for looking at it. I changed the figures and it was still the same behaviour. I looked at FSInterrogate as Pete suggested and noticed that the 32 bit and Float64 parameters change at the exact moment the light goes off on the parallel port. The sim light remains lit. I also noticed that the middle marker 8 bit "1" stays on for a little while after the inner marker goes on, I took care of this in my code by saying that if the middle marker light comes on and the inner marker goes true, then the inner marker has priority. I am not quite sure how to handle the 32 bit and Float64 parameters within the code. It seems that these changing is the cause of my problems. If I can get the program to ignore these and only turn off when the 8bit parameter goes low then it will work. E
  5. Thanks for the reply Pete, I will try FSInterrogate as you suggest. This was an exercise initially to get it working, I now want to get some eyebrow lights working for my helo sim. The next experiment is to get the warning lights going. (low rpm, oil, fuel etc). Thanks for your help and your work (without which I wouldn't be doing any of this) !
  6. Hi Guys, I have a small programming problem that I was hoping someone could help me with. I am playing around with the FSUIPC SDK and VB and experimenting with the parallel port. Basically I have written a small program that is supposed to turn on LED's connected to the port when the Marker lights are activated in the sim. I have everything working (cool) apart from a small glitch. This is when I am over the Inner marker. It de-activates the light too early. It is fairly consistant when it happens, it seems to be at the same point when the light turns itself off, even though the sim light is still on. I am not really a programmer, so it is probably something stupid I am not doing right. The code fragment for the relevant routine is below. You will note that it is an expansion of the example in the SDK. The PortOut Call turns the appropriate pin on or off. Private Sub Timer2_Timer() Dim dwResult As Long Dim omiInnermkr() As Byte Dim omiMiddlemkr() As Byte Dim omiOutermkr() As Byte ReDim omiInnermkr(2) ReDim omiMiddlemkr(2) ReDim omiOutermkr(2) ' As an example of retrieving data, we will get the Marker status. ' If we wanted additional reads/writes at the same time, we could put them here If FSUIPC_Read(&HBAC, 2, VarPtr(omiInnermkr(1)), dwResult) Then ' "Read" proceeded without any problems If FSUIPC_Process(dwResult) Then ' "Process" proceeded without any problems If omiInnermkr(1) Then shpInner.FillColor = &HFFFFF Call PortOut(888, 1) Else If omiInnermkr(1) = False Then shpInner.FillColor = &H0& ' Call PortOut(888, 0) End If End If Else Label7.Caption = "Processing: " & ResultText(dwResult) End If Else ' Unable to "Read" Label7.Caption = "Reading: " & ResultText(dwResult) End If If FSUIPC_Read(&HBAE, 2, VarPtr(omiMiddlemkr(0)), dwResult) Then ' "Read" proceeded without any problems If FSUIPC_Process(dwResult) Then ' "Process" proceeded without any problems If omiMiddlemkr(0) Then shpMiddle.FillColor = &HFF00& Call PortOut(888, 2) Else If omiMiddlemkr(0) = False Then shpInner.FillColor = &H0& Call PortOut(888, 0) End If End If If omiMiddlemkr(0) Then If omiInnermkr(1) Then shpMiddle.FillColor = &H0& Call PortOut(888, 1) Else If omiMiddlemkr(0) = False Then shpInner.FillColor = &H0& Call PortOut(888, 0) End If End If End If Else ' Unable to "Process" Label7.Caption = "Processing: " & ResultText(dwResult) End If Else ' Unable to "Read" Label7.Caption = "Reading: " & ResultText(dwResult) End If If FSUIPC_Read(&HBB0, 2, VarPtr(omiOutermkr(0)), dwResult) Then ' "Read" proceeded without any problems If FSUIPC_Process(dwResult) Then ' "Process" proceeded without any problems If omiOutermkr(0) Then shpOuter.FillColor = &HFF00& Call PortOut(888, 4) Else ' Call PortOut(888, 0) shpOuter.FillColor = &H0& End If Else ' Unable to "Process" shpMiddle.FillColor = &H0& End If Else ' Unable to "Read" Label7.Caption = "Reading: " & ResultText(dwResult) End If End Sub Any help would be appreciated. Thanks! E :wink:
×
×
  • 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.