Jump to content
The simFlight Network Forums

[ERROR]: Error setting Client Data Calculator Code


DaveSCUSA

Recommended Posts

Hello John again,

I understand the effort you have to make to analyze these items. Highly appreciated. As I ama retired systems engineer, I am most disappointed in myselfI can't seem to move ahead. I have spent six months trying to get all these buttons and keys to work with the C510 in my home built cockpit (the Diamond DA62 seems to work fine). I use Air Manager as a contributor created the full C510 cockpit using Simconnect.   

I had several [ERROR]: Error setting Client Data Calculator Code entries in the FSUIPC7 log. One was 51922  [ERROR]: Error setting Client Data Calculator Code [-2147467259]: '1 (>K:MASTER_BATTERY_OFF) 0 (>A:ELECTRICAL MASTER BATTERY, bool)'. I removed the variable and will test this afternoon. The SDK says the battery variable can be set but it's the only item I can see that may be in error.

However, I also received this error: 52141  [ERROR]: Error setting Client Data Calculator Code [-2147467259]: '0 (>K:ELECT_FUEL_PUMP1_SET)' and can't understand why the error as the SDK description shows the event is correct.

1. Can you describe what these errors mean? They happen during the loading of MSFS

2. Canu you help with the Pump Set error.

3. I also pulling my hair out (I am bald) with buttons/keys working or not working (not the same button/key working and then not working). The key master battery works and shows in the cockpit but the avionics switch doesn't. The code between the two is shown in Air Manager Lua (Not too different in concept from FSUIPC7). I just use Air Manager as a test tool when I'm starting from cold and in the landing view (outside the cockpit. The code for the battery and avionics are (using Simconnect):

--BATTERY
function callback_batt(position)
    if position == 0 then
        switch_set_position(sw_batt, 1)
        fs2020_event("MASTER_BATTERY_ON")
    elseif position == 1 then
        switch_set_position(sw_batt, 0)
        fs2020_event("MASTER_BATTERY_OFF")
    end
end
sw_batt = switch_add("sw_big_rd_middle.png", "sw_big_rd_up.png", 180, 58, 45, 119, callback_batt)

function ss_batt(batt_on)
    if batt_on then
        switch_set_position(sw_batt, 1)
    else 
        switch_set_position(sw_batt, 0)
    end
end    
fs2020_variable_subscribe("ELECTRICAL MASTER BATTERY", "Bool", ss_batt)

--AVIONICS
function callback_avion(position)
    if position == 0 then
        switch_set_position(sw_avion, 1)
        fs2020_event("AVIONICS_MASTER_SET", 1)
    elseif position == 1 then
        switch_set_position(sw_avion, 0)
        fs2020_event("AVIONICS_MASTER_SET", 0)
    end
end
sw_avion = switch_add("sw_big_dwn.png", "sw_big_up.png", 382, 59, 45, 114, callback_avion)

function ss_avion(avion_on)
    if avion_on then
        switch_set_position(sw_avion, 1)
    else 
        switch_set_position(sw_avion, 0)
    end
end    
fs2020_variable_subscribe("AVIONICS MASTER SWITCH", "Bool", ss_avion)    

 

Mustang PUU.png

FSUIPC7.ini FSUIPC7.log C510.ini myevents.txt

Link to comment
Share on other sites

34 minutes ago, DaveSCUSA said:

1. Can you describe what these errors mean? They happen during the loading of MSFS

Any errors setting client data calculator code are NOT due to the calculator code itself, it means that the calculator code could not be sent to the sim/WASM for some reason. Any errors in the calculator code itself will be logged in the FSUIPC_WASM.log file (or possibly the MSFS console) and not in the FSUIPC7.log file.

Looking at your log file. the errors are reported as the WAPI hasn't yet connected to the FSUIC7 WASM module and so the calculator code could not be sent to the sim, i.e. they are logged before this message is logged"

Quote

    83515 Starting WAPI...
    83515   [INFO]: **** Starting FSUIPC7 WASM Interface (WAPI) version 1.0.4 (WASM version 1.0.3) using connection -1
    83515   [INFO]: Connected to MSFS
   109437 -------------------- Starting everything now ----------------------
 

Basically you are trying to do things too early - just be more patient. Once you have loaded an aircraft and are ready-to-fly, wait for a short while before trying to do anything. Usually it is best to wait until the lvars have been loaded, i.e. when this is logged:

Quote

   114812 Lvars received: 307 L:vars & 0 H:vars now available

The reception of lvars is also logged in the FSUIPC7 main window.

And if using InputEvents, you need to wait until all these are loaded and initial values received, which in your log is here:

Quote

   118031 InputEvent parameter received for 'SAFETY_Warning_2': ''

i.e. approximately 2 minutes after FSUIPC7 is started. The number of Input Events is also logged in the FSUIPC7 main window.

I will look into your other questions, as well as taking another look at the C510, at the weekend. I believe SU15 should be released tomorrow, and I will release FSUIPC 7.4.12 shortly afterwards, which has improved handling for Input Events -  this may be useful for the C510 so please update once released.

John

Later: could you just give me a list of the buttons/switches that you are having issues with, and I will take a look at each and let you know how to assign to them in FSUIPC7. This will be quicker and easier for me than going through your files or lua code.

Edited by John Dowson
Later added
Link to comment
Share on other sites

Please also note that I have already advised on how to assign for the battery, avionics, starter - all of these are easily controlled using Input Events.
 

For any further questions on the C510, can you please use the other thread you created for this: 

 

I would like to keep information on how to use FSUIPC7 to control this aircraft in one place, so it is easy to find for other users. So, please post in that thread for anything that you are having difficulties with - and please re-read what I have already said in that thread.

John

Link to comment
Share on other sites

Thank you John,

I guess I ignore the calc code error.

I will test each switch in detail and provide you details. Thank you for your time. I have, in some cases, reassigned the keys with the UI.

Is the Air Manager information valuable?

Link to comment
Share on other sites

12 minutes ago, John Dowson said:

Please also note that I have already advised on how to assign for the battery, avionics, starter - all of these are easily controlled using Input Events.

For any further questions on the C510, can you please use the other thread you created for this: 

I would like to keep information on how to use FSUIPC7 to control this aircraft in one place, so it is easy to find for other users. So, please post in that thread for anything that you are having difficulties with - and please re-read what I have already said in that thread.

John

Thanks again,

The difficulty I am having is trying to keep all button and key executions in one area. Not some in the button/key press in the profile ini and some in the myevents.txt. The myevents.txt is used when I want to use the Calc Code. I am well aware of the C510 events - input events to use. I do avoid using the input events as they some times don't work. The attached is list of events and input events discovered while using the FSUIPC7 log with the sim displayed cockpit. It also contains the LVars listed for the C510.

Do the Input Events consistently work? 

C510 Ini Vals.txt

Link to comment
Share on other sites

16 hours ago, DaveSCUSA said:

Is the Air Manager information valuable?

Not really.

16 hours ago, DaveSCUSA said:

The difficulty I am having is trying to keep all button and key executions in one area. Not some in the button/key press in the profile ini and some in the myevents.txt.

This doesn't really make sense. All your assignments are kept in the ini file (or files). The myevents.txt file just holds your preset definitions. I could have kept these in a [myOffsets] section of the ini file I suppose, but as the MobiFlight presets are provided via the events.txt file,  I thought I would use the same mechanism for user-defined presets.

16 hours ago, DaveSCUSA said:

I do avoid using the input events as they some times don't work.

Why not? What do you mean? You should use Input Events when available, I see no reason not to.

16 hours ago, DaveSCUSA said:

The attached is list of events and input events discovered while using the FSUIPC7 log with the sim displayed cockpit. It also contains the LVars listed for the C510.

No need to attached this as I know what is available as I have this aircraft.

16 hours ago, DaveSCUSA said:

Do the Input Events consistently work? 

I don't see why they shouldn't. There can be a short delay when using Input Events for incrementing/decrementing the Input Event value, as a round trip to the FS is needed to get the updated value before a next increment/decrement, but this is the same as when using lvars.

John

Link to comment
Share on other sites

Btw, where is that cockpit VC image from? That doesn't look like the virtual cockpit that I see in the C510.
What are those lighting switches that you say do not work? There are various Input Events for the lights, so try those.

For the generator switch, you can use the Input Event ELECTRICAL_Alternator_2 with values/parameters 0, 1 & 2 for the 3 positions. In the down position (2), it will only stay there momentarily and then spring back to the central position (1), as it does in the VC.

John

 

Link to comment
Share on other sites

Thank you, very comprehensive.

Perhaps I am making the interface too complicated. I try to use the same technique for all buttons on a device. All in presets, UI assignments or Lua. 

Because I lost trust in myself using Lua, I started using controls or Simvars, Simevents. I used presets to allow separation of on/off of toggle events. One can test a variable to exercise an event. 

As input events cannot be manipulated in presets, I tended to stay away from the input events.

Thru you input, I will use input events only. 

The C510 panel screenshot is from a contributor to AirManager and is used on a touchscreen monitor. A useful visual tool when not using the VC.

Link to comment
Share on other sites

I guess now the biggest dilemma I have is how to toggle with momentary key presses (press on, press again off). I have a keypad that sends multiple keys on a press. Starters are pressed on then off on release. I would like to have fuel valves and ignition switches tur on with a press and off with a second press and using input events with all keys.

How would I do that using the key assignments UI? The alternative I guess is lua?

Link to comment
Share on other sites

19 hours ago, DaveSCUSA said:

Perhaps I am making the interface too complicated. I try to use the same technique for all buttons on a device. All in presets, UI assignments or Lua. 

Again, this is misleading. You can use presets via UI assignments and Lua - just defining a preset does nothing. And you need to use whatever works for that particular button or switch - it may be a standard control, an input event, and lvar, a hvar, or a combination of one or more of these (which can implemented via overloading assignments, a preset, a macro, or in lua code). You need to use what works. If there are multiple ways to control a switch or button, then you can choose which method to use.

19 hours ago, DaveSCUSA said:

Thru you input, I will use input events only. 

No - use whatever works! It is silly to restrict yourself by using one method only - you will invariably get stuck.

14 hours ago, DaveSCUSA said:

I would like to have fuel valves and ignition switches tur on with a press and off with a second press and using input events with all keys.

How would I do that using the key assignments UI? The alternative I guess is lua?

If there are toggle controls/events, you can use these. Otherwise, if you are using presets, you can possibly implement the preset as a toggle control (ie.g. the preset can toggle/inveet a value, or the code can do different things depending on the state of a simvar or lvar via a conditional).

You can also overload key assignments as you can button assignments. If you want different things to happen depending on if it is the first or second press, then you would need to have two assignments and use an offset condition to determine which assignment is needed. If there is no offset that determines this, you will need to add one.

Otherwise yes, the alternative is lua.

John

Link to comment
Share on other sites

6 hours ago, John Dowson said:

You can use presets via UI assignments and Lua - just defining a preset does nothing. And you need to use whatever works for that particular button or switch.

This question is specific to the C510. The only non-Input Event control is the left and right fuel valves (located on the throttles).

I can easily use a preset for these controls. 

The question is, "is there any other option to set up a push on/push off keypress to on and off input events other than Lua". It is known that presets cannot set input events.

Having said that, the RPN code in templates can set BVars as shown in previous code you sent.

Is there any chance that setting BVars will be available in presets?

 

Link to comment
Share on other sites

15 hours ago, DaveSCUSA said:

The question is, "is there any other option to set up a push on/push off keypress to on and off input events other than Lua". It is known that presets cannot set input events.

Yes, as explained in my previous comment.

15 hours ago, DaveSCUSA said:

Having said that, the RPN code in templates can set BVars as shown in previous code you sent.

No it cannot - that will not work. You cannot set B:vars via calculator code.

15 hours ago, DaveSCUSA said:

Is there any chance that setting BVars will be available in presets?

That is a question for Asobo/MSFS, but I very much doubt it. SU15 is the last sim update this year.

John

Link to comment
Share on other sites

6 hours ago, John Dowson said:

No it cannot - that will not work. You cannot set B:vars via calculator code.

//Cockspur/Mustang C510
Mustang_C510_Ignition1_on#2 (>L:FSUIPC_C510_Ignition_1)
Mustang_C510_Ignition1_norm#1 (>L:FSUIPC_C510_Ignition_1)
You can then assign directly to those presets.
If you would prefer a single toggle preset, use the following code:

	<Component ID="FSUIPC_External_Control">
		<UseTemplate Name="ASOBO_GT_Update">
			<UPDATE_CODE>
				(L:FSUIPC_C510_Ignition_1, Number) s0
				l0 0 &gt; if{
						0 (&gt;L:FSUIPC_C510_Ignition_1)
						1 (&gt;B:ENGINE_Ignition_1_Toggle) 
				}
			</UPDATE_CODE>
			<FREQUENCY>1</FREQUENCY>
		</UseTemplate>
	</Component>
and preset

You sent this code and thanks. There is a BVal included. This is what I was asking.

 

Link to comment
Share on other sites

18 hours ago, DaveSCUSA said:

You sent this code and thanks. There is a BVal included. This is what I was asking.

The preset code here is this:

Quote
//Cockspur/Mustang C510
Mustang_C510_Ignition1_on#2 (>L:FSUIPC_C510_Ignition_1)
Mustang_C510_Ignition1_norm#1 (>L:FSUIPC_C510_Ignition_1)

i.e. it uses and lvar, not a b-var.
This code was given to show a hack that you can use to introduce a l-var to control a b-var. You then use this lvar in the calc code to control the b-var in the xml  code.

As I said, this is a hack. You cannot directly control b-vars via calculator code.l

Link to comment
Share on other sites

Hi I am using FSUIPC quite long without problems, but after the last FSUIPC Update from 23.5 and MSFS SU15 Update, I get the same error messages and none of my button is working. I don't have changed anything in the config.

 

Hier ist my log:FSUIPC7.log

Link to comment
Share on other sites

3 minutes ago, Chad P said:

Hi I am using FSUIPC quite long without problems, but after the last FSUIPC Update from 23.5 and MSFS SU15 Update, I get the same error messages and none of my button is working. I don't have changed anything in the config.

Looks like the WAPI is not enabled - could you please attach your FSUIPC7.ini file as well so I can check this.

Also, please try the following:
   - check that the WAPI is enabled (i.e. in your FSUIPC7.ini you should see something like:

Quote

[WAPI]
LogLevel=Info
EnableWAPI=Yes


   - in your FSUIPC7.ini file, change or add the following:
        DetectToConnectDelayAuto=60
        InitialStallTime=20
        StartUpTuningActive=Yes
   then run MSFS and let it start FSUIPC7. When MSFS gets to the main menu, exit then restart. The first run will tune your parameters, and then these will be use in the second.

Then try FSUIPC7 and see if it works. If not, restart FSUIPC7 - does it then work?

Any issues, please attach your FSUIPC7.ini file and your FSIOPC7.log and FSUIPC7_prev.log files.

You can also maybe try with another aircraft - people reporting this issue seem to be using the Fenix A320. I think this may use a different camera state during loading and FSUIPC7 may not be starting the WAPI because of this.

John

Link to comment
Share on other sites

Hi, thx for help. After the last FSUIPC Update I discovered, that FSUIPC wont't start anymore with MSFS, so I used the MSFS.bat. Something removed fsuipc from the exe.xml. This was the time when the problems started.

When I start the sim without autostart of fsuipc and start it by hand, when I am at the gate, then there are no problems (new log).

 

But what should I do to get FSUIPC back working with autostart in the exe.xml.

Quote

  - in your FSUIPC7.ini file, change or add the following:
        DetectToConnectDelayAuto=60
        InitialStallTime=20
        StartUpTuningActive=Yes

 

I will try this also

 

 

 

FSUIPC7.log FSUIPC7.ini

Link to comment
Share on other sites

6 hours ago, Chad P said:

After the last FSUIPC Update I discovered, that FSUIPC wont't start anymore with MSFS, so I used the MSFS.bat. Something removed fsuipc from the exe.xml.

You should always check the changes.txt document when you update. In 7.4.12, the default auto-start method has been changed from using the EXE.xml method to using the MSFS.bat, so what you say doesn't make sense. For all issues with auto-start, please see the following FAQ entry, and if you still have issues after reading that then please post in that topic and I will take a look: 

 

That log file you attached shows that FSUIPC was working as expected - the WAPI was started/connected. lvars/hvars were received and your lua autos started. The only error is this:

Quote

     4250  [ERROR]: Error setting Client Data Calculator Code [-2147467259]: '1 (>L:S_FCU_EFIS1_ND_ZOOM)'

and that is because it is being sent too early, before the WAPI has been started/connected. You cannot use presets/calc. code before the WAPI is ready.

6 hours ago, Chad P said:

But what should I do to get FSUIPC back working with autostart in the exe.xml.

Re-run the installer, and at the components selection page, select the EXE.xml auto-start method only, i.e. open the auto-start options, de-select the MSFS.bat method (first option) and select the EXE.xml method (second option). But really should not need to do this - the MSFS.bat  method should work fine, once your start-up options have been tuned correctly. I would try this before changing auto-start methods. 

Your ini also shows one issue - a missing device:

Quote

[JoyNames]
A=T.Flight Hotas X << MISSING JOYSTICK >>
A.GUID={7EAFBAB0-024B-11EA-8002-444553540000}

Are you not using this anymore (replaced by the T.A320 Pilot perhaps)? 

If not using this any more, you should remove all assignments to the A device, and also remove those two lines from the [JoyNames] section. If you still have and use this (i.e. connect it for certain aircraft) then ok to leave everything how it is. However, you could get some strange issues if you have the T.Flight Hotas X connected at  the same time as the T.A320 Pilot, as you will have the main flight controls assigned to two controls which can conflict and cause sudden jumps on the axes.

You should also update this:

Quote

[Profile.FBW]
1=Airbus A320neo Colonia Air Cockpit Mod
2=Airbus A320neo Colonia Air
3=Airbus A330-900 Colonia Air D-AIDI

to this:

Quote

[Profile.FBW]
1=Airbus A320neo
2=Airbus A330-900

i.e. use substrings for your aircraft profile names to catch more variants

And looks like you manually added something to the LuaFiles section:

Quote

[LuaFiles]
1=A320ParkBrake
2=Lua PMCO_FNX32X
3=PMCO_FNX32X

That 2nd entry is invalid, and the section should be:

Quote

[LuaFiles]
1=A320ParkBrake
3=PMCO_FNX32X

The [LuaFiles] section is maintained by FSUIPC and should NOT be manually edited.

John

Link to comment
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
×
×
  • 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.