CW5.1 on S08QG8 - PacketDevice Bean

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CW5.1 on S08QG8 - PacketDevice Bean

Jump to solution
1,459 Views
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

Labels (1)
Tags (1)
0 Kudos
1 Solution
337 Views
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
 
 
 

View solution in original post

0 Kudos
2 Replies
338 Views
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 Kudos
337 Views
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 Kudos