Delta Electronics PCI-DMC-B01 Computer Hardware User Manual


 
Chapter 8 Using SDO Protocol API | PCI-DMC-A01 / PCI-DMC-B01
8-12 Revised March, 2012
8.8 _DMC_01_read_message2
FORMAT
I16 PASCAL _DMC_01_read_message2 (I16 CardNo, U16 NodeID, U16 *Cmd,
U16 *COBID ,U16 *DataType,U16 *Value0,U16 *Value1,U16 *Value2,U16 *Value3,U16 *cnt)
Purpose
Reads the last SDO command message into the data buffer and returns the number of reads.
Parameters
Name Data Type Unit Description
CardNo U16
Number
Unit
CardNo is between 0~15
NodeID U16
Number
Unit
Node ID
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)
Value2 U16* Number Message buffer (Data3) – Data (Low byte)
cnt U16* Number Number of commands completed
Example
U16 CardNo=0, Cmd, COBID, Value0, Value1, Value2, Value3, cnt, temp;
U16 Index=0x6060, SubIdx=0, DataType=0x2f, value0=0x1, value1=0, value2=0, value3=0;
I16 status= _DMC_01_read_message2(CardNo, NodeID , &Cmd, &COBID, &DataType,
&Value0, &Value1, &Value2, &Value3, &cnt)
temp = cnt;
status= _DMC_01_send_message3 (CardNo, Index, SubIdx, DataType, value0, value1,
value2, value3);
status= _DMC_01_read_message2(CardNo, NodeID , &Cmd, &COBID, &DataType, &Value0,
&Value1, &Value2, &Value3, &cnt)
if(cnt-temp)
status= _DMC_01_send_message3 (CardNo, Index, SubIdx, DataType, value0,
value1,value2, value3);