Difference between revisions of "Component: Electrical Machines (AllCode)"
From Flowcode Help
Jump to navigationJump to searchLine 57: | Line 57: | ||
''<span style="color:red;">No additional examples</span>'' | ''<span style="color:red;">No additional examples</span>'' | ||
+ | |||
+ | |||
Line 63: | Line 65: | ||
==Macro reference== | ==Macro reference== | ||
+ | ===GetLogDataReady=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 76: | Line 79: | ||
+ | ===GetRPM=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 89: | Line 93: | ||
+ | ===GetWeight=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 107: | Line 112: | ||
+ | ===SetControlKP=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 125: | Line 131: | ||
+ | ===SetControlSetpoint=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 143: | Line 150: | ||
+ | ===GetAPIVersion=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 156: | Line 164: | ||
+ | ===GetLogData=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 174: | Line 183: | ||
+ | ===GetDataArray=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 192: | Line 202: | ||
+ | ===GetSafetySwitch=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 205: | Line 216: | ||
+ | ===SetControlKI=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 223: | Line 235: | ||
+ | ===ZeroLoadCell=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 236: | Line 249: | ||
+ | ===SetControlMaxDrivePercentage=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 254: | Line 268: | ||
+ | ===SetMotorType=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 272: | Line 287: | ||
+ | ===SetLoadCellCalibration=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 290: | Line 306: | ||
+ | ===GetVoltage=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 308: | Line 325: | ||
+ | ===GetControlFeedback=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 321: | Line 339: | ||
+ | ===SetControlKD=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 339: | Line 358: | ||
+ | ===SetCapacitorBank=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 357: | Line 377: | ||
+ | ===GetCommsOK=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 370: | Line 391: | ||
+ | ===GetLogStartAngle=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 383: | Line 405: | ||
+ | ===SetVoltage=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 406: | Line 429: | ||
+ | ===Get3PhaseMode=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 419: | Line 443: | ||
+ | ===GetAbsPosition=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 432: | Line 457: | ||
+ | ===SetFan=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 450: | Line 476: | ||
+ | ===SetMotorDirection=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 468: | Line 495: | ||
+ | ===GetMotorDirection=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 481: | Line 509: | ||
+ | ===SetThreePhaseDriveMode=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 499: | Line 528: | ||
+ | ===GetCurrent=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 517: | Line 547: | ||
+ | ===SetFrequency=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 535: | Line 566: | ||
+ | ===SetDynoLoad=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 553: | Line 585: | ||
+ | ===GetErrorStatus=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 566: | Line 599: | ||
+ | ===GetControlOutputs=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 584: | Line 618: | ||
+ | ===SetActive=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 602: | Line 637: | ||
+ | ===SetDriveMode=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 620: | Line 656: | ||
+ | ===SetTCPProps=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 658: | Line 695: | ||
+ | ===SetAbsPosition=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 671: | Line 709: | ||
+ | ===Initialise=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- |
Revision as of 11:49, 3 February 2023
Author | Matrix TSL |
Version | 2.0 |
Category | AllCode |
Contents
- 1 Electrical Machines component
- 2 Component Source Code
- 3 Detailed description
- 4 Examples
- 5 Macro reference
- 5.1 GetLogDataReady
- 5.2 GetRPM
- 5.3 GetWeight
- 5.4 SetControlKP
- 5.5 SetControlSetpoint
- 5.6 GetAPIVersion
- 5.7 GetLogData
- 5.8 GetDataArray
- 5.9 GetSafetySwitch
- 5.10 SetControlKI
- 5.11 ZeroLoadCell
- 5.12 SetControlMaxDrivePercentage
- 5.13 SetMotorType
- 5.14 SetLoadCellCalibration
- 5.15 GetVoltage
- 5.16 GetControlFeedback
- 5.17 SetControlKD
- 5.18 SetCapacitorBank
- 5.19 GetCommsOK
- 5.20 GetLogStartAngle
- 5.21 SetVoltage
- 5.22 Get3PhaseMode
- 5.23 GetAbsPosition
- 5.24 SetFan
- 5.25 SetMotorDirection
- 5.26 GetMotorDirection
- 5.27 SetThreePhaseDriveMode
- 5.28 GetCurrent
- 5.29 SetFrequency
- 5.30 SetDynoLoad
- 5.31 GetErrorStatus
- 5.32 GetControlOutputs
- 5.33 SetActive
- 5.34 SetDriveMode
- 5.35 SetTCPProps
- 5.36 SetAbsPosition
- 5.37 Initialise
- 6 Property reference
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
GetLogDataReady
![]() |
GetLogDataReady |
Checks to see if the logging is complete and ready to read. | |
![]() |
Return |
GetRPM
![]() |
GetRPM |
Reads the speed in RPM | |
![]() |
Return |
GetWeight
![]() |
GetWeight |
Reads the voltage of a single channel | |
![]() |
Scale |
Range: 0-1 - 0=Weight, 1=Torque | |
![]() |
Return |
SetControlKP
![]() |
SetControlKP |
![]() |
Value |
![]() |
Return |
SetControlSetpoint
![]() |
SetControlSetpoint |
![]() |
Value |
![]() |
Return |
GetAPIVersion
![]() |
GetAPIVersion |
Reads the API firmware version | |
![]() |
Return |
GetLogData
![]() |
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 | |
![]() |
Buffer |
Buffer to store the incoming log data | |
![]() |
Return |
GetDataArray
GetSafetySwitch
![]() |
GetSafetySwitch |
Reads the safety switch | |
![]() |
Return |
SetControlKI
![]() |
SetControlKI |
![]() |
Value |
![]() |
Return |
ZeroLoadCell
![]() |
ZeroLoadCell |
![]() |
Return |
SetControlMaxDrivePercentage
![]() |
SetControlMaxDrivePercentage |
![]() |
Value |
Range 0.0-1.0 | |
![]() |
Return |
SetMotorType
![]() |
SetMotorType |
![]() |
MotorType |
0=DC, 1=1 Phase, 2=3 Phase | |
![]() |
Return |
SetLoadCellCalibration
![]() |
SetLoadCellCalibration |
![]() |
Value |
![]() |
Return |
GetVoltage
![]() |
GetVoltage |
Reads the voltage of a single channel | |
![]() |
Channel |
Range: 0-5 - 0=DC1, 1=DC2, 2=U, 3=V, 4=W, 5=VEXT | |
![]() |
Return |
GetControlFeedback
![]() |
GetControlFeedback |
![]() |
Return |
SetControlKD
![]() |
SetControlKD |
![]() |
Value |
![]() |
Return |
SetCapacitorBank
![]() |
SetCapacitorBank |
![]() |
Cap |
![]() |
Return |
GetCommsOK
![]() |
GetCommsOK |
Checks if comms are ok and stable | |
![]() |
Return |
GetLogStartAngle
![]() |
GetLogStartAngle |
Collects the U Phase angle at the start of logging. Used to calculate and re-create the 3Phase voltage data. | |
![]() |
Return |
SetVoltage
![]() |
SetVoltage |
Sets the DC Voltage from 0 to 24V | |
![]() |
Voltage |
![]() |
Index |
![]() |
Return |
Get3PhaseMode
![]() |
Get3PhaseMode |
Checks to see if the brushless mode is enabled | |
![]() |
Return |
GetAbsPosition
![]() |
GetAbsPosition |
Reads the absolute position of the encoder | |
![]() |
Return |
SetFan
![]() |
SetFan |
|Sets the speed of the FAN from 0 (MIN) to 3000 (MAX) | |
![]() |
Speed |
![]() |
Return |
SetMotorDirection
![]() |
SetMotorDirection |
![]() |
MotorDirection |
0=FW, 1=BW | |
![]() |
Return |
GetMotorDirection
![]() |
GetMotorDirection |
Reads the motor direction | |
![]() |
Return |
SetThreePhaseDriveMode
![]() |
SetThreePhaseDriveMode |
![]() |
Mode |
0=Simple, 1=Accurate | |
![]() |
Return |
GetCurrent
![]() |
GetCurrent |
Reads the current of a single channel | |
![]() |
Channel |
Range: 0-6 - 0=DC1, 1=DC2, 2=U, 3=V, 4=W, 5=Dyno, 6=I, 7=TotalDriver | |
![]() |
Return |
SetFrequency
![]() |
SetFrequency |
![]() |
Frequency |
Frequency of sine wave in Hz | |
![]() |
Return |
SetDynoLoad
![]() |
SetDynoLoad |
![]() |
Load |
![]() |
Return |
GetErrorStatus
GetControlOutputs
![]() |
GetControlOutputs |
![]() |
Data |
![]() |
Return |
SetActive
![]() |
SetActive |
![]() |
Active |
0=Off, 1=On | |
![]() |
Return |
SetDriveMode
![]() |
SetDriveMode |
![]() |
Mode |
0=PWM, 1=On/Off/Float | |
![]() |
Return |
SetTCPProps
![]() |
SetTCPProps |
Sets the TCP IP address and Port | |
![]() |
IP0 |
![]() |
IP1 |
![]() |
IP2 |
![]() |
IP3 |
![]() |
Port |
![]() |
Return |
SetAbsPosition
![]() |
SetAbsPosition |
Resets the absolute motor position to 0 | |
![]() |
Return |
Initialise
![]() |
Initialise |
Returns 1 if the connection is ok and communications have been established | |
![]() |
MotorType |
0=DC, 1=1Phase, 2=3Phase, 3=AngleControl | |
![]() |
Return |