BCD & Decimal Converter

The solution is simple: add :B after the tag. 🔨

I thought I had to program it in LookoutDirect to display a value in DL260.
 
Hello,

> Care to share your solution.

Something to chew on:

result:=(value and $F);
result:=result + (((value shr 4) and $F) * 10);
result:=result + (((value shr 8) and $F) * 100);
result:=result + (((value shr 12) and $F) * 1000);

Good luck,

Mark
http://www.peakhmi.com/
 
Thank you Mark.

LookoutDirect doesn't support bit operations...I 'm thinking if I have a communication driver for directLogics I might use VB next time.




Hello,

> Care to share your solution.

Something to chew on:

result:=(value and $F);
result:=result + (((value shr 4) and $F) * 10);
result:=result + (((value shr 8) and $F) * 100);
result:=result + (((value shr 12) and $F) * 1000);

Good luck,

Mark
http://www.peakhmi.com/
 

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,472
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,485
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,820
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...
Replies
11
Views
3,144
hi... i have an issue in s7 300 plc, while we run the machine(in idle there is no fault) , plc cpu goes in SF mode, after restart the power cycle...
Replies
2
Views
107
Back
Top Bottom