-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parsing of AC PGNs (127744 - 127749 #398
Comments
|
I do call the parser and am successfully parsing other messages. Here is where the parser gets pulled in: void loop() { I did notice with these messages that I am not able to include them in the message handler. I believe that is because I am doing everything in my local file rather than referring off to the h and .cpp file. But other than that everything else is the same as how I am parsing other messages. The message I am attempting to parse is on the bus as shown below (the other phases are as well). And I can also see the message I am sending is on the bus, but with no AC current/power data (I'm only trying current/power for now). |
My mistake - I accidentally closed the issue rather than submitting the above reply. |
But do you call your parser on your message handler? There is no automatic call for each message parser and also message handler has to be registered. Parsers nad setters can be locals, if they are not published on N2kMessages module. |
Thanks for the input. I believe I understand the comment and I made a couple of changes and added "ACPhaseB" to message handler and to the message. I can't get it to successfully compile when I added "{127745L,&ACPhaseB}," to the message handler so I know I still have something that isn't correct. I found a similar example on the NMEA2000 shield Github forum from a couple of years ago and this matches that so I am confused as to what I did not properly update. //Message handler for received message parameters tNMEA2000Handler NMEA2000Handlers[]={ bool ParseN2kACPhaseBPGN127745(const tN2kMsg &N2kMsg,unsigned char &SID,double &ConnectionNumber, double &ACRMScurrent,double &Power) { |
You have only declared parser, but still do not call it. You need to also write full function |
I decided to create my own .h and .cpp files and successfully integrated the AC current/power, voltage/frequency and AC input status pgns into my file. I really appreciate all of the guidance that you provided. |
Hi Timo -
Really appreciate the work that you have done with the library. I am trying to make an update to my system to pull in AC parameters. The most important ones for me are current and power. From looking at some previous issues that were resolved along with the library I put together what is shown below for PGN 127745. The syntax is correct as it compiles, but it is not pulling in the data. I have been looking at it for a couple of days and still can't figure out what I am doing wrong. Can you help point me in the right direction?
bool ParseN2kPGN127745(const tN2kMsg &N2kMsg,unsigned char &SID,double &ConnectionNumber, double &ACRMScurrent,double &Power) {
if (N2kMsg.PGN!=127745L) return false;
int Index=0;
SID=N2kMsg.GetByte(Index);
ConnectionNumber=N2kMsg.Get2ByteUDouble(1,Index);
ACRMScurrent=N2kMsg.Get2ByteUDouble(0.1,Index);
Power=N2kMsg.Get2ByteUDouble(0.1,Index);
return true;
}
The text was updated successfully, but these errors were encountered: