decimal to BCD

ready961

Member
Join Date
Jan 2003
Posts
78
Im trying to set a timer in my automation direct DL-06 from my touch screen to 10 sec. But it seems that the number I put in is decimal and the timer reads in BCD/HEX. How do I do this?
 
Its an ez touch. I can change the panel to hex but I want the operator to be able to type in decimal. Like if the want the timer to be on for 15 seconds they just type in 15.
 
sorry undo what i said ...in EZtouch u have the option of feeding the numbers in BCD and Directlogic can take number in BCD as well....
dont give the i/p in unsigned decimal....use bcd format in ur hmi
 
You need to set the Tag in EZ-Touch to BCD_INT_16

Then you do the scaling with the object that you are using with that Tag. If you use a Numeric Entry object there is a tab for scaling. Or if you look on the General tab of the Numeric Entry object there is a section labeled "# Digits", here you can set the total digits and the fractional digits. In your case I would set the Total Digits to 3 and set the Fractional Digits to 1 and not mess with the Scaling tab. This will scale the timer value correctly.
 
Tark, Thanks this work the way I wanted. Now I want to enter in 1 into the panel and have it read 1.37 in the plc. Can I scale this in the panel? Who I need to readjust the decimal?
 
It depends on what you are trying to accomplish. I’m assuming you are still talking about timers. The value of a Timer (TMR) is 0 – 999.9 seconds, so if you are using this instruction then you set the Total Digits to 4 and the Fractional Digits to 1. If you are using a Timer Fast (TMRF), the value of this timer is 0 – 99.99, so you would set the Total Digits to 4 and the Fractional Digits to 2.

If you are looking to display a decimal point in a BCD value on the touch screen then you want to use the # Digits section. In other words the Timer value in the PLC shows 9999, but you want to show this value on the touch screen as 999.9, then use the # Digits section. If you need to do some scaling or some type of conversion, then you would use the Scaling tab. I generally don’t use the Scaling tab because I perform any required scaling in the PLC, this makes the PLC program easier to read and there is less confusion.
 

Similar Topics

Hello, I am stumped on how to tackle this issue. I am working on an Energy project on a solar / wind farm and I am trying to read in some data...
Replies
7
Views
2,482
I am taking a Simple SP which is in BCD and adding to that, When doing so I have noticed if the value is < 8 it works out fine, but if > 8 it...
Replies
4
Views
2,504
i'm newbie in PLC, would u like to help me, plese.. i'm using an instruction MOV, for moving Hexadecimal data #0020 which is &32 in decimal,to...
Replies
3
Views
1,829
Can anyone give me a script to convert BCD number in Decimal, or vice versa? for ex. 0x300 <-> 300 (decimal).
Replies
5
Views
2,820
In S7/TIA Portal, is there a function to round a real to a specified number of decimal places? e.g. If I have 22.519432 and I want to round it to...
Replies
16
Views
1,933
Back
Top Bottom