pilotgil Posted September 18, 2012 Report Share Posted September 18, 2012 I just started fooling with Lua and had a few successes. I thought it would be cool to try to write something out a com port such as when a button is pressed. So I wrote this: dev = com.open(com1, 19200, 0) if dev == 0 then ipc.log("Could not open port") ipc.exit() end val = 5.0978056 str = string.format("NUM%04d", val) com.write(dev, str) As soon as I press the "button", FS immediately crashes. However, the com port (a real com port which is tested good) never opens and the log file says that the com port says "LUA. 0: Could not open port" The "val" means nothing, just a number to spit out the com port when I push a button. I am sure I'm missing something simple. I checked the com ports looping two together with Hyperterm and they are working. I looked at the documentation but I am obviously missing something...any help would be appreciated. Gil Link to comment Share on other sites More sharing options...
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
Already have an account? Sign in here.Sign In Now