Transmitting 16bit J1939 CAN message

(1/2) > >>

Hello PLUS+1 community,
i want to implement a automatic start/stop function with a Danfoss M024.
I use the J1939 standard and need to send PGN61677 with SPN7745 and data content 10b(hex).

Therefore I used the PGN_Tx1 component from the J1939 Libary. The problem is that if I understand correctly the hexadecimal number must be converted into binary which is 100001011(bin). The length of 9 bits is too long for the TX component's data input which requires an array of 8 bits length.
Is this even correct to convert in to binary?

I'm relatively new to GUIDE programming so any help is greatly appreciated. :)

I attached a jpg with my code block.

Hi llang, I'm not sure how you determined 9 bits length, the overall length should be 8 bytes.

See below of example for an engine simulator I have that sends to PGN 61444 Electronic Engine Controller 1 random RPM/Speed message.

You need to find a breakdown of the PGN, that will tell you your SPN start position in the 8 bytes and the length of the message;
example her for PGN 61444

Hi Lukey,

thank you for your answer. I thought that I have to convert the hex code into bin which has 9 digits (therefore 16 bytes needed), which is wrong i guess.

I can give you an extract from the PGN document. Could you please explain, how I can send e.g. "10b Start requested, automatic type"? Can i just put the hex code into an encode function?

Thanks in advance. :)

Best regards, Lukas

I think you want something like this, but best to test it to be sure.

Assuming you would want to set the 1st bit to False when wanting to switch engine off.

Thank you.

In the encode block you set the first input to true - this must be the "01b = Start requested, operator type".
So if i want e.g. "10b = Start requested, automatic type" I have to set the second input to true and the first to false?


[0] Message Index

[#] Next page

Go to full version