-
Notifications
You must be signed in to change notification settings - Fork 2
3. Operation
The following description of operation, is only applicable when the gateway is in "RAW data" mode, future new modes will have different operation.
When the gateway powers up for the first time, or after a factory reset, it will send out a Boot Loader text string….
$PDGY,TEXT,Digital_Yacht_iKonvert_v2.22_#AB-181018-12345_Mode:15<CR><LF>
Which identifies the model, firmware version, serial number and mode.
Then it will wait for the application to configure and initialise it. At this stage even though the gateway is physically connected to the NMEA2000 network, it is "Off Bus" (inactive) and no NMEA2000 communication is taking place.
To tell the application that it is powered up but "Off Bus", the gateway outputs an "I'm Alive" message every second, which is the Network Status Message (see Serial Protocol section 3) but with null data values…
$PDGY,000000,,,,,,,<CR><LF>
By default just the mandatory TX and RX PGNs are enabled and the first task for the application is to send the required TX and RX PGN lists to the gateway (see Serial Protocol section 5 and 6), which will store them in Non-Volatile memory.
The TX and RX PGN lists are retained by the gateway after a power cycle, so it is not necessary for the application to set these every time it is run.
Before any NMEA2000 communication can take place, the gateway must be initialised, which causes it to go "On Bus" i.e. negotiate a CAN Address.
The gateway is designed to operate as autonomously from the application as possible and once initialised it will carry out all the normal NMEA2000 network management tasks automatically. Negotiating a CAN Address, maintaining a list of active devices on the network, responding to requests from other devices, etc. are all handled with no input from the application.
Once the TX and RX PGN lists are configured, the application must initialise the gateway by sending it the Initialisation Sentence (see Serial Protocol section 7). This causes the gateway to go "On Bus" and the N2K LED will now illuminate and flash as data is received.
All PGNs received that are in the gateway's currently configured RX PGN list will be passed through to the application using the RX PGN Sentence (see Serial Protocol section 1). The PGN number, priority, source and destination Addresses, time stamp and the PGN payload (encoded in base64) are all included in the sentence, so that the application has full visibility of what the data is, where it has come from, it's priority and relative timing.
Every second, the gateway will also send a Network Status Sentence that provides the application with additional information about the status of the NMEA2000 network (see Serial Protocol section 3).
If the application wishes to transmit a PGN on to the network, it must send a TX PGN sentence (see Serial Protocol section 2) to the gateway. The gateway will check that the requested PGN to be transmitted is in its TX PGN List, and if it is, it will place the PGN in its transmit queue and send at the first opportunity. If the PGN is not in the TX PGN list or the gateway is unable to complete this transmission it will send a NACK sentence back to the application with the reason for non-transmission (see Serial Protocol section 9).
If the application closes for any reason and communication with the iKonvert gateway is lost, the gateway will continue to stay in whatever state it was in before i.e. "On Bus" or Off Bus".
If it is "On Bus" then it continues to send out the Heartbeat PGN 126993 and responds to any network management PGNs.
When the application runs again and opens the virtual serial port connection to the iKonvert gateway, it will immediately start to receive the Network Status Sentence from the gateway, with null data if "Off Bus" or with the status of the NMEA2000 network if "On Bus". Also, if the gateway is "On Bus" it will immediately start to send the application RX PGN Sentences, without the application having to re-initialise it.
iKonvert Developers Guide V1.02