January 13, 20179 yr I am working on a setup where I change the cockpit config with different liveries from GNS530/430 to GTN750/650. All works well apart from RXP/GPS/MASTER_DEVICE_NEXT. I have setup a indicator to tell me which device is master and no matter what I set-up in the ini files true or false it always starts with GNS430-2 as master. When I select next device it goes to GTN-1, then GTN-2 and DEFAULT. It will not cycle the GNS-1 and GNS-2 but only looks at the GTN plugin. As the RXP/GPS/MASTER_DEVICE_NEXT is the same command for both plugins can we have some why to switch from one to the other or for this command to look at both ini files when both installed. On another point when I only have the GTN plugin it always starts with GTN650-2 as master no matter what I setup in ini file. Tom. Just seen in manual that this command is designed to work across multiple Reality XP plugins. As far as I can see it not working that way.
January 13, 20179 yr We've solved a bug in the GNS code dealing with the settings file (about which gauge type+unit gets saves) which is related to this. We're porting this bug fix to the GTN code for the next update. As for gps master, it works across multiple plugin with direct write to the dataref. That is if you set the dataref to 0 (no masters), or to a meaningful device id (an id recognize by the plugin(s), the correct plugin will pick it up. However, 'device next' implies all plugins would have to share a list and this is not designed like this. Usually, the current system is ok for most cases. In your case, I'd recommend you write device id(s) to the dataref, instead of using the publish commands.
January 13, 20179 yr Author So if I set RXP/radios/indicators/gps_master_device to:- 825571143 for GTN750-1 842348103 for GTN650-2 825439559 for GNS530-1 842216519 for GNS430-2 In SASL:- defineProperty("gps_master", globalPropertyi("RXP/radios/indicators/gps_master_device")) defineProperty("gtn", globalPropertyi("429/ann/rxp_gtn")) defineProperty("gns", globalPropertyi("429/ann/rxp_gns")) function update() if (get(gtn) == 0) then set(gps_master, 825571143) end if (get(gtn) == 1) then set(gps_master, 842348103) end if (get(gns) == 0) then set(gps_master, 825439559) end if (get(gns) == 1) then set(gps_master, 842216519) end end Tom. OR defineProperty("gps_master", globalPropertyi("RXP/radios/indicators/gps_master_device")) defineProperty("gps_state", globalPropertyi("429/ann/rxp_gps")) function update() if (get(gps_state) == 0) then set(gps_master, 0) end if (get(gps_state) == 1) then set(gps_master, 825571143) end if (get(gps_state) == 2) then set(gps_master, 842348103) end if (get(gps_state) == 3) then set(gps_master, 825439559) end if (get(gps_state) == 4) then set(gps_master, 842216519) end end
January 13, 20179 yr I'm not fluent with SASL, but the general concept is: 1) Display/Indicator: READ "RXP/radios/indicators/gps_master_device" and set the light corresponding to the ID. 2) Button push: WRITE the ID corresponding to the button to "RXP/radios/indicators/gps_master_device". PS: LUA supports hexadecimal literals if you prefix them with 0x I find it easier to read hexadecimal than decimal for the ID(s) especially because they are just composed of 4 ASCII letters: 'G' is 0x47, '0' to '9' is 0x30 to 0x39. For example, GTN 650 #2 is 'G652', in hexadecimal it is [0x47, 0x36, 0x35, 0x32] or as a 32 bits value (little endian on X86): 0x32353647 (converted to decimal it gives: 842348103) Known IDs are: G431, G432, G501, G502, G531, G532, G651, G652, G751, G752 The same goes for the 'discrete' dataref, it is easier to use hexadecimal. The dataref value is a bitset, i.e. each bit represents a value which is either 1 (on) or 0 (off), and hexa values read bitwise naturally: 0x01 is the bit1, 0x02 is bit2, 0x04 is bit3, 0x08 is bit4, 0x10 is bit5 etc... (little endian aka lsb to the right, counting bits from 1 to 32).
Archived
This topic is now archived and is closed to further replies.