Package: xcomcan
Python library to access Studer-Innotec Xcom-CAN with theStuder Public Protocolusing CAN 2.0B framesPrerequisitesPlease read the complete documentation available on :Studer Innotec SA-> Support -> Download Center -> Software and Updates -> Communication protocols Xcom-CANGetting Started1. Package installation$pipinstallxcomcan2. Hardware installationConnect yourXcom-CAN(Studer side) to your installation using the cable provided with the deviceConnect yourXcom-CAN(External side) to your controller (personal computer, Raspberry Pi, etc.) using aUSBtoCANadapter (Kvaser, etc.)Please refer to theXcom-CANmanual for more information about commissioning the device3. Xcom-CAN Protocol selectionInteraction with the Xtender/Vario systems through third party devices such as PLC or SCADA requires to selectStuder Public Protocolwith dip switches as shown below. There’s two operation modes available :Exclusive : This configuration is recommended when there is onlyonedevice communicating with theStuder Public Protocolon the external CAN interface. TheXcom-CANwill send a response to every frame that appears on the external CAN interface. For frames which do not fit theStuder Public Protocolspecifications, theXcom-CANwill send an error frame message. This mode is practical for debugging as every frame sent by the PLC/SCADA will get a response. It will also detect any frame that could be corrupted when transmission occurs.Tolerant : This configuration is recommended when there areseveraldevices communicating with different protocols on the external CAN interface. TheXcom-CANwill only send a response to the frames that completely fit theStuder Public Protocolspecifications. This mode enable the installer to extend the CAN bus on the external interface and to add others devices that can communicate with the PLC/SCADA on the same physical support as theXcom-CAN.Xcom-CAN Dip switches protocol selectionN° 1N° 2N° 3N° 4Studer PublicOFFONOFFOFFExclusive ProtocolOFFONOFFONTolerant Protocol4. Software configurationSet the Studer CAN public client as follow :StuCanPublicClient(0x00,CAN_BUS_SPEED,bustype='kvaser',debug=True)where ‘0x00’ is the source addresswhereCAN_BUS_SPEEDis your CAN bus bitrate as selected inside the XcomCAN device with the dip-switches, it must be set to 10000, 20000, 50000, 100000, 125000, 250000, 500000 or 1000000wherebustypeis the CAN interface name has specified here :python-canwheredebugenables you to get some useful console information for debugging purposeXcom-CAN Dip switches CAN bus speed selectionN° 6N° 7N° 8CAN bus speedOFFOFFOFF10 kbpsOFFOFFON20 kbpsOFFONOFF50 kbpsOFFONON100 kbpsONOFFOFF125 kbpsONOFFON250 kbpsONONOFF500 kbpsONONON1 Mbps5. Run an example from/examplesfolderGo to/examplesfolder with a terminal and execute this script$pythontry_stu_can_public_client.pyCheckclient fileto understand it.6. Open documentationOpen documentation fromRead The DocsWarningsPleasecheck carefully theXcom-CANdip switches configuration as well as the jumper for CAN-H, CAN-L and GND signalsUsedevices addresses generated intoaddresses fileIt is strongly recommendedNOTto spam theXcom-CANwith multiple requests. Even if theXcom-CANhas a frame buffer, the response will not be faster because of internal Studer bus load. The correct way to communicate with theXcom-CANis to send a request and towaitfor the response before sending the next request. If no response comes fromXcom-CANafter a delay of 1 second, we can consider that the timeout is over and another request can be send.AuthorsStuder Innotec SA-Initial work-Studer Innotec SALicenseThis project is licensed under the MIT License - see theLICENSEfile for details