Kaffeebart Posted April 1, 2019 Report Posted April 1, 2019 Hi there I followed instruction in advanced user guide appendix 3 and added a VRINSIGHT Section to FSUIPC.ini [VRINSIGHT] 1=COM4 2=COM5 But now both Devices will be detected with the same joystick number. What do i have to do that i can use both of them seperately. I want one for the Pilots input and the other one for the FO input so i must differentiate both CDUs Thank you PS: Using FSX and FSUIPC 4 latest Version
Pete Dowson Posted April 1, 2019 Report Posted April 1, 2019 5 hours ago, Kaffeebart said: I followed instruction in advanced user guide appendix 3 and added a VRINSIGHT Section to FSUIPC.ini [VRINSIGHT] 1=COM4 2=COM5 But now both Devices will be detected with the same joystick number. What do i have to do that i can use both of them seperately. I want one for the Pilots input and the other one for the FO input so i must differentiate both CDUs I'm afraid I don't know. Can you try VRInsight support? Pete
Kaffeebart Posted April 2, 2019 Author Report Posted April 2, 2019 :-( I can try but last time i had a Question i got never Response. nevertheless thank you Pete
Pete Dowson Posted April 2, 2019 Report Posted April 2, 2019 3 hours ago, Kaffeebart said: I can try but last time i had a Question i got never Response. Thinking about it further, I don't think FSUIPC can distinguish between two identical VRi units -- except by serial port number of course (which is at a lower level of code). I suppose that could have been a way of it assigning a different joystick number to each, but I'm sorry, development of FSUIPC4 ceased a while ago. It never came up when VRi serial port device support was "live", because If there was a real demand back then I'm sure it would have been implemented. I think it would still be possible by only declaring one of the devices in FSUIPC4.INI for default handling there, with the other being handled by a Lua plug-in. There is a document on handling VRi devices by Lua plug-ins in your FSUIPC Documents folder, and the "VRI_SetMach and VRI_SetBaro lua examples provided should also help. If all you wish to do is detect the button presses and assign them, you can either program them to set "virtual buttons" as in the HIDdemo lua or, probably easier and more efficient for a CDU keyboard, send the appropriate keypresses directly using the Lua library facilities. Pete
Kaffeebart Posted April 2, 2019 Author Report Posted April 2, 2019 Hi Pete Thanks for your Response. I will give it a try by using LUA script Also i will have a look to virtual Buttons. - Don't know when i will find some time to check it but i will give response for my results. Stefan
Pete Dowson Posted April 2, 2019 Report Posted April 2, 2019 1 hour ago, Kaffeebart said: Also i will have a look to virtual Buttons If you don't need the flexibility of assigning the keys on the CDU to different things in FSUIPC (for example, for different aircraft CDU implementations), then it would be easier and more efficient to just make the Lua script send the relevant controls or keypresses. Functions for both of these are provided in the Lua ipc library 9see the Lua library document). Pete
Kaffeebart Posted April 3, 2019 Author Report Posted April 3, 2019 HIDscanner didn't found any of the CDUs But using com.read in Lua Script seems to work. Thank you for your help. For all with the same Problem: - I added 3 Areas in the FSUIPC.ini [VRINSIGHT] 1=COM4 2=COM5 [VRInsight.CDU2] Lua=CDUpilot DriverReads=YES DriverWrites=NO [VRInsight.CDU2] Lua=CDUfo DriverReads=YES DriverWrites=NO - For the Lua script itself i used parts of HDIdemo and VRI_SetMach The Main Function actually writes only a log of what i received by the com port. if VRImodel == nil then -- Set known ports if testing with Lua not loaded automatically VRIdevice = "COM4" end speed = 115200 -- is this the same for all VRI devices? handshake = 0 -- No handshake minsize = 8 maxsize = 8 -- VRI seems to use fixed length blocks of 8 bytes -- Polling rate in number of polls per second -- Must higher than 0 Pollrate = 20 dev = com.open(VRIdevice, speed, handshake) if dev == 0 then ipc.log("Could not open VRIdevice port") ipc.exit() end -- Hauptfunktion function Poll(time) str, n = com.read(dev,8) ipc.log(str) -- Here i receive Data from Com Port for example "LSKL1" or "FUN11" or "KEYA" end if Pollrate == 0 then -- Ouch. Mustn't divide by zero! Pollrate = 20 end event.timer(1000/Pollrate, "Poll") -- poll values 'Pollrate' times per second
Pete Dowson Posted April 3, 2019 Report Posted April 3, 2019 2 hours ago, Kaffeebart said: HIDscanner didn't found any of the CDUs So they are both genuine serial port devices. 2 hours ago, Kaffeebart said: But using com.read in Lua Script seems to work. Well done! You did it quicker than I could, I'm so unfamiliar these days with VRI devices! Pete
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now