03-26-2019 01:11 AM
Hi
i have created a data string of 17bytes for can implementation.i am using can 9853 module.but can will support only 8 bytes of data.so i want to divide this 17bytes into 8bytes+8bytes+1bytes and want to send through can port to external device(testing device).and i want to send these three separate bytes within 200ms.how to do??i have attached vi and screenshot .
Solved! Go to Solution.
03-26-2019 02:05 AM
Hi rishijha,
why are you still using hex-formatted strings instead of plain U8 arrays?
I thought you already learned that in your last thread…
When those 17 bytes are your (CAN message) payload then please keep this in an U8 array:
so i want to divide this 17bytes into 8bytes+8bytes+1bytes and want to send through can port to external device
All you need to do is to use ArraySubset three times and build 3 CAN messages from the 3 parts of your payload…
03-26-2019 03:37 AM
When those 17 bytes are your (CAN message) payload then please keep this in an U8 array:
but my can payload is U-64 bit integer as u can see in screenshot.so i have to divide 17 byte of data in to 64bit+64bit+8bit.
my payload is combination of 2Byte+2Byte+4Byte+2Byte+3Byte+4Byte=17Bytes.
why are you still using hex-formatted strings instead of plain U8 arrays?
what is the problem with my method.any way my payload is in hexadecimal.
03-26-2019 04:58 AM - edited 03-26-2019 05:00 AM
Hi rishijha,
what is the problem with my method.any way my payload is in hexadecimal.
It's overly complicated (aka Rube-Goldberg)!
Your data is not "hexadecimal" - that is just the display setting in the frontpanel! The underlying data are just bytes (or 64bit entities), no matter how you display them…
Additionally you will have even more problems to convert your hex-formatted string back into U64 data.
but my can payload is U-64 bit integer as u can see in screenshot.so i have to divide 17 byte of data in to 64bit+64bit+8bit.
Why didn't you say so in your first post? It's quite annoying when you change your requirements after getting answers…
Once you understand what I'm showing to you you can combine my snippets in this thread to directly create 3 U64 values instead of that intermediate 17-byte array. Good luck!
03-28-2019 02:21 AM
Hi
GerdW,
I am sending that 64it+64bit+8bit from CAN port0 to CAN port1 @1000ms continuously.when i am sending first 64bit from port0 i am able to receive same 64bit at port1.when sending 2nd 64bit i am receiving same previous 64bit why??when 3rd 8bit will write to port0 that time i am seeing 2nd 64bit.so it looks like one frame is pushing another frame.so this the problem or something else??
03-28-2019 03:01 AM
Hi rishijha,
so it looks like one frame is pushing another frame.
I never had that problem with all those NI9853 modules I used so far…
so this the problem
No.
or something else??
Yes.
(I guess your VI is the problem. But again you didn't attach it…)
03-28-2019 03:33 AM
Please have a look on attached file.another vi i am using basic can fpga example from example finder.so please tell me where is the problem with real time vi.
03-28-2019 03:41 AM - edited 03-28-2019 03:42 AM
03-28-2019 03:55 AM
now i have attached both.check once.
03-28-2019 04:06 AM
Hi rishijha,
are there any CAN bus errors?
- If I recall correctly you get some "echo" messages from those 9853, but as I filter CAN messages in the FPGA I only receive those messages I'm interested in.
- To check CAN bus communication independently from any other device on the bus I use something like this. So I'm always sure about messages sent on the CAN bus! I really recommend to use such devices when doing any work involving CAN bus…