Thanks Boyce,  I think Im getting closer.
What would I need to define to send a nibble, then how do i reference whether its the upper or lower nibble?
Cheers, Dave.
			
									
									unable to transmit J1939 mesage with more than 8 bytes of data
- embtechnicalservices
- Posts: 52
- Joined: Fri Jan 15, 2016 10:14 am
Re: unable to transmit J1939 mesage with more than 8 bytes of data
http://www.emb-technical-services.co.uk

Windows 10 Home x64 - PowerVision 2.9.21075 OEM
i7-7700HQ ,16GBRAM, 500GBSSD, DELL Inspion 7567, 4K UHD Display.
						
Windows 10 Home x64 - PowerVision 2.9.21075 OEM
i7-7700HQ ,16GBRAM, 500GBSSD, DELL Inspion 7567, 4K UHD Display.
- boyce
- Enovation Controls Development 
- Posts: 322
- Joined: Wed Sep 08, 2010 5:09 pm
Re: unable to transmit J1939 mesage with more than 8 bytes of data
You really can't.  CAN messages are transmitted with a length in bytes.
			
									
									Boyce Schrack
Enovation Controls
						Enovation Controls
- embtechnicalservices
- Posts: 52
- Joined: Fri Jan 15, 2016 10:14 am
Re: unable to transmit J1939 mesage with more than 8 bytes of data
sorry, I didnt make myself clear.
if i wanted to send 20 bytes for example, the first 18 of which were full bytes, then the next byte was built of 2 nibbles, and the last byte was 8 individual bits.
thanks again for the support. I'll post up the script once its working for others to benefit from as this has been a learing curve.. :)
			
									
									if i wanted to send 20 bytes for example, the first 18 of which were full bytes, then the next byte was built of 2 nibbles, and the last byte was 8 individual bits.
thanks again for the support. I'll post up the script once its working for others to benefit from as this has been a learing curve.. :)
http://www.emb-technical-services.co.uk

Windows 10 Home x64 - PowerVision 2.9.21075 OEM
i7-7700HQ ,16GBRAM, 500GBSSD, DELL Inspion 7567, 4K UHD Display.
						
Windows 10 Home x64 - PowerVision 2.9.21075 OEM
i7-7700HQ ,16GBRAM, 500GBSSD, DELL Inspion 7567, 4K UHD Display.
- boyce
- Enovation Controls Development 
- Posts: 322
- Joined: Wed Sep 08, 2010 5:09 pm
Re: unable to transmit J1939 mesage with more than 8 bytes of data
Okay, the nibbles would have to be or'ed together and written out to the byte.
uint8 nibblehi = 0x04;
uint8 nibblelo = 0x05;
uint8 nibbles = (nibblehi << 4) | nibblelo;
buffer.WriteInt8(9, nibbles);
			
									
									uint8 nibblehi = 0x04;
uint8 nibblelo = 0x05;
uint8 nibbles = (nibblehi << 4) | nibblelo;
buffer.WriteInt8(9, nibbles);
Boyce Schrack
Enovation Controls
						Enovation Controls
- embtechnicalservices
- Posts: 52
- Joined: Fri Jan 15, 2016 10:14 am
Re: unable to transmit J1939 mesage with more than 8 bytes of data
Boyce, thankyou very much. please find below screen grabs and copy of the code that is sending a 28 byte multipacket J1939 message made up from variables pulled from powervision. I would have never worked out the nibble bits. Perhaps some examples of these along with words and bits could make their way to the next  user guide?
For refernce I gave the first 6 values AA BB CC DD EE FF so I could see the placment in the transmitted response, and the rest are some ransom value. The last 2 'reserved' were packed with AB, CD, again so I could check where they appeared.
then with  fildter applied in CAN capture you get this segmented data...

or with no filter, the full multiplex string....

I'm off for a beer after that small triumph. thanks again :)
			
									
									For refernce I gave the first 6 values AA BB CC DD EE FF so I could see the placment in the transmitted response, and the rest are some ransom value. The last 2 'reserved' were packed with AB, CD, again so I could check where they appeared.
Code: Select all
//---------------------------------------------------------------------------------------------
// Murphy Scripting
// - Leave EventName as $Send Torque Curve$ for main script method
//---------------------------------------------------------------------------------------------
void $Send Torque Curve$ () 
{
   // List of the bytes & nibbles needed to fill and thieir definition ( in groups of 8 bytes for ease)
   uint8 byte0, byte1, byte2, byte3, byte4, byte5, byte6, byte7;
   uint8 byte8, byte9, byte10, byte11, byte12, byte13, byte14, byte15;
   uint8 byte16, byte17, byte18, byte19, byte20, nibblehi21, nibblelo21, nibblehi22, nibblelo22, nibblehi23, nibblelo23;
   uint8 nibblehi24, nibblelo24, nibblehi25, nibblelo25, byte26, byte27;
   //Define the Variable in Powervision to be placed in each byte defined above.
   smRead(VariableIDs.Engine_Speed_at_Point_01, byte0);            //Full Byte 
   smRead(VariableIDs.Engine_Torque_at_Point_01, byte1);           //Full Byte
   smRead(VariableIDs.Engine_Speed_at_Point_02, byte2);            //Full Byte
   smRead(VariableIDs.Engine_Torque_at_Point_02, byte3);           //Full Byte
   smRead(VariableIDs.Engine_Speed_at_Point_03, byte4);            //Full Byte
   smRead(VariableIDs.Engine_Torque_at_Point_03, byte5);           //Full Byte
   smRead(VariableIDs.Engine_Speed_at_Point_04, byte6);            //Full Byte
   smRead(VariableIDs.Engine_Torque_at_Point_04, byte7);           //Full Byte
   smRead(VariableIDs.Engine_Speed_at_Point_05, byte8);            //Full Byte
   smRead(VariableIDs.Engine_Torque_at_Point_05, byte9);           //Full Byte
   smRead(VariableIDs.Engine_Speed_at_Point_06, byte10);           //Full Byte
   smRead(VariableIDs.Engine_Torque_at_Point_06, byte11);          //Full Byte
   smRead(VariableIDs.Engine_Speed_at_Point_07, byte12);           //Full Byte
   smRead(VariableIDs.Engine_Torque_at_Point_07, byte13);          //Full Byte
   smRead(VariableIDs.Engine_Speed_at_Point_08, byte14);           //Full Byte
   smRead(VariableIDs.Engine_Torque_at_Point_08, byte15);          //Full Byte
   smRead(VariableIDs.Engine_Speed_at_Point_09, byte16);           //Full Byte
   smRead(VariableIDs.Engine_Torque_at_Point_09, byte17);          //Full Byte
   smRead(VariableIDs.Engine_Speed_at_Point_10, byte18);           //Full Byte
   smRead(VariableIDs.Engine_Torque_at_Point_10, byte19);          //Full Byte
   smRead(VariableIDs.Engine_Speed_at_Point_11, byte20);           //Full Byte
   smRead(VariableIDs.Fractional_Torque_at_Point_01, nibblehi21);  //Upper Nibble
   smRead(VariableIDs.Fractional_Torque_at_Point_02, nibblelo21);  //Lower Nibble
   smRead(VariableIDs.Fractional_Torque_at_Point_03, nibblehi22);  //Upper Nibble
   smRead(VariableIDs.Fractional_Torque_at_Point_04, nibblelo22);  //Lower Nibble
   smRead(VariableIDs.Fractional_Torque_at_Point_05, nibblehi23);  //Upper Nibble
   smRead(VariableIDs.Fractional_Torque_at_Point_06, nibblelo23);  //Lower Nibble
   smRead(VariableIDs.Fractional_Torque_at_Point_07, nibblehi24);  //Upper Nibble
   smRead(VariableIDs.Fractional_Torque_at_Point_08, nibblelo24);  //Lower Nibble
   smRead(VariableIDs.Fractional_Torque_at_Point_09, nibblehi25);  //Upper Nibble
   smRead(VariableIDs.Fractional_Torque_at_Point_10, nibblelo25);  //Lower Nibble  
   smRead(VariableIDs.Reserved0x27, byte26);                                 //Full Byte
   smRead(VariableIDs.Reserved0x28, byte27);                                 //Full Byte
   
   // List of how the nibbles combine back into bytes
   uint8 byte21 = (nibblehi21 <<4) | nibblelo21;
   uint8 byte22 = (nibblehi22 <<4) | nibblelo22;
   uint8 byte23 = (nibblehi23 <<4) | nibblelo23;
   uint8 byte24 = (nibblehi24 <<4) | nibblelo24;
   uint8 byte25 = (nibblehi25 <<4) | nibblelo25;
   
             
   //Setup the mode inc the multipacket tx
   CANMessageInfo info;
   info.MessageType = CANMessageInfoType.MultiPacket;
   info.DestinationAddress = 0xFF;
   info.RtsCtsMaxPackets = 3;
   
   //setup the header and the message structure
   CANMessageBuffer buffer;
   buffer.CanID = 0x1FF08;              //TX ID
   buffer.Size = 28;                    //Number of bytes to send
   //     Write 8 bits, (byte number, contents);
   buffer.WriteInt8(0, byte0);
   buffer.WriteInt8(1, byte1);
   buffer.WriteInt8(2, byte2);
   buffer.WriteInt8(3, byte3);  
   buffer.WriteInt8(4, byte4); 
   buffer.WriteInt8(5, byte5); 
   buffer.WriteInt8(6, byte6); 
   buffer.WriteInt8(7, byte7); 
   buffer.WriteInt8(8, byte8); 
   buffer.WriteInt8(9, byte9); 
   buffer.WriteInt8(10, byte10); 
   buffer.WriteInt8(11, byte11); 
   buffer.WriteInt8(12, byte12); 
   buffer.WriteInt8(13, byte13); 
   buffer.WriteInt8(14, byte14); 
   buffer.WriteInt8(15, byte15); 
   buffer.WriteInt8(16, byte16);
   buffer.WriteInt8(17, byte17);
   buffer.WriteInt8(18, byte18);
   buffer.WriteInt8(19, byte19);
   buffer.WriteInt8(20, byte20);
   buffer.WriteInt8(21, byte21);
   buffer.WriteInt8(22, byte22);
   buffer.WriteInt8(23, byte23);
   buffer.WriteInt8(24, byte24);
   buffer.WriteInt8(25, byte25);
   buffer.WriteInt8(26, byte26); 
   buffer.WriteInt8(27, byte27);
                   
   //Send the whole lot out 
   int port = 0;
   SendCANMessage(port, buffer, info);
}

or with no filter, the full multiplex string....

I'm off for a beer after that small triumph. thanks again :)
http://www.emb-technical-services.co.uk

Windows 10 Home x64 - PowerVision 2.9.21075 OEM
i7-7700HQ ,16GBRAM, 500GBSSD, DELL Inspion 7567, 4K UHD Display.
						
Windows 10 Home x64 - PowerVision 2.9.21075 OEM
i7-7700HQ ,16GBRAM, 500GBSSD, DELL Inspion 7567, 4K UHD Display.

