07-12-2019 01:32 AM
We are using USB-8502 for CAN communication with our motor. we have write some code to write and read the can data.
the code runs fine at first, but the USB-8502(Port2) fail to read after 10 minute.
we try to read the data from X-Net Monitor instead of using the code, but USB-8502 fail to read data with X-Net as well.
Below is the application for our code:
Port1: reading and write alternately .(No failure found)
Port2: reading and write alternately with a background thread.(fail to read after some time.)
Attached is some test we do to analysis the failure(Monitor the CAN data with another Peak-System CAN):
Picture1: Write with X-Net using Port2, the data send out normal. and we get reply (0x581h).
Picture2: Write with Peak-System CAN, check the if there is data received from USB-8502.(there is reply from the monitor but the X-NET fail to read)
This situation continue until we plug off/on the USB connector.
We know that this should have something related to our code, but we are wondering:
What kind of error would cause USB-8502 fail to read till a reset?
07-22-2019 09:18 PM
07-24-2019 09:55 AM
Hi,
Does the LED on your USB-8502 turn red?
If yes, this means your device has entered the "Bus OFF State" and will stop trying to read frames from the CAN network.
07-31-2019 11:22 AM
I have a similar issue. My 8502 stops functioning when I plug a thumb drive in any other USB port. The thumb drive is fully functional (used in many other computers), has no virus (all computers scan the thumb drive), and in all failure situations the 8502 must be plugged off/on before functionality is restored.
NI-MAX sees the device as "inactive". Reset and Self-Tests both fail.
Following the plug off/on, NI-MAX sees the device as active and Reset and Self-Test work normally.
The 8502 need not be sending or receiving for this failure mode to occur.
07-31-2019 11:55 AM
The Led has not turn red, the led is green and on for all the time until USB-8502 plug off/on.
Actually, I have got the code from our software engineer, and he was using a streamframeoutput mode and got the payload wrong. So, every time the code try to send out one message, there is a few uninitialized data following. I think the device may has got some error or entered some mode after running for a while.
We have correct the payload and it is fine now. Thanks for your help.
08-01-2019 09:02 AM
Could it be something wrong about the USB Bus, something like voltage drop when you plug the thumb drive or there are too many device?