vorlex Posted November 29, 2021 Report Share Posted November 29, 2021 (edited) 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 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 November 29, 2021 by vorlex Quote Link to comment
hooovahh Posted December 2, 2021 Report Share Posted December 2, 2021 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. Quote Link to comment
JB_1592 Posted January 4, 2022 Report Share Posted January 4, 2022 (edited) 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 January 4, 2022 by JB_1592 Added more info... Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.