Page 1 of 1

A little help for a newbie please!

Posted: 17 Jan 2014, 17:33
by Passman
This is a great program, just what I have been looking for.

The straight forward Send Simconnect Event is fine, however I'm getting very confused by the scripting and I wonder if someone could point me in the right direction please.

I have coded the following for a set Xpndr event and it works perfectly

Code: Select all

Dim frq
frq = HIDMacros.GetBuffer
frq = HIDMacros.StrRPad(frq, "0", 4)
HIDMacros.FSXEvent "XPNDR_SET", "&h"&frq
However, the following code to set VOR1 doesn't work at all and I have absolutly no idea why!

Code: Select all

Dim frq
frq = HIDMacros.GetBuffer
frq = HIDMacros.StrRPad(frq, "0", 3)
HIDMacros.FSXEvent "VOR1_SET", "&h"&frq 
What am I doing wrong and how can I resolve the problem?

Mant thanks for your help

Peter

Re: A little help for a newbie please!

Posted: 20 Jan 2014, 08:54
by admin
The code looks fine.
I can not check myself as I don't use FSX any more, but maybe the value for VOR1 doesn't come in hexa BCD but as real value.
So I would try:

Code: Select all

HIDMacros.FSXEvent "VOR1_SET", frq
And maybe for debugging purposes just start with something like

Code: Select all

HIDMacros.FSXEvent "VOR1_SET", 123
and then extend to variable from buffer.

Re: A little help for a newbie please!

Posted: 20 Jan 2014, 12:49
by Passman
Thanks for your suggestions.

They have clarified most problems I had, I'm most grateful for your time.

My last issue is around

Code: Select all

HIDMacros.FSXEvent "ADF_SET", ???
Following your suggestions nothing seems to set this as expected. Any helpful pointers please?

Many thanks

Re: A little help for a newbie please!

Posted: 21 Jan 2014, 08:50
by admin
After one google search I would try something like

Code: Select all

HIDMacros.FSXEvent "ADF_COMPLETE_SET", &H333000
to tune ADF freq 333.

Google for "simconnect ADF_SET"

Re: A little help for a newbie please!

Posted: 21 Jan 2014, 11:04
by Passman
Hi Petr

Many thanks for the help and pointer. I'm pleased to say that is what I needed to get to the final solution.

Here is the code I ended up with and it works brilliantly , even allows me to set the tenth digit when required (although very seldom).

Code: Select all

Dim frq
frq = HIDMacros.GetBuffer
frq = frq * 1000
frq = HIDMacros.StrRPad(frq, "0", 7) 
HIDMacros.FSXEvent "ADF_COMPLETE_SET", "&h"&frq 
It's the first time I have tried to do anything like this and it takes some getting your head around it. What a difference it has made to the simming experience, it give you so much more time to concentrate on the flying.

The secret is to know what to search for on google!

Thanks again for you help, hopefully I won't need you again!

Peter