LMS 2012
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Output

UBYTE cOutputPackParam (DATA32 Val, DATA8 *pStr)

  • Helper function to pack parameters - always to const parameters -
  • This is to pack parameters back into a string ready for Daisy
  • chain transmission

    Parameters
    (DATA8)Val - 32 bit value you would like to pack
    (DATA8*)pStr - String pointer where to pack the 32 bit Val

    opOUTPUT_PRG_STOP (LAYER, NO, TYPE)

  • Program stop
  • Dispatch status unchanged


    opOUTPUT_SET_TYPE (LAYER, NO, TYPE)

  • Set output type
  • Dispatch status unchanged

    Parameters
    (DATA8)LAYER - Chain layer number [0..3]
    (DATA8)NO - Output no [0..3]
    (DATA8)TYPE - Output device type

    opOUTPUT_RESET (LAYER, NOS)

  • Resets the Tacho counts
  • Dispatch status unchanged

    Parameters
    (DATA8)LAYER - Chain layer number [0..3]
    (DATA8)NOS - Output bit field [0x00..0x0F]

    opOUTPUT_STOP (LAYER, NOS)

  • Stops the outputs
  • Dispatch status unchanged

    Parameters
    (DATA8)LAYER - Chain layer number [0..3]
    (DATA8)NOS - Output bit field [0x00..0x0F]
    (DATA8)BRAKE - Brake [0,1]

    opOUTPUT_SPEED (LAYER, NOS, SPEED)

  • Set speed of the outputs
  • Dispatch status unchanged

    Parameters
    (DATA8)LAYER - Chain layer number [0..3]
    (DATA8)NOS - Output bit field [0x00..0x0F]
    (DATA8)SPEED - Speed [-100..100%]

    opOUTPUT_POWER (LAYER, NOS, SPEED)

  • Set power of the outputs
  • Dispatch status unchanged

    Parameters
    (DATA8)LAYER - Chain layer number [0..3]
    (DATA8)NOS - Output bit field [0x00..0x0F]
    (DATA8)POWER - Power [-100..100%]

    opOUTPUT_START (LAYER, NOS)

  • Starts the outputs
  • Dispatch status unchanged

    Parameters
    (DATA8)LAYER - Chain layer number [0..3]
    (DATA8)NOS - Output bit field [0x00..0x0F]

    opOUTPUT_POLARITY (LAYER, NOS, POL)

  • Set polarity of the outputs
  • Dispatch status unchanged

    Parameters
    (DATA8)LAYER - Chain layer number [0..3]
    (DATA8)NOS - Output bit field [0x00..0x0F]
    (DATA8)POL - Polarity [-1,0,1]
  • Polarity:

    • -1 makes the motor run backward
    • 1 makes the motor run forward
    • 0 makes the motor run the opposite direction

    opOUTPUT_STEP_POWER (LAYER, NOS, POWER, STEP1, STEP2, STEP3, BRAKE)

  • Set Ramp up, constant and rampdown steps and power of the outputs
  • Dispatch status unchanged

    Parameters
    (DATA8)LAYER - Chain layer number [0..3]
    (DATA8)NOS - Output bit field [0x00..0x0F]
    (DATA8)POWER - Power [-100..100]
    (DATA32)STEP1 - Tacho pulses [0..MAX]
    (DATA32)STEP2 - Tacho pulses [0..MAX]
    (DATA32)STEP3 - Tacho pulses [0..MAX]
    (DATA8)BRAKE - 0 = Coast, 1 = BRAKE

    opOUTPUT_TIME_POWER (LAYER, NOS, POWER, TIME1, TIME2, TIME3, BRAKE)

  • Set Ramp up, constant and rampdown steps and power of the outputs
  • Dispatch status unchanged

    Parameters
    (DATA8)LAYER - Chain layer number [0..3]
    (DATA8)NOS - Output bit field [0x00..0x0F]
    (DATA8)POWER - Power [-100..100]
    (DATA32)TIME1 - Time in Ms [0..MAX]
    (DATA32)TIME2 - Time in Ms [0..MAX]
    (DATA32)TIME3 - Time in Ms [0..MAX]
    (DATA8)BRAKE - 0 = Coast, 1 = BRAKE

    opOUTPUT_STEP_SPEED (LAYER, NOS, SPEED, STEP1, STEP2, STEP3, BRAKE)

  • Set Ramp up, constant and rampdown steps and power of the outputs
  • Dispatch status unchanged

    Parameters
    (DATA8)LAYER - Chain layer number [0..3]
    (DATA8)NOS - Output bit field [0x00..0x0F]
    (DATA8)SPEED - Power [-100..100]
    (DATA32)STEP1 - Tacho pulses [0..MAX]
    (DATA32)STEP2 - Tacho pulses [0..MAX]
    (DATA32)STEP3 - Tacho pulses [0..MAX]
    (DATA8)BRAKE - 0 = Coast, 1 = BRAKE

    opOUTPUT_TIME_SPEED (LAYER, NOS, SPEED, STEP1, STEP2, STEP3, BRAKE)

  • Set Ramp up, constant and rampdown steps and power of the outputs
  • Dispatch status unchanged

    Parameters
    (DATA8)LAYER - Chain layer number [0..3]
    (DATA8)NOS - Output bit field [0x00..0x0F]
    (DATA8)SPEED - Power [-100..100]
    (DATA32)STEP1 - Time in mS [0..MAX]
    (DATA32)STEP2 - Time in mS [0..MAX]
    (DATA32)STEP3 - Time in mS [0..MAX]
    (DATA8)BRAKE - 0 = Coast, 1 = BRAKE

    opOUTPUT_STEP_SYNC (LAYER, NOS, SPEED, TURN, STEP, BRAKE)


  • Dispatch status unchanged

    Parameters
    (DATA8)LAYER - Chain layer number [0..3]
    (DATA8)NOS - Output bit field [0x00..0x0F]
    (DATA8)SPEED - Power [-100..100]
    (DATA16)TURN - Turn Ratio [-200..200]
    (DATA32)STEP - Tacho Pulses [0..MAX]
    (DATA8)BRAKE - 0 = Coast, 1 = BRAKE

    opOUTPUT_TIME_SYNC (LAYER, NOS, SPEED, TURN, STEP, BRAKE)


  • Dispatch status unchanged

    Parameters
    (DATA8)LAYER - Chain layer number [0..3]
    (DATA8)NOS - Output bit field [0x00..0x0F]
    (DATA8)SPEED - Power [-100..100]
    (DATA16)TURN - Turn Ratio [-200..200]
    (DATA32)TIME - Time in ms [0..MAX]
    (DATA8)BRAKE - 0 = Coast, 1 = BRAKE

    opOUTPUT_READ (LAYER, NO, *SPEED, *TACHO)

Parameters
(DATA8)LAYER - Chain layer number [0..3]
(DATA8)NO - Output no [0..3]
(DATA8)*SPEED - Speed [-100..100]
(DATA32)*TACHO - Tacho pulses [-MAX .. +MAX]

opOUTPUT_READY (LAYER, NOS)

  • Wait for output ready (wait for completion)
  • Dispatch status can change to BUSYBREAK
  • cOUTPUT_START command has no effect on this command

    Parameters
    (DATA8)LAYER - Chain layer number [0..3]
    (DATA8)NOS - Output bit field [0x00..0x0F]



    opOUTPUT_TEST (LAYER, NOS, BUSY)

  • Testing if output is not used

    Parameters
    (DATA8)LAYER - Chain layer number [0..3]
    (DATA8)NOS - Output bit field [0x00..0x0F]
    Returns
    (DATA8) BUSY - Output busy flag (0 = ready, 1 = Busy)



    opOUTPUT_CLR_COUNT (LAYER, NOS)

  • Clearing tacho count when used as sensor

    Parameters
    (DATA8)LAYER - Chain layer number [0..3]
    (DATA8)NOS - Output bit field [0x00..0x0F]



    opOUTPUT_GET_COUNT (LAYER, NOS, *TACHO)

  • Getting tacho count when used as sensor - values are in shared memory

    Parameters
    (DATA8)LAYER - Chain layer number [0..3]
    (DATA8)NOS - Output number [0x00..0x0F]
    (DATA32)*TACHO - Tacho pulses [-MAX .. +MAX]