Jump to content

Error When reading timer value


Pascal BRIANTO

Recommended Posts

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

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

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

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...