03-27-2024 02:33 PM
Hi,
Im trying to extract j1939 can signals with NI9853 module on cRIO-9025.
Most of my code are from NI example project: "CAN Signals Receive.lvproj". See attached files.
Communications looking good, but im only get default values from my signals i have choosen in the Xnet Create session signal list.
I have used the same j1939.dbc file with Flexlogger using NI9863 module and everything works well. At least the .dbc file looks ok.
I wonder if the example dosent support j1939 protocol?
If not, i would like to know how to extract signals from j1939 protocol with NI9853 module on cRIO-9025.
Thanks.
03-27-2024 06:06 PM
NI-XNET supports J1939.
You can refer to the shipping example Hardware Input and Output >> CompactRIO >> Module Specific IO >> CAN >> 985x with NI-XNET to use the conversion session of XNET.
03-28-2024 02:21 AM
Thx for your reply!,
Accually im refering to your code example in my first post, see attached files.
NI9853 doesnt support Xnet on FPGA side but as you mentioned i can use it on RT.
I successfully used the signal conversion with a CAN open protocol with your code in another project.
But when im using j1939 i only get zeroes for my extracted signals. It looks like i get the default values as output.
I was a bit worried that it didnt support j1939, but the extraction of signals with Xnet should all be in my added .dbc file for the signal list.
So it should work then. I have tried to log signals with my j1939.dbc file with flexlogger and i works.
Im a bit confused here that it still dosent work.
Im useing Labview 2019 by the way.
03-28-2024 07:03 PM
Does the program work for non-J1939 frames?
Do your J1939 frames have data size greater than 8 bytes?
04-02-2024 12:30 AM
My program works for CanOpen communication. But not for my j1939 signals.
Im using the same code.
I used Xnet database editor and find out that the payload differs depending on messages in my .dbc file
I have seen 8,12 and 16 payload lengths.
In my created Xnet session i have chosen signals in messages with only 8 bytes payload,
even though the .dbc file i use contains messages with longer payloads.
You can se one of my signals in the attachment
04-05-2024 04:31 AM
I think its a bit strange that my code works for CanOpen protocol but not j1939 protocol.
Its state that Xnet supports j1939 from 2015.
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000kFycSAE&l=sv-SE
Even though i dont use Xnet module i still able to use the Xnet vi:s on my RT target with NI9853.
Im using an old cRIO-9025 so i dont have resources to implement NI9862 module with Xnet for my project.
Perhaps i will test NI9862 in a smaler test project just to test Xnet coding.
04-05-2024 04:49 AM
Hi tokar,
@tokar wrote:
I think its a bit strange that my code works for CanOpen protocol but not j1939 protocol.
I don't have XNet installed here, so I cannot comment on the ConvertFrameRawToSignal function.
Do you really need to flatten the 6×U32 CAN data frame of the NI9853 to an array of bytes?
I don't have hardware with a NI9853 at hand, but worked with them for quite some time:
Can you check the ArbID in your CAN data frames for your 29bit extended ArbIDs? The NI9853 needed an additional bit set when sending extended ArbIDs (AFAIK it was bit #31 of the ArbID element) and maybe this bit is also set when receiving extended ArbIDs…
(How many different messages do you need to read? Wouldn't it be easier to convert the 8 byte payload using your own routine? That's what I did most of the time…)
04-08-2024 05:06 AM
Do you really need to flatten the 6×U32 CAN data frame of the NI9853 to an array of bytes?
Answer: Looking at NI example "Can signals receive.lvprog" that uses ConvertFrameRawToSignal function, they using flatten to string and convert to array of bytes. So im using the same.
Can you check the ArbID in your CAN data frames for your 29bit extended ArbIDs? The NI9853 needed an additional bit set when sending extended ArbIDs (AFAIK it was bit #31 of the ArbID element) and maybe this bit is also set when receiving extended ArbIDs…
Answer:My j1939 protocol using 29 bits identifier.
In the message there is a bit that tells if its extended or not. I assumed that the Xnet function "Xnet convert(Frame raw to signal)" can handle that information, but im not sure..
Xnet supports j1939 protocol from LV2015, see link.
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000kFycSAE&l=sv-SE
In testing i have chosen to only use one message to extract one signal.
Its not that many signals so its possible to extract info from payload. My j1939 uses only 8 bits payloads for my wanted messages.
But i dont know how to get the separate the payload from message and nether how to convert the payload into signal values.
Maybe you can help me with that info?
04-08-2024 05:47 AM - edited 04-08-2024 05:51 AM
Hi tokar,
@tokar wrote:
Its not that many signals so its possible to extract info from payload. My j1939 uses only 8 bits payloads for my wanted messages.
But i dont know how to get the separate the payload from message and nether how to convert the payload into signal values.
You can also use TypeCast instead of those SplitNumbers functions, I use them to show the internal packing of the signals in the message…
(Edit: I built the array of bytes in the wrong order of bytes, please correct on your own.)
04-08-2024 05:58 AM
I think GredW is correct. If I remember correctly, NI-985x handles ArbID slightly differently than NI-XNET. There is an extension ID flag.
Can you save your raw J1939 data from NI-985s on a control in a VI and post it here? I don't have an NI-985x but I can play around with NI-XNET.