Store PLCnext CommunityPLCnext on LinkedInPLCnext on Instagram  PLCnext on YouTube Github PLCnext CommunityStore PLCnext Community

0
Votes
Undo
  1. ndusak
  2. PLCnext Engineer
  3. Tuesday, 04 May 2021
Hi,
I am trying to convert time to udint. It worked perfectly with PC Worx but on plcnext engineer I am getting an error that the conversion is not supported. Is there any other way to convert time to int?
Attachments (1)
Accepted Answer
Martin PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo
Hello,
I can't say why that works in PC WORX, but it makes sense that this isn't allowed in PLCnext Engineer. The TIME type is a 32-bit signed integer, so trying to convert this to an unsigned 32-bit integer will lose all the negative values.
Instead, you can use the TO_DINT function, which works OK for me with a TIME value.
~ Martin.
Phoenix Contact Electronics Headquarters - PLCnext Runtime Product Management and Support
ndusak Accepted Answer Pending Moderation
0
Votes
Undo
Hi Martin,
Thank you for your quick response. A long time ago I have found somewhere that I should be using udint to convert time, and I have been using it without problems ever since. I have tried it now with dint and it is working. Thank you again.
  1. one week ago
  2. PLCnext Engineer
  3. # 1
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.