You are here

Write motor configuration from XML file in 3rd app

1 post / 0 new
jernejm
Offline
Last seen: 1 month 1 week ago
VESC Free
Joined: 2021-11-05 12:51
Posts: 3
Write motor configuration from XML file in 3rd app

Hello,

I am writing my own application in C++ for running Trampa VESC 6MK V. In my program, I manage to integrate functions for running motor and reading parameters, but I can not integrate function for writing motor configuration from default XML file. 

What I did, I took and connected function (from vesc tool) in next order:

void commands::setMcconf ->  void ConfigParams::serialize -> quint32 ConfigParams::getSignature -> ConfigParam *ConfigParams::getParam -> uint32_t Utility::crc32c -> void ConfigParams::setParamSerial ->  void VescInterface::cmdDataToSend -> void Packet::sendPacket -> void VescInterface::packetDataToSend

At this point I believe everything is OK. I compared the array in the last function in my program and in VESC TOOL code (I added there qDebug for checking output) and both of arrays are the same. I get an array of total length 495 bytes (length of conf. data is 489), for example: 03 01E9 0D [488 bytes] 3983 03

But after execution in my application, new parameters are not loaded. I also sniffed raw USB data packages via Device Monitoring Studio after writing parameters in VESC TOOL and somehow, the sent array there is not long 495 (489) bytes, but 464 (458) bytes, for example: 03 01CA 0D [457 bytes] E1CE 03   

So, my question is, what is the right size of array for writing motor configuration (489 bytes or 458) and how is the shortest array created?

Thank you for help