Jump to content

Radio Export and Input through Export.lua


Recommended Posts

Posted

Hi guys,

 

been playing with exporting and setting the VHF AM radio through Export.lua and a C# app I'm testing with.

 

The radio wheels/thumbs - They appear to work by sending the value you want to set them to. i.e. if you want the fourth dial to say "25" you need to send "0.25" to button 3016 on device 55.

 

So I have a couple of questions I guess:

 

 

  • Why does each dial for the radio have 2 buttons (is this for forward and back? If so I can't seem to see a difference in the values you send through)
  • Is the only way to set the correct value is to have your application keep track of the value you want to set and just hard set it using a direct value?

 

 

Any help would be appreciated.

 

 

Thanks,

Ken.

Posted (edited)

Hi Levinsky. You are correct, either a step up/down but you can also set an absolut value for each freq 'knob' and device. Was some time since I made my panels (and still got some issues with the code in one direction of change but they end up into the correct value). search my buildtheard 'HOGBOX' for a code example.

 

edit: a bit 'sleepy' last night, you're spot on above as far I see, Either an application handling the steps (up or down) or write an absolute value within the range, to set desired freq per wheel.

 

Buttonnumber for the FM radio differs from my set, guess its another module than 10C ? Good to review the sripts also. Found the couse of why my indicators spins oddly in one direction, thanks ;-)

Edited by Duckling

- - - -

Posted

Hi Duckling,

 

thanks for the point in the right direction. Managed to get an Open Cockpits radio card interfaces and working nicely with DCS A-10C. I handled most of the smarts in my C# app as I also use that for the Open Cockpits CDU.

 

Thanks,

Ken.

Posted
Hi guys,

 

been playing with exporting and setting the VHF AM radio through Export.lua and a C# app I'm testing with.

 

The radio wheels/thumbs - They appear to work by sending the value you want to set them to. i.e. if you want the fourth dial to say "25" you need to send "0.25" to button 3016 on device 55.

 

So I have a couple of questions I guess:

 

 

  • Why does each dial for the radio have 2 buttons (is this for forward and back? If so I can't seem to see a difference in the values you send through)
  • Is the only way to set the correct value is to have your application keep track of the value you want to set and just hard set it using a direct value?

 

 

Any help would be appreciated.

 

 

Thanks,

Ken.

 

Hi Ken,

 

Export of 1.2.6 version has changed. Why ? Surely to simplify.

Before with version, each frequency rotary had two buttons :

First to increase value and the second to decrease value. The value, than it was necessary to send, was the new frequency.

Ex for the ten : "12"0.000 = 0.6 and use the good button to increase or decrease.

 

Now with the 1.2.6, each button only gives the direction.

Ex for the ten : "12"0.000

VHF AM = (device 55) Button 9, send +0.01 to increase frequecy

VHF AM = (device 55) Button 10, send -0.01 to decrease freqency

 

If this can help you...

 

Cheers

Tacno

UniversRadio for DCS : http://universradio.fr

Homepit on eagle.ru forum :http://forums.eagle.ru/showpost.php?p=1547848&postcount=1 (more details : http://www.tacnoworld.fr)

3rd-Wing.net/75th vFighter "Tiger Sharks"/S-01 Tacno (squadron commander)

Posted

Here an example for A10C UHF Box 2 (not for other models!)

 

 

 

 

 

 

 

 

first you need the device ID of the radio:

  • UHFRadio = GetDevice(54) --The returned value should be tested on validity. If the model was changed on the fly,UHFradio is not longer valid.

Now you have the following functions available:

  • UHFRadio:is_on() -- returns 0 if the radio cannot be used .
  • UHFRadio: set_frequency(freq) --freq is the desired frequency in Hz. The dial buttons are set automatically
  • freq = UHFRadio:get_frequency() -- returns the current frequency in Hz set in box 2
  • UHFRadio:performClickableAction(3007, 0.0) -- sets the mode dial to MANUAL
  • UHFRadio:performClickableAction(3007, 0.1) -- sets the mode dial to PRESET
  • UHFRadio:performClickableAction(3007, 0.2) -- sets the mode dial to GUARD

The returned frequencies are not exact the expected Hz values. There is always an unreliable fraction of about 1000 Hz or more. You need to find a good rounding function to get a clean value.

 

 

 

 

 

 

 

To get the positions of the mode dial, you first need the device ID of the cockpit panels:

  • MainPanel = GetDevice(0) --The returned value should be tested on validity. If the model was changed the ID is not longer valid.
  • UHFlbTB = MainPanel:get_argument_value(168) -- returns the position of the master dial (left dial). (the smiley is a 8. The editor prevents a correction)
  • UHFrbTB = MainPanel:get_argument_value(167) -- returns the position of the mode dial (right dial)

The channel selector for the PRESET case is a bit tricky and different for the VHF and UHF box. If you need that too, please post.

The two other boxes work in the same way with different iDs. You find the IDs in:

\DCS World\Mods\aircrafts\A-10C\Cockpit\Scripts\clickabledata.lua

\DCS World\Mods\aircrafts\A-10C\Cockpit\Scripts\devices.lua

Regards,

Mike

[sIGPIC][/sIGPIC]

Posted

Hi Tacno and Mike,

 

appreciate all the information guys - its very helpful. I have been testing with my standalone install of DCS A-10C and not my DCS World so I don't break the setup I fly with. :). Looks like I will need to start testing with 1.2.6 though as I wasn't aware they changed it.

 

Will test out what you both have provided - thanks.

 

Ken.

Posted (edited)

Thanks Mike/Tacno for the heads'up

 

Still in 1.2.4 ;-)

 

/Gus

 

edit: Anyone seen any info of this from ED in the changelog of the new version ?

Would be nice to know before making the plunge..

Edited by Duckling

- - - -

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...