Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » Is there any FB that can covert Decimal to Bin?
Is there any FB that can covert Decimal to Bin? [message #1819111] Wed, 08 January 2020 07:28 Go to next message
joy woo is currently offline joy wooFriend
Messages: 198
Registered: May 2019
Senior Member
And "and ", " or ","xor" operator
Re: Is there any FB that can covert Decimal to Bin? [message #1819118 is a reply to message #1819111] Wed, 08 January 2020 09:00 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1584
Registered: January 2014
Senior Member

can you be more specific what your binary output should be? There are conversion FBs as defined in IEC 61131-3.

Also in the IEC 61131-3 directory you can find logic operator FBs.

But from my experience it mostly is better to define own simple or basic FBs for such functions.
Re: Is there any FB that can covert Decimal to Bin? [message #1819125 is a reply to message #1819118] Wed, 08 January 2020 12:39 Go to previous messageGo to next message
joy woo is currently offline joy wooFriend
Messages: 198
Registered: May 2019
Senior Member
The ng-modulebus is for tcp/ip, but i need to use rtu, so i used the old modbus module, i read the value of I/O status which is integer, such as 255 is 11111111, 65535 is 1111111111111111,
i use modbus[rtu:/dev/ttyS0:115200:N:8:1:2000:3:1:0..1:0]
and the value is 65535, that means the output value is 1111111111111111, that means all the 16 output are on,
i need to convert 65535 to 1111111111111111, and according to the place to do some logics,.
actully, FB_AND in iec61131 i input In1 as 137, input In2 as 1 but the out is 0
Re: Is there any FB that can covert Decimal to Bin? [message #1819126 is a reply to message #1819125] Wed, 08 January 2020 12:50 Go to previous messageGo to next message
joy woo is currently offline joy wooFriend
Messages: 198
Registered: May 2019
Senior Member
i

[Updated on: Wed, 08 January 2020 12:51]

Report message to a moderator

Re: Is there any FB that can covert Decimal to Bin? [message #1819128 is a reply to message #1819126] Wed, 08 January 2020 14:21 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1584
Registered: January 2014
Senior Member

ah so you need a bit representation in the string. I think here the a ST algorithm and generating an according string is better.
Previous Topic:HMI question
Next Topic:4diac support for my device-stm32f103
Goto Forum:
  


Current Time: Tue Apr 23 17:21:05 GMT 2024

Powered by FUDForum. Page generated in 0.03148 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top