cod:16 conversion

Amr Hassan

Member
Join Date
May 2005
Posts
340
hi
i am converting s5 to s7 program
as i understand this function converts the integer to bcd , therfore it should be equivelant to to ITB in s7
but when i see the output parameters of the s5 function , there is a bcd1 which is a word a bcd2 which is a byte
in s7 the result is in one word only , can someone explain to me what should be the contents of bcd1 and bcd2 so that i can create a function having the same parameters
best regards
 
thanks
i used to have error in compilation with these blocks stating "plc type is not define "

now i copied the fc from the library to the project before compiling , the error did not appear

thanks again
 
Hi,

In Step5 the FB241 cod:16 convert a 16Bit
integer from -32768 to +32767 into a
BCD with 6 decads ( 0-5 + sign).
'DUAL' = 16Bit integer with sign (word)
'SBCD' = sign (bit)
'BCD1' = decad 0-3 (word)
'BCD2' = decad 4+5 (byte)

In Step7 the 'ITB'-instruction converts a integer
in range from -999 to +999 ( 3 decads with sign only)

So, if your integer is larger than +/- 999,
convert it to DINT and use the
'DTB'- instruction. ( 7 decads + sign )


cheers

Rolf
 

Similar Topics

Hi all. I'm here, again, with traffic lights program. I write this question earlier and I get one really good answers with it, but now I really...
Replies
5
Views
4,412
Hi Folks, I am not able to communicate to BEI Ideacod Absolute encoder with the Counter Module. Issue is as i Enable Direct Enable command in...
Replies
0
Views
2,454
i have been assigned a project where the COD levels (Chemical Oxygen Demand)in the effluent is to be monitored. I have done some research on the...
Replies
7
Views
2,359
I have a machine which is undergoing upgradation. As part of the process two SEW drives are being replaced., existing Gen B with new Gen C. The...
Replies
3
Views
193
Currently I’m using ESA model VT155W0000 HMI and it’s communicate with Fanuc PLC. Can any one suggest can I convert ESA model to EXOR HMI eSMART07M
Replies
0
Views
87
Back
Top Bottom