CAN cmd 8, SDO read, data type

CAN cmd 8, SDO read, data type

This sub-routine looks at the first value returned by CAN function 8, which is the data type.

  IF can_ok=FALSE THEN
    PRINT #op_chan,"CAN error SDO ";HEX(obj_index)
  ELSEIF VR(vrbase)=$80 THEN
    PRINT #op_chan,"SDO ";HEX(obj_index);" read aborted by slave"
  ELSEIF VR(vrbase)=$4f THEN
    ' byte
    PRINT #op_chan,(VR(vrbase+1))[0];" ";HEX(VR(vrbase+1))
  ELSEIF VR(vrbase)=$4b THEN
    ' int
    PRINT #op_chan,(VR(vrbase+1))[0];" ";HEX(VR(vrbase+1))
  ELSEIF VR(vrbase)=$43 THEN
    ' 32 bit long int
    PRINT #op_chan,VR(vrbase+1)+VR(vrbase+2)*65536[0];
    PRINT #op_chan,"  ";HEX(VR(vrbase+2));" ";HEX(VR(vrbase+1))
  ELSEIF VR(vrbase)=$41 THEN
    ' string
    clast=VR(vrbase+1)
    IF clast>32 THEN clast=32
    FOR c=1 TO clast
      PRINT #op_chan,CHR(VR(vrbase+1+c));
    NEXT c
    PRINT #op_chan,""
  ENDIF

$80 means "aborted",
$4F = byte
$4B = Int
$43 = Long int
$41 = string
    • Related Articles

    • Reading blocks of data from TrioPC Motion ActiveX or DLL

      The ActiveX and DLL have a way to read blocks of data. The method is called PRMBLK. If you look at he help, it shows you the list. You need to define the type of block you want to read, for example DefineSystem would be used to read system values ...
    • CAN cmd 6, Read message

      Function = 6: Syntax: CAN(channel, 6, message, variable) Description: Read in the message from the specified buffer to a VR array. The first VR holds the identifier. The subsequent values hold the data bytes from the CAN packet. Parameters: message: ...
    • Gathering analog input data using Flexslice Ain Module

      A Visual Studio program connecting over Ethernet will not be deterministic. So there will be timing errors. The built-in SCOPE command can be used to log data. It will save data to TABLE at the servo cycle rate. So if SERVO_PERIOD is 1000 usec, then ...
    • Motion Perfect problem when SCOPE command is used

      When running the SCOPE command in a program, I think Motion Perfect doesn't like the SCOPE command being issued over and over when I run it. It seems more stable when I comment the SCOPE command out after it's ran once. ...
    • CANbus port check

      MC403, MC405, Euro404 and Euro408 Motion Coordinators that appear to have a failed CANbus port. Check that the CANIO_ADDRESS is set to 32 when using Trio CANIO mode or to 40 .. 42 when using CanOpen. The CANIO_ADDRESS is stored in Flash in the above ...