Automation Direct 405 D4-430 Math BCD to Decimal Help

randy741985

Member
Join Date
Oct 2006
Location
US
Posts
154
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 adds 110 and so on in decimal what am I missing?


Thanks in Advance.
 
Can you be more specific as to what you are trying to do?
Do you actually need to convert the value to Decimal? For what reason?
If you are staying in the PLC with the value, keep it as BCD as this is the 'natural' data type in the PLC.

For example:
If I do LD V4050 ADD V4051 OUT V4050 with 20 in V4050 and 25 in V4051, the resulting value after the rung energizes is 45 in V4050.
If you are going out of the PLC and truly need the value to be Decimal, please explain what code you are using.
 
OK I have variable SP V4101, with a value of 92Hex which Represents 146MM in Decimal.

I want To use a Variable V4110 With A Decimal Value of 19 Hex Which Converts to 25 Decimal and ADD it to V4101 to Create a SP.

Problem Here happens when the HEX Result goes over > 99 to 100 then the result becomes 256 I think it is because of the BCD.

Its probably a easy fix but I haven't Got it yet...


Thanks
 
It sounds like you are mixing up your data types. You need to pick one format or the other.
So let's view everything as decimal. In data view put V4101 and put V4110.
For both V4101 and V4110 change the view format to Decimal at the top of the Data View window.
Put a value of 146 into V4101. Put a value of 25 into V4110.
Do a rung that has LD V4101 ADDB V4110 OUT V4101.
Make the rung go true and you should see a value of 171 in V4101. Probably the problem you had was using a ADD instead of a ADDB.
 

Similar Topics

Hello, A customer is having me look at a few upgrades to their systems, they are also having a hard time getting support for the equipment from...
Replies
2
Views
5,430
Hello, I have an automation direct d2 262 plc and C-more HMI EA9T6CL-R. I need to prepare a program, scheduled to be performed on a future date. I...
Replies
1
Views
142
Hello all- I have a unique challenge using a customers Direct logic 06 PLC. This customer has a DC motor operating at 10 RPM which is turning a...
Replies
1
Views
147
Hi, I have been trying to run drive via Sysmac studio. I can ping the drive. I can see the logic bits going on/off as per command. But, drive is...
Replies
21
Views
586
Anyone tried Automation Directs new CM5 HMI. We've been the EA9's for a few years now with minimal complaints. A few failures here and there but...
Replies
17
Views
1,622
Back
Top Bottom