Jump to content

Connecting Over Network


cmarcus

Recommended Posts

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);

oPLC breakpoint.jpg

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.