Zerout23 Posted June 21, 2021 Share Posted June 21, 2021 Hello, Is there a way where I can have a user select whether they want to connect to a single device using either RTU or TCP/IP. Currently I have a Button Component with the sequence device.MyDevice.ConfigureComm() However, this only allows the user to configure the device using the protocol that I preconfigure. I would want them to select whether they want to connect using a serial or ethernet connection. Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted June 21, 2021 Share Posted June 21, 2021 There are a couple ways to do it, but the easiest is simply to preconfigure a serial and an ethernet port, giving them unique names. Then you can just do: device.myDevice.PortName = "mySerialPort" or device.myDevice.PortName = "myEthernetPort" You will probably have to do initcomm() after switching. Note you can also do this with the ProtocolName variable to switch protocols. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.