Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi

I have difficulties to send a value to AP_ALT value.

My epl code send a value 0 to 35000.

In Epicinfo.cfg i have-FSUIPC_WRITE_8=U2,4,07D4

I tried every size of variable without success.

AP_VS setting is working well.

What is the difference between smallint and longint?

I took care of EPIC programming considerations in EPICINFO doc.

Still I don’t find the way.

Regards

Posted
Hi

I have difficulties to send a value to AP_ALT value.

My epl code send a value 0 to 35000.

In Epicinfo.cfg i have-FSUIPC_WRITE_8=U2,4,07D4

The values 0 to 35000 written to 07D4 will amount to a maximum of just over half a metre (35000/65536). As documented, the value the AP uses is metres times 65536.

What is the difference between smallint and longint?

A smallint is 2 bytes long and has a maximum value of 32767 (65535 if unsigned), a longint is 4 bytes and has a maximum value 65536 times as big.

If you only want the Altitude to the nearest metre, write the number of metres as a 2-byte shortint to offset 07D6. The fraction would go into 07D4 (eg 32768 = half metre). If you want accuracy you'd need to write two values I think, as EPL only caters for shortints I think.

Regards,

Pete

Posted

I've been scanning through the EPICINFO documentation (I've forgotten most of it, as I've not used it in years). And I found another idea there.

You could try, instead of the direct FSUIPC offset, the panel token assignment,

AP_ALT_VAR_SET_ENGLISH=U2

I think you should find this works in feet, which would be easier for you.

Regards,

Pete

Posted

Thanks for replies.

When you say, "you'd need to write two values"

Do I need 2 ofset with 2 soft axis?

07D4 and 07D6? What is 07D5?

I try to figure out how ofsets work.

If using AP_ALT_VAR_SET_ENGLISH=U2

Should I place it in Epicinfo.cfg or Fs.cfg?

Yesterday I tried in Epicinfo.cfg without succes.

But i l try it again If you think that is the solution.

Should i need to do a special Math proc. in my EPL?

Or just sending 0 to 35000 (Feet min)?

Is it corect if i say a Word is same as smallint and LongWord same as longint?

Posted

When you say, "you'd need to write two values"

Do I need 2 ofset with 2 soft axis?

Yes, you would need 2 because you are trying to transfer 32 bits (4 bytes) or data whilst the axes can only transfer 16 bits (2 bytes).

07D4 and 07D6? What is 07D5?

07D5 is the second byte of the 2 bytes used for the 16 bit value in 07D4!

I try to figure out how ofsets work.

They don't "work", they are just addresses, numbers. In Intel processors, memroy is referenced by addresses. Each byte has an address, from 0 up to whatever memory size is used. "Offsets" are merely differences from the start of a block of memory to where the specified data is. 07D4 is hexadecim 7D4 bytes offset from the start of the reserved FSUIPC memory. The hexadecimal number 07D4 is decimal 2004, so there are 2004 bytes lower in that memory. The word "offset" means just that -- "set off, or away from".

If using AP_ALT_VAR_SET_ENGLISH=U2

Should I place it in Epicinfo.cfg or Fs.cfg?

As documented in the EPICINFO documentation!!! It is listed there as an EpicInfo parameter -- how come you found the FSUIPC_WRITE stuff and by-passed all the easier ones?

Yesterday I tried in Epicinfo.cfg without succes.

But i l try it again If you think that is the solution.

Sorry, I am trying to advise from memory. I've not used EPIC for years. I think most people now use FSCommunicator or something else, whiich is probably easier to use, than my EPICINFO stuff which was designed mainly to work with the IPC.VXD on Windows 95 with an ISA EPIC Rev D board.

Should i need to do a special Math proc. in my EPL?

Or just sending 0 to 35000 (Feet min)?

As I said, I think the AP ALT VAR thingy uses feet. Certainly not feet min though.

Is it corect if i say a Word is same as smallint and LongWord same as longint?

I don't really know where you are getting your terms from in any case, but in Microsoft C/C++ the term "WORD" is reserved for a 16 bit unsigned number whereas a "short int" is a 16 bit signed integer. Similarly Microsoft C/C++ uses "DWORD" (for "double word") for 32--bit unsigned and either "long int" or just "int" for 32-bit signed integers. 8-bit bytes are just "char" which may be signed or unsigned depending on compiler options, or "BYTE" which is unsigned

The "smallint" may be 16 bit or even 8 bit for all I know. Where are you looking? If it is FSInterrogate then I think the terms there are from Delphi, which I don't know, but there are separate terms for 8-bit, 16-bit and 32-bit unsigned and signed numbers there. They should be reasonably intuitive to work out, otherwise try the documentation.

If you need more help with EPIC I would recommend trying the new EPIC forum. I think it is http://www.simengineers.com/yaf/default.aspx.

Regards,

Pete

Posted
As I said, I think the AP ALT VAR thingy uses feet. Certainly not feet min though.

He he Certainly not.

All this should help me for the moment. I l give news when it will work.

Thanks

  • 2 weeks later...
Posted

After some changes in my EPL and put AP_ALT_VAR_SET_ENGLISH=U2 in EOICINFO.cfg it works.

Now for the vs_setting I use

FSUIPC_WRITE_7=U1,-2vs_set,07F2

I need to send value 3000 to -3000 for AP_VS_SETING (smallint)

it works very well for +100 +200.......to+3000

But when it is time for negative it is somthing else.

I know it works. What we have to do for example to send 100 I send 100

to send -100 I send 65535-100 =65435 then we have -100 in FS vs seting.

The perfect command to do so seems to be ~ (ones compliment) to reverse the value.

But the command freez EPIC right away when sent.

myWord=100~100; shows 65435 then Epic freez.

how should I use the command to make the ap_vs_set works?

Posted

I know it works. What we have to do for example to send 100 I send 100 to send -100 I send 65535-100 =65435 then we have -100 in FS vs seting.

Actually, that's 1 out. And al that stuff is only because EPIC (still?) doesn't support negative numbers.

The binary representaion of -1 in 16-bit hex is FFFF (i.e. all ones). As an unsigned 16-bit number this looks like decumal 65535. So -1 is 65535. Your -100 would be 65436. So your formula all in 16 bits should be (65535 - (value)) + 1.

The perfect command to do so seems to be ~ (ones compliment) to reverse the value. But the command freez EPIC right away when sent. myWord=100~100; shows 65435 then Epic freez.

This is something you need to take up with the EPIC developers (Ralph Robinson should be able to help). I don't even remember there being a "~" function when I used EPIC.

Regards,

Pete

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.