Hi Sebastian
This was done long time ago so i still not remeber 100%.
If i´m right the Problem is....
1. FSX not have a SET EventID for Transponder
Code:
So only the FULL 4 Nuber Value can be SET ... But NOT the 1,10,100 or 1000 Part Individual.
*******
2. Its not Possible to WRITE a Bitmasked Offset that include MORE then 1 BIT ( If 4 Bits are Marked then ALL 4 Bits write 1/0 simmular)
So a FSUIPC Offset Write is not possible ( or i not see the way)
Code:
To Write 1 Diggit individual we need to write via BCD Mode .... And Write to a Nibble Halfbyte .
For Example the 1000 Part must be write to Offset:0354 Size 1 Byte Bitmask 4,5,6,7 Active.
((EDIT: We could write it Binary instead of BCD like a 7 would be 0111 ... But that also need to write 4 bits individual) )
You say in the Past there is no need to WRITE multiple Bits .... So that wont work i think !
*********
Idea !
If we can NOT write a Nibble we MUST write the full Byte .... That means we must Write 2 Numbers in a row.
Thats the time to use Modulo, round or a verry Long IF/ELSEIF Line
Example: We like to change 1000 Part ... From 12xx to 22xx ....
The xx we can ignore cause this is a other Byte. So the Raw Value of Byte 1 in that example is "12"
So we must first define the value of the 100 Part to write it "again" when we change the 1000 Part.
Maby Modulo %10 will work to get "2" here. Then we only need to Add the needed 1000 Part we like to set like $+20 in that example
Syntax:
$%10+20 (20 for the "2" of 1000 Part .... 30 for the "3" and so on .... For "0" $%10 should be enough. )
More Problematic is the second Position of the Bye i think.
Here we need to "carry" the first number,
Example : We like to change 100 Part from 12xx to 13xx
Now we need maby Round ....
Raw Data is 12 . If we Divide through 10 and round without decimals then 12/10=1,2 Round = 1 Then we must multiply it again to get 10 and add the needed number on right part.
Syntax:
Round($/10,0)*10+3 ( 3 cause in example we like to swap from 12xx to 13xx ... so 4 for x4xx .... 5 for x5xx and so on)
Alternate is a long IF ELSE ... Like IF Valie is between 10 and 20 Then write 1x ELSEIF Value is between 20 and 30 then write 2x and so on ( x is the number we like to set on 2nd diggit)
Like if($>9||$<20,1x,if($>19||$<29,2x,if( and so on ....and so on )))))))))))))))
What do you think about.... Can this Work or do you know a better way ? Stepahn what do you mean ?