MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

05/03/2024 - This forum is read-only

The community support for MobiFlight has moved exclusively over to our Discord server. Register for free and enjoy more interactive functions like image and video upload, voice chat. More than 7,000 registered users around the world make it a great experience!

See you on our MobiFlight Community Discord server.

A HUGE Thank You to everyone who participated in the forum, especially obviously to Pizman and Stephan who did an outstanding job over so many years providing an incredible service to the MobiFlight community.

The forum is still providing a lot of good content, hence we keep this information accessible.

icon
Avatar
sisoffi
Posts: 91
i am trying to find a solution to lvars assignment.
on three of them and precisely on the
1. HDG of the vor RMI and on the 2.pitch and 3.bank of the standby the values are perfectly read from 0 to 256 and then it changes directly to 0,
effectively unbalancing the stepper motor assignment.

I also left 4 bytes free after assigning each offset associated with the Lvar, but nothing to do. I am attaching the Lua as it is associated:

............
function CM1_rmi_card1 (varname, value) ipc.readUB(0x697E, value) end (HDG°)
function CM1_rmi_needle1 (varname, value) ipc.readUB(0x697F, value) end (VOR1 POINTER)
function CM1_rmi_needle2 (varname, value) ipc.readUB(0x6980, value) end (VOR2 POINTER)
function stbyhor_card1 (varname, value) ipc.readUB(0x6991, value) end (BANK)
function stbyhor_card2 (varname, value) ipc.readUB(0x6995, value) end (PITCH)

.............

event.Lvar("CM1_rmi_card1", lvps, "CM1_rmi_card1") -- (number) | offset = 0x697E | type = int | size = UD, 1 | mask = N/A
event.Lvar("stbyhor_card1", lvps, "stbyhor_card1") -- (number) | offset = 0x6991 | type = int | size = UD, 4 | mask = N/A
event.Lvar("stbyhor_card2", lvps, "stbyhor_card2") -- (number) | offset = 0x6995 | type = int | size = UD, 4 | mask = N/A
2020-11-04 12:59
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
If a Value end at 255 this means the "typ of data" is set to a Unsigned "1 Byte Integer" ( UB )

I not a pro in Programming.... But i think your issue is in the code OR in the Mobiflight Configs....

Get Sure....
The Codeline that read the LVAR and support it on a Offset will create the Offset in the needed Format...... HDG e.g. is mostly a Unsigned Word ( 2 Byte INT) but pretty sure it can NEVER be a 1 Byte Offset !!
If the Code is stil correct then get sure Mobiflight use correct Settings.... Also here you must define a Datatyp of 2 Bytes or greater ( The same as you use in the code !)
Good Luck !
2020-11-05 19:09
Avatar
sisoffi
Posts: 91
thank you for your reply.
the lvar is correct, and i put in the mobi setting INT and 2 bytes
but no work at 256 change to 0
2020-11-06 16:21
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
This can not be correct !

iconsisoffi:


I also left 4 bytes free after assigning each offset associated with the Lvar, but nothing to do. I am attaching the Lua as it is associated:

............
function CM1_rmi_card1 (varname, value) ipc.readUB(0x697E, value) end (HDG°)
function CM1_rmi_needle1 (varname, value) ipc.readUB(0x697F, value) end (VOR1 POINTER)
function CM1_rmi_needle2 (varname, value) ipc.readUB(0x6980, value) end (VOR2 POINTER)
function stbyhor_card1 (varname, value) ipc.readUB(0x6991, value) end (BANK)
function stbyhor_card2 (varname, value) ipc.readUB(0x6995, value) end (PITCH)

.............

event.Lvar("CM1_rmi_card1", lvps, "CM1_rmi_card1") -- (number) | offset = 0x697E | type = int | size = UD, 1 | mask = N/A
event.Lvar("stbyhor_card1", lvps, "stbyhor_card1") -- (number) | offset = 0x6991 | type = int | size = UD, 4 | mask = N/A
event.Lvar("stbyhor_card2", lvps, "stbyhor_card2") -- (number) | offset = 0x6995 | type = int | size = UD, 4 | mask = N/A



I don´t know exactly what you do here..... But all make no sense....

In the UPPER part you use Offset 697E .... AND 697F for two different things.... BOTH are "UB" .... Means unsigned Byte ( 1 Byte Integer)
In LOWER Part you define the FIRST "event.Lvar" to Offset 697E but now as "UD" .... Means Unsigned Doubeword.... So 4 Byte.

Means the upper Functions (RMI Card and Needle) use the first 2 Bytes of the "Event rmi card1"

sounds wrong !
Good Luck !
2020-11-06 23:12
icon