Jump to content
The simFlight Network Forums

Need help with setting an Lvar Hdg value on Aerosoft CRJ - Need clarification if I am even doing this right


activex

Recommended Posts

All offset addresses map to a physical memory area. Well, in most cases. There are a few offsets that are ghosted, i.e. mapped to a different memory area. However, this is only for a couple of specific offsets and does not apply to the free user offsets. These ghosted offsets are used when the offset size has increased but there is no space left in the standard offset area to increase the size.

Edited by John Dowson
clarified
Link to comment
Share on other sites

John,

 

1) I am stuck on reading current AP heading select (using Lvar: ASCRJ_VAR_AP_SELHDG). I simplified my example and still it is not working.

Here's the ini file:

[LvarOffsets]
1=L:ASCRJ_VAR_AP_SELHDG=SD0xA000

Here's the code:

var offset = new Offset<int>(0xA000);
  FSUIPCConnection.Process();
  var result2 = offset.Value;

Please note:

I got other Lvars to work but this one doesn't work. I know the value can be read because this code works (Paul's api call, he uses doubles for Lvars across the board):

var result = FSUIPCConnection.ReadLVar("ASCRJ_VAR_AP_SELHDG");

2) If I omit the datatype in the ini file, then it defaults to double (8 bytes)? Therefore, is this valid entry?

[LvarOffsets]
1=L:ASCRJ_VAR_AP_SELHDG=0xA000

In that case I presume I have space out my offsets 8 byte apart. I did try using a double in the above example with single offset, no luck.

Link to comment
Share on other sites

15 minutes ago, activex said:

Here's the code:

var offset = new Offset<int>(0xA000);
  FSUIPCConnection.Process();
  var result2 = offset.Value;

I don't understand this so cannot advise. As I keep telling you, for anything related to c#, use Paul's sub-forum.

15 minutes ago, activex said:

If I omit the datatype in the ini file, then it defaults to double (8 bytes)? Therefore, is this valid entry?

[LvarOffsets]
1=L:ASCRJ_VAR_AP_SELHDG=0xA000

Yes, if you omit the size, it defaults to an 8-byte double.

But are you sure that is a valid lvar? i.e. is it listed when you log the lvars? It doesn't appear in the MF spreadsheet in the ASCRJ tab...
Note also that some lvars are read-only, so you cannot change their value.

You seem to be keep coming back with more issues when the topic for this issue is now closed as far as I can see. Can I lock this topic now? If you have any other issues, you can create a new topic for that issue.

John

Link to comment
Share on other sites

Quote

I don't understand this so cannot advise. As I keep telling you, for anything related to c#, use Paul's sub-forum.

Okay will do. The statement simply read an offset of 0xA000 into result variable. 

Quote

But are you sure that is a valid lvar? i.e. is it listed when you log the lvars? It doesn't appear in the MF spreadsheet in the ASCRJ tab...
Note also that some lvars are read-only, so you cannot change their value.

Of course, I verified it in the sim and also stated that I can read it using Paul's api function (that takes that very lvar string), so it is 100% legit. I do understand the difference between read vs write lvars, I never bothered you with that, my main issue so far were about setting up the ini files with offsets mapped to lvars and then reading these offsets. As for me, I find it nearly impossible to work with this SDK:

1) There's no logging to troubleshoot any mapping issues, there are no exceptions being thrown, etc.

2) I discovered already 1 bug, in Paul's DLL and there maybe more, either in his DLL or somewhere else. What's frustrating about this whole experience is that even if you follow the documentation and the stuff just doesn't work. Not sure if it is your code or Paul's code that's giving me issues and there's no way to tell.

I would like to thank you for your help and yes, go ahead close this topic, I will see if Paul can help me.

 

Link to comment
Share on other sites

6 minutes ago, activex said:

1) There's no logging to troubleshoot any mapping issues, there are no exceptions being thrown, etc.

Yes thre is. For anything relating to lvar access, set the loglevel ini parameter to Debug or Trace. You can also activate different logging levels in the WASM if you so wish.
Other logging (i.e. FSUIPC) is controlled by the FSUIPC log flags.

8 minutes ago, activex said:

2) I discovered already 1 bug, in Paul's DLL and there maybe more, either in his DLL or somewhere else.

All software has bugs....I'm sure there are some in the I/F I have provided, but certainly not anything related to anything you have so far posted...

9 minutes ago, activex said:

What's frustrating about this whole experience is that even if you follow the documentation and the stuff just doesn't work. I would have to say, this the worst experience I had with an SDK in my 15 years of software engineering and designing systems, and integrating with 3rd party applications, etc. This here, is impossible. Not sure if it your code or Paul's code that's giving me issues and there's no way to tell.

I don't understand this rant. I really don't understand what your current issue is, it seems to vary from post-to-post. Maybe you could clarify.
But, as I keep saying. I know nothing about the c# client dll, that should really be your first contact for support if that is where you have issues.
If its with the lvars-to-offsets, then please post in this forum, but do not confuse the two completely separate pieces of functionality.
 

 

Link to comment
Share on other sites

Quote

I don't understand this rant. I really don't understand what your current issue is, it seems to vary from post-to-post. Maybe you could clarify.

I was trying to provide a feedback, maybe a bit too strong. I retracted my comments, apologies if I offended you.

Quote

But, as I keep saying. I know nothing about the c# client dll, that should really be your first contact for support if that is where you have issues.
If its with the lvars-to-offsets, then please post in this forum, but do not confuse the two completely separate pieces of functionality.

True, but as it turns out, your help (+ my feedback) helped Paul to fix a bug. So, your support was valuable with his API. Sometimes, 2 parties need to get involved to fix an issue. I will not post anymore C# related code.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.