problème communication
problème communication
Hello,
I am using the PCAN-USB Pro and I have successfully sent USB to CAN frames with Python (Initialized-Write-Uninitialize) as you could see on the following capture on the PCAN-View, and I have connected the PCAN USB Pro with an Anybus Communicator gateway with a female CAN-CAN Cable and I see that the frames sent from python are not sent to the Anybus Communicator I have checked the CAN-CAN cable pins that there is a resistance of 120ohm termination and the Pins are well compatible with the Pin of the PCAN and Gatway.
I want to know if the frames I sent from Python code to the PCAN will be sent automatically from the PCAN to another tool ?
it will be necessary to make another program to send to the Anybus Communicator or not? otherwise where i could have a problem ?
Thanks for your help
I am using the PCAN-USB Pro and I have successfully sent USB to CAN frames with Python (Initialized-Write-Uninitialize) as you could see on the following capture on the PCAN-View, and I have connected the PCAN USB Pro with an Anybus Communicator gateway with a female CAN-CAN Cable and I see that the frames sent from python are not sent to the Anybus Communicator I have checked the CAN-CAN cable pins that there is a resistance of 120ohm termination and the Pins are well compatible with the Pin of the PCAN and Gatway.
I want to know if the frames I sent from Python code to the PCAN will be sent automatically from the PCAN to another tool ?
it will be necessary to make another program to send to the Anybus Communicator or not? otherwise where i could have a problem ?
Thanks for your help
- Attachments
-
- PCAN-View.PNG (49.36 KiB) Viewed 12269 times
-
- Sales & Support
- Posts: 1083
- Joined: Fri 20. Sep 2019, 13:31
Re: problème communication
Hello,
Please make sure that you use the right baudrate to communicate with this hardware you trying to communicate with.
Secondly, if you want to view the messages from your PCANBasic-Application in PCAN-View, make sure that you use the exact same channel as your PCAN-View application.
Step 1:
Start your PCANBasic-application
Step 2:
Initialize the same channel as your PCANBasic application with PCAN-View.
You'll receive a warning that "This hardware is already in use by another software! the bitrate cannot be changed".
Step 3:
See if this will result in the messages being sent by your PCANBasic application to appear in the receive window of PCAN-View:
The Transmit-Window show messages which were created and sent by PCAN-View itself
Best Regards
Marvin
Please make sure that you use the right baudrate to communicate with this hardware you trying to communicate with.
Secondly, if you want to view the messages from your PCANBasic-Application in PCAN-View, make sure that you use the exact same channel as your PCAN-View application.
Step 1:
Start your PCANBasic-application
Step 2:
Initialize the same channel as your PCANBasic application with PCAN-View.
You'll receive a warning that "This hardware is already in use by another software! the bitrate cannot be changed".
Step 3:
See if this will result in the messages being sent by your PCANBasic application to appear in the receive window of PCAN-View:
The Transmit-Window show messages which were created and sent by PCAN-View itself
Best Regards
Marvin
---
Marvin Heidemann
PEAK-Support Team
Marvin Heidemann
PEAK-Support Team
Re: problème communication
Hello,
Thank you for your explanation that I checked and I am on the same speed, but I want to know if the frames sent from USB to CAN (from my computer i.e. python code to PCAN-USB Pro) will be automatically transmitted from the CAN to another device (PCAN USB Pro to the gateway) connected to the CAN bus of the PCAN-USB Pro?
Because on the PCAN view I see that the received frames and that does not tell me that they are transmitted.
knowing that I used the 3 steps (Initialize- Write-Initialize)
I need to add other function to allow to send from my PCAN USB Pro to another hardware
cordially
Thank you for your explanation that I checked and I am on the same speed, but I want to know if the frames sent from USB to CAN (from my computer i.e. python code to PCAN-USB Pro) will be automatically transmitted from the CAN to another device (PCAN USB Pro to the gateway) connected to the CAN bus of the PCAN-USB Pro?
Because on the PCAN view I see that the received frames and that does not tell me that they are transmitted.
knowing that I used the 3 steps (Initialize- Write-Initialize)
I need to add other function to allow to send from my PCAN USB Pro to another hardware
cordially
-
- Sales & Support
- Posts: 1083
- Joined: Fri 20. Sep 2019, 13:31
Re: problème communication
Hello,
Please share your code with us,
and explain to us, what you are refering to.
Best Regards
Marvin
Please share your code with us,
and explain to us, what you are refering to.
Best Regards
Marvin
---
Marvin Heidemann
PEAK-Support Team
Marvin Heidemann
PEAK-Support Team
Re: problème communication
here is the code i use to send the frame:
when I execute this code I see on the PCAN View that it has received but I want to know what I must add so that the frame will be transmitted from the PCAN to the gateway
thanks again
cordially
Code: Select all
from PCANBasic import *
#Initialize the PCAN
m_PCAN = PCANBasic()
m_Result = m_PCAN.Initialize(PCAN_USBBUS1, PCAN_BAUD_500K)
# creation of the frame
m_Msg = TPCANMsg()
m_Msg
m_Msg.ID = 0x103
m_Msg.LEN =3
m_Msg.DATA[0] = 0xA
m_Msg.DATA[1] = 0xB
m_Msg.DATA[2] = 0xC
m_Msg.DATA[3] = 0xD
m_Msg.MSGTYPE = PCAN_MESSAGE_STANDARD
m_Result = m_PCAN.Write(PCAN_USBBUS1,m_Msg)
if m_Result == PCAN_ERROR_OK :
print("Message sent")
# Uninitialize the PCAN
m_PCAN.Uninitialize(PCAN_USBBUS1)
when I execute this code I see on the PCAN View that it has received but I want to know what I must add so that the frame will be transmitted from the PCAN to the gateway
thanks again
cordially
-
- Sales & Support
- Posts: 1083
- Joined: Fri 20. Sep 2019, 13:31
Re: problème communication
Hello,
You dont need to add anything to send the message on the bus, the "write" method like used
in your example is sufficent for that.
Your code itself works, like you can see here:
Also another CAN-Node was able to receive this message on the bus:
PCAN-View, like previously mentioned, will not display messages in the transmit-window, if the message was not directly created and sent by PCAN-View itself. A message sent on the same PCAN-Net (Aka. Same Hardware) will be displayed in the receive-window.
If you cannot seem to establish a communication between your python application and your Gateway-device, this is most likely due to a physical issue (wrong baudrate, over/undertermination)
Can you describe to us, what you are expecting and what exactly does not work?
Best Regards
Marvin
You dont need to add anything to send the message on the bus, the "write" method like used
in your example is sufficent for that.
Your code itself works, like you can see here:
Also another CAN-Node was able to receive this message on the bus:
PCAN-View, like previously mentioned, will not display messages in the transmit-window, if the message was not directly created and sent by PCAN-View itself. A message sent on the same PCAN-Net (Aka. Same Hardware) will be displayed in the receive-window.
If you cannot seem to establish a communication between your python application and your Gateway-device, this is most likely due to a physical issue (wrong baudrate, over/undertermination)
Can you describe to us, what you are expecting and what exactly does not work?
Best Regards
Marvin
---
Marvin Heidemann
PEAK-Support Team
Marvin Heidemann
PEAK-Support Team
Re: problème communication
Here is the diagram of what I want to do and what works and what does not.
i want to know if what i can do is doable, if yes i want to know what i should do or added to my code
I know that I can do it from the PCAN View to the gateway but I am trying to send it from my python code
Thank you
Cordly
i want to know if what i can do is doable, if yes i want to know what i should do or added to my code
I know that I can do it from the PCAN View to the gateway but I am trying to send it from my python code
Thank you
Cordly
-
- Sales & Support
- Posts: 1083
- Joined: Fri 20. Sep 2019, 13:31
Re: problème communication
Hello,
Please send us a complete Screenshot of your PCAN-View communicating with this gateway device, like you already did.
Please make sure to include the status bar at the bottom of pcanview:
Best Regards
Marvin
Please send us a complete Screenshot of your PCAN-View communicating with this gateway device, like you already did.
Please make sure to include the status bar at the bottom of pcanview:
Best Regards
Marvin
---
Marvin Heidemann
PEAK-Support Team
Marvin Heidemann
PEAK-Support Team
Re: problème communication
I do not know if the statue which causes the problem but I arrive sent frames from another adapter USB CAN with its monitor and I receive well but for on the PCAN USB PRO and I also send from my PCAN PRO and I sees that the sent frames are well received.
Re: problème communication
Hello,
Thank you very much for your help I just solved the problem, it was the BUSHEAVY Statue in the end and sorry for the inconvenience.
cordially
Thank you very much for your help I just solved the problem, it was the BUSHEAVY Statue in the end and sorry for the inconvenience.
cordially