CW5.1 on S08QG8 - PacketDevice Bean

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

CW5.1 on S08QG8 - PacketDevice Bean

跳至解决方案
1,479 次查看
ranemyr
Contributor I
Hi
Trying to use the PacketDevice Bean in ProcessorExpert and can´t get it to work.
Anyone having an example how to use this bean?
 
/Peter
--
Alban edit: added info provided by Peter on post reply

Message Edited by Alban on 2007-03-28 08:45 PM

标签 (1)
标记 (1)
0 项奖励
1 解答
357 次查看
ProcessorExpert
Senior Contributor III
Dear Customer,
Please see typical usage of PacketDevice bean - a packet sending:
 
#define MAXDATALEN 42 //maximal posible length of transmitted data

void main(void)

{

TPacket pck = {0, 0, 0, 0, 0, 0}; //packet structure

char ctmp[MAXDATALEN]; //transceived data

TPacketType type = ptToken;

byte i;

/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/

PE_low_level_init();

/*** End of Processor Expert internal initialization. ***/

for(i=0; i<MAXDATALEN; i++) {

 ctmp[i] = i+0x30;

}

pck.DestAddr = 1; //Destination device address.

pck.SrcAddr = 2; //Source device address.

pck.Type = type; //Type of the packet.

pck.ID = 8; //Packet identification.

pck.Data = ctmp;  //Pointer to the transceived data.

pck.DataLen = MAXDATALEN; //Length of the transceived data.

PckD1_SendPacket(pck);

/*** Don't write any code pass this line, or it will be deleted during code generation. ***/

/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/

for(;:smileywink:{}

/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/

} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/

 
The OnTxData() event is invoked after data sending. The Data and DataLen items have to be set correctly to be sent data successfully. For more info see PacketDevice bean help.
 
I hope this help you.
 
Best Regards,
Jan Pospisilik, Processor Expert Support
 
 
 

在原帖中查看解决方案

0 项奖励
2 回复数
358 次查看
ProcessorExpert
Senior Contributor III
Dear Customer,
Please see typical usage of PacketDevice bean - a packet sending:
 
#define MAXDATALEN 42 //maximal posible length of transmitted data

void main(void)

{

TPacket pck = {0, 0, 0, 0, 0, 0}; //packet structure

char ctmp[MAXDATALEN]; //transceived data

TPacketType type = ptToken;

byte i;

/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/

PE_low_level_init();

/*** End of Processor Expert internal initialization. ***/

for(i=0; i<MAXDATALEN; i++) {

 ctmp[i] = i+0x30;

}

pck.DestAddr = 1; //Destination device address.

pck.SrcAddr = 2; //Source device address.

pck.Type = type; //Type of the packet.

pck.ID = 8; //Packet identification.

pck.Data = ctmp;  //Pointer to the transceived data.

pck.DataLen = MAXDATALEN; //Length of the transceived data.

PckD1_SendPacket(pck);

/*** Don't write any code pass this line, or it will be deleted during code generation. ***/

/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/

for(;:smileywink:{}

/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/

} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/

 
The OnTxData() event is invoked after data sending. The Data and DataLen items have to be set correctly to be sent data successfully. For more info see PacketDevice bean help.
 
I hope this help you.
 
Best Regards,
Jan Pospisilik, Processor Expert Support
 
 
 
0 项奖励
357 次查看
ranemyr
Contributor I
Hi
I forgot to put these mandatory information.
MCU i am using is MC9S08QG8 , HCS08,
CodeWarrior Ver 5.1
The PacketDevice bean is USAK7_4
with CRC16 Bean UIAP7_6
 
/Peter
0 项奖励