Files
ecmc_plugin_socketcan/docs/readmeCanOpenSocket.md
2021-03-16 16:53:29 +01:00

846 lines
20 KiB
Markdown

git clone https://github.com/linux-can/can-utils
cd can-utils
make
sudo make install
git clone git https://github.com/CANopenNode/CANopenSocket.git
cd CANopenSocket
git submodule init
git submodule update
cd tools
./get_tools.sh
cd CANopenNode
make
update gcc if needed (if error at __has_include):
sudo yum install centos-release-scl
sudo yum install devtoolset-7-gcc*
scl enable devtoolset-7 bash
which gcc
gcc --version
fatal error: bits/getopt_core.h:
Modify CO_main_basic.c:
//#include <bits/getopt_core.h>
#include <getopt.h>
Follow this to test:
https://github.com/CANopenNode/CANopenNode/blob/master/doc/gettingStarted.md
sudo modprobe vcan
sudo ip link add dev vcan0 type vcan
sudo ip link set up vcan0
candump vcan0
./canopend --help
./canopend vcan0 -i 4 -s od4_storage -a od4_storage_auto
Seems not suppoer "-a" option so remove that:
./canopend vcan0 -i 4 -s od4_storage
update
Checkout master of CanopenNode to make it work like in gettingStarted.md
needed to use this as the canid 1 device:
echo "-" > od1_storage
echo "-" > od1_storage_auto
./canopend vcan0 -i 1 -c "stdio" -s od1_storage -a od1_storage_auto
# EDSEditor (windows)
## install mono on raspian
sudo apt-get install mono-complete
# Setup kvaser leaf
## must install socketcan_kvaser_drivers.tar.gz from kvaser download.
$ tar -xvzf socketcan_kvaser_drivers.tar.gz
$ cd socketcan_kvaser_drivers
# IMPORTANT: must add #include <linux/version.h> to all source files to get linux version macros.
$ make
$ sudo make install
$ sudo make load
# seems kvaser need to use can_dev
$ modprobe can_dev
$ modprobe can
$ modprobe can_raw
# seems leaf0 is now called can0 (not sure why)
$ sudo ip link set can0 type can bitrate 125000
$ sudo ip link set up can0
$ ip link show can0
# check that interface is there
$ ip addr
# Connect pmu to canbus
# connect pmu to power
# monitor canbus with candump
$ candump can0
can0 280 [0]
can0 280 [0]
can0 280 [0]
can0 280 [0]
can0 280 [0]
can0 703 [1] 05
can0 280 [0]
can0 683 [4] 00 00 00 00
can0 280 [0]
can0 280 [0]
can0 183 [8] 00 00 00 00 0B 40 04 20
can0 280 [0]
can0 703 [1] 05
can0 280 [0]
can0 280 [0]
can0 280 [0]
can0 703 [1] 05
can0 280 [0]
can0 280 [0]
can0 280 [0]
...
can0 280 [0]
can0 280 [0]
can0 703 [1] 05
can0 280 [0]
can0 280 [0]
can0 683 [4] 00 0NMT0 00 00 0B 40 04 20
can0 703 [1] 05
can0 280 [0]
..
# 183 seems to be PDO status bytes
can0 183 [8] 00 00 00 00 0B 40 04 20
# 703 seems to be NMT hearbeat
can0 703 [1] 05
# 280 seems to be "alarm" that it has no basic configuration (needs to be transfeered over pdo (for all amplifiers) or sdo for the specific amplifier)
can0 280 [0]
# 603 seems to not be described in manual.. Just described as third transmit pdo?!
can0 683 [4] 00 00 00 00
# SDO Transfers
To SDO load data from slave to master then use SDO 0x600+NodeId (Recive PDO of slave) then answer will be on 0x580+NodeId
# From "master" to "slave"
w 0x603 [8] 0x40 0x40 0x26 0x00 0x00 0x00 0x00 0x00
# From "slave" to "master"
r 0x583 [8] 0x41 0x40 0x26 0x00 0x38 0x00 0x00 0x00
0x38 = 56 byte bytes to transfer
# All 56 bytes: (toggle 0x61,0x71)
w 0x603 [8] 0x40 0x40 0x26 0x00 0x00 0x00 0x00 0x00
w 0x603 [8] 0x61 0x40 0x26 0x00 0x00 0x00 0x00 0x00
w 0x603 [8] 0x71 0x40 0x26 0x00 0x00 0x00 0x00 0x00
w 0x603 [8] 0x61 0x40 0x26 0x00 0x00 0x00 0x00 0x00
w 0x603 [8] 0x71 0x40 0x26 0x00 0x00 0x00 0x00 0x00
w 0x603 [8] 0x61 0x40 0x26 0x00 0x00 0x00 0x00 0x00
w 0x603 [8] 0x71 0x40 0x26 0x00 0x00 0x00 0x00 0x00
w 0x603 [8] 0x61 0x40 0x26 0x00 0x00 0x00 0x00 0x00
# Note only 7 bytes payload, byte0 is toggle.. 0x00, 0x10 ...
r 0x583 [8] 0x41 0x40 0x26 0x00 0x38 0x00 0x00 0x00
r 0x583 [8] 0x00 0x18 0x00 0x24 0x00 0x0E 0x00 0x0A
r 0x583 [8] 0x10 0x00 0x00 0x00 0xBF 0x00 0x00 0x00
r 0x583 [8] 0x00 0xC2 0x01 0x00 0x00 0x00 0x00 0x35
r 0x583 [8] 0x10 0x1C 0x84 0x02 0x46 0x1A 0x3C 0x49
r 0x583 [8] 0x00 0xC2 0x01 0x00 0x00 0x00 0x00 0x00
r 0x583 [8] 0x10 0x00 0xC8 0x48 0x51 0x2F 0x00 0x00
r 0x583 [8] 0x00 0x5C 0x2D 0x81 0x14 0x67 0x0D 0xA6
# Error retuned from slave
readStates_ = WAIT_FOR_REQ_CONF!!!
w 0x603 [8] 0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00
r 0x583 [8] 0x80 0x00 0x00 0x00 0x00 0x00 0x02 0x06
# Seems to work
Need to write new frameEqual func
CHECK THE TOGGKLE WHEN Reciving data frames!
data[0]: 24
data[1]: 36
data[2]: 14
data[3]: 10
data[4]: 0
data[5]: 194
data[6]: 0
data[7]: 450
data[8]: 0
data[9]: 0
data[10]: 7221
data[11]: 644
data[12]: 6726
data[13]: 18748
data[14]: 450
data[15]: 0
data[16]: 0
data[17]: 0
data[18]: 18632
data[19]: 12113
data[20]: 0
data[21]: 11612
data[22]: 5247
data[23]: 3431
data[24]: 170
data[25]: 192
data[26]: 0
data[27]: 5000
# "Complete log"
readStates_ = WAIT_FOR_REQ_CONF!!!
w 0x603 [8] 0x40 0x40 0x26 0x00 0x00 0x00 0x00 0x00
readStates_ = WAIT_FOR_DATA!!!
r 0x583 [8] 0x41 0x40 0x26 0x00 0x38 0x00 0x00 0x00
w 0x701 [1] 0x05
w 0x080 [0]
w 0x7E5 [0]
w 0x603 [8] 0x61 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recivedBytes = 7!!!
r 0x583 [8] 0x00 0x18 0x00 0x24 0x00 0x0E 0x00 0x0A
w 0x603 [8] 0x71 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recivedBytes = 14!!!
r 0x583 [8] 0x10 0x00 0x00 0x00 0xC2 0x00 0x00 0x00
w 0x603 [8] 0x61 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recivedBytes = 21!!!
r 0x583 [8] 0x00 0xC2 0x01 0x00 0x00 0x00 0x00 0x35
w 0x603 [8] 0x71 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recivedBytes = 28!!!
r 0x583 [8] 0x10 0x1C 0x84 0x02 0x46 0x1A 0x3C 0x49
w 0x603 [8] 0x61 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recivedBytes = 35!!!
r 0x583 [8] 0x00 0xC2 0x01 0x00 0x00 0x00 0x00 0x00
w 0x603 [8] 0x71 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recivedBytes = 42!!!
r 0x583 [8] 0x10 0x00 0xC8 0x48 0x51 0x2F 0x00 0x00
w 0x603 [8] 0x61 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recivedBytes = 49!!!
r 0x583 [8] 0x00 0x5C 0x2D 0x81 0x14 0x67 0x0D 0xA9
w 0x603 [8] 0x71 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recivedBytes = 56!!!
All data transfered
data[0]: 24
data[1]: 36
data[2]: 14
data[3]: 10
data[4]: 0
data[5]: 194
data[6]: 0
data[7]: 450
data[8]: 0
data[9]: 0
data[10]: 7221
data[11]: 644
data[12]: 6726
data[13]: 18748
data[14]: 450
data[15]: 0
data[16]: 0
data[17]: 0
data[18]: 18632
data[19]: 12113
data[20]: 0
data[21]: 11612
data[22]: 5249
data[23]: 3431
data[24]: 169
data[25]: 191
data[26]: 0
data[27]: 5000
r 0x583 [8] 0x11 0x00 0xBF 0x00 0x00 0x00 0x88 0x13
r 0x280 [0]
r 0x703 [1] 0x05
r 0x280 [0]
w 0x701 [1] 0x05
w 0x080 [0]
w 0x7E5 [0]
# SDO Write:
################################## TEST WRITE SDO#############
WRITEVALUE!!
STATE = WRITE_REQ_TRANSFER
STATE = WRITE_WAIT_FOR_CONF
w 0x603 [8] 0x21 0x90 0x26 0x01 0x07 0x00 0x00 0x00
STATE = WRITE_DATA
r 0x583 [8] 0x60 0x90 0x26 0x01 0x00 0x00 0x00 0x00
w 0x603 [8] 0x20 0x08 0x74 0xE8 0xBE 0xA8 0x5B 0x6B
Example of error frame!!
r 0x583 [8] 0x80 0x08 0x74 0xE8 0x00 0x00 0x02 0x06
################################## TEST WRITE SDO#############
w 0x603 [8] 0x21 0x90 0x26 0x01 0x07 0x00 0x00 0x00 # request upload/write
r 0x583 [8] 0x60 0x90 0x26 0x01 0x00 0x00 0x00 0x00 # Ok from slave
w 0x603 [8] 0x60 0x08 0xF4 0xA9 0xBE 0xC0 0xCB 0xE1 # Send data
r 0x583 [8] 0x01 0x18 0x00 0x24 0x00 0x0E 0x00 0x0A # ???
# Check some pvs
camonitor IOC_TEST:CAN03-PWR_A IOC_TEST:CAN03-PWR_B IOC_TEST:CAN03-PWR_OUT IOC_TEST:CAN03-REFL_OUT IOC_TEST:CAN03-SDO01-Array IOC_TEST:CAN03-PDO01-Array IOC_TEST:CAN03-PWR_A
camonitor IOC_TEST:CAN03-PWR_A IOC_TEST:CAN03-PWR_B IOC_TEST:CAN03-PWR_OUT IOC_TEST:CAN03-REFL_OUT IOC_TEST:CAN03-V_REG IOC_TEST:CAN03-V_TEMP IOC_TEST:CAN03-I_DRV IOC_TEST:CAN03-I_PRE IOC_TEST:CAN03-I_1A IOC_TEST:CAN03-I_2A IOC_TEST:CAN03-V_REFL_SAVE IOC_TEST:CAN03-V_PLUSMON IOC_TEST:CAN03-V_I_DC IOC_TEST:CAN03-I_1B IOC_TEST:CAN03-I_2B IOC_TEST:CAN03-V_12V_MON IOC_TEST:CAN03-VREF_PWR_OPV IOC_TEST:CAN03-V_AUX_IN IOC_TEST:CAN03-V_5V_ACB IOC_TEST:CAN03-V_3V5 IOC_TEST:CAN03-AIR_INLET IOC_TEST:CAN03-AIR_OUTLET IOC_TEST:CAN03-SDO01-Array IOC_TEST:CAN03-PDO01-Array
# Most recent data dump
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
r 0x703 [1] 0x05
r 0x280 [0]
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
r 0x280 [0]
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
r 0x703 [1] 0x05
r 0x280 [0]
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
r 0x280 [0]
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
r 0x703 [1] 0x05
r 0x280 [0]
w 0x7E5 [0]STATE = READ_REQ_TRANSFER analogValues
STATE = READ_WAIT_FOR_CONF analogValues
w 0x080 [0]
w 0x700 [1] 0x05
w 0x603 [8] 0x40 0x40 0x26 0x00 0x00 0x00 0x00 0x00
STATE = READ_WAIT_FOR_DATA analogValues
r 0x583 [8] 0x41 0x40 0x26 0x00 0x38 0x00 0x00 0x00
w 0x603 [8] 0x61 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 7
r 0x583 [8] 0x00 0x18 0x00 0x24 0x00 0x0E 0x00 0x0A
w 0x603 [8] 0x71 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 14
r 0x583 [8] 0x10 0x00 0x00 0x00 0xC5 0x00 0x00 0x00
w 0x603 [8] 0x61 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 21
r 0x583 [8] 0x00 0xC2 0x01 0x00 0x00 0x00 0x00 0x35
w 0x603 [8] 0x71 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 28
r 0x583 [8] 0x10 0x1C 0x84 0x02 0x46 0x1A 0x3C 0x49
w 0x603 [8] 0x61 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 35
r 0x583 [8] 0x00 0xC2 0x01 0x00 0x00 0x00 0x00 0x00
w 0x603 [8] 0x71 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 42
r 0x583 [8] 0x10 0x00 0xC8 0x48 0x51 0x2F 0x00 0x00
w 0x603 [8] 0x61 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 49
r 0x583 [8] 0x00 0x5C 0x2D 0x7F 0x14 0x67 0x0D 0xAA
w 0x603 [8] 0x71 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 56
STATE = READ_IDLE analogValues
All data read from slave SDO.
data[00]: 24
data[01]: 36
data[02]: 14
data[03]: 10
data[04]: 0
data[05]: 197
data[06]: 0
data[07]: 450
data[08]: 0
data[09]: 0
data[10]: 7221
data[11]: 644
data[12]: 6726
data[13]: 18748
data[14]: 450
data[15]: 0
data[16]: 0
data[17]: 0
data[18]: 18632
data[19]: 12113
data[20]: 0
data[21]: 11612
data[22]: 5247
data[23]: 3431
data[24]: 170
data[25]: 193
data[26]: 0
data[27]: 5000
r 0x583 [8] 0x11 0x00 0xC1 0x00 0x00 0x00 0x88 0x13
r 0x280 [0]
r 0x683 [4] 0x00 0x00 0x00 0x00
r 0x280 [0]
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
data[00]: 0
data[01]: 0
data[02]: 16395
data[03]: 8196
r 0x183 [8] 0x00 0x00 0x00 0x00 0x0B 0x40 0x04 0x20
r 0x703 [1] 0x05
r 0x280 [0]
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
r 0x280 [0]
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
r 0x703 [1] 0x05
r 0x280 [0]
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
r 0x280 [0]
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
r 0x703 [1] 0x05
r 0x280 [0]
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
r 0x280 [0]
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
STATE = READ_REQ_TRANSFER analogValues
STATE = READ_WAIT_FOR_CONF analogValues
w 0x603 [8] 0x40 0x40 0x26 0x00 0x00 0x00 0x00 0x00
STATE = READ_WAIT_FOR_DATA analogValues
r 0x583 [8] 0x41 0x40 0x26 0x00 0x38 0x00 0x00 0x00
w 0x603 [8] 0x61 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 7
r 0x583 [8] 0x00 0x18 0x00 0x24 0x00 0x0E 0x00 0x0A
w 0x603 [8] 0x71 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 14
r 0x583 [8] 0x10 0x00 0x00 0x00 0xC5 0x00 0x00 0x00
w 0x603 [8] 0x61 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 21
r 0x583 [8] 0x00 0xC2 0x01 0x00 0x00 0x00 0x00 0x35
w 0x603 [8] 0x71 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 28
r 0x583 [8] 0x10 0x1C 0x84 0x02 0x46 0x1A 0x3C 0x49
w 0x603 [8] 0x61 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 35
r 0x583 [8] 0x00 0xC2 0x01 0x00 0x00 0x00 0x00 0x00
w 0x603 [8] 0x71 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 42
r 0x583 [8] 0x10 0x00 0xC8 0x48 0x51 0x2F 0x00 0x00
w 0x603 [8] 0x61 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 49
r 0x583 [8] 0x00 0x5C 0x2D 0x7F 0x14 0x67 0x0D 0xAA
w 0x603 [8] 0x71 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 56
STATE = READ_IDLE analogValues
All data read from slave SDO.
data[00]: 24
data[01]: 36
data[02]: 14
data[03]: 10
data[04]: 0
data[05]: 197
data[06]: 0
data[07]: 450
data[08]: 0
data[09]: 0
data[10]: 7221
data[11]: 644
data[12]: 6726
data[13]: 18748
data[14]: 450
data[15]: 0
data[16]: 0
data[17]: 0
data[18]: 18632
data[19]: 12113
data[20]: 0
data[21]: 11612
data[22]: 5247
data[23]: 3431
data[24]: 170
data[25]: 193
data[26]: 0
data[27]: 5000
r 0x583 [8] 0x11 0x00 0xC1 0x00 0x00 0x00 0x88 0x13
r 0x280 [0]
r 0x280 [0]
r 0x703 [1] 0x05
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
r 0x280 [0]
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
r 0x280 [0]
r 0x703 [1] 0x05
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
r 0x683 [4] 0x00 0x00 0x00 0x00
r 0x280 [0]
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
data[00]: 0
data[01]: 0
data[02]: 16395
data[03]: 8196
r 0x183 [8] 0x00 0x00 0x00 0x00 0x0B 0x40 0x04 0x20
r 0x703 [1] 0x05
r 0x280 [0]
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
r 0x280 [0]
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
r 0x703 [1] 0x05
r 0x280 [0]
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
STATE = READ_REQ_TRANSFER analogValues
STATE = READ_WAIT_FOR_CONF analogValues
w 0x603 [8] 0x40 0x40 0x26 0x00 0x00 0x00 0x00 0x00
STATE = READ_WAIT_FOR_DATA analogValues
r 0x583 [8] 0x41 0x40 0x26 0x00 0x38 0x00 0x00 0x00
w 0x603 [8] 0x61 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 7
r 0x583 [8] 0x00 0x18 0x00 0x24 0x00 0x0E 0x00 0x0A
w 0x603 [8] 0x71 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 14
r 0x583 [8] 0x10 0x00 0x00 0x00 0xC5 0x00 0x00 0x00
w 0x603 [8] 0x61 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 21
r 0x583 [8] 0x00 0xC2 0x01 0x00 0x00 0x00 0x00 0x35
w 0x603 [8] 0x71 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 28
r 0x583 [8] 0x10 0x1C 0x84 0x02 0x46 0x1A 0x3C 0x49
w 0x603 [8] 0x61 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 35
r 0x583 [8] 0x00 0xC2 0x01 0x00 0x00 0x00 0x00 0x00
w 0x603 [8] 0x71 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 42
r 0x583 [8] 0x10 0x00 0xC8 0x48 0x51 0x2F 0x00 0x00
w 0x603 [8] 0x61 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 49
r 0x583 [8] 0x00 0x5C 0x2D 0x7F 0x14 0x67 0x0D 0xAA
w 0x603 [8] 0x71 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 56
STATE = READ_IDLE analogValues
All data read from slave SDO.
data[00]: 24
data[01]: 36
data[02]: 14
data[03]: 10
data[04]: 0
data[05]: 197
data[06]: 0
data[07]: 450
data[08]: 0
data[09]: 0
data[10]: 7221
data[11]: 644
data[12]: 6726
data[13]: 18748
data[14]: 450
data[15]: 0
data[16]: 0
data[17]: 0
data[18]: 18632
data[19]: 12113
data[20]: 0
data[21]: 11612
data[22]: 5247
data[23]: 3431
data[24]: 170
data[25]: 193
data[26]: 0
data[27]: 5000
r 0x583 [8] 0x11 0x00 0xC1 0x00 0x00 0x00 0x88 0x13
r 0x280 [0]
r 0x280 [0]
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
r 0x280 [0]
r 0x703 [1] 0x05
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
r 0x280 [0]
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
r 0x280 [0]
r 0x703 [1] 0x05
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
r 0x280 [0]
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
r 0x280 [0]
r 0x703 [1] 0x05
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
r 0x683 [4] 0x00 0x00 0x00 0x00
r 0x280 [0]
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
STATE = READ_REQ_TRANSFER analogValues
STATE = READ_WAIT_FOR_CONF analogValues
w 0x603 [8] 0x40 0x40 0x26 0x00 0x00 0x00 0x00 0x00
STATE = READ_WAIT_FOR_DATA analogValues
r 0x583 [8] 0x41 0x40 0x26 0x00 0x38 0x00 0x00 0x00
w 0x603 [8] 0x61 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 7
r 0x583 [8] 0x00 0x18 0x00 0x24 0x00 0x0E 0x00 0x0A
w 0x603 [8] 0x71 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 14
r 0x583 [8] 0x10 0x00 0x00 0x00 0xC5 0x00 0x00 0x00
w 0x603 [8] 0x61 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 21
r 0x583 [8] 0x00 0xC2 0x01 0x00 0x00 0x00 0x00 0x35
w 0x603 [8] 0x71 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 28
r 0x583 [8] 0x10 0x1C 0x84 0x02 0x46 0x1A 0x3C 0x49
w 0x603 [8] 0x61 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 35
r 0x583 [8] 0x00 0xC2 0x01 0x00 0x00 0x00 0x00 0x00
w 0x603 [8] 0x71 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 42
r 0x583 [8] 0x10 0x00 0xC8 0x48 0x51 0x2F 0x00 0x00
w 0x603 [8] 0x61 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 49
r 0x583 [8] 0x00 0x5C 0x2D 0x7F 0x14 0x67 0x0D 0xAA
w 0x603 [8] 0x71 0x40 0x26 0x00 0x00 0x00 0x00 0x00
recived bytes = 56
STATE = READ_IDLE analogValues
All data read from slave SDO.
data[00]: 24
data[01]: 36
data[02]: 14
data[03]: 10
data[04]: 0
data[05]: 197
data[06]: 0
data[07]: 450
data[08]: 0
data[09]: 0
data[10]: 7221
data[11]: 644
data[12]: 6726
data[13]: 18748
data[14]: 450
data[15]: 0
data[16]: 0
data[17]: 0
data[18]: 18632
data[19]: 12113
data[20]: 0
data[21]: 11612
data[22]: 5247
data[23]: 3431
data[24]: 170
data[25]: 193
data[26]: 0
data[27]: 5000
r 0x583 [8] 0x11 0x00 0xC1 0x00 0x00 0x00 0x88 0x13
r 0x280 [0]
data[00]: 0
data[01]: 0
data[02]: 16395
data[03]: 8196
r 0x183 [8] 0x00 0x00 0x00 0x00 0x0B 0x40 0x04 0x20
r 0x280 [0]
r 0x703 [1] 0x05
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
r 0x280 [0]
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
r 0x280 [0]
r 0x703 [1] 0x05
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
r 0x280 [0]
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x280 [0]
r 0x280 [0]
r 0x703 [1] 0x05
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
# Basic configuration write (maybe should write a 4800 (=48%) to byte 3 and 4)
caput -a IOC_TEST:CAN03-SDO02-BasicConfig 7 0 0 0 0 0 0
# or better 48000 VDC_CTRL (48%), fan stops of pmu and amplifier on is LED is not on anymore
caput -a IOC_TEST:CAN03-SDO02-BasicConfig 7 0 0 0 192 18 0 0
This will happen:
WRITEVALUE basicConfig
STATE = WRITE_REQ_TRANSFER basicConfig
STATE = WRITE_WAIT_FOR_CONF basicConfig
w 0x603 [8] 0x21 0x90 0x26 0x01 0x07 0x00 0x00 0x00
writeDataStateMachine basicConfig
STATE = WRITE_DATA basicConfig
r 0x583 [8] 0x60 0x90 0x26 0x01 0x00 0x00 0x00 0x00
w 0x603 [8] 0x01 0x00 0x00 0x00 0xC0 0x12 0x00 0x00
writeDataStateMachine basicConfig
STATE = WRITE_IDLE basicConfig
All data written to slave SDO.
# Amplifier on is bit 0 of byte 0, so to power on just execute:
caput -a IOC_TEST:CAN03-SDO02-BasicConfig 7 1 0 0 192 18 0 0
# After basic configuration the r 280 will stop () this means the pmu now have basic configuration
r 0x583 [8] 0x11 0x00 0xC5 0x00 0x00 0x00 0x88 0x13
r 0x703 [1] 0x05
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
r 0x703 [1] 0x05
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
w 0x7E5 [0]
w 0x080 [0]
w 0x700 [1] 0x05
# Some commands
IOC_TEST:CAN03-PowerOnCmd
IOC_TEST:CAN03-VrefPwrCmd
IOC_TEST:CAN03-VdcCtrlCmd
## Turn amplifier on
caput IOC_TEST:CAN03-PowerOnCmd 1
WRITEVALUE basicConfig
STATE = WRITE_REQ_TRANSFER basicConfig
STATE = WRITE_WAIT_FOR_CONF basicConfig
w 0x603 [8] 0x21 0x90 0x26 0x01 0x07 0x00 0x00 0x00
writeDataStateMachine basicConfig
STATE = WRITE_DATA basicConfig
r 0x583 [8] 0x60 0x90 0x26 0x01 0x00 0x00 0x00 0x00
w 0x603 [8] 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00
writeDataStateMachine basicConfig
STATE = WRITE_IDLE basicConfig
All data written to slave SDO.
data[00]: 1
data[01]: 0
data[02]: 0
data[03]: 0
## Set VrefOwr to 100
caput IOC_TEST:CAN03-VrefPwrCmd 100
NOT WORKING.. Will get the below???
r 0x583 [8] 0x11 0x00 0xC5 0x00 0x00 0x00 0x88 0x13
WRITEVALUE basicConfig
STATE = WRITE_REQ_TRANSFER basicConfig
STATE = WRITE_WAIT_FOR_CONF basicConfig
w 0x603 [8] 0x21 0x90 0x26 0x01 0x07 0x00 0x00 0x00
writeDataStateMachine basicConfig
STATE = WRITE_DATA basicConfig
r 0x583 [8] 0x60 0x90 0x26 0x01 0x00 0x00 0x00 0x00
w 0x603 [8] 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
writeDataStateMachine basicConfig
STATE = WRITE_IDLE basicConfig
All data written to slave SDO.
## Set VdcCtrlCmd to 5000
caput IOC_TEST:CAN03-VdcCtrlCmd 5000
NOT WORKING.. Will get the below???
WRITEVALUE basicConfig
STATE = WRITE_REQ_TRANSFER basicConfig
STATE = WRITE_WAIT_FOR_CONF basicConfig
w 0x603 [8] 0x21 0x90 0x26 0x01 0x07 0x00 0x00 0x00
writeDataStateMachine basicConfig
STATE = WRITE_DATA basicConfig
r 0x583 [8] 0x60 0x90 0x26 0x01 0x00 0x00 0x00 0x00
w 0x603 [8] 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
writeDataStateMachine basicConfig
STATE = WRITE_IDLE basicConfig
All data written to slave SDO.