Jump to content
The simFlight Network Forums

Problem To Get Variables from FSUIPC


Recommended Posts

Hi Folks,

I have a general question about using the variables from FSUIPC.

I use Visual Basic 2008 Express Edition. In an example Code I found this to use the Variables:

Public FlagReadyToFly As Offset(Of Byte()) = New FSUIPC.Offset(Of Byte())(&H3364, 256)

But I don´t get the correct values, which should be....

If you are in the initially menu, it should give you 255.

FSInterrogate says. it is a U8-Type with size 1. How else can I use the variable 3364?

Please Help me! I think I make a general mistake.

Thank you, Tobias

Link to comment
Share on other sites

Public FlagReadyToFly As Offset(Of Byte()) = New FSUIPC.Offset(Of Byte())(&H3364, 256)

This appears to be just a declaration, not a program? What is the "256" part for? (Sorry, I don't know VB).

But I don´t get the correct values, which should be....

If you are in the initially menu, it should give you 255.

FSInterrogate says. it is a U8-Type with size 1.

Use FSInterrogate to see how things work. The correct reference to what the values are is the documentation, not really the brief labels in FSInterrogate's parameter files!

How else can I use the variable 3364?

Please Help me! I think I make a general mistake.

Maybe if you showed a bit more of the program, like where you initialise the interface and where you read the values it might help?

Regards

Pete

Link to comment
Share on other sites

Hi Folks,

I have a general question about using the variables from FSUIPC.

I use Visual Basic 2008 Express Edition. In an example Code I found this to use the Variables:

Public FlagReadyToFly As Offset(Of Byte()) = New FSUIPC.Offset(Of Byte())(&H3364, 256)

But I don´t get the correct values, which should be....

If you are in the initially menu, it should give you 255.

FSInterrogate says. it is a U8-Type with size 1. How else can I use the variable 3364?

Please Help me! I think I make a general mistake.

Thank you, Tobias

Hi

What you are using is the FSUIPC Client DLL by Paul Henty for Visual-Basic .NET.

With (&H3364, 256) you try to read the Offset 0x3364 with 256 Byte length.

Just read the Documention from Paul Henty and try the examples what is really very well described.

The example code gives you also a clear way to follow to get anything you need to read from or write to FSUIPC.

Link to comment
Share on other sites

I will see the FSI documentation aswell as the DLL documentation.

I think you still misunderstand! The FSI documentation only tells you how to use FSInterrogate. You want the complete table of offsets and their explanations supplied as the major part of the FSUIPC SDK!

Is there another possibility to read FSUIPC? I can´t find any other example code for VB.NET.

Doesn't the VB.Net Shell ZIP file in the FSUIPC SDK include an example? Have you looked? I'm pretty sure most VB.NET users manage with that or the Paul Henty library method.

Pete

Link to comment
Share on other sites

Public FlagReadyToFly As Offset(Of Byte()) = New FSUIPC.Offset(Of Byte())(&H3364, 256)

Hi Tobias,

What you've declared here is an offset that will read 256 bytes into a byte array.

Offset 3364 is only 1 byte in length, so you should only declare it as a byte (not a byte array):

Public FlagReadyToFly As Offset(Of Byte) = New FSUIPC.Offset(Of Byte)(&H3364)

If you look in the UserGuide.htm in the docs folder, there is a section called "Registering your interest in an Offset" This explains what type of VB variable you should use in the offset declaration according to how the offset is described in the "FSUIPC for Programmers" document from Peter. The top line of the table says that offsets with size 1 should use Byte in VB.NET.

Paul

Link to comment
Share on other sites

Thank you again for your answers.

This type of programming is a bit new for me.

@ Pete: I work with the example from SDK. It is pretty good. And I found my problem now. It was exact that, what Phenty now wrote down. I think, that I will now unterstand the situation better now. Sorry for the stupid answers from my side, but as I said, it´s new for me. I still have to learn, where to search and how I should ask, that you better understand me question ;)

@ Phenty: Thank you too

Have a nice and thank you. Pete, you do a really great job!

Tobias

Link to comment
Share on other sites

  • 1 year later...

Oh goodness!

Did you ever jump into a puddle only to find it was 10ft deep?

I struggle even to program in Visual Basic 2008 but I manage with the help of google searches!

I have made a little prog which runs through a verbal checklist for a 737-800. Basically it does this:

1) Call the checklist item challenge

2) If the 'checkbox' for that item is not checked wait 5s then call again

3) If the 'checkbox' is checked, call the repsonse and move to the next challenge

4) when you get to the end of the list, call 'checklist complete' and close that list

Obviously I need to replace the checkboxes with actual offsets, and so I need to be able to interface VB2008 with FSUiPC.

Er, how?

I have read the SDK but it seems the code is for VB2005?

I've searched the forums here (hence the 'reply' to this post), but, to be frank. it's _way_ above my head.

Can someone point me in the direction of a page which might be called 'Visual Baasic 2008 to FSUIPC interfacing for Dummies'???

Thanks,

Roger.

Link to comment
Share on other sites

Obviously I need to replace the checkboxes with actual offsets, and so I need to be able to interface VB2008 with FSUiPC.

Er, how?

I have read the SDK but it seems the code is for VB2005?

Is is not the same language? Surely Microsoft don't redesign the language every three years or so? The C compiler still compiles C, why doesn't the VB compiler compile VB?

Pete

Link to comment
Share on other sites

Hi Peter,

thanks for your quick reply.

To be honest I don't know if it is the same language - I _really_ am a babe-in-arms when it comes to this stuff!

What I did is this:

1) Dwnloaded the FSUIPC SDK

2) Opened UIPC_SDK _VisualBasic.zip

3) read the 'readthisVB.txt'!

4) got confused...

From the readthis... I gelaned that one should insert the fsuipc.bas module into my program.

Not being entirely sure how to do this, I simply cut and pasted the text from the fsuipc.bas file into my prog.

I am getting two error messages, one is that I cannot 'dim' something as 'any' since it's not supported any more. The second is that VarPtr is no longer supported in VB2008.

This made me think that the fsuipc.bas mosule might need 'porting' to Visual Basic 2008.

However, I am fully aware I could have done things very wrong!

I know you're a busy guy, supporting a community of talented and experienced prgrammers - hence my request ofr the 'for Dummies' version of things.

What I want to be able to do is to see if an offset has a certain value, rather than testing of a checkbox is checked. I am sure this is possible very easily, but don't know how to start.

I hope all this makes sense.

many thanks,

Roger.

P.S. if convnient, you can email me direct on fatcharlie at btopenworld dot com.

Link to comment
Share on other sites

Oh dear, oh dear!!!!

I've just discovered the proper interface for VB.Net....

You must think I'm an awful chump!

I've just this second opened it up in Visual Basic 2008 Express - I'm assuming it'll do what I want it to do.

Sorry for wasting your time - I'll let you know how it goes.

Thanks,

Roger.

Link to comment
Share on other sites

1) Dwnloaded the FSUIPC SDK

2) Opened UIPC_SDK _VisualBasic.zip

3) read the 'readthisVB.txt'!

4) got confused...

Well, I would be too, because I do not know anything about VB.

What I want to be able to do is to see if an offset has a certain value, rather than testing of a checkbox is checked. I am sure this is possible very easily, but don't know how to start.

Well, I can help with C, C++ and Assembly Code even, but not Basic, C# or Delphi. Sorry. Perhaps if you posted the questions you just asked me in a new thread with something like "Help with VB please!" in the title, some kind soul will be able to advise.

Regards

Pete

Link to comment
Share on other sites

Heh! By now you'll have read my last posing. Doh!

Thanks anyway for your very prompt replies and I will definitely take up your suggestion of posting a new topic.

Forgive me if I appear too gushing, but in any case I wanted to say many, many thanks for your fantastic work in taking FSUIPC forward.

Without it, there would simply not be a way for people like me to indulge in this hobby of bulding cockpits. Perhaps someone else would have done it - but the fact is that you did. Thanks.

Roger.

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.