Difference between revisions of "Reading actual drive state with SimpleMotion V2"

From Granite Devices Knowledge Wiki
Jump to: navigation, search
(Created page with "This C++ example shows how to read actual current driven into motor. <syntaxhighlight lang="cpp"> smint32 readout; float actualcurrent; //read raw value of current smRead1Pa...")
(No difference)

Revision as of 11:09, 9 July 2014

This C++ example shows how to read actual current driven into motor.

smint32 readout;
float actualcurrent;
 
//read raw value of current
smRead1Parameter(  handle, nodeAddress, SMP_ACTUAL_TORQUE, &readout );
 
//as raw value is integer in "hardware units" scale, convert it to amperes
const float HWcurrentScale=560;//counts/A, this conversion value is for Argon
actualTorq=float(smint16(ana2))/HWcurrentScale;