LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Read/write with j1939

Hi,

 

Very new to LabVIEW. I have a CopperHill technologies board (SAE j1939 Gateway Module with USB Port, RTC, Micro SD Memory Card) and I am trying to read the data coming from the board and the connected product and parse it according to j1939.

 

I can detect the usb with the VISA resource name, but can't then use any of the XNET functionality. Similarly, I can setup the VI do read the data with XNET, but I can't link it to the USB port.

 

I'm brand new to LabVIEW and trying to learn it fast to get this figured out,

so any help is good.

 

Thanks!

0 Kudos
Message 1 of 11
(307 Views)

VISA and XNET are different protocols.

First of all decide which protocol you want to use either usb or CAN.

Below link have details regarding communication with the board:

 

Details of your board

https://copperhilltech.com/sae-j1939-gateway-module-with-usb-port-rtc-microsd-memory-card/

 

Communication using serial port(usb)

https://copperhilltech.com/jcom1939-monitor-pro-x-extended-sae-j1939-data-monitor-recorder-simulator...

Programming the SAE J1939 ECU Simulator Board Using Visual Studio C#

https://copperhilltech.com/blog/programming-the-sae-j1939-ecu-simulator-board-using-visual-studio-c/

 

 


CLD Using LabVIEW since 2013
0 Kudos
Message 2 of 11
(269 Views)

Thanks for the resources. I am able to read some data through my labview program, but I can't filter by the PGN numbers and so I'm just getting the raw data coming through. Is there a way to do that through the VISA class?

0 Kudos
Message 3 of 11
(239 Views)

What are you actually trying to receive from the controller.

How much have you achieved?

Kindly share the code to further checking.


CLD Using LabVIEW since 2013
0 Kudos
Message 4 of 11
(229 Views)

I'm trying to receive data according to the PGN 64982, j1939-71. I have attached the link to the code below. It's totally unfinished, and won't run, but I'm trying to send a RESET message to the board, then send a PGN filter to access the data for than PGN.

 

Again, totally messy and unfinished but thank you for having a look!

 

https://copperhilltech.com/content/jCOM1939-Protocol.pdf

 

^ is the link to the protocol pdf from copperhill technologies.

0 Kudos
Message 5 of 11
(212 Views)

kindly down convert the vi to LabVIEW2020 or before


CLD Using LabVIEW since 2013
0 Kudos
Message 6 of 11
(199 Views)

Okay so with the array, I am trying to send the RESET message to the COM port, see the copper hill document link. (page 6)

https://copperhilltech.com/content/jCOM1939-Protocol.pdf

I want to then be able to use ADDFILTER to filter out some PGN's so that I can start interpreting the data I'm receiving.

 

It doesn't seem like I am correctly writing to the COM port, or I am missing something in my VISA serial block.

 

I have attached a different version, that gives me the same output, saved as 2019.

 

 

Download All
0 Kudos
Message 7 of 11
(187 Views)

Hi, I have a Copperhill technologies board, and I am trying to send a reset message and an addfilter message to the board so that I can start filtering the PGN's according to j1939. It seems to always just be returning the same message back out. I want to avoid using NI-XNET and a library.

 

The link to the board is here:

https://copperhilltech.com/sae-j1939-gateway-module-with-usb-port-rtc-microsd-memory-card/

 

The document containing the COM protocol:

https://copperhilltech.com/content/jCOM1939-Protocol.pdf

 

My LabVIEW code is attached I am trying to use.

 

0 Kudos
Message 8 of 11
(190 Views)

Hi Jack,

 

why do you need to start a new thread for the very same topic?

Please keep related things in one place!

 


@sJack wrote:

I have a Copperhill technologies board, and I am trying to send a reset message and an addfilter message to the board so that I can start filtering the PGN's according to j1939. It seems to always just be returning the same message back out. I want to avoid using NI-XNET and a library.


You don't "want to avoid X-NET", you have to avoid X-NET -  your device expects communication by VISA…

 

Did you read the manual where you provided the link?

Did you understand the message format expected by your device? It seems you didn't read the manual very carefully, as your messages are ill-formed!

 

The RESET message consists of the bytes "C0 00 05 05 A5 69 5B", which is wrong in two ways!

  1. The red marked bytes 0005 tell the device to expect 5 more bytes in this message, but you only send 4 additional data bytes!
  2. The missing 5th byte is the checksum, but you forgot to add that checksum - and you forgot to attach a subVI to calculate that checksum…

That checksum calculation is explained on page 4 of your manual!

 

Recommendation: whenever controls/constants/indicators show values using a non-default display mode you should make that display mode indicator (aka radix) visible in the context menu of that FP item (or constant)!

Best regards,
GerdW


using LV2016/2019/2020 on Win8.1/10+cRIO
0 Kudos
Message 9 of 11
(156 Views)

Hi GerdW,

 

I only started a new thread as no one replied to my previous one after a few days. Forgive me for the seemingly dumb mistakes. I have never used LabVIEW or worked with a communications protocol before, so I am learning as I go. Understanding the message is a work in progress.

 

That being said, I appreciate your explanation, and I think this will help me move a step in the right direction.

 

Regards,

 

Kieran

0 Kudos
Message 10 of 11
(139 Views)