News:

  • June 09, 2026, 07:03:40 AM

Login with username, password and session length

Author Topic: How Do I convert Signed BCD Number to a Signed Decimal Number?  (Read 7889 times)

cybertronics

  • Newbie
  • *
  • Posts: 1
How Do I convert Signed BCD Number to a Signed Decimal Number?
« on: December 09, 2008, 10:40:39 PM »
 ???
I am using DirectSOFT 5 with a D4-450 CPU. The modual in question is a High Speed Counter connected to a quadliniture Accucoder. I want to output the +/- values to a touch screen.

This modual uses a signed BCD number using a double Word to represent a negative BCD Value by placing an 8 as the MSB of the second word. I need to be able to convert these values to a signed decimal or such for use on my touch screen. the only options I have is:

Signed_int_16
Signed_int_32
Unsigned_int_16
Unsigned_int_32
BCD_int_16
BCD_int_32
Floating_pt_32

Currently if i use BCD, I get 80000001-80000100 to represent -1-100%. I need to be able to convert this so that I can get the negative symble when I get a negative number. I dont know how to do this  :-[

the range must be be from -100 to +100 as this is reporting an orface position.

Also with the high speed counter, I need the current count to be held retenitive, I Cannot seem to do this even though I am using a retenitive range for the count. When I power the plc down and back on, it resets to zero. I am reading the current count from the counter to V4006-V4007 which should be a retinitive range. Im not sure what is happening here, unless the counter is overwrighting this value. If this is the case, I need a way to make the counter card count in a retinitive range of shared memory.

Any help on this matter would be most appreciated


There are no comments for this topic. Do you want to be the first?