Jump to content

PCAN Driver Question


vorlex

Recommended Posts

Hello, 

Im using for PCAN Driver for communication with a CAN Device

 

I want to send via rs485 msg-s then to read them with the Peaksystems CAN 

I have an issue with reading the values from CAN.

My program reads only the first value. 

When I send msg and expect change there is no change in values I expect

image.png.adaa2d41ac39d6139957b9fa9279efbb.png

Only E2 changes everytime I want to read, but not the next 2 values where I Expect change. 

I guess Im missing something, but I dont know what.

Here is my program.


RS.zip

 

Edited by vorlex
Link to comment

Seems like there are several VIs missing.  Some are on the Desktop under RS CAN Communication.  Still I'm not sure how RS485 is used.  Regardless I'd put another device on the CAN bus, and listen to the traffic to isolate where the issue could be coming from.  Is the device not sending it properly? are you not reading it properly?  This might be more obvious with another device on the bus listening.

Link to comment
  • 1 month later...

Can you describe the expected behavior a little better? You are only reading from the CAN adapter under the Manual Send state, it isn't deterministic whether the VISA send or CAN read occurs first, and you are only reading one message each time so if you have a bunch in the buffer then you are never getting to them.

I've used PCAN-USB devices quite a bit and one other thing worth noting: Aside from the CLFN nodes being set to run in the UI thread, the PCAN-Light library that driver uses is no longer supported and I've had issues with that DLL under Windows 10. Make sure you find the latest version of the DLL, which helps, but an even better idea is to switch over to the PCAN-Basic API. The usage is mostly similar.

EDIT: Also, in regards to putting another CAN device on the bus, you shouldn't need to if what you are doing is correct... You are never calling PCAN_WRITE, so if you actually intend to send anything over the bus then there's problem number one. If you really are only trying to read, then you can see what messages are being received by opening PCAN-View. You may already have it if you installed the OEM driver package, but if not then you can download it here:

https://www.peak-system.com/PCAN-View.242.0.html?&L=1

Note that you'll want to open PCAN-View only after your application initializes the CAN adapter or your application may error on initialization. (PCAN-View can operate in listen only mode while another application has a the adapter open, but other apps generally won't be able to initialize a new session while it is running. I think newer drivers might behave better there, but I haven't played around with that for a while.)

Edited by JB_1592
Added more info...
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
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.