cmarcus Posted September 12, 2016 Report Share Posted September 12, 2016 Hello, I'm having an issue with getting the .NET driver to connect and read values. I am having no problems connecting using Visilogic, but when I take those properties and use them in the .NET driver they don't seem to be working. The interesting this is that I'm not getting an exception, so my application believes the driver is connected, but looking at the properties for the Ethernet object it appears not to be. When I put a break point on the oPLC object, it states that the object could not be evaluated because the previous function had timed out. When run it down to the last line and check the response values it is null. Here's the code: Ethernet ethernet = new Ethernet(_cell1PLC_IP, _cell1PLC_Port, EthProtocol.TCP, 3, 3000); PLC oPLC = PLCFactory.GetPLC(ethernet, 1); oPLC.SetExecuter(OperandsExecuterType.ExecuterPartialBinaryMix); // Create the write request // ReadWriteRequest[] readShifts = new ReadWriteRequest[1]; readShifts[0] = new ReadOperands { NumberOfOperands = 1, OperandType = OperandTypes.MB, StartAddress = 0, }; // Extract the shift times // object[] shiftTimes = ((object[])readShifts[0].ResponseValues); Link to comment Share on other sites More sharing options...
Saragani Posted September 13, 2016 Report Share Posted September 13, 2016 Hi, Your code is is missing the actual call to the PLC. You create the ReadWriteRequest array, but do nothing with it. You should call oPLC.ReadWrite(ref readShifts ); Link to comment Share on other sites More sharing options...
cmarcus Posted September 13, 2016 Author Report Share Posted September 13, 2016 Wow, that was embarassing! LoL. Guess I just needed another set of eyes to look at this. Thank you very much. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now