Jump to content
The simFlight Network Forums

Writing a "value" to a bit in C#


Recommended Posts


I am looking for an example to follow for writing a value to a bit in C# for project magenta.

To cause a engine fire failure in engine #1, Project Magenta stipulates that  "Failures Variable 0x5750 1 FailureCode, one byte offset, value 51, must be used".

In the users guide I am not seeing the example that I could try and use. Do I need to see an optometrist again so soon? LOL

My eventual goal is to develop a random failures generator for my flight deck that matches everything in my QRH manual. This would be so useful since I fly alone most of the time and an Project Magenta instructor station is just much more than I can use.

Also, Very much learning to write code.


Link to comment
Share on other sites

Hi James,

For C# you'll need my .NET Client DLL. If you haven't already, please see the website for details on how to install it into your project, and to download the 'Example Code' project which gives examples of how to use the DLL.


Specifically, have a look at the example called "BC004: Writing to Offsets" under the 'Basic Concepts' section in the Example Code application. 

For your Project Magenta offset you'll need to declare it with a type of 'byte'. Then assign the value 51 and call Process().

I recommend using the grouping feature so you can better manage which offsets are processed. (See BC005: Grouping Offsets).

If you're totally new to this, I recommend the "Complete Video Guide For Beginners" in the help section of the website. This will show you how everything fits together and how to get everything set up.


Link to comment
Share on other sites

Hi Paul,


Thank you for the reply. I have completed your video guide for beginners and even have put together some neat learning scripts that manipulate switches and read korry lights. 


I will have a good look at the BC005:Goup Offset.  I have been using the BC004: Writing to Offset to try and push the value 51 to offset 5070,1 but when using the program FSintrerrogatstd2, it only shows a "1" and nothing happening within my flight deck.  

I will go over the BC005 thoroughly. Thank you for the guidance and I will report back if I have success.




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.