03-01-2018 11:37 AM
Sorry you are having issues with OpenG. I have back saved the majority of my CAN stuff back to 2012 which is done outside of a package. As a result it is a manual process to install it. You don't just double click a package and have VIPM take over.
So first install all the normal OpenG packages through VIPM. If you can't you can probably just copy over the user.lib from another computer. Then install XNet if you intend on using the frame and signal conversion or XNet tools. Then download my code here. Then extract that zip to your LabVIEW install folder which will likely either be one of the following for you:
C:\Program Files (x86)\National Instruments\LabVIEW 201x
C:\Program Files\National Instruments\LabVIEW 201x
Then restart LabVIEW. Now you should have a Hooovahh palette on your block diagram.
The Integer to Enum can probably be replaced with a coerce to type. I've been using this 15765 code on various projects successfully lately, and I think the main core state machine, and the diagram on my blog should document it well enough for you to adopt it to your own. I'm working on XCP right now, but is being developed on company time so this one might be harder to post.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
03-05-2018 09:35 AM
hi Hooovahh, thanks for that. I was trying to follow your directions on Thursday and the SourceForge server was down so VIPM was having issues and I couldnt install OpenG. Their server is back now. I installed OpenG now via VIPM and that seems to be ok so far.
I used your Google drive link and copied over the CAN vis and I can successfully send a single CAN message using your Vector CAN Example. However that link doesnt contain the 15765 vis. I've tried the 15765 VI's from this link of your post but they're from 2015 and the link from your blog has the files in a VIPM package. Do you have the 15765 vis for version 2012 in a Zip file? Thanks so much.
If I'm able to send and receive a multi-frame CAN message, I would be so happy. Currently thats the only hurdle in my project.
03-05-2018 10:14 AM
Okay well thank you for that, apparently I missed the ISO 15765 protocol in the back save that I posted. If you can try to again download the back saved code for 2012 from here. It now contains the back saved code of which I can't really test since 2015 is the oldest I have at the moment. I also added the MNU files to for the ISO palettes too.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
03-05-2018 01:43 PM
Thanks a lot for that new Zip file! I downloaded it and everything seems fine now. I'm trying the VIs now.
03-06-2018 08:28 AM
hi Hooovahh
I tried to do a small demo to see if it all works but I'm probably doing something wrong. This is how I set it up, trying to send a multi-frame message:
The disabled CAN demo in your set of VIs works fine and I can detect the data using a P-CAN. But when I run the above circuit I made, it gives a timeout error and when I debug further I saw this in 'CANTransmitSingleframe.vi':
Error 6101 occurred at ISO 15765 Class_ISO.lvclass:Write Single Frame_ISO.vi
Possible reason(s): vector xl driver error 101XL_ERR_WRONG_PARAMETER
I see the xLCANTransmit for the working CAN demo in for 'CANtransmit.vi' ....
...is configured differently compared to 'CANTransmitSingleframe.vi' used in the 15765 vis:
That's all I could find for now. I'm sure the problem is in how I set up the 15765 demo since your CAN demo works and you said you've been using your vis successfully.
03-06-2018 09:02 AM - edited 03-06-2018 09:05 AM
You are doing multiple things wrong, and without access to the hardware I can't be sure what all the issues are. The first issue I see is you are stating that the the request ID is 0xAAAA1111, and the response is 0xAAAA2222. Every example I've seen of diagnostic CAN is on standard CAN IDs which are only 11 bits. Your example is 32 bits. Even if it was an extended CAN ID that is only 29. If your device actually need extended CAN IDs you'll need to modify the code to send and receive extended IDs (it is just a boolean in reading/writing frames) but more importantly I suspect your IDs are wrong. Trying to write this ID which is greater than 11 bits on a standard frame is probably why you are getting the Wrong Parameter error.
Then there is the question of your payload. You send a request of 0x2EFE0100FF000101. Do you intend on this performing a UDS Write DID? If so then you can just use the UDS Write Data By Identifier, which has the ID and Data In as separate controls, and also performs error handling and negative responses. It appears you are trying to write the DID 0xFE01, with a payload of 0x00FF000101 is this correct? If so you may want to start small and see if you can read this DID using the UDS Read Data By Identifier. Odds are that DID is protected and can't be written to until you enter the Extended or Programming mode depending on where that memory is mapped to. This is done with the UDS Diagnostic Session Control. Depending on your ECU you may need to perform a Seed/Key after entering that mode, to have access to writing that DID.
The difference in the transmit VI is because we know when performing diagnostic functions we only need to write a single frame at a time. This means that the Transmit can be simplified into the Transmit Single Frame where the input is a cluster instead of the array of clusters, we can remove the for loop, and have a constant of 1 as the number of frames to transmit.
And lastly in the future post code, not pictures of code. These were simple enough to understand but a snippet or the VI is much better than an image since a jpeg is not executable code. It is like taking a screenshot of notepad.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
03-06-2018 10:09 AM
Thanks for the feedback! Oh yea you're right those were invalid CAN ID's that I was using. I had used them for placeholders for posting the picture here. That explains the Parameter Error I was getting. I'm now using simple ID's and simple data just to get the demo working.
I just found out that hardware Session data in the Write-frame vi is just coming in as un-initialized. Trying to debug that now and then I'll try out your payload suggestions. Thanks for the explanation in the difference of the VIs.
I'll post actual code next time.
03-06-2018 01:40 PM - edited 03-06-2018 01:41 PM
I think the issue is that the Vector device is not being initialized properly in my circuit. When I run your CAN demo, the green light on the Vector device goes from blinking to On and then I can see the packet when I hit Transmit. When I run my own demo, the light stays blinking and the error at the DLL function is "vector xl driver error 113 XL_ ERR_PORT_ IS_ OFFLINE".
I'm thinking the 'Open_Can_hardware.vi" in the 15765 class will handle the Init part. I tried connecting various other VI's from the working CAN demo (e.g. Set baud rate, Flush Que, Start Driver) but they're not compatible with the input for that Open_CAN_hardware Vi for the 15765 class.
I attached the code. Can you see anything wrong with the Init part?
03-06-2018 02:04 PM
I don't know what the hardware baud rate will initialize to but it might be incorrect. Here is how you get access to the Vector Hardware and set it.
Also notice that I broke out the Hardware Channel this should also have valid data in it. The fact that you are getting an error from the Vector driver makes me think this part is working but it might tell you if you are on the wrong port or channel. Remember this example uses the first non-virtual port it finds, and if it doesn't find any it will still try to initialize and will error out. Make sure no other software is using that port when you run the VI. This means CANalyzer, CANoe, CANape, and any other VI are not actively using that port (VIs not running and Vector software stopped). That might be one reason you get a offline error.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
03-06-2018 03:26 PM
I tried your circuit, set the baud rate and used the UDS vi and its still giving the same error. I have no other software thats using the device. Hardware channel seems to be correct.
I want to use your code so I can rule out errors on my side and I tried using the .PNG snippet but it wont work for me (others also report this problem). Could you post the vi as an attachment?
Out of time for today and I'll be off tomorrow so I'll try it again when I get back on Thursday. Thanks a lot for your help so far, I really appreciate it.