Component: Electrical Machines (AllCode)

From Flowcode Help
Jump to navigationJump to search
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