void SendVehicleIdentification(byte idString[])
{
dword i;
pg VI_EMS vi = {dlc = 1785}; // define parameter group with biggest possible value
if(elcount(idString) > 1785)
return;
for (i=0; i<elcount(idString); ++i)
{
vi.byte(i) = idString.byte(i);
}
vi.dlc = elcount(idString); // set data length to length of the string
output(vi);
}
Example 3 (J1939-22):
On key 'a'
{
// Send a PG as a single C-PG within Multi-PG
pg 0x0 pgTSC1 = {dlc = 8};
pgTSC1.sa = 1;
pgTSC1.da = 2;
pgTSC1.fdf = 1;
pgTSC1.tm = 1;
output(pgTSC1);
}