#SOLVED: Strings (data value), Xplane and Mobiflight

1 messages · Page 1 of 1 (latest)

tropic pollen
#

Hi everyone!

I am that annoying guy always asking about outputting strings from xplane. I am happy to say i found a solution. I want to share my solution, it may be particular, but may be useful.
Xplane strings, which can be "string" or "data" value type are arrays, which are not displayed as so in datareftool. But because they are arrays, they contain elements ([0,1,2.... etc]). Now if you try to output them in mobiflight, you will see double characters that are meaningless on the first look, but as it came out, they have a meaning: it is an ASCII code of an array element (subelement). By adding "if"- condition for each digit (cycling through needed letters, it is not necessary to cycle through an entire English alphabet, for me W N E S compass was enough), you can modify it. As for numbers, which are obviously not integers, but "text numbers" it is enough to subtract 48, which is "0" value in ASCII table. Maybe my little investigation here can be useful for someone who has troubles with outputting strings and chars from xplane, as well as for developers of Mobiflight.
Sorry for my bad English
And a little proof pic attached.

tranquil grove
#

oh my god 🙂 this is genius and dumb (on xplanes side) at the same time. Thanks for sharing this information, it indeed can be useful if you need to do something specific like your case.

shy wraith
#

Hi, great solution. But next time please post Xplane specific issues under xplane topic. Better to have all the goodies there 🙂

tropic pollen
tranquil grove
#

wait, you mean all the lines on the fmc screen are separate datarefs?

#

could be a custom output device I think

tropic pollen
tropic pollen
tranquil grove
#

except for the ascii decoding part right now 🙂

#

but you could do it in the arduino I guess

tropic pollen
#

But still it is doable

tranquil grove
#

but we cannot send an array right now I guess?

#

or maybe we can, havwnt tried

tropic pollen
#

Nope. Unfortunately if you output it directly , you will get no value on output

#

I was struggling with it for a year and only found occasionally this thing this night

tranquil grove
#

but what would you get on arduino side? some delimited character string?

#

yeah this is an interesting find

tropic pollen
tranquil grove
#

can you file a feature requedt on github and document what you learned there?

tropic pollen
#

Yes i will do today

tranquil grove
#

so we wont forget about it

#

cool

#

maybe there is a proper way to read strings too but I wonder if this is just for zibo or a general thing for strings?

tropic pollen
#

Including zibo

modern drum
#

I think Sebastián has this fix already in mind.

#

Handling string datarefs I mean

tropic pollen
# modern drum https://github.com/MobiFlight/MobiFlight-Connector/issues/1026

I know this topic.

  1. native xpuipc strings are outputted without a problem, but:
  2. custom aircraft non-integer data is still unoutputtable;
  3. non-integer containing arrays in xp are not outputtable as well: basically, a string in xplane is an array, consisting of elements, which are not integers. In simple words, for now, its impossible to directly output in mobiflight non-integer values from xplane.

I found a solution for this i guess, im filing a github request now, maybe i can help a little bit with it🙂

#

Also i wouldnt use "string" term within xplane. I would prefer "non-integer", because mf can't output anything from xplane, that is not a number

tranquil grove
#

you could comment on that issue that @modern drum linked and mention the one you are filing (and mention #1026 ony yours)

tropic pollen
#

I filed a new request.

tranquil grove
#

just type #1026 on a comment and it should find the one

tropic pollen
#

With detailed instructions

tranquil grove
#

yeah that is fine

tropic pollen
#

Can you check it if its there

tranquil grove
#

linking them together is probably good so that they are easy to find that they are somewhat related

#

lets see

tropic pollen
#

Yep thank you

tranquil grove
#

added a comment

#

it links them both ways

#

by the way, @tropic pollen I think you can create custom XPUIPC offsets in the xpuipc config

#

or with the flywithlua plugin?

#

if xpuipc string reading works?

#

so that you could make custom offsets

#

not sure if it would be possible to take the array style things and create regular strings into your own datarefs in lua too?

#

or is it just the fsuipc that currently works with strings, not the native dataref support? Havent really done much xplane stuff in this area yet

tropic pollen
#

So @tranquil grove as i have just written in a wrong old topic

#

yes xpuipc coding works, but you still must code things character by character

#

i wasnt able to code it, so i went via mobiflight, and it worked for me