Hinse Posted October 5, 2013 Share Posted October 5, 2013 Hi, I would like to be able to shut down or Start up an RS232 device from code. My system will have an RS232 that will not always be present, I added an option on the main page to enable/disable this device. The problem is when the application starts it looks for the RS232 device and generates errors if it is not present, I want the code to wait until the operator selects it, then start the serial device, or shut down. Thank you, Pierre Link to comment Share on other sites More sharing options...
AzeoTech Posted October 6, 2013 Share Posted October 6, 2013 There are two different parts to this depending on what you are asking. If you want to disable a comm port, set the comm port to 0: device.myDevice.port = 0. If you want to stop a bunch of channels from reading, usually the best way is to set their timing to 0, put them all in the same group, then use channel.ReadGroup() from a sequence to do the actual polling interval rather than use Timing. Then to stop reading, you just stop the sequence. Link to comment Share on other sites More sharing options...
Hinse Posted October 9, 2013 Author Share Posted October 9, 2013 Com=0 worked perfectly for me. thank you. Now I just have to figure out how to scan through the com ports to find the correct USB Serial adapter. Pierre Link to comment Share on other sites More sharing options...
AzeoTech Posted October 10, 2013 Share Posted October 10, 2013 You might look at this post: http://www.azeotech.com/board/index.php?/topic/4526-problems-with-loading-advapi32dll-and-using-the-loaded-functions/?hl=enumerating#entry15441 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.