
adccommunitymod (AutomationDirect) asked a question.
Converting BCD to Decimal
Created Date: February 06,2009
Created By: bdolweck
**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****
I am not sure how to convert the BCD numbers selected from the HMI to a decimal number in the DO6. I am controlling a stepper motor for indexing and the BCD/Hex numbers in the out box are not matching the BCD selected numbers from the HMI. Any help with this would be helpful
Created Date: February 06,2009
Created by: KPrice
bdolweck, the BIN instruction will convert BCD to decimal. For example:
LD V2000 (holds 100 BCD)
BIN (converts 100 BCD to 256 decimal)
OUT V2001 (holds 256)
Also if using a C-more, you can assign different data types to your tags.
Hope this helps.
Created Date: February 06,2009
Created by: bdolweck
Thanks, That works. The description of the BIN box in the instruction browser only tells you that it will convert BCD to Binary. It doesn't say anything about decimal
Created Date: February 06,2009
Created by: Do-more PE
For the DirectLogic line of PLC's binary and decimal are used interchangeably. Don't ask me why, but they are.
Created Date: February 06,2009
Created by: bdolweck
I am not sure how to convert the BCD numbers selected from the HMI to a decimal number in the DO6. I am controlling a stepper motor for indexing and the BCD/Hex numbers in the out box are not matching the BCD selected numbers from the HMI. Any help with this would be helpful