Quote:
Originally Posted by Douwe Fokkema
Hi José,
Thanks for your comments. If you have a suggestion for using for using PGN's 65345, 65360 and 65379, welcome. And I would appreciate to have the spec's for these PGN's.
I agree the hexadecimal ASCII is not the most efficient. I copied this part from Canboat, it just works. May be change to binary formats later.
Douwe Fokkema
|
Hello Douwe,
I think this explains better what you ask me:
// Raymarine / Simrad data reading
FlagType getpgn_stk(void) //
Single packet non addressed: 0x0ff00 - 0x0ffff
{
FlagType retflags = 0;
uint8_t ii;
CanRxMsg mess = Rx0Msg;
uint16_t value = ((mess.Data[1] & 0x07) << 8) | mess.Data[0];
if ((value == 1851) || (value == 1857)) { // Raymarine /
Simrad verification
switch((mess.ExtId >> 8) & 0x00ffff) {
case 65340: // Simrad Pilot Mode, 0xFF3C
value = get16(&mess.Data[2]);
ii = 0; // Default set: STBY (value == 0x00)
if (value == 0x0110) ii = 0x02; // AUTO Mode
else if (value == 0x0310) ii = 0x04; // VANE Mode
else if (value == 0x0610) ii = 0x08; // TRACK Mode
else if (value == 0x0410) ii = 0x01; // No Drift Mode
NAVDAT.autom = ii; // --> Seatalk1 pilot mode (Thomas Knauf doc)
break;
case 65345: // SeatalkNG Pilot
Wind Datum, 0xFF41
BOATDATA.WindRef = get_uangle(&mess.Data[2]); // Pilot
wind reference
break;
case 65360: // SeatalkNG Pilot Locked heading, PGN 65360, 0xFF50
NAVDAT.autoc = get_uangle(&mess.Data[5]);
retflags = PILOT_COUR;
break;
case 65379: // SeatalkNG Pilot Mode, 0xFF63
value = get16(&mess.Data[2]);
ii = 0; // Default set: STBY
if (value == 0x0040) ii = 0x02; // AUTO Mode
else if (value == 0x0100) ii = 0x04; // VANE Mode
else if (value == 0x0180) ii = 0x08; // TRACK Mode
else if (value == 0x0181) ii = 0x01; // No Drift Mode (?)
NAVDAT.autom = ii; // --> Seatalk1 pilot mode (Thomas Knauf doc)
break;
}
}
return(retflags);
}
I have also done the control for Simrad
B&G pilots, although it is not yet complete for heading corrections in wind mode.
The BOATDATA.WindRef variable is used by Ray as a reference to which corrections are added in wind / vane mode. Those corrections, as you know well, go in radians ^ -4
The variable NAVDAT.autoc is the "Pilot Locked Heading". Reference for corrections in AUTO mode. Also in rad^-4
I would like to discuss the PGN 127237 "heading track control" in this thread. I have seen that manufacturers barely complete it. And this aspect is interesting because they supplement it with PGN propietary ones. In addition, it seems to be "round trip": Order and response. Certainly, the operating mode specified here is not accurate because the "commanded heading" mode refers to three possible modes: Wind, Track and NoDrift.
That is why I think that the pilot calculator only manages the course tracking in magnetic angle, and it is the P70 in this case that is giving orders to correct XTE and wind angle, maneuvers and figures for
fishing, etc.
I am finishing the
software of a new pilot. In it, all course management is performed by the calculator in all modes. Thus there are no dependencies on external elements of other manufacturers. Do you think it's OK?