Difference between revisions of "Component: Electrical Machines (AllCode)"

From Flowcode Help
Jump to navigationJump to search
(XML import)
 
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
+
{| style="width:50%"
 
 
{| width="50%"
 
 
|-
 
|-
| width="20%" style="color: gray;" | Author
+
| width="20%" style="color:gray;" | Author
 
| Matrix TSL
 
| Matrix TSL
 
|-
 
|-
| width="20%" style="color: gray;" | Version
+
| width="20%" style="color:gray;" | Version
| 2.0 (Release)
+
| 2.0
 
|-
 
|-
| width="20%" style="color: gray;" | Category
+
| width="20%" style="color:gray;" | Category
 
| AllCode
 
| AllCode
 
|}
 
|}
  
  
 +
==Electrical Machines component==
 +
A set of functions to communicate with the Matrix EM hardware.  Allows the functions to be easily standardised across all SCADA programs.
  
==[[File:Component Icon c3e5eb13_e03d_4ca6_be4d_1c63ad107a35.png|Image]] Electrical Machines component==
+
==Component Source Code==
A set of functions to communicate with the Matrix EM hardware.
 
Allows the functions to be easily standardised across all SCADA programs.
 
  
==Examples==
+
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_EM_Functions.fcsx FC_Comp_Source_EM_Functions.fcsx]
''<span style="color:red;">No additional examples</span>''
 
  
 +
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_EM_Functions.fcsx FC_Comp_Source_EM_Functions.fcsx]
  
==Downloadable macro reference==
+
==Detailed description==
  
''This component does not contain any downloadable macros''
 
  
==Simulation macro reference==
 
  
===<span style="font-weight: normal;"><u><tt>GetLogDataReady</tt></u></span>===
 
Checks to see if the logging is complete and ready to read.
 
  
'''Parameters'''
 
  
:''This macro has no parameters''
 
  
  
'''Return value'''
 
  
:[[Variable Types|BOOL]] : Returns true if the operation is a success, else false
 
  
  
===<span style="font-weight: normal;"><u><tt>GetRPM</tt></u></span>===
 
Reads the speed in RPM
 
  
'''Parameters'''
 
  
:''This macro has no parameters''
 
  
  
'''Return value'''
 
  
:[[Variable Types|UINT]]
+
''No detailed description exists yet for this component''
  
 +
==Examples==
  
===<span style="font-weight: normal;"><u><tt>GetWeight</tt></u></span>===
 
Reads the voltage of a single channel
 
  
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''Scale''
 
::Range: 0-1 -  0=Weight, 1=Torque
 
  
  
'''Return value'''
 
  
:[[Variable Types|FLOAT]]
 
  
  
===<span style="font-weight: normal;"><u><tt>SetControlKP</tt></u></span>===
 
''<span style="color:red;">No additional information</span>''
 
  
  
  
'''Parameters'''
 
  
:[[Variable Types|FLOAT]] ''Value''
 
  
  
'''Return value'''
 
  
:''This call does not return a value''
 
  
 +
''<span style="color:red;">No additional examples</span>''
  
===<span style="font-weight: normal;"><u><tt>SetControlSetpoint</tt></u></span>===
 
''<span style="color:red;">No additional information</span>''
 
  
  
  
'''Parameters'''
 
  
:[[Variable Types|FLOAT]] ''Value''
 
  
  
'''Return value'''
 
  
:''This call does not return a value''
 
  
  
===<span style="font-weight: normal;"><u><tt>GetAPIVersion</tt></u></span>===
 
Reads the API firmware version
 
  
'''Parameters'''
 
  
:''This macro has no parameters''
+
==Macro reference==
  
 +
===Get3PhaseMode===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Get3PhaseMode'''
 +
|-
 +
| colspan="2" | Checks to see if the brushless mode is enabled&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Return value'''
 
  
:[[Variable Types|BYTE]]
+
===GetAPIVersion===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetAPIVersion'''
 +
|-
 +
| colspan="2" | Reads the API firmware version&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
===<span style="font-weight: normal;"><u><tt>GetLogData</tt></u></span>===
+
===GetAbsPosition===
Gets a 64-byte packet of log data. 250 packets make up a single log.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetAbsPosition'''
 +
|-
 +
| colspan="2" | Reads the absolute position of the encoder&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u32-icon.png]] - ULONG
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
Returns 0 if comms failed and 1 if comms OK
 
  
'''Parameters'''
+
===GetCommsOK===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetCommsOK'''
 +
|-
 +
| colspan="2" | Checks if comms are ok and stable&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:[[Variable Types|BYTE]] ''Buffer''
 
::Buffer to store the incoming log data
 
  
 +
===GetControlFeedback===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetControlFeedback'''
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Return value'''
 
  
:[[Variable Types|BOOL]] : Returns true if the operation is a success, else false
+
===GetControlOutputs===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetControlOutputs'''
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
===<span style="font-weight: normal;"><u><tt>GetDataArray</tt></u></span>===
+
===GetCurrent===
Collects a data array from the EM box full of control data.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetCurrent'''
 +
|-
 +
| colspan="2" | Reads the current of a single channel&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | Range: 0-6 - 0=DC1, 1=DC2, 2=U, 3=V, 4=W, 5=Dyno, 6=I, 7=TotalDriver&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
Each set of data includes:
 
  
Setpoint, Feedback, Poutput, Ioutput, Doutput
+
===GetDataArray===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetDataArray'''
 +
|-
 +
| colspan="2" | Collects a data array from the EM box full of control data. Each set of data includes: Setpoint, Feedback, Poutput, Ioutput, Doutput Returns the number of complete data samples collected.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 +
| width="90%" | data
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
Returns the number of complete data samples collected.
 
  
'''Parameters'''
+
===GetErrorStatus===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetErrorStatus'''
 +
|-
 +
| colspan="2" | Gets the current error status. Error status will automatically resolve itself once the causing condition has been removed. 0 = No Error 1 = Error - likely over current or brownout&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:[[Variable Types|FLOAT]] ''data''
 
  
 +
===GetLogData===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetLogData'''
 +
|-
 +
| colspan="2" | Gets a 64-byte packet of log data. 250 packets make up a single log. Returns 0 if comms failed and 1 if comms OK&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Buffer
 +
|-
 +
| colspan="2" | Buffer to store the incoming log data&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Return value'''
 
  
:[[Variable Types|BYTE]]
+
===GetLogDataReady===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetLogDataReady'''
 +
|-
 +
| colspan="2" | Checks to see if the logging is complete and ready to read.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
===<span style="font-weight: normal;"><u><tt>GetSafetySwitch</tt></u></span>===
+
===GetLogStartAngle===
Reads the safety switch
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetLogStartAngle'''
 +
|-
 +
| colspan="2" | Collects the U Phase angle at the start of logging.  Used to calculate and re-create the 3Phase voltage data.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Parameters'''
 
  
:''This macro has no parameters''
+
===GetMotorDirection===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetMotorDirection'''
 +
|-
 +
| colspan="2" | Reads the motor direction&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
'''Return value'''
+
===GetRPM===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetRPM'''
 +
|-
 +
| colspan="2" | Reads the speed in RPM&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:[[Variable Types|UINT]]
 
  
 +
===GetSafetySwitch===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetSafetySwitch'''
 +
|-
 +
| colspan="2" | Reads the safety switch&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>SetControlKI</tt></u></span>===
 
''<span style="color:red;">No additional information</span>''
 
  
 +
===GetVoltage===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetVoltage'''
 +
|-
 +
| colspan="2" | Reads the voltage of a single channel&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | Range: 0-5 -  0=DC1, 1=DC2, 2=U, 3=V, 4=W, 5=VEXT&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
'''Parameters'''
+
===GetWeight===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetWeight'''
 +
|-
 +
| colspan="2" | Reads the voltage of a single channel&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Scale
 +
|-
 +
| colspan="2" | Range: 0-1 -  0=Weight, 1=Torque&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:[[Variable Types|FLOAT]] ''Value''
 
  
 +
===Initialise===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 +
|-
 +
| colspan="2" | Returns 1 if the connection is ok and communications have been established&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | MotorType
 +
|-
 +
| colspan="2" | 0=DC, 1=1Phase, 2=3Phase, 3=AngleControl&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Return value'''
 
  
:''This call does not return a value''
+
===SetAbsPosition===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetAbsPosition'''
 +
|-
 +
| colspan="2" | Resets the absolute motor position to 0&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
===<span style="font-weight: normal;"><u><tt>ZeroLoadCell</tt></u></span>===
+
===SetActive===
''<span style="color:red;">No additional information</span>''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetActive'''
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 +
| width="90%" | Active
 +
|-
 +
| colspan="2" | 0=Off, 1=On&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
 +
===SetCapacitorBank===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetCapacitorBank'''
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Cap
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Parameters'''
 
  
:''This macro has no parameters''
+
===SetControlKD===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetControlKD'''
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 +
| width="90%" | Value
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
'''Return value'''
+
===SetControlKI===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetControlKI'''
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 +
| width="90%" | Value
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:''This call does not return a value''
 
  
 +
===SetControlKP===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetControlKP'''
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 +
| width="90%" | Value
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>SetControlMaxDrivePercentage</tt></u></span>===
 
''<span style="color:red;">No additional information</span>''
 
  
 +
===SetControlMaxDrivePercentage===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetControlMaxDrivePercentage'''
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 +
| width="90%" | Value
 +
|-
 +
| colspan="2" | Range 0.0-1.0&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
'''Parameters'''
+
===SetControlSetpoint===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetControlSetpoint'''
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 +
| width="90%" | Value
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:[[Variable Types|FLOAT]] ''Value''
 
::Range 0.0-1.0
 
  
 +
===SetDriveMode===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetDriveMode'''
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Mode
 +
|-
 +
| colspan="2" | 0=PWM, 1=On/Off/Float&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Return value'''
 
  
:''This call does not return a value''
+
===SetDynoLoad===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetDynoLoad'''
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 +
| width="90%" | Load
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
===<span style="font-weight: normal;"><u><tt>SetMotorType</tt></u></span>===
+
===SetFan===
''<span style="color:red;">No additional information</span>''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetFan'''
 +
|-
 +
| colspan="2" | |Sets the speed of the FAN from 0 (MIN)  to 3000 (MAX)&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Speed
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
 +
===SetFrequency===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetFrequency'''
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Frequency
 +
|-
 +
| colspan="2" | Frequency of sine wave in Hz&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''MotorType''
+
===SetLoadCellCalibration===
::0=DC, 1=1 Phase, 2=3 Phase
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetLoadCellCalibration'''
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 +
| width="90%" | Value
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
'''Return value'''
+
===SetMotorDirection===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetMotorDirection'''
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 +
| width="90%" | MotorDirection
 +
|-
 +
| colspan="2" | 0=FW, 1=BW&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:''This call does not return a value''
 
  
 +
===SetMotorType===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetMotorType'''
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | MotorType
 +
|-
 +
| colspan="2" | 0=DC, 1=1 Phase, 2=3 Phase&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>SetLoadCellCalibration</tt></u></span>===
 
''<span style="color:red;">No additional information</span>''
 
  
 +
===SetTCPProps===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetTCPProps'''
 +
|-
 +
| colspan="2" | Sets the TCP IP address and Port&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | IP0
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | IP1
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | IP2
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | IP3
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Port
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
'''Parameters'''
+
===SetThreePhaseDriveMode===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetThreePhaseDriveMode'''
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
 +
| width="90%" | Mode
 +
|-
 +
| colspan="2" | 0=Simple, 1=Accurate&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:[[Variable Types|FLOAT]] ''Value''
 
  
 
+
===SetVoltage===
'''Return value'''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
:''This call does not return a value''
+
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetVoltage'''
 
+
|-
===<span style="font-weight: normal;"><u><tt>GetVoltage</tt></u></span>===
+
| colspan="2" | Sets the DC Voltage from 0 to 24V&nbsp;
Reads the voltage of a single channel
+
|-
 
+
|-
'''Parameters'''
+
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
 
+
| width="90%" | Voltage
:[[Variable Types|BYTE]] ''Channel''
+
|-
::Range: 0-5 -  0=DC1, 1=DC2, 2=U, 3=V, 4=W, 5=VEXT
+
| colspan="2" | &nbsp;
 
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
'''Return value'''
+
| width="90%" | Index
 
+
|-
:[[Variable Types|FLOAT]]
+
| colspan="2" | &nbsp;
 
+
|-
 
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
===<span style="font-weight: normal;"><u><tt>GetControlFeedback</tt></u></span>===
+
| width="90%" style="border-top: 2px solid #000;" | ''Return''
''<span style="color:red;">No additional information</span>''
+
|}
 
 
 
 
 
 
'''Parameters'''
 
 
 
:''This macro has no parameters''
 
 
 
 
 
'''Return value'''
 
 
 
:[[Variable Types|FLOAT]]
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>SetControlKD</tt></u></span>===
 
''<span style="color:red;">No additional information</span>''
 
 
 
 
 
 
 
'''Parameters'''
 
 
 
:[[Variable Types|FLOAT]] ''Value''
 
 
 
 
 
'''Return value'''
 
 
 
:''This call does not return a value''
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>SetCapacitorBank</tt></u></span>===
 
''<span style="color:red;">No additional information</span>''
 
 
 
 
 
 
 
'''Parameters'''
 
 
 
:[[Variable Types|BYTE]] ''Cap''
 
 
 
 
 
'''Return value'''
 
 
 
:''This call does not return a value''
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>GetCommsOK</tt></u></span>===
 
Checks if comms are ok and stable
 
 
 
'''Parameters'''
 
 
 
:''This macro has no parameters''
 
 
 
 
 
'''Return value'''
 
 
 
:[[Variable Types|BOOL]] : Returns true if the operation is a success, else false
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>GetLogStartAngle</tt></u></span>===
 
Collects the U Phase angle at the start of logging.
 
 
 
Used to calculate and re-create the 3Phase voltage data.
 
 
 
'''Parameters'''
 
 
 
:''This macro has no parameters''
 
 
 
 
 
'''Return value'''
 
 
 
:[[Variable Types|BYTE]]
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>SetVoltage</tt></u></span>===
 
Sets the DC Voltage from 0 to 24V
 
 
 
'''Parameters'''
 
 
 
:[[Variable Types|FLOAT]] ''Voltage''
 
 
 
:[[Variable Types|BYTE]] ''Index''
 
 
 
 
 
'''Return value'''
 
 
 
:''This call does not return a value''
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>Get3PhaseMode</tt></u></span>===
 
Checks to see if the brushless mode is enabled
 
 
 
'''Parameters'''
 
 
 
:''This macro has no parameters''
 
 
 
 
 
'''Return value'''
 
 
 
:[[Variable Types|BOOL]] : Returns true if the operation is a success, else false
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>GetAbsPosition</tt></u></span>===
 
Reads the absolute position of the encoder
 
 
 
'''Parameters'''
 
 
 
:''This macro has no parameters''
 
 
 
 
 
'''Return value'''
 
 
 
:[[Variable Types|ULONG]]
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>SetFan</tt></u></span>===
 
|Sets the speed of the FAN from 0 (MIN)  to 3000 (MAX)
 
 
 
'''Parameters'''
 
 
 
:[[Variable Types|UINT]] ''Speed''
 
 
 
 
 
'''Return value'''
 
 
 
:''This call does not return a value''
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>SetMotorDirection</tt></u></span>===
 
''<span style="color:red;">No additional information</span>''
 
 
 
 
 
 
 
'''Parameters'''
 
 
 
:[[Variable Types|BOOL]] ''MotorDirection''
 
::0=FW, 1=BW
 
 
 
 
 
'''Return value'''
 
 
 
:''This call does not return a value''
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>GetMotorDirection</tt></u></span>===
 
Reads the motor direction
 
 
 
'''Parameters'''
 
 
 
:''This macro has no parameters''
 
 
 
 
 
'''Return value'''
 
 
 
:[[Variable Types|UINT]]
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>SetThreePhaseDriveMode</tt></u></span>===
 
''<span style="color:red;">No additional information</span>''
 
 
 
 
 
 
 
'''Parameters'''
 
 
 
:[[Variable Types|BOOL]] ''Mode''
 
::0=Simple, 1=Accurate
 
 
 
 
 
'''Return value'''
 
 
 
:''This call does not return a value''
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>GetCurrent</tt></u></span>===
 
Reads the current of a single channel
 
 
 
'''Parameters'''
 
 
 
:[[Variable Types|BYTE]] ''Channel''
 
::Range: 0-6 - 0=DC1, 1=DC2, 2=U, 3=V, 4=W, 5=Dyno, 6=I, 7=TotalDriver
 
 
 
 
 
'''Return value'''
 
 
 
:[[Variable Types|FLOAT]]
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>SetFrequency</tt></u></span>===
 
''<span style="color:red;">No additional information</span>''
 
 
 
 
 
 
 
'''Parameters'''
 
 
 
:[[Variable Types|UINT]] ''Frequency''
 
::Frequency of sine wave in Hz
 
 
 
 
 
'''Return value'''
 
 
 
:''This call does not return a value''
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>SetDynoLoad</tt></u></span>===
 
''<span style="color:red;">No additional information</span>''
 
 
 
 
 
 
 
'''Parameters'''
 
 
 
:[[Variable Types|FLOAT]] ''Load''
 
 
 
 
 
'''Return value'''
 
 
 
:''This call does not return a value''
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>GetErrorStatus</tt></u></span>===
 
Gets the current error status.
 
 
 
Error status will automatically resolve itself once the causing condition has been removed.
 
 
 
0 = No Error
 
 
 
1 = Error - likely over current or brownout
 
 
 
'''Parameters'''
 
 
 
:''This macro has no parameters''
 
 
 
 
 
'''Return value'''
 
 
 
:[[Variable Types|BYTE]]
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>GetControlOutputs</tt></u></span>===
 
''<span style="color:red;">No additional information</span>''
 
 
 
 
 
 
 
'''Parameters'''
 
 
 
:[[Variable Types|FLOAT]] ''Data''
 
 
 
 
 
'''Return value'''
 
 
 
:''This call does not return a value''
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>SetActive</tt></u></span>===
 
''<span style="color:red;">No additional information</span>''
 
 
 
 
 
 
 
'''Parameters'''
 
 
 
:[[Variable Types|BOOL]] ''Active''
 
::0=Off, 1=On
 
 
 
 
 
'''Return value'''
 
 
 
:''This call does not return a value''
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>SetDriveMode</tt></u></span>===
 
''<span style="color:red;">No additional information</span>''
 
 
 
 
 
 
 
'''Parameters'''
 
 
 
:[[Variable Types|BYTE]] ''Mode''
 
::0=PWM, 1=On/Off/Float
 
 
 
 
 
'''Return value'''
 
 
 
:''This call does not return a value''
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>SetTCPProps</tt></u></span>===
 
Sets the TCP IP address and Port
 
 
 
'''Parameters'''
 
 
 
:[[Variable Types|BYTE]] ''IP0''
 
 
 
:[[Variable Types|BYTE]] ''IP1''
 
 
 
:[[Variable Types|BYTE]] ''IP2''
 
 
 
:[[Variable Types|BYTE]] ''IP3''
 
 
 
:[[Variable Types|UINT]] ''Port''
 
 
 
 
 
'''Return value'''
 
 
 
:''This call does not return a value''
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>SetAbsPosition</tt></u></span>===
 
Resets the absolute motor position to 0
 
 
 
'''Parameters'''
 
 
 
:''This macro has no parameters''
 
 
 
 
 
'''Return value'''
 
 
 
:''This call does not return a value''
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>Initialise</tt></u></span>===
 
Returns 1 if the connection is ok and communications have been established
 
 
 
'''Parameters'''
 
 
 
:[[Variable Types|BYTE]] ''MotorType''
 
::0=DC, 1=1Phase, 2=3Phase, 3=AngleControl
 
 
 
 
 
'''Return value'''
 
 
 
:[[Variable Types|BOOL]] : Returns true if the operation is a success, else false
 
  
  
 +
===ZeroLoadCell===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ZeroLoadCell'''
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
 
==Property reference==
 
==Property reference==
<span style="font-weight: normal;"><u>Comms Mode</u></span>
 
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''CommsMode''.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
''<span style="color:red;">No additional information</span>''
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
 
+
|-
 
+
|-
<span style="font-weight: normal;"><u>Stop On Error</u></span>
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Communications
This property is of type ''True or false'' and can be referenced with the variable name ''StopOnError''.
+
|-
 
+
|-
Automatically allows the runtime to stop if there is a communications error.
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Comms Mode
<span style="font-weight: normal;"><u>Autodetect Port</u></span>
+
|-
 
+
| colspan="2" | &nbsp;
This property is of type ''True or false'' and can be referenced with the variable name ''AutoDetect''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
''<span style="color:red;">No additional information</span>''
+
| width="90%" | Stop On Error
 
+
|-
 
+
| colspan="2" | Automatically allows the runtime to stop if there is a communications error.&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Network Interface</u></span>
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | USB Communications
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''NetworkComms1::NetworkInterface''.
+
|-
 
+
|-
Some computers may have several network interfaces such as ethernet ports and wifi access.
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
+
| width="90%" | Autodetect Port
Select the correct network interface for the network you wish to connect to.
+
|-
 
+
| colspan="2" | &nbsp;
Use the IP address to confirm you are connected to the right network.
+
|-
 
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
<span style="font-weight: normal;"><u>IP Address</u></span>
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Runtime Statistics
 
+
|-
This property is of type ''Line of text'' and can be referenced with the variable name ''NetworkComms1::IPAddress''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
IP Address of the selected network interface.
+
| width="90%" | Console Data
 
+
|-
<span style="font-weight: normal;"><u>EM Box IP Address</u></span>
+
| colspan="2" | Allow console data to be generated showing the high level EM communications and returns&nbsp;
 
+
|}
This property is of type ''Line of text'' and can be referenced with the variable name ''BoxIP''.
 
 
 
''<span style="color:red;">No additional information</span>''
 
 
 
 
 
 
 
<span style="font-weight: normal;"><u>EM Box Port</u></span>
 
 
 
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''BoxPort''.
 
 
 
''<span style="color:red;">No additional information</span>''
 
 
 
 
 
 
 
<span style="font-weight: normal;"><u>Console Data</u></span>
 
 
 
This property is of type ''True or false'' and can be referenced with the variable name ''ConsoleData''.
 
 
 
Allow console data to be generated showing the high level EM communications and returns
 

Latest revision as of 13:10, 7 February 2023

Author Matrix TSL
Version 2.0
Category AllCode


Electrical Machines component

A set of functions to communicate with the Matrix EM hardware. Allows the functions to be easily standardised across all SCADA programs.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_EM_Functions.fcsx

Please click here to view the component source code (Beta): FC_Comp_Source_EM_Functions.fcsx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples







Macro reference

Get3PhaseMode

Fc9-comp-macro.png Get3PhaseMode
Checks to see if the brushless mode is enabled 
Fc9-bool-icon.png - BOOL Return


GetAPIVersion

Fc9-comp-macro.png GetAPIVersion
Reads the API firmware version 
Fc9-u8-icon.png - BYTE Return


GetAbsPosition

Fc9-comp-macro.png GetAbsPosition
Reads the absolute position of the encoder 
Fc9-u32-icon.png - ULONG Return


GetCommsOK

Fc9-comp-macro.png GetCommsOK
Checks if comms are ok and stable 
Fc9-bool-icon.png - BOOL Return


GetControlFeedback

Fc9-comp-macro.png GetControlFeedback
 
Fc9-f32-icon.png - FLOAT Return


GetControlOutputs

Fc9-comp-macro.png GetControlOutputs
 
Fc9-f32-icon.png - FLOAT Data
 
Fc9-void-icon.png - VOID Return


GetCurrent

Fc9-comp-macro.png GetCurrent
Reads the current of a single channel 
Fc9-u8-icon.png - BYTE Channel
Range: 0-6 - 0=DC1, 1=DC2, 2=U, 3=V, 4=W, 5=Dyno, 6=I, 7=TotalDriver 
Fc9-f32-icon.png - FLOAT Return


GetDataArray

Fc9-comp-macro.png GetDataArray
Collects a data array from the EM box full of control data. Each set of data includes: Setpoint, Feedback, Poutput, Ioutput, Doutput Returns the number of complete data samples collected. 
Fc9-f32-icon.png - FLOAT data
 
Fc9-u8-icon.png - BYTE Return


GetErrorStatus

Fc9-comp-macro.png GetErrorStatus
Gets the current error status. Error status will automatically resolve itself once the causing condition has been removed. 0 = No Error 1 = Error - likely over current or brownout 
Fc9-u8-icon.png - BYTE Return


GetLogData

Fc9-comp-macro.png GetLogData
Gets a 64-byte packet of log data. 250 packets make up a single log. Returns 0 if comms failed and 1 if comms OK 
Fc9-u8-icon.png - BYTE Buffer
Buffer to store the incoming log data 
Fc9-bool-icon.png - BOOL Return


GetLogDataReady

Fc9-comp-macro.png GetLogDataReady
Checks to see if the logging is complete and ready to read. 
Fc9-bool-icon.png - BOOL Return


GetLogStartAngle

Fc9-comp-macro.png GetLogStartAngle
Collects the U Phase angle at the start of logging. Used to calculate and re-create the 3Phase voltage data. 
Fc9-u8-icon.png - BYTE Return


GetMotorDirection

Fc9-comp-macro.png GetMotorDirection
Reads the motor direction 
Fc9-u16-icon.png - UINT Return


GetRPM

Fc9-comp-macro.png GetRPM
Reads the speed in RPM 
Fc9-u16-icon.png - UINT Return


GetSafetySwitch

Fc9-comp-macro.png GetSafetySwitch
Reads the safety switch 
Fc9-u16-icon.png - UINT Return


GetVoltage

Fc9-comp-macro.png GetVoltage
Reads the voltage of a single channel 
Fc9-u8-icon.png - BYTE Channel
Range: 0-5 - 0=DC1, 1=DC2, 2=U, 3=V, 4=W, 5=VEXT 
Fc9-f32-icon.png - FLOAT Return


GetWeight

Fc9-comp-macro.png GetWeight
Reads the voltage of a single channel 
Fc9-u8-icon.png - BYTE Scale
Range: 0-1 - 0=Weight, 1=Torque 
Fc9-f32-icon.png - FLOAT Return


Initialise

Fc9-comp-macro.png Initialise
Returns 1 if the connection is ok and communications have been established 
Fc9-u8-icon.png - BYTE MotorType
0=DC, 1=1Phase, 2=3Phase, 3=AngleControl 
Fc9-bool-icon.png - BOOL Return


SetAbsPosition

Fc9-comp-macro.png SetAbsPosition
Resets the absolute motor position to 0 
Fc9-void-icon.png - VOID Return


SetActive

Fc9-comp-macro.png SetActive
 
Fc9-bool-icon.png - BOOL Active
0=Off, 1=On 
Fc9-void-icon.png - VOID Return


SetCapacitorBank

Fc9-comp-macro.png SetCapacitorBank
 
Fc9-u8-icon.png - BYTE Cap
 
Fc9-void-icon.png - VOID Return


SetControlKD

Fc9-comp-macro.png SetControlKD
 
Fc9-f32-icon.png - FLOAT Value
 
Fc9-void-icon.png - VOID Return


SetControlKI

Fc9-comp-macro.png SetControlKI
 
Fc9-f32-icon.png - FLOAT Value
 
Fc9-void-icon.png - VOID Return


SetControlKP

Fc9-comp-macro.png SetControlKP
 
Fc9-f32-icon.png - FLOAT Value
 
Fc9-void-icon.png - VOID Return


SetControlMaxDrivePercentage

Fc9-comp-macro.png SetControlMaxDrivePercentage
 
Fc9-f32-icon.png - FLOAT Value
Range 0.0-1.0 
Fc9-void-icon.png - VOID Return


SetControlSetpoint

Fc9-comp-macro.png SetControlSetpoint
 
Fc9-f32-icon.png - FLOAT Value
 
Fc9-void-icon.png - VOID Return


SetDriveMode

Fc9-comp-macro.png SetDriveMode
 
Fc9-u8-icon.png - BYTE Mode
0=PWM, 1=On/Off/Float 
Fc9-void-icon.png - VOID Return


SetDynoLoad

Fc9-comp-macro.png SetDynoLoad
 
Fc9-f32-icon.png - FLOAT Load
 
Fc9-void-icon.png - VOID Return


SetFan

Fc9-comp-macro.png SetFan
|Sets the speed of the FAN from 0 (MIN) to 3000 (MAX) 
Fc9-u16-icon.png - UINT Speed
 
Fc9-void-icon.png - VOID Return


SetFrequency

Fc9-comp-macro.png SetFrequency
 
Fc9-u16-icon.png - UINT Frequency
Frequency of sine wave in Hz 
Fc9-void-icon.png - VOID Return


SetLoadCellCalibration

Fc9-comp-macro.png SetLoadCellCalibration
 
Fc9-f32-icon.png - FLOAT Value
 
Fc9-void-icon.png - VOID Return


SetMotorDirection

Fc9-comp-macro.png SetMotorDirection
 
Fc9-bool-icon.png - BOOL MotorDirection
0=FW, 1=BW 
Fc9-void-icon.png - VOID Return


SetMotorType

Fc9-comp-macro.png SetMotorType
 
Fc9-u8-icon.png - BYTE MotorType
0=DC, 1=1 Phase, 2=3 Phase 
Fc9-void-icon.png - VOID Return


SetTCPProps

Fc9-comp-macro.png SetTCPProps
Sets the TCP IP address and Port 
Fc9-u8-icon.png - BYTE IP0
 
Fc9-u8-icon.png - BYTE IP1
 
Fc9-u8-icon.png - BYTE IP2
 
Fc9-u8-icon.png - BYTE IP3
 
Fc9-u16-icon.png - UINT Port
 
Fc9-void-icon.png - VOID Return


SetThreePhaseDriveMode

Fc9-comp-macro.png SetThreePhaseDriveMode
 
Fc9-bool-icon.png - BOOL Mode
0=Simple, 1=Accurate 
Fc9-void-icon.png - VOID Return


SetVoltage

Fc9-comp-macro.png SetVoltage
Sets the DC Voltage from 0 to 24V 
Fc9-f32-icon.png - FLOAT Voltage
 
Fc9-u8-icon.png - BYTE Index
 
Fc9-void-icon.png - VOID Return


ZeroLoadCell

Fc9-comp-macro.png ZeroLoadCell
 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Communications
Fc9-type-16-icon.png Comms Mode
 
Fc9-type-7-icon.png Stop On Error
Automatically allows the runtime to stop if there is a communications error. 
Fc9-conn-icon.png USB Communications
Fc9-type-7-icon.png Autodetect Port
 
Fc9-conn-icon.png Runtime Statistics
Fc9-type-7-icon.png Console Data
Allow console data to be generated showing the high level EM communications and returns