egoltzman Posted January 13, 2016 Report Share Posted January 13, 2016 I'm trying to read a timer value from a V350 device and fail. When I run this code I have no problem to read the MI101 value: rw[0] = new ReadOperands() { OperandType = OperandTypes.MI, NumberOfOperands = 1, StartAddress = 101 }; but if I try to read the TD1 value with this code I get an InvalidCastException: rw[0] = new ReadOperands() { OperandType = OperandTypes.TimerCurrent, NumberOfOperands = 1, StartAddress = 1 }; How can I do it without getting the exception, if at all? Thanks Link to comment Share on other sites More sharing options...
Saragani Posted January 14, 2016 Report Share Posted January 14, 2016 Check your code. You probably get the exception when you are casting the values you got from the request (You probably still cast it to an array of int16) 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