I have a PXIe-8431/8 that I am trying to use in 2-wire Auto mode on all ports. I know I can change this setting from the default 4-wire in MAX when running as Administrator, as well as with Device Manager. However, I would like to do this programatically (my serial communication is implemented using the .NET SerialPort class, but I can use C++ or TestStand to change this setting if needed). I've tried using DeviceIoControl as well as viSetAttribute. In both cases, if I read the setting back after writing it, it is correct (RS485_MODE_2W_AUTO (3)). If I close the CreateFile() handle or the VISA session I used to change the setting and then open a new session or handle, reading the Transceiver Mode attribute returns the default of 0 (RS485_MODE_4WIRE). I have tried running my code as Administrator with the same results.
Since the transceiver mode can be changed in MAX or Device Manager, I know this setting can be persisted across multiple sessions. How do I save this setting across multiple sessions programatically?
Thanks,
Brandon