Jump to content
The simFlight Network Forums

Recommended Posts

Hello,

I've got FSUIPC6 and am now having issues with com.write() is it possible someone can check its not me being stupid. The below is a simplified version but still does the same, opens the com port and then closes it immediately after without sending a single string... the script continues to log the data on screen perfectly. what would cause the Port to close whilst the thread is still running?

dev = com.open("COM9",115200,0)

--[[if MyComPort == 0 then
  ipc.display (" Could not open port " )
  ipc.sleep(5000)
  ipc.exit()
else
  ipc.display ("arduino connected")
  ipc.sleep (5000)
  ipc.exit()
end]]

  
function NoseGr(offset, value)
  value = value / 163.8;

	sentence = string.format ("<A%03d", value)

	com.write (dev, sentence)
	--ipc.log(sentence)
	ipc.display(sentence)
   
end

event.offset(0x0BF0, "UD", "NoseGr") 

FSUIPC log 

********* FSUIPC6, Version 6.0.8 (7th May 2020) by Pete & John Dowson *********
Prepar3D.exe version = 4.5.13.32097
Running inside Prepar3D v4
Module base=7FFDF8EC0000
Windows 10 Home 64 Bit reported as Build 18362, Release ID: 1903 (OS 10.0)
Reading options from "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\FSUIPC6.ini"
Checking the Registrations now ...
User Name=""
User Addr=""
FSUIPC6 Key is provided
WIDEFS7 not user registered, or expired
        0 System time = 08/07/2020 11:24:45
        0 FLT path = "C:\Users\Custo\Documents\Prepar3D v4 Files\"
        0 Using DialogMode
       16 FS path = "G:\Program Files\Lockheed Martin\Prepar3D v4\"
       94 ---------------------- Joystick Device Scan -----------------------
       94 Product= Throttletek 1
       94    Manufacturer= Leo Bodnar
       94    Serial Number= B69945
       94    Vendor=1DD2, Product=200D (Version 1.36)
      110    GUIDs returned for product: VID_1DD2&PID_200D:
      110       GUID= {AFCB1B20-BC5F-11EA-8001-444553540000}
      110       Details: Btns=32, POVs=(0, 0, 0, 0), Cal=x00000000, Max=R3420,U3285,V3989,X0,Y0,Z2670
      110 -------------------------------------------------------------------
      110 Device acquired for use:
      110    Joystick ID = 1 (Registry okay)
      110    1=Throttletek 1
      110    1.GUID={AFCB1B20-BC5F-11EA-8001-444553540000}
      110 -------------------------------------------------------------------
      141 ### Checking Prepar3D.cfg
      141     Controllers are set to ON, using RawInput within P3D
      141 -------------------------------------------------------------------
      141 LogOptions=00000000 00000001
      141 -------------------------------------------------------------------
      141 SimConnect_Open succeeded: waiting to check version okay
      141 Opened separate AI Traffic client okay
     3110 Running in "Lockheed Martin® Prepar3D® v4", Version: 4.5.13.32097 (SimConnect: 4.5.0.0)
     3110 Initialising SimConnect data requests now
     3110 FSUIPC Menu entry added
     3110 ... Using Prepar3D with Academic License
     3125 C:\Users\Custo\Documents\Prepar3D v4 Files\citation in air working.fxml
     3125 G:\Program Files\Lockheed Martin\Prepar3D v4\SimObjects\Airplanes\F1_Cessna Mustang\F1_Cessna_Mustang.air
     3141 ### The user object is 'F1_Cessna_Mustang2'
     3141 ### Mode is NORMAL
     3578 ### Mode: PAUSE on
    26969 Loading Complete ...
    26969 ### Mode is NORMAL
    27297 Aircraft loaded: running normally now ...
    27328 User Aircraft ID 2 supplied, now being used
    28250 System time = 08/07/2020 11:25:13, Simulator time = 14:24:50 (13:24Z)
    28250 Aircraft="F1_Cessna_Mustang2"
    35235 -------------------- Starting everything now ----------------------
    35297 LUA.0: beginning "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\ipcReady.lua"
    36500 Advanced Weather Interface Enabled
    57391 Sim stopped: average frame rate for last 30 secs = 69.3 fps
    57391    Max AI traffic was 0 aircraft
    57391 -------------------------------------------------------------------
    58547 === Closing session: waiting for DLLStop to be called ...
    64782 === DLLStop called ...
    64782 === Closing external processes we started ...
    65782 === About to kill any Lua plug-ins still running ...
    65922 Lua threads being terminated:
    65922       1 = "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua"
    66094 LUA: "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua": killed
    66094 === Closing global Lua thread
    67110 === About to kill my timers ...
    67313 === Restoring window procs ...
    67313 === Unloading libraries ...
    67313 === stopping other threads ...
    67313 === ... Button scanning ...
    67422 === ... Axis scanning ...
    67516 === Releasing joystick devices ...
    67516 === Freeing macro memory
    67516 === Removing any offset overrides
    67516 === Clearing any displays left
    67516 === NOTE: not calling SimConnect_Close ...
    67516 === AI slots deleted!
    67516 === Freeing button memory ...
    67516 === Deleting wxstationlist.bin file ...
    67516 === Closing my Windows ...
    67516 === Freeing FS libraries ...
    68516 === Closing devices ...
    68516 === Closing the Log ... Bye Bye! ...
    68516 System time = 08/07/2020 11:25:54, Simulator time = 14:25:19 (13:25Z)
    68516 *** FSUIPC log file being closed
Minimum frame rate was 51.0 fps, Maximum was 86.4 fps
Average frame rate for running time of 30 secs = 69.3 fps
Maximum AI traffic for session was 0 aircraft
Memory managed: 18 Allocs, 17 Freed
********* FSUIPC Log file closed ***********

from the COM Reader

0 08/07/2020 10:36:29 IRP_MJ_CREATE DOWN   G:\Program Files\Lockheed Martin\Prepar3D v4\Prepar3D.exe   COM9  
1 08/07/2020 10:36:29 IRP_MJ_CREATE UP STATUS_SUCCESS  G:\Program Files\Lockheed Martin\Prepar3D v4\Prepar3D.exe   COM9  
2 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_SET_QUEUE_SIZE) DOWN  00 04 00 00 00 04 00 00  ........ 8  COM9  
3 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_SET_QUEUE_SIZE) UP STATUS_SUCCESS     COM9  
4 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_SET_TIMEOUTS) DOWN  ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ÿÿÿÿ................ 20  COM9  
5 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_SET_TIMEOUTS) UP STATUS_SUCCESS     COM9  
6 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_PROPERTIES) DOWN      COM9  
7 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_PROPERTIES) UP STATUS_SUCCESS 40 00 02 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 06 00 00 00 cd 00 00 00 7f 00 00 00 70 6b 06 00 0c 00 01 1f 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00  @...........................Í......pk...........@.............. 64  COM9  
8 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_BAUD_RATE) DOWN      COM9  
9 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_BAUD_RATE) UP STATUS_SUCCESS 00 c2 01 00  .Â.. 4  COM9  
10 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_LINE_CONTROL) DOWN      COM9  
11 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_LINE_CONTROL) UP STATUS_SUCCESS 00 00 08  ... 3  COM9  
12 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_CHARS) DOWN      COM9  
13 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_CHARS) UP STATUS_SUCCESS 00 00 00 00 11 13  ...... 6  COM9  
14 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_HANDFLOW) DOWN      COM9  
15 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_HANDFLOW) UP STATUS_SUCCESS 01 00 00 00 40 00 00 00 80 03 00 00 00 02 00 00  ....@...€....... 16  COM9  
16 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_SET_BAUD_RATE) DOWN  00 c2 01 00  .Â.. 4  COM9  
17 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_SET_BAUD_RATE) UP STATUS_SUCCESS     COM9  
18 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_SET_RTS) DOWN      COM9  
19 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_SET_RTS) UP STATUS_SUCCESS     COM9  
20 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_SET_DTR) DOWN      COM9  
21 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_SET_DTR) UP STATUS_SUCCESS     COM9  
22 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_SET_LINE_CONTROL) DOWN  00 00 08  ... 3  COM9  
23 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_SET_LINE_CONTROL) UP STATUS_SUCCESS     COM9  
24 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_SET_CHARS) DOWN  00 00 00 00 11 13  ...... 6  COM9  
25 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_SET_CHARS) UP STATUS_SUCCESS     COM9  
26 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_SET_HANDFLOW) DOWN  01 00 00 00 40 00 00 00 80 03 00 00 00 02 00 00  ....@...€....... 16  COM9  
27 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_SET_HANDFLOW) UP STATUS_SUCCESS     COM9  
28 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_PURGE) DOWN  0a 00 00 00  .... 4  COM9  
29 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_PURGE) UP STATUS_SUCCESS     COM9  
30 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN      COM9  
31 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  .................... 20  COM9  
32 08/07/2020 10:36:29 IRP_MJ_READ DOWN     1024 COM9  
33 08/07/2020 10:36:29 IRP_MJ_READ UP STATUS_SUCCESS     COM9  
34 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN      COM9  
35 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  .................... 20  COM9  
36 08/07/2020 10:36:29 IRP_MJ_READ DOWN     1024 COM9  
37 08/07/2020 10:36:29 IRP_MJ_READ UP STATUS_SUCCESS     COM9  
38 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN      COM9  
39 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  .................... 20  COM9  
40 08/07/2020 10:36:29 IRP_MJ_READ DOWN     1024 COM9  
41 08/07/2020 10:36:29 IRP_MJ_READ UP STATUS_SUCCESS     COM9  
42 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN      COM9  
43 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  .................... 20  COM9  
44 08/07/2020 10:36:29 IRP_MJ_READ DOWN     1024 COM9  
45 08/07/2020 10:36:29 IRP_MJ_READ UP STATUS_SUCCESS     COM9  
46 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN      COM9  
47 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  .................... 20  COM9  
48 08/07/2020 10:36:29 IRP_MJ_READ DOWN     1024 COM9  
49 08/07/2020 10:36:29 IRP_MJ_READ UP STATUS_SUCCESS     COM9  
50 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN      COM9  
51 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  .................... 20  COM9  
52 08/07/2020 10:36:29 IRP_MJ_READ DOWN     1024 COM9  
53 08/07/2020 10:36:29 IRP_MJ_READ UP STATUS_SUCCESS     COM9  
54 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN      COM9  
55 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  .................... 20  COM9  
56 08/07/2020 10:36:29 IRP_MJ_READ DOWN     1024 COM9  
57 08/07/2020 10:36:29 IRP_MJ_READ UP STATUS_SUCCESS     COM9  
58 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN      COM9  
59 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  .................... 20  COM9  
60 08/07/2020 10:36:29 IRP_MJ_READ DOWN     1024 COM9  
61 08/07/2020 10:36:29 IRP_MJ_READ UP STATUS_SUCCESS     COM9  
62 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN      COM9  
63 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  .................... 20  COM9  
64 08/07/2020 10:36:29 IRP_MJ_READ DOWN     1024 COM9  
65 08/07/2020 10:36:29 IRP_MJ_READ UP STATUS_SUCCESS     COM9  
66 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN      COM9  
67 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  .................... 20  COM9  
68 08/07/2020 10:36:29 IRP_MJ_READ DOWN     1024 COM9  
69 08/07/2020 10:36:29 IRP_MJ_READ UP STATUS_SUCCESS     COM9  
70 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN      COM9  
71 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  .................... 20  COM9  
72 08/07/2020 10:36:29 IRP_MJ_READ DOWN     1024 COM9  
73 08/07/2020 10:36:29 IRP_MJ_READ UP STATUS_SUCCESS     COM9  
74 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN      COM9  
75 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  .................... 20  COM9  
76 08/07/2020 10:36:29 IRP_MJ_READ DOWN     1024 COM9  
77 08/07/2020 10:36:29 IRP_MJ_READ UP STATUS_SUCCESS     COM9  
78 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) DOWN      COM9  
79 08/07/2020 10:36:29 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_GET_COMMSTATUS) UP STATUS_SUCCESS 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  .................... 20  COM9  
80 08/07/2020 10:36:29 IRP_MJ_READ DOWN     1024 COM9  
81 08/07/2020 10:36:29 IRP_MJ_READ UP STATUS_SUCCESS     COM9  
82 08/07/2020 10:36:30 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_PURGE) DOWN  0a 00 00 00  .... 4  COM9  
83 08/07/2020 10:36:30 IRP_MJ_DEVICE_CONTROL (IOCTL_SERIAL_PURGE) UP STATUS_SUCCESS     COM9  
84 08/07/2020 10:36:30 IRP_MJ_CLOSE DOWN      COM9  
85 08/07/2020 10:36:30 IRP_MJ_CLOSE UP STATUS_SUCCESS     COM9  

--------------------------------------

 

Share this post


Link to post
Share on other sites
3 minutes ago, MichaelStevenD said:

I've got FSUIPC6 and am now having issues with com.write() is it possible someone can check its not me being stupid. The below is a simplified version but still does the same, opens the com port and then closes it immediately after without sending a single string... the script continues to log the data on screen perfectly. what would cause the Port to close whilst the thread is still running?

You say  you are "now" having issues. does that mean you didn't before? Before what?

The complete first section appears to be commented out. However, if you used it in anything like its current form you do an ipc.exit no matter whether the port is opened successfully or not.

How are you detecting that the com port is being closed? I've run your script here, only changing two things:

1 the com port: the only one I have is "com3",
2 the com.write line to num = com.write so i can see if data was sent.

I then used the Lua tracing option (in the Logging Tab) to see the numbers:

   468312 LUA.2: beginning "E:\FSUIPC6\comtest.lua"
   468312 LUA.2: E:\FSUIPC6\comtest.lua:1
   468312 LUA.2: Global: ipcPARAM = 0
   468344 LUA.2: E:\FSUIPC6\comtest.lua:23
   468344 LUA.2: Global: dev = 2
   468344 LUA.2: E:\FSUIPC6\comtest.lua:14
   468344 LUA.2: E:\FSUIPC6\comtest.lua:25
   468344 LUA.2: Waiting for an event in "E:\FSUIPC6\comtest.lua"
   468344 LUA.2: Offset Change event: calling "NoseGr" in "E:\FSUIPC6\comtest.lua"
   468359 LUA.2: E:\FSUIPC6\comtest.lua:15
   468359 LUA.2: Local: offset = 3056
   468359 LUA.2: Local: value = 16383
   468359 LUA.2: E:\FSUIPC6\comtest.lua:17
   468359 LUA.2: Local: value = 100.01831501832
   468359 LUA.2: E:\FSUIPC6\comtest.lua:19
   468359 LUA.2: Global: sentence = <A100
   468375 LUA.2: E:\FSUIPC6\comtest.lua:21
   468375 LUA.2: Global: num = 5
   468406 LUA.2: E:\FSUIPC6\comtest.lua:23
   468406 LUA.2: Waiting for an event in "E:\FSUIPC6\comtest.lua"

Note that report "num = 5", showing 5 bytes were sent.

So then I tested with a deliberate close, inserting com.close(dev) before the function.

  1032578 LUA.3: beginning "E:\FSUIPC6\comtest.lua"
  1032578 LUA.3: E:\FSUIPC6\comtest.lua:1
  1032578 LUA.3: Global: ipcPARAM = 0
  1032609 LUA.3: E:\FSUIPC6\comtest.lua:12
  1032609 LUA.3: Global: dev = 2
  1033469 LUA.3: E:\FSUIPC6\comtest.lua:23
  1033469 LUA.3: E:\FSUIPC6\comtest.lua:14
  1033484 LUA.3: E:\FSUIPC6\comtest.lua:25
  1033484 LUA.3: Waiting for an event in "E:\FSUIPC6\comtest.lua"
  1033484 LUA.3: Offset Change event: calling "NoseGr" in "E:\FSUIPC6\comtest.lua"
  1033484 LUA.3: E:\FSUIPC6\comtest.lua:15
  1033484 LUA.3: Local: offset = 3056
  1033484 LUA.3: Local: value = 16383
  1033484 LUA.3: E:\FSUIPC6\comtest.lua:17
  1033484 LUA.3: Local: value = 100.01831501832
  1033484 LUA.3: E:\FSUIPC6\comtest.lua:19
  1033500 LUA.3: Global: sentence = <A100
  1033500 LUA.3: E:\FSUIPC6\comtest.lua:21
  1033500 LUA.3: Global: num = 0
  1033500 LUA.3: E:\FSUIPC6\comtest.lua:23
  1033500 LUA.3: Waiting for an event in "E:\FSUIPC6\comtest.lua"

You'll see that because the port was closed, num = 0, i.e. zero bytes were written.

So it is definitely working properly.

Pete

 

 

 

Share this post


Link to post
Share on other sites

Hi Pete,

Thank you for the reply.

1) This is no more than a simplified copy (with slight changes to COM number and offsets read) from a popular upload 'Lua to Arduino' that a had been posted a while back on this forum with FSUIPC5. I had used it on FSUIPC5 a while back (different PC) and from memory I had not struggled as much as I have done over the last week to get it working on FSUIPC6.

2) Commented out section was just to isolate and debug com.open to see if com port was indeed being opened and it works just fine. 

3) serial port monitor receives IRM_MJ_CLOSE ,1 second after the port is open and the script is still running. the event.offset() is also working as it continues to call NoseGr and ipc.display continues to work but com.write stops pushing strings to the com port.

56 minutes ago, Pete Dowson said:

Note that report "num = 5", showing 5 bytes were sent.

THATS INTERESTING, mine never shows a log for bytes sent...

 34938 -------------------- Starting everything now ----------------------
    34984 LUA.0: beginning "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\ipcReady.lua"
    34984 LUA.0: ...o\Documents\Prepar3D v4 Add-ons\FSUIPC6\ipcReady.lua:1
    34984 LUA.0: Global: ipcPARAM = 0
    35094 LUA.1: beginning "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua"
    35094 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:1
    35094 LUA.1: Global: ipcPARAM = 0
    35109 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:22
    35109 LUA.1: Global: dev = 1
    35109 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:13
    35125 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:24
    35125 LUA.1: Waiting for an event in "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua"
    35125 LUA.1: Offset Change event: calling "NoseGr" in "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua"
    35125 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:14
    35125 LUA.1: Local: offset = 3056
    35125 LUA.1: Local: value = 16383
    35125 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:16
    35125 LUA.1: Local: value = 100.01831501832
    35141 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:18
    35141 LUA.1: Global: sentence = <A100
    35859 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:20
    35875 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:22
    35875 LUA.1: Waiting for an event in "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua"
    36094 Advanced Weather Interface Enabled
    41000 LUA.1: Offset Change event: calling "NoseGr" in "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua"
    41000 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:14
    41000 LUA.1: Local: value = 33
    41016 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:16
    41016 LUA.1: Local: value = 0.2014652014652
    41016 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:18
    41016 LUA.1: Global: sentence = <A000
    41016 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:20
    41031 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:22
    41047 LUA.1: Waiting for an event in "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua"
    41047 LUA.1: Offset Change event: calling "NoseGr" in "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua"
    41047 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:14
    41047 LUA.1: Local: value = 145
    41047 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:16
    41047 LUA.1: Local: value = 0.88522588522589
    41047 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:18
    41047 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:20
    41078 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:22
    41078 LUA.1: Waiting for an event in "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua"
    41078 LUA.1: Offset Change event: calling "NoseGr" in "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua"
    41078 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:14

 

Share this post


Link to post
Share on other sites

sent the 'last log' not current sorry,  this is the current. it gives a global num 0

 35141 -------------------- Starting everything now ----------------------
    35203 LUA.0: beginning "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\ipcReady.lua"
    35203 LUA.0: ...o\Documents\Prepar3D v4 Add-ons\FSUIPC6\ipcReady.lua:1
    35203 LUA.0: Global: ipcPARAM = 0
    35313 LUA.1: beginning "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua"
    35313 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:1
    35313 LUA.1: Global: ipcPARAM = 0
    35328 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:22
    35328 LUA.1: Global: dev = 1
    35328 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:13
    35328 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:24
    35328 LUA.1: Waiting for an event in "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua"
    35328 LUA.1: Offset Change event: calling "NoseGr" in "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua"
    35328 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:14
    35328 LUA.1: Local: offset = 3056
    35328 LUA.1: Local: value = 16383
    35344 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:16
    35344 LUA.1: Local: value = 100.01831501832
    35344 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:18
    35344 LUA.1: Global: sentence = <A100
    36078 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:20
    36078 LUA.1: Global: num = 0
    36078 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:22
    36094 LUA.1: Waiting for an event in "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua"
    36359 Advanced Weather Interface Enabled
    40594 LUA.1: Offset Change event: calling "NoseGr" in "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua"
    40594 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:14
    40594 LUA.1: Local: value = 106
    40594 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:16
    40594 LUA.1: Local: value = 0.64713064713065
    40609 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:18
    40609 LUA.1: Global: sentence = <A000
    40609 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:20
    40625 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:22
    40625 LUA.1: Waiting for an event in "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua"
    40625 LUA.1: Offset Change event: calling "NoseGr" in "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua"
    40625 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:14
    40625 LUA.1: Local: value = 193
    40641 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:16
    40641 LUA.1: Local: value = 1.1782661782662
    40641 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:18
    40641 LUA.1: Global: sentence = <A001
    40641 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:20
    40656 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:22
    40656 LUA.1: Waiting for an event in "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua"
    40656 LUA.1: Offset Change event: calling "NoseGr" in "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua"
    40656 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:14
    40656 LUA.1: Local: value = 255
    40656 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:16
    40672 LUA.1: Local: value = 1.5567765567766
    40672 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:18
    40672 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:20
    40703 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:22
    40703 LUA.1: Waiting for an event in "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua"
    40703 LUA.1: Offset Change event: calling "NoseGr" in "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua"
    40703 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:14
    40703 LUA.1: Local: value = 341
    40703 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:16
    40703 LUA.1: Local: value = 2.0818070818071
    40703 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:18
    40703 LUA.1: Global: sentence = <A002
    40719 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:20
    40734 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:22
    40734 LUA.1: Waiting for an event in "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua"
    40734 LUA.1: Offset Change event: calling "NoseGr" in "C:\Users\Custo\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua"
    40734 LUA.1: ...\Documents\Prepar3D v4 Add-ons\FSUIPC6\GEARPANEL.lua:14

 

Share this post


Link to post
Share on other sites
33 minutes ago, MichaelStevenD said:

THATS INTERESTING, mine never shows a log for bytes sent...

You need to use a variable to receive the result of the com.write.

I don't know where your Close signal is coming from. As far as FSUIPC is concerned it is still connected, at least on my system, otherwise the attempts to write through the Windows functions would not confirm bytes transferred. You say:

35 minutes ago, MichaelStevenD said:

I had used it on FSUIPC5 a while back (different PC)

so I believe it is something different about the installation of drivers on your different PC. Certainly the code for com ports is no different in FSUIPC6 from FSUIPC5.

To see the results of the com.write in the Trace you need to have the result stored in a variable, as in the change I did here (if you refer back).

Pete

 

 

Share this post


Link to post
Share on other sites
30 minutes ago, MichaelStevenD said:

sent the 'last log' not current sorry,  this is the current. it gives a global num 0

Ah. Right -- so that confirms the port has not sent any data. 

I think you need to investigate possible problems with the drivers in your Windows setup. Is the COM port an added one, like mine (a BrainBoxes USB to Serial adapter) or one of those heritage type motherboard ports (now apparently discontinued)?

I can thoroughly recommend BrainBoxes serial ports, whether PCI, PCI-E or USB adapter.  All of my serial port devices are connected to one or other of these -- my complete PFC cockpit uses two such ports, and on a separate PC my Arduino, used to operate relays for the genuine 737 starter switches. Also my Aerosoft (Australia) GA28R Piper Arrow III cockpit, which is also 100% COM serial port driven.

Just make sure you have up to date drivers installed.

Pete

 

Share this post


Link to post
Share on other sites

Really Appreciate your time, its clearly not an FSUIPC issue so wont go any further on here but thanks for pointing me in the right direction .

Cheers

Michael

 

 

Share this post


Link to post
Share on other sites

Hi Pete,

Just a quick update, I moved the Arduino and the LUA script onto a friends pc (20 month old PC) and all works fine.

I bought another new PC, different make to the one before (which I need for a multi setup anyway) and JUST put a clean install of P3D. 4.5 NO add-ons or other stuff, on the C drive. Downloaded FSUIPC6 and added the two LUA files. Once again I get exactly the same issue, global num = 0 but the thread continues to display perfectly. The Arduino flashes briefly when the com is opened but goes quite immediately after.

  • I've updated the USB drivers
  • Updated window
  • turned off defender and removed all other security 
  • The port is a standard 3.0 from the motherboard but I have tried ever other port on the PC (2.0 and 3.0 ) with no such luck.

breaking it down I can only come to 2 conclusions

1) I need to find some specific driver to allow communication as these PCs are not supporting it anymore.

2) The backend of function com.write doesn't like what is on both these new PCs.

Maybe more people will come forward with this over time as it feels like a new spec PC issue.

Kind Regards,

Michael

 

Share this post


Link to post
Share on other sites
1 hour ago, MichaelStevenD said:

Maybe more people will come forward with this over time as it feels like a new spec PC issue.

Well my PC is very recent. 

But surely you are not relying on the old style COM ports which used to be available on the motherboard? Try one of the Brainboxes cards or USB adapters. Their drivers are excellent.

Pete

 

Share this post


Link to post
Share on other sites
1 hour ago, MichaelStevenD said:

This is me not using the correct terminology, I'm using USB. but of course its not a port its a bus. There are no RS232 ports involved in this issue.

So what serial port USB driver are you using? I had no end of problems when I used the basic FTDI ones. That's when I looked around and tried the Brainboxes ones. Never any problems since then.

See if you can compare drivers and versions between the PC on which it worked and the two on which it doesn't.

Pete

 

 

Share this post


Link to post
Share on other sites

Hi Pete,

Same serial driver version as the PC that it worked on 10.0.18362.1 actually all 5 PCs I've tried it on have the same windows driver version. 2 PCs work, 3 don't. I have also tried the Arduino mega 2560 driver that comes with Arduino version 1.2.3.0 which is the same as the ATmega2560 driver. none of the Boards are using the old FTDI chips that I have. 

Running Windows 10 Home Version 1909

image.thumb.png.ced1cf0976ddf2dc17f586a36f409fed.png

Just looking at these brainbox PCI cards, are you suggesting I run straight into the Arduinos onboard serial port pins 0 and 1 and bypass the USB side completely?

or.... you are using the Arduino Pro stuff that doesn't come with a USB port?

do you have pics of your ones you could post?

 

Just arching back to the USB side, I noticed this...

Opening the serial port using the monitor I could send data into the Arduino successfully as described before (which is why I'm having trouble getting my head round it being a com port issue)

 

866996433_portmonitor.thumb.png.f1d0a5bf817ef07612ccc0206e3bb3f3.png

but when I close the port, go into monitoring only mode and start P3D I get this...

 

1248542248_portmonitorwithP3dconnected.thumb.png.aba366329f3c194687c840ec2a5a6acd.png

The two streams are identical until this point.

 

Edited by MichaelStevenD
Additional info

Share this post


Link to post
Share on other sites
51 minutes ago, MichaelStevenD said:

Added the Lua to start on a keypress and it works.....

The ipc.ready is doing something maybe to early...?????

Not sure how it would make a difference. Maybe something else is going on which somehow closes it. You could try keeping it in the ipcReady.lua but preceding it with a delay (ipc.sleep). 

55 minutes ago, MichaelStevenD said:

investigating today

Okay. Let us know what you find please.

Pete

 

Share this post


Link to post
Share on other sites

Hi Pete,

The delay was the first thing i tried, 15 sec, 30sec all the way upto 2mins .... every time it done the same thing, after the delay it opened the port sent nothing and then closed.

Just tried the [Auto] in the .ini file and everthing works fine, ive loaded P3D up 10 times in a row and no issues. ive also loaded it onto the other PC and the Auto function works a charm. 

I can categorically say the ipcready file is the issue.

If you do look into it i'm happy to test anything you want me to but for me I can now get on with my build 🍾

Kind Regards,

Michael

Share this post


Link to post
Share on other sites
1 hour ago, MichaelStevenD said:

I can categorically say the ipcready file is the issue.

How do you invoke your plug-in with ipcReady? Perhaps you could show me ipcReady.lua, please?

You see there are two ways: ipc.runlua (the best way) and ipc.macro("Lua ...). I'm thinking that your Lua terminates and in the process closes ports which were opened within its "realm" if it was just a macro.

When I tested here I merely assigned a keypress to invoke the Lua script. I can re-test with your ipcready and see what the issue is.

Pete

 

Share this post


Link to post
Share on other sites

I was also doing it the best way,

ipcReady, file attached

ipcReady.lua

Quote
54 minutes ago, Pete Dowson said:

I'm thinking that your Lua terminates and in the process closes ports which were opened within its "realm" if it was just a macro.

 

if that was the case then would it not terminate the simconnect window which continues to output the data until i close P3D

Share this post


Link to post
Share on other sites
25 minutes ago, MichaelStevenD said:

if that was the case then would it not terminate the simconnect window which continues to output the data until i close P3D

It shouldn't do anything related to a separate Lua it just happens to run. It was only me trying to envisage what might be going wrong.

It might be a good idea to see if starting it with ipc.macro is any different. I'll try here later with both methods. If i can reproduce the problem I can get it fixed.

Pete

 

  • Like 1

Share this post


Link to post
Share on other sites
25 minutes ago, MichaelStevenD said:

I will give it a go

I've now tried it both ways, ipc.macro and ipc.runlua, and i cannot make it fail with either. There's definitely something different on your system and the relation to being started from ipcReady is very mysterious. Perhaps a test with it starting from a different plug-in, but later, to eliminate anything to do with start up timing. For example, ipcLast.lua assigned to a keypress (temporarily of course).

Pete

 

Share this post


Link to post
Share on other sites

Maybe you could also try updating to v6.0.9, or better still, the v6.0.10b release posted in this thread: 

It helps if we are testing on the same version...

John

 

 

Share this post


Link to post
Share on other sites

Hi Gents,

I had already downloaded FSUIPC6.0.9 without realising when I swapped to my new computer, same issue. I also get the same problem with FSUIPC6.0.10.

On 7/16/2020 at 3:23 PM, Pete Dowson said:

I've now tried it both ways, ipc.macro and ipc.runlua, and i cannot make it fail with either. There's definitely something different on your system and the relation to being started from ipcReady is very mysterious. Perhaps a test with it starting from a different plug-in, but later, to eliminate anything to do with start up timing. For example, ipcLast.lua assigned to a keypress (temporarily of course).

ipc.macro works, I'm not familiar with the ipcLast.lua format, I will need to do some research. 

Kind regards,

Michael

 

Share this post


Link to post
Share on other sites

Just a quick question Pete, I hope you don't mind as I know you use Leo Bodnar. 

I've done a Plane specific Lvar Lua script with all the buttons that weren't available as standard, now it syncs the first in game switch with the physical 1 but then I have to move all the others to initialise, I can put each button into a separate folder and they all sync but would prefer them all in one. I tried using the 'control to repeat' but it looks like it Kills the script every time and thet canny be good for business...

 

if ipcPARAM == 1 then

	LVarSet = "L:LEFTGEN"

	ipc.writeLvar(LVarSet, 1)      
end

if ipcPARAM == 2 then

	LVarSet = "L:LEFTGEN"
  
  ipc.writeLvar(LVarSet, 0)
  

end

if ipcPARAM == 3 then

	LVarSet = "L:LEFTGEN"

	ipc.writeLvar(LVarSet, 2)

end

if ipcPARAM == 4 then

	LVarSet = "L:RIGHTGEN"

	ipc.writeLvar(LVarSet, 1)

end


if ipcPARAM == 5 then

	LVarSet = "L:RIGHTGEN"

	ipc.writeLvar(LVarSet, 0)

end

if ipcPARAM == 6 then

	LVarSet = "L:RIGHTGEN"

	ipc.writeLvar(LVarSet, 2)

end

if ipcPARAM == 7 then

	LVarSet = "L:MASTERBATT"

	ipc.writeLvar(LVarSet, 1)

end

if ipcPARAM == 8 then

	LVarSet = "MASTERBATT"

	ipc.writeLvar(LVarSet, 0)

end

if ipcPARAM == 9 then

	LVarSet = "MASTERBATT"

	ipc.writeLvar(LVarSet, 2)

end

im upto ipcPARAM 40....

Share this post


Link to post
Share on other sites
3 hours ago, MichaelStevenD said:

I'm not familiar with the ipcLast.lua format

Sorry, i didn't explain well. I meant using your ipcReady ome renamed as, say, ipcLast and started with a keypress -- testing whether it was just some weird timing thing, or being somehow related to one Lua starting another.

2 hours ago, MichaelStevenD said:

I've done a Plane specific Lvar Lua script with all the buttons that weren't available as standard, now it syncs the first in game switch with the physical 1 but then I have to move all the others to initialise, I can put each button into a separate folder and they all sync but would prefer them all in one.

Sorry, I don't understand. How is anything "syncing" anything else. Your script simply seems to be setting different L:Vars selected by the parameter in the calling assignment. A more direct way would be a macro for each assignment. Not sure why you are going to the trouble of having a long Lua plug-in.

How is anything "syncing"?

By "all in one" do you mean setting all of the L:Var values with one assignment?  Have you tried that? You might need a delay between each to allow the gauge time to implement the previous setting -- gauge code is not designed to be re-entrant.

2 hours ago, MichaelStevenD said:

I tried using the 'control to repeat' but it looks like it Kills the script every time and thet canny be good for business...

Sorry, you'll need to explain what you mean there too.

BTW i'm out till Saturday, so there may be a delay.

Pete

 

Share this post


Link to post
Share on other sites

Morning Pete,

I should of just used the Macros, so much easier. I just got 'lost in Lua'. Now I have a single file and it all works 👍

By syncing I mean, when the plane loads in, the virtual switch position agrees with the physical switch position, without having to move it to initialise its position. 

I will try the ipclast and report back.

have a lovely weekend,

Michael

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • 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.