Chapter 8 Using SDO Protocol API | PCI-DMC-A01 / PCI-DMC-B01
Revised March, 2012 8-11
8.7 _DMC_01_read_message
FORMAT
I16 PASCAL _DMC_01_read_message (I16 CardNo, U16* Cmd, U16* COBID,
U16* DataType,U16* Value0,U16* Value1,U16* Value2,U16* Value3)
Purpose
Reads the last SDO command message into the data buffer.
Parameters
Name Data Type Unit Description
CardNo
U16
Number
Unit
CardNo is between 0~15
Cmd U16* Number Index of object dictionary
COBID U16* Number CAN object ID(0x580 + current Node ID)
DataType U16* Number Datatype of object dictionary
Value0 U16* Number
Message buffer (Data1) – Idx low (High byte),
CMD (Low byte)
Value1 U16* Number
Message buffer (Data2) – Sub-Idx (High byte)
Idx high (Low byte)
Value2 U16* Number Message buffer (Data3) – Data (Low byte)
Value3 U16* Number Message buffer (Data4) – Data (High byte)
Example
/*
CardNo: Card No; NodeID: NodeID; Index: SDO Index; SubIdx: SDO Subindex;
DataType: (Read Command) Read data, set as 0x40; (Write Command) Write 8-bit, set as
0x2f;
(Write Command) Write 16-bit, set as 0x2f; (Write Command) Write 32-bit, set as 0x23f;
Value0: SDO data low word (Low byte), Value1: SDO data low word (High byte);
Value2: SDO data high word (Low byte), Value3: SDO data high word (High word);
*/
U16 CardNo=0,
U16 Cmd, COBID, DataType, Value0, Value1, Value2, Value3;
I16 status= _DMC_01_read_message (CardNo, &Cmd, & COBID, &DataType,
&Value0, &Value1, &Value2, &Value3);