Jump to content

CAN ncReadObj.vi output


Recommended Posts

Hi friends,

                   After a long time.  :worshippy:

 

I am developing a CAN read/write module for CAN diagnostics testing. There is no problem with ncWriteObj.vi- works fine. I can also see the data on CANoe Trace window.

But I also need to read the response of the ECU module from a different CAN ID.

I just connected the Message handle to the VI and read back the values.

 

Say for example

If the diagnostic command is 

 

02 10 C0 FF FF FF FF FF

 

The positive response should be

 

02 50 C0 FF FF FF FF FF

(actually only the first 3 bytes matter)

If I use ncReadObj VI the output is

 

0 0 0 0 80 59 4C A

 

*** update: the above data is not correct. I get the same output even if I change the command.

what is happening here?

Even if the formatting is not correct, I expected bytes 1-4 to be the same value.(assuming the data array to be reversed)

Where am I making mistake? Sync problem?

Please help. It is driving me crazy. :throwpc:

 

 

-Sharon

 

P.S Unfortunately I cant attach my code. It is on a different PC and using pendrive is prohibited. Sorry  :oops:

Link to comment

Why are you using the old Series 2 CAN drivers?  Is this a legacy program?  Does your device support XNET?  If so I highly recommend using the XNET drivers.  They are superior in almost every way.  That being said it is your choice and if you are more comfortable with one driver set versus another then use what you like.

 

Back to the question.  Start with the basics.  You said that you can see the CAN write works fine using another tool, can you see the CAN message come back from the ECU using this other tool?  What do you see there?  What I'm trying to get at is, is the problem that the ECU doesn't actually send what it should?

 

Assuming it is sending the data it should try opening the example in the example finder.  I think it is called something like "Read write same port" where you can setup a write a frame, then read the frames back.  Does this work as expected?

 

Maybe also look at MAX.  There is a bus monitor that can look at raw frames coming in.  I can't remember if there is a way to write frames there, but maybe your other tool can send the request and see if the bus monitor sees the request, and the reply from the ECU.

  • Like 1
Link to comment

That frame data looks like an error frame.  What's the value of IsRemote in the return data from ncReadObj?  "IsRemote" is deceptively named and can indicate an error (look into the docs for the function).

 

Remember that when you send your request, the next frame may not be the response.  It might be an error or unrelated frame (or a previous diagnostic response that wasn't cleared out of the RX buffer).  If you're reading ncReadObj that will only read the first frame on the RX queue.  I suggest using the function to read multiple frames (ncReadNetMult, but don't quote me on that... I don't have LabVIEW on this computer).  Look into the examples to see how to use it to grab everything on the RX buffer.

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.