adccommunitymod (AutomationDirect) asked a question.

ASCII to Real or BCD

Created Date: July 19,2012

Created By: lasernerd

**** 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'm using RS-232 to communicate a value (degrees, from -360.00 to +360.00) to my D0-06 to drive the high-speed outputs (it's a CNC rotary indexing table). I can drop the negative values and the decimals if they'll cause problems in the conversion (i.e. -1.00º = 359.00º. And 187.52º = 18752) I can't figure out how to get the number in ASCII converted to something the HSIO motion control can use (real or BCD or whatever). Any ideas on what command to use to convert? Or do I need some kind of ugly workaround. I don't think the CNC can output anything other than ASCII, though I will check if what I'm asking above is impossible. Robin


  • adccommunitymod (AutomationDirect)

    Created Date: July 20,2012

    Created by: Bob S BN

    Look at the DL-06 user manual volume 1,

    Page 5-208 is about the "AIN " box to import ASCII code.

    Page 5-216 is about the "AEX " box for picking out values and converting to BCD.

    EDIT: This thread at post#8 shows how I used the above instructions to recieve and convert weight data from a scale.

    http://forum.automationdirect.com/showthread.php?t=7904

    Hope this helps,

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: July 19,2012

    Created by: lasernerd

    I'm using RS-232 to communicate a value (degrees, from -360.00 to +360.00) to my D0-06 to drive the high-speed outputs (it's a CNC rotary indexing table). I can drop the negative values and the decimals if they'll cause problems in the conversion (i.e. -1.00º = 359.00º. And 187.52º = 18752)

    I can't figure out how to get the number in ASCII converted to something the HSIO motion control can use (real or BCD or whatever).

    Any ideas on what command to use to convert? Or do I need some kind of ugly workaround. I don't think the CNC can output anything other than ASCII, though I will check if what I'm asking above is impossible.

    Robin

    Expand Post