Jump to content
The simFlight Network Forums
String

PFC C2 Pro - Fuel Selector Marco PFCHID

Recommended Posts

Hello,

I am using a registered copy of FSUIPC 5.122 with PFChid 5.01 (PFChid64.dll) on W10-64 bit and using P3DV4.2 flying the Carenado A36

I am in the process of setting up a PFC C2 Pro Console and have run into an issue writing the macro file to re-assign one of the two "Tank Select " switches that has three possible positions. 

PFC.mcro

[Macros]
1=TankSelect1/0=C65957

2=TankSelect1/1=C65955

3=TankSelect1/2=C65958

I think the issue I am having has less to do with the commands that are being sent, but more to do with the switch not sending the command. Using the macro as seen above, the Tank Select in P3D moves to the off position and will not move when I rotate the Tank Select switch on the C2 Pro or by mouse in the aircraft. If I only enter "TankSelect1/0=C65957" line into the macro, then when rotating the switch completely left, the Tank Select in P3D will switch to the left (easy). Whenever I introduce this line "2=TankSelect1/1=C65955" to the macro, the Tank Select in P3D moves to the off position and will not move when I rotate the Tank Select switch on the C2 Pro or by mouse in the aircraft. Running only the "3=TankSelect1/2=C65958" line in the macro by itself, the Tank Select in P3D does not move, but you can move it by mouse in the aircraft.

Help is very much appreciated.

Chris

Edited by String

Share this post


Link to post
Share on other sites
13 hours ago, String said:

I think the issue I am having has less to do with the commands that are being sent, but more to do with the switch not sending the command. Using the macro as seen above, the Tank Select in P3D moves to the off position and will not move when I rotate the Tank Select switch on the C2 Pro or by mouse in the aircraft. If I only enter "TankSelect1/0=C65957" line into the macro, then when rotating the switch completely left, the Tank Select in P3D will switch to the left (easy). Whenever I introduce this line "2=TankSelect1/1=C65955" to the macro, the Tank Select in P3D moves to the off position and will not move when I rotate the Tank Select switch on the C2 Pro or by mouse in the aircraft. Running only the "3=TankSelect1/2=C65958" line in the macro by itself, the Tank Select in P3D does not move, but you can move it by mouse in the aircraft.

Can you log "Events" in FSUIPC then check what is being sent? Do those standard sim controls actually work on that aircraft? It sounds like they don't, or not properly and there's no way sending a standard command should then prevent a switch being moved by mouse. How do you recover from that - reload the aircraft or restart P3D?

I see the Carenado A36 is one of the included P3D4 aircraft, so I can test these commands on it here, myself. but I will be assigning keyboard or Goflight buttons. And it may not be today. There's also a "FUEL SELECTOR SET" control, which would need a parameter (probably 0,1,2,3).

BTW FSUIPC 5.122 is out of date. The current one is 5.14. You should really update when asking for support, just in case things have changed.

Pete

 

Share this post


Link to post
Share on other sites

I have done some tests. The controls you are using work fine. Also the FUEL SELECTOR SET control works with parameters 0=OFF, 2=LEFT, 3=RIGHT. I cannot make the mouse operate the switch properly no matter what I do -- and that's true just after loading P3D, with no attempts to use those controls.  Occasionally, after clicking many times in various places it will select "RIGHT", but then won't move at all -- with the mouse. No trouble with the controls though.

So, it looks like your mouse problems are to do with the Carenado implementation, or a P3D bug.

For your macros sending those controls, I can't advise. We need a log showing their use with your switch. Enable both Button and Event logging. We may need PFCHid logging as well, but that's another matter which I'd advise on afterwards.

Pete

 

Share this post


Link to post
Share on other sites

Now running FSUIPC 5.14

I have attached the log file with Button and Event logging enabled. I also ran P3D in Win mode with the log console open. Watching the events "real time" appears the sim control for the "TankSelect" repeats without pause continually sending the sim control.

Chris 

 

 

FSUIPC5.log

Share this post


Link to post
Share on other sites
55 minutes ago, String said:

I have attached the log file with Button and Event logging enabled. I also ran P3D in Win mode with the log console open. Watching the events "real time" appears the sim control for the "TankSelect" repeats without pause continually sending the sim control.

Ah, I see.  With a switch (as opposed to a button), I think you need a + or - added to the switch name, to denote whether to do the action when it switches on or off. Without that it just looks like a button being held down.

See the PFCHid document, page 5.

Pete

 

Share this post


Link to post
Share on other sites
1 minute ago, spokes2112 said:

Sorry to say nothing will work. Carenado decided to use G:Vars for controlling the fuel selector within the interior .mdl.

Not sure what G:Vars are, but certainly the regular sim controls (the ones assigned to these macros) work fine. Tested here by assigning directly to switches (one switch each for the three positions).

Pete

 

Share this post


Link to post
Share on other sites

Sorry Pete,  just tested the old fashioned way with the Carenado A-36, via keyboard.. Works perfectly via FSUIPC commands.
Suppose too much coffee & over thinking it based on previous posts..

Have a great evening. 
Roman

Share this post


Link to post
Share on other sites
23 minutes ago, Pete Dowson said:

Ah, I see.  With a switch (as opposed to a button), I think you need a + or - added to the switch name, to denote whether to do the action when it switches on or off. without that it just looks like a button being held down.

See the PFCHid document, page 5.

Pete

 

Tested the following in the macro one at a time and observed the following results in the logging console:

1=TankSelect1/0=C65957 -- Works perfect selector rotates to the left tank, does not repeat

 

2=TankSelect1/1=C65955 -- Repeats the sim command continuously

Note: I was unsure of the location of the "+" so I test the following three locations and tested the "-" as well in each of the positions

2=TankSelect1/1+=C65955 -- Does not send the command 

2=TankSelect1+/1=C65955 -- Does not send the command 

2=TankSelect+1/1=C65955 -- Does not send the command 

 

3=TankSelect1/2=C65958 -- Does not send the command 

Chris

Share this post


Link to post
Share on other sites

Below is the log with no lines entered in the macro file and cycling the left fuel tank select switch on the C2 Pro through each position.

Console Started ...

[Continuation log requested by user]
Running inside Prepar3D v4 on Windows 10
Module base=7FFFE48C0000
  2265093 *** EVENT: Cntrl= 65794 (0x00010102), Param= 0 (0x00000000) PAUSE_ON
  2267781 *** EVENT: Cntrl= 65962 (0x000101aa), Param= 1 (0x00000001) FUEL_SELECTOR_SET
  2268937 *** EVENT: Cntrl= 65962 (0x000101aa), Param= 0 (0x00000000) FUEL_SELECTOR_SET
  2271172 *** EVENT: Cntrl= 65962 (0x000101aa), Param= 1 (0x00000001) FUEL_SELECTOR_SET
  2272609 *** EVENT: Cntrl= 65962 (0x000101aa), Param= 14 (0x0000000e) FUEL_SELECTOR_SET
  2273609 *** EVENT: Cntrl= 65962 (0x000101aa), Param= 14 (0x0000000e) FUEL_SELECTOR_SET
  2275515 *** EVENT: Cntrl= 65794 (0x00010102), Param= 0 (0x00000000) PAUSE_ON
 

Chris

Share this post


Link to post
Share on other sites
39 minutes ago, String said:

1=TankSelect1/0=C65957 -- Works perfect selector rotates to the left tank, does not repeat

 

2=TankSelect1/1=C65955 -- Repeats the sim command continuously

I suspect the 0 position is in fact an "off", whereas the other two areboth "on". I don't though know. I haven't had a Cirrus for many years now.

42 minutes ago, String said:

2=TankSelect1/1=C65955 -- Repeats the sim command continuously

Note: I was unsure of the location of the "+" so I test the following three locations and tested the "-" as well in each of the positions

2=TankSelect1/1+=C65955 -- Does not send the command 

2=TankSelect1+/1=C65955 -- Does not send the command 

2=TankSelect+1/1=C65955 -- Does not send the command 

I don't know the position of the + either. In fact I'd forgotten all about the /position bit -- I thought at first glance that was partr of the name. But looking now at the document i see in fact that it wouldn't take a + or - parameter, as the /n facility is specifically intended to deal with rotary multi-position switches.

So I'm puzzled as to how the ther positions are repeating. Have you tried using the PFCHid logging? The document list this log option which may show what is going on:

 

LogDecode=Yes
 

32 minutes ago, String said:

2267781 *** EVENT: Cntrl= 65962 (0x000101aa), Param= 1 (0x00000001) FUEL_SELECTOR_SET

Ah, so it is using the SET control, not the specific positions! 

So why are you trying to change that via macros? And if you really want to, which not simply have the one line "TankSelector1"?

Pete

 

 

Share this post


Link to post
Share on other sites
3 hours ago, Pete Dowson said:

So I'm puzzled as to how the ther positions are repeating. Have you tried using the PFCHid logging? The document list this log option which may show what is going on:

LogDecode=Yes


So why are you trying to change that via macros? And if you really want to, which not simply have the one line "TankSelector1"?

Pete

I would like to change the sim control via macro because the default "Param" coming from PFChid for the "Tank Select" are 0=OFF, 1=ALL, 14=Crossfeed left to right and I am in need of OFF, LEFT, RIGHT.

 

It is my understanding that I need more than adding "TankSelector1" because of the specifically intended /n facility to deal with rotary multi-position switches. I might not understand what you mean by a single line.

 

I conducted another test with the following macro that is the same as the first macro I used, but this time I am using the "TankSelect2"

[Macros]
1=TankSelect2/0=C65958
2=TankSelect2/1=C65955
3=TankSelect2/2=C65957

Using this macro and the second tank select on the C2 Pro; position bits "0" and "1" work perfect, but still unable to get position bit "2" to send the sim command.

 

Below is a print of the PFChid64 log. I had an issue uploading it, so I copied and pasted it for you. I rotated both Tank Selects on the C2 Pro as seen at the bottom of the log.

********* PFChid, Version 5.01 by Pete Dowson *********
        0: Listing macros from "C:\Flight Sim\Prepar3D v4\Modules\PFC.mcro"
        0: INI section "Config" selected
        0: Macro file to be used: "PFC"
        0: Error 6 [00000006] returned on HidD_GetAttributes:  (\\?\hid#vid_046d&pid_c517&mi_01&col01#7&dcfa928&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030})
        0: Error 6 [00000006] returned on HidD_GetAttributes:  (\\?\hid#vid_046d&pid_c521&mi_00#7&29fa4020&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030})
        0: Error 6 [00000006] returned on HidD_GetAttributes:  (\\?\hid#vid_046d&pid_c517&mi_00#7&31a6e6ea&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030})
  
  Manufacturer= Precision Flight Controls, Inc.
  Product= PFC MFD Rudder Pedals
  Vendor=0689, Product=D010
  Serial Number= PFC MFD Rudder Pedals
       16: ... Ok, added as device #1
  
  Manufacturer= Precision Flight Controls, Inc.
  Product= PFC Cirrus II Pro
  Vendor=0689, Product=C200
  Serial Number= PFC Cirrus II Pro
       16: ... Ok, added as device #2
       78: Device #2 received: META FormatVersion = 2
       94: Device #2 received: META ReportSupported = Class 08, Cmd 0001, Indx 0
       94: Device #2 received: META ElevTrimLimits = 0 to 804
       94: Device #2 received: META FormatVersion = 2
       94: Device #2 received: META FirmwareDate = ID 4098, 2015-7-7
       94: Device #2 Raw[41] = 02 FF 13 00 00 00 00 00 00 00 00 00 00 00 00 00
       94:                     00 00 00 00 00 02 FF 11 D0 07 D0 07 00 00 00 00
       94:                     00 00 00 00 00 00 00 00 00
       94: Device #2 received: META Unhandled metadata 19 ((null))
       94: Device #2 Raw[41] = 02 FF 11 D0 07 D0 07 00 00 00 00 00 00 00 00 00
       94:                     00 00 00 00 00 02 FF 0D FF 00 11 00 00 00 00 00
       94:                     00 00 00 00 00 00 00 00 00
       94: Device #2 received: META Unhandled metadata 17 ((null))
       94: Device #2 received: META ReportSupported = Class FF, Cmd 0011, Indx 0
       94: Device #2 received: META ElevTrimLimits = 0 to 804
       94: Device #1 received: META FormatVersion = 2
       94: Device #1 Raw[41] = 02 FE 00 02 00 00 00 00 00 00 00 00 00 00 00 00
       94:                     00 00 00 00 00 02 01 01 0C 00 04 00 00 00 00 42
       94:                     04 00 FB 01 00 00 00 00 00
       94: Device #1: Unhandled Calibration (select 0, type 2)
       94: Device #1 received: ToeBrakes[1] = 4 (0 normalised)
       94: Device #1 received: Rudder[0] = 255 (0 normalised)
       94: Device #1 received: META FormatVersion = 2
       94: Device #1 received: META FirmwareDate = ID 53264, 2011-12-19
       94: Device #1 received: META FirmwareVersion = ID 53264, 1.3)
       94: Device #1 received: META ReqFullReport
      141: Device #2 received: META ReportSupported = Class FF, Cmd 0012, Indx 0
      141: Device #2 received: META ReportSupported = Class FF, Cmd 0003, Indx 0
      141: Device #2 received: META ReportSupported = Class FF, Cmd 0013, Indx 0
      141: Device #2 received: META ReportSupported = Class 09, Cmd 0001, Indx 0
      141: Device #2 received: META ReportSupported = Class 09, Cmd 0002, Indx 0
      141: Device #2 received: META FirmwareVersion = ID 136, 1.3)
      172: Device #2 received: META FormatVersion = 2
      172: Device #2 received: META ReportSupported = Class 08, Cmd 0001, Indx 0
      172: Device #2 received: META ElevTrimLimits = 0 to 804
      172: Device #2 received: META FormatVersion = 2
      172: Device #2 received: META FirmwareDate = ID 4098, 2015-7-7
      219: Device #2 received: META ReportSupported = Class FF, Cmd 0011, Indx 0
      219: Device #2 Raw[41] = 02 FF 13 00 00 00 00 00 00 00 00 00 00 00 00 00
      219:                     00 00 00 00 00 02 FF 11 D0 07 D0 07 00 00 00 00
      219:                     00 00 00 00 00 00 00 00 00
      219: Device #2 received: META Unhandled metadata 19 ((null))
      219: Device #2 Raw[41] = 02 FF 11 D0 07 D0 07 00 00 00 00 00 00 00 00 00
      219:                     00 00 00 00 00 02 FF 0D FF 00 12 00 00 00 00 00
      219:                     00 00 00 00 00 00 00 00 00
      219: Device #2 received: META Unhandled metadata 17 ((null))
      219: Device #2 received: META ReportSupported = Class FF, Cmd 0012, Indx 0
      219: Device #2 received: Hdg[0] = 0
      250: Device #2 received: Airspeed[0] = 0
      250: Device #2 received: META ElevTrimLimits = 0 to 804
      250: Device #2 Raw[41] = 02 FF 11 D0 07 D0 07 00 00 00 00 00 00 00 00 00
      266:                     00 00 00 00 00 02 FF 04 00 00 24 03 00 00 00 00
      266:                     00 00 00 00 00 00 00 00 00
      266: Device #2 received: META Unhandled metadata 17 ((null))
      266: Device #2 received: META ElevTrimLimits = 0 to 804
      266: Device #2 received: META ReportSupported = Class FF, Cmd 0003, Indx 0
      297: Device #2 Raw[41] = 02 FF 11 D0 07 D0 07 00 00 00 00 00 00 00 00 00
      297:                     00 00 00 00 00 02 FF 0D FF 00 13 00 00 00 00 00
      297:                     00 00 00 00 00 00 00 00 00
      297: Device #2 received: META Unhandled metadata 17 ((null))
      297: Device #2 received: META ReportSupported = Class FF, Cmd 0013, Indx 0
      297: Device #2 received: META ReportSupported = Class 09, Cmd 0001, Indx 0
      297: Device #2 received: META ReportSupported = Class 09, Cmd 0002, Indx 0
      297: Device #2 received: META ElevTrimLimits = 0 to 804
      328: Device #2 received: META ReportSupported = Class 02, Cmd 0008, Indx 0
      328: Device #2 received: META ReportSupported = Class 08, Cmd 0001, Indx 0
      328: Device #2 Raw[41] = 02 FF 11 D0 07 D0 07 00 00 00 00 00 00 00 00 00
      328:                     00 00 00 00 00 02 FF 04 00 00 24 03 00 00 00 00
      328:                     00 00 00 00 00 00 00 00 00
      328: Device #2 received: META Unhandled metadata 17 ((null))
      328: Device #2 received: META ElevTrimLimits = 0 to 804
      328: Device #2 Raw[41] = 02 FF 11 D0 07 D0 07 00 00 00 00 00 00 00 00 00
      328:                     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      328:                     00 00 00 00 00 00 00 00 00
      328: Device #2 received: META Unhandled metadata 17 ((null))
      375: Device #2 received: META ElevTrimLimits = 0 to 804
      375: Device #2 received: META ReportSupported = Class 08, Cmd 0003, Indx 0
      375: Device #2 received: META ReportSupported = Class 08, Cmd 0002, Indx 0
      375: Device #2 received: META ReportSupported = Class 08, Cmd 0004, Indx 0
      407: Device #2 received: META ReportSupported = Class 08, Cmd 0006, Indx 0
      407: Device #2 received: META ReportSupported = Class 07, Cmd 0001, Indx 0
      407: Device #2 received: META FirmwareVersion = ID 4098, 5.0)
      407: Device #2 Raw[41] = 02 FF 0E 00 00 00 00 00 00 00 00 00 00 00 00 00
      407:                     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      407:                     00 00 00 00 00 02 FF 01 02
      407: Device #2 received: META Unhandled metadata 14 (EquipAddedRemoved)
      438: Device #2 received: ThrottleQuad[0] = 68 (14049 normalised)
      438: Device #2 received: ThrottleQuad[1] = 0 (16383 normalised)
      485: Device #2 received: ThrottleQuad[2] = 950 (-16008 normalised)
      485: Device #2 received: ThrottleQuad[3] = 0 (16383 normalised)
      485: Device #2 received: ThrottleQuad[4] = 958 (-16112 normalised)
      485: Device #2 received: ThrottleQuad[5] = 0 (16383 normalised)
      516: Device #2 received: ApDisconnect[0] = 0
      516: Device #2 received: PitchTrim[0] = 0
      516: Device #2 received: Cws[0] = 0
      547: Device #2 received: Ailerons[0] = 515 (422 normalised)
      547: Device #2 received: Elevator[0] = 534 (0 normalised)
      547: Device #2 received: RudderTrim[0] = 518 (192 normalised)
      578: Device #2 received: AileronTrim[0] = 510 (-64 normalised)
      578: Device #2 received: ElevatorTrim[0] = 128 (-11168 normalised)
      610: Device #2 received: CowlFlaps[0] = 2
      610: Device #2 received: CowlFlaps[1] = 2
      641: Device #2 received: TankSelect[0] = 1
      641: Device #2 received: TankSelect[1] = 1
      688: Device #2 received: Flaps[0] = 2
      688: Device #2 received: Alternator[0] = 0
      688: Device #2 received: Alternator[1] = 0
      719: Device #2 received: FuelBoost[0] = 0
      719: Device #2 received: FuelBoost[1] = 0
      719: Device #2 received: LandingGear[0] = 1
      750: Device #2 received: Magneto[0] = 0
      750: Device #2 received: Magneto[1] = 0
      750: Device #2 received: CarbHeater[0] = 0
      782: Device #2 received: Battery[0] = 0
      891: Device #2 received: Avionics[0] = 0
      985: Device #2 received: AltAir[0] = 0
      985: Device #2 received: PitotHeat[0] = 0
      985: Device #2 received: ParkingBrake[0] = 0
      985: Device #2 received: CarbHeater[1] = 0
      985: Device #2 received: META ReqFullReport
     3125: Using macros from "C:\Flight Sim\Prepar3D v4\Modules\PFC.mcro" selected
     5032: Device #2 received: TankSelect[0] = 0
     6391: Device #2 received: TankSelect[0] = 1
     7297: Device #2 received: TankSelect[0] = 3
     9063: Device #2 received: TankSelect[1] = 2
    10125: Device #2 received: TankSelect[1] = 1
    11141: Device #2 received: TankSelect[1] = 0
    12844: Device #2 received: TankSelect[1] = 1
    13938: Device #2 received: TankSelect[1] = 2
********* PFChid Log file closed *********

Thank you for the help

Chris 

Share this post


Link to post
Share on other sites
1 hour ago, String said:

I would like to change the sim control via macro because the default "Param" coming from PFChid for the "Tank Select" are 0=OFF, 1=ALL, 14=Crossfeed left to right and I am in need of OFF, LEFT, RIGHT.

Oh, I see. My error.

1 hour ago, String said:

It is my understanding that I need more than adding "TankSelector1" because of the specifically intended /n facility to deal with rotary multi-position switches. I might not understand what you mean by a single line.

That was assuming the switch returned the values needed, they would be parameters to a single macro. So you'd get FUEL_SELECTOR_SET with parameters 0, 1, 2.  I assume (if that's what is returned by the Cirrus), but now I see that those aren't the values you want. I also may be interpreting the documentation for the DLL incorrectly.

1 hour ago, String said:

     5032: Device #2 received: TankSelect[0] = 0
     6391: Device #2 received: TankSelect[0] = 1
     7297: Device #2 received: TankSelect[0] = 3
     9063: Device #2 received: TankSelect[1] = 2
    10125: Device #2 received: TankSelect[1] = 1
    11141: Device #2 received: TankSelect[1] = 0
    12844: Device #2 received: TankSelect[1] = 1
    13938: Device #2 received: TankSelect[1] = 2

Thst seems odd. Two tank selector switches, but one returning 0, 1, 3, and the other 0, 1, 2?

I'm at a bit of a loss to know why your original macros don't work, or rather, why they repeat continuously. The log from the DLL doesn't show repeats from the device.

I'll have a look in the code for the DLL to see if I can spot anything, but as I say it is very old code now, dating back to whenPFC started using HID interfaces (before that it was all COM serial port operated). The only work done recently on it was re-compiling for 64-bit, with suitable changes for that to happen.

I've also got the difficulty of having no hardware to check it with. 

I'll get back to you if I have ideas or any sort of fix.

Pete

 

Share this post


Link to post
Share on other sites

Pete,

I understand what you are saying regarding the age of the code, but I am still impressed with it's functionality for how old it is. I am also available to help work through the issues to bring the code up to date from a testing and feedback standpoint.

Once again, your help is much appreciated.

Chris

Share this post


Link to post
Share on other sites
6 hours ago, String said:

I understand what you are saying regarding the age of the code, but I am still impressed with it's functionality for how old it is. I am also available to help work through the issues to bring the code up to date from a testing and feedback standpoint.

I will see what I can do ...

Pete

 

Share this post


Link to post
Share on other sites

Just a clarification, please. Are these log entries when using your original macro, the one you said was looping, repeating the FS control?

14 hours ago, String said:

3125: Using macros from "C:\Flight Sim\Prepar3D v4\Modules\PFC.mcro" selected
     5032: Device #2 received: TankSelect[0] = 0
     6391: Device #2 received: TankSelect[0] = 1
     7297: Device #2 received: TankSelect[0] = 3
     9063: Device #2 received: TankSelect[1] = 2
    10125: Device #2 received: TankSelect[1] = 1
    11141: Device #2 received: TankSelect[1] = 0
    12844: Device #2 received: TankSelect[1] = 1
    13938: Device #2 received: TankSelect[1] = 2

Because, if so, I don't understand why there's only a second or so between each switch chnage being seen and logged.

Do you have the FSUIPC Event logging covering this period (less than 9 seconds)? If not could you reproduce the events like this? I'd like to see what happens on the change -- i.e. do the repeats just continue forever or until thenext change to the same switch?

One other useful bit of logging would be to first set LogMacroNames=Yes, because the macro is executed by using offset 0xD70 in FSUIPC, and there's only one place in PFCHid64 where that's done -- just after logging the Macro name. I want to see if it is looping in PFCHid or in FSUIPC, because I simply cannot see any way it repeats in PFCHid unless the hardware is repeatedly sending the report that the switch has changed "to the same position", which the Decode log (snippet above) didn't show.

In other words, it is not making sense at present. 

BTW if I cannot solve this strange problem with PFCHid, or it simply takes too much time, your needs could probably be met with a Lua plug-in:
You would use event.intercept to get notification of the write to 0x3880 (Engine 1 Tank Selector) and if the "UD" type value is 0 write 0,  if 1 write 2, if 14 write 3.  This would actually be more efficient than using macro file execution.

Pete

 

Share this post


Link to post
Share on other sites
On 8/21/2018 at 4:18 PM, Pete Dowson said:

That seems odd. Two tank selector switches, but one returning 0, 1, 3, and the other 0, 1, 2?

That was my first thought as well.

On 8/22/2018 at 5:42 AM, Pete Dowson said:

Just a clarification, please. Are these log entries when using your original macro, the one you said was looping, repeating the FS control?

Because, if so, I don't understand why there's only a second or so between each switch chnage being seen and logged.

The log was from the macro below, when I switch from testing TankSelect1 to TankSelect2 

[Macros]
1=TankSelect2/0=C65958
2=TankSelect2/1=C65955
3=TankSelect2/2=C65957

On 8/22/2018 at 5:42 AM, Pete Dowson said:

Do you have the FSUIPC Event logging covering this period (less than 9 seconds)? If not could you reproduce the events like this? I'd like to see what happens on the change -- i.e. do the repeats just continue forever or until thenext change to the same switch?

I don't have the FSUIPC Event logging covering this period (less than 9 seconds), so I have recreated the log.

On 8/22/2018 at 5:42 AM, Pete Dowson said:

One other useful bit of logging would be to first set LogMacroNames=Yes, because the macro is executed by using offset 0xD70 in FSUIPC, and there's only one place in PFCHid64 where that's done -- just after logging the Macro name. I want to see if it is looping in PFCHid or in FSUIPC, because I simply cannot see any way it repeats in PFCHid unless the hardware is repeatedly sending the report that the switch has changed "to the same position", which the Decode log (snippet above) didn't show.

I have set LogMacroNames=Yes

Three New Logs, one with the TankSelect1 macro, one with the TankSelect2 macro and one with no macro only rotating the TankSelect1 Switch on the C2 Pro

FSUIPC5 - TankSelect1 macro.log

FSUIPC5 - TankSelect2 macro.log

FSUIPC5 - no macro.log

PFChid64 - TankSelect1 macro.log

PFChid64 - TankSelect2 macro.log

PFChid64 - no macro.log

Share this post


Link to post
Share on other sites

This is so long ago now (so many things happened since then), I'm going to have to start over. And not today. it's my 75th birthday and i'm just about to switch off for the evening1

I've got the files though: Why don't you look at what you are going to upload first?

FSUIPC5 - TankSelect1 macro.log -- log truncated before system even ready!

FSUIPC5 - TankSelect2 macro.log -- waste of space. just a load and close 24 seconds after being ready. nothing in between.

FSUIPC5 - no macro.log  -- same waste of space. just a load and close 24vseconds after being ready. nothing in between.

You don't even have Event logging enabled in any of those in any case.

PFChid64 - TankSelect1 macro.log

PFChid64 - TankSelect2 macro.log

PFChid64 - no macro.log

For these I need a few days in any case, to remember again what the macros do in the code and understand the logs again. But I'll wait for proper FSUIPC logs as requested as they are likely to be more productive.

Pete

 

 

Share this post


Link to post
Share on other sites
21 hours ago, Pete Dowson said:

This is so long ago now (so many things happened since then), I'm going to have to start over. And not today. it's my 75th birthday and i'm just about to switch off for the evening1

I've got the files though: Why don't you look at what you are going to upload first?

Pete,

Happy Birthday!

I will run the logs again and this time log closer at the data to the best of my ability before sending.

Thank you again...

Share this post


Link to post
Share on other sites
14 hours ago, String said:

I will run the logs again and this time log closer at the data to the best of my ability before sending.

To activate the logging which would be most useful:

1. Open FSUIPC Options
2. Select the Logging tab
3. Check the option on the left for non-axis Events


Also it would be useful to see when offset D70 was written to, so:
4. On the right-hand side of the Logging options, enter 0D70 as an offset and U32 as its type
5. In the next line enter 0D6C as the offset and S32 as the type
6. Check "normal log" below.
7. Click OK
8. Operate the PFC control which invokes the macro, write down the order in which you operate the switch and let me know, along with matching logs.

Pete

 

Share this post


Link to post
Share on other sites
6 hours ago, Pete Dowson said:

To activate the logging which would be most useful:

 1. Open FSUIPC Options
2. Select the Logging tab
3. Check the option on the left for non-axis Events

I have enabled non-axis Events

6 hours ago, Pete Dowson said:

Also it would be useful to see when offset D70 was written to, so:

I have enabled these logging options.

6 hours ago, Pete Dowson said:

Operate the PFC control which invokes the macro, write down the order in which you operate the switch and let me know, along with matching logs.

Started with both TankSelect1 and TankSelect2 3-position switches located on the C2 Pro console rotated full left. 

1. Rotated TankSelect1 to the right waited 2-seconds

2. Rotated TankSelect1 to the right waited 2-seconds 

3. Rotated TankSelect1 to the left waited 2-seconds

4. Rotated TankSelect1 to the left waited 2-seconds

5. Rotated TankSelect2 to the right waited 2-seconds 

6. Rotated TankSelect2 to the right waited 2-seconds

7. Rotated TankSelect2 to the left waited 2-seconds 

8. Rotated TankSelect2 to the left waited 2-seconds

9. PitotHeat was turned ON for 10-sec then OFF

FSUIPC5 - no macro.log

PFChid64 - no macro.log

FSUIPC5 - TankSelect1 macro.log

PFChid64 - TankSelect1 macro.log

Share this post


Link to post
Share on other sites

The PFCHid64 Log shows that, somehow, the macro for the "RIGHT" position is repeating forever within PFCHid.

I cannot find anywhere which could explain such a difference between TankSelect0/0, /1 and /2.

So, I'm sorry, I need more logging. This time just the PFCHid log. But first make sure

LogDecode=Yes
LogMacroNames=Yes
LogIPCwrites=Yes

The third one is an addition. This will halp me narrow it down, after which I may have to add extra logging and send you a test version to narow it down further.

Shame that I have no way here to debug the issue. I might try to figure out a way to fool the driver into thinking it has a device with a TankSelect switch, but it is very difficult. so many parts of the code to bypass somehow.

Pete

 

 

Share this post


Link to post
Share on other sites
17 hours ago, Pete Dowson said:

This time just the PFCHid log. But first make sure

LogDecode=Yes
LogMacroNames=Yes
LogIPCwrites=Yes

Pete,

I have set the logging in the PFChid64.ini as you indicated and have attached the new PFChid64.log.

Chris

PFChid64.log

Share this post


Link to post
Share on other sites
6 hours ago, String said:

I have set the logging in the PFChid64.ini as you indicated and have attached the new PFChid64.log.

That seems to tell me what is going on. The TankSelect switch is one of many which, having been set in a position and the appropriate offset changed in FSUIPC, needs that offset monitored in case it is is changed by another action (eg reload the aircraft, or using the mouse on screen). The scanning of such switches allows PFCHid to restore the actual switch setting so that the console switches always match what the sim has set.

Unfortunately, that can't be done with macros. BUT it tries! In other words, it is repeating the action forever in the hope that the normally assigned offset will be set to what it is programmed (normally) to be.

In other words, it seems to be an original flaw in the logic with the macro implementation.

I have a test version for you to try:  PFChid64_510_TEST.zip
Please let me know. If that is good, I shall make the same changes to the 32-bit version.

Very odd no one has come across this before!

Pete

 

Share this post


Link to post
Share on other sites
On 8/30/2018 at 3:39 AM, Pete Dowson said:

I have a test version for you to try:  PFChid64_510_TEST.zip
Please let me know. If that is good, I shall make the same changes to the 32-bit version.

Pete,

Unfortunately, I am traveling, until this Sunday, so I am having to remote into my SIM/PC and have my mother-in-law rotate the fuel selector switches for me to generate the log. Bless her as she forgot how to use a mouse, once we got past that obstacle all went well.

Log attached... from my location the fuel selector in the virtual cockpit did not rotate correctly.

Chris 

PFChid64.log

Share this post


Link to post
Share on other sites
2 hours ago, String said:

from my location the fuel selector in the virtual cockpit did not rotate correctly.

Very puzzling to me -- the Log shows EXACTLY the same loop I was sure I was preventing!

So, sorry about this, but I need the extra bit of logging doing, which I added in 5.10. as well as what you have already, please add:

LogLoopActions=Yes

Turning into a bit of a saga! Comes of me not having the hardware any more, I'm afraid!

Pete

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×

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.