Pascal BRIANTO Posted November 24, 2017 Report Share Posted November 24, 2017 Hi, As another user, i'm tring to read a timer value by using com driver .net and I 've got an exception (see the attach file). Have you got a solution. Thank you Link to comment Share on other sites More sharing options...
Saragani Posted November 25, 2017 Report Share Posted November 25, 2017 I have not seen the entire code, so it is hard to tell. Link to comment Share on other sites More sharing options...
Pascal BRIANTO Posted November 28, 2017 Author Report Share Posted November 28, 2017 Hi, Here more informations: I tried the basic exemple from the pdf documentation I hope it will help Thank you Link to comment Share on other sites More sharing options...
Saragani Posted November 28, 2017 Report Share Posted November 28, 2017 Which PLC Model? I just tested it with a V130 and it worked (the small example from the documentation). I see that in your first post, your code shows that the protocol used as ASCII. V130 and any of the enhanced PLCs should use a Binary message for read and write. Furthermore, I see, from the stack trace, that the error message arrives from ReadIntegersMessage, so unlike the code example that you gave me, the first error is related to read operation, while the code examples are related to write operation. I'm confused. Link to comment Share on other sites More sharing options...
Pascal BRIANTO Posted November 29, 2017 Author Report Share Posted November 29, 2017 Hello Saragani, We use M-90 and I notice that the Utils.cs (in Com Driver source code) as this déclaration for OperandTypesLength Link to comment Share on other sites More sharing options...
Saragani Posted November 30, 2017 Report Share Posted November 30, 2017 Yes, you are correct. The Timers preset and current works differently in the U90 / Jazz PLCs (I just confirmed it). While the Vision PLCs return a string which is the preset, where each byte (represented as hex) is either the hour, minutes, seconds, or milliseconds, In the U90/Jazz PLCs, the value (in hex) is a 16bit integer where the 2 MSBs are the resolution, and the rest of the 14 LSBs are the raw value depending on the resolution. (Resolution: 10ms = 0, 100ms = 01, 1s = 10, 10s = 11 ..... the numbers are bits) . The fix is not as simple as it looks (since changing the value from 32 to 16 would still cause an exception, and the returned value will be incorrect. Link to comment Share on other sites More sharing options...
Saragani Posted November 30, 2017 Report Share Posted November 30, 2017 OK. I've did some fix that should allow both U90 and Vision PLCs support Read of timer Preset and Current values. I don't think that write preset or current values is supported in the U90 (It doesn't work when I send the command, and I also don't see the U90 Ladder allows changing timer current or preset value during Online. Unitronics.ComDriver.dll Link to comment Share on other sites More sharing options...
Pascal BRIANTO Posted November 30, 2017 Author Report Share Posted November 30, 2017 Ok, we will find another way for r/w action on timer value. Thank a lot you for your research. Link to comment Share on other sites More sharing options...
Saragani Posted November 30, 2017 Report Share Posted November 30, 2017 I did give you a new DLL that allows you to read the timer value. I'm not sure that you can write the preset. Maybe you can write a "Protocol" by yourself, and then change it from ladder. I'll investigate the U90 Ladder code myself again in order to see if maybe there is some sort of code that does allow writing timers values. 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