Open port appear to work , and isOpen returns true.
GetSelectedBank is returning 251 each time, when my expectation is it should return a 0(zero) since i am selecting all banks. Not sure if Select Bank works or now, but if I set it to a value outside the range of 0-32, it does complain about an invalid value.
Each of the TurnOnRelay command is returning false. Not sure if this is a result of possibly a failure in SelectBank?
Anyway, I am unable to turn the relays on or off at this point.
Any help would be appreciated.
NCD.NCDComponent ncdComponent = new NCD.NCDComponent();
ncdComponent.IPAddress = "192.168.1.3";
ncdComponent.Port = 9999;
ncdComponent.IsTwoWay = true;
ncdComponent.ReadTimeOut = 1000;
ncdComponent.UsingComPort = false;
ncdComponent.OpenPort();
Console.WriteLine("Port Open: {0}", ncdComponent.IsOpen);
ncdComponent.ProXR.RelayBanks.SelectBank(0);
Console.WriteLine("Selected Bank: {0}", ncdComponent.ProXR.RelayBanks.GetSelectedBank());
Console.WriteLine("Turn ON Relay 0: {0}", ncdComponent.ProXR.RelayBanks.TurnOnRelay(0));
Console.WriteLine("Turn ON Relay 1: {0}", ncdComponent.ProXR.RelayBanks.TurnOnRelay(1));
Console.WriteLine("Turn ON Relay 2: {0}", ncdComponent.ProXR.RelayBanks.TurnOnRelay(2));
Console.WriteLine("Turn ON Relay 3: {0}", ncdComponent.ProXR.RelayBanks.TurnOnRelay(3));
Console.WriteLine("Turn ON Relay 4: {0}", ncdComponent.ProXR.RelayBanks.TurnOnRelay(4));
Console.WriteLine("Turn ON Relay 5: {0}", ncdComponent.ProXR.RelayBanks.TurnOnRelay(5));
Console.WriteLine("Turn ON Relay 6: {0}", ncdComponent.ProXR.RelayBanks.TurnOnRelay(6));
Console.WriteLine("Turn ON Relay 7: {0}", ncdComponent.ProXR.RelayBanks.TurnOnRelay(7));
Hi Bstill,
It could be old lib or wrong object.
What is your relay part#? Could you compress and send me your sample code? I will have a look.
Thanks,
Shirui Xu
BStill,
Btw, please run NCD base to make sure the ethernet module and board works correct.
Please also make sure there is only one program connects module through 2101. The module won’t accept multi connections.
Shirui Xu
Port 9999 is the telnet setup port and port 80 is the HTTP port. Both will accept a TCP socket because those protocols are built on TCP communications, but will not forward the data over the serial line of the module to the Relay Board.
Can you go to the module’s IP address in your browser and post a screenshot of both the Serial Settings and Connection pages under Channel 1 on the left?