Jump to content

Component: Electrical Machines (AllCode)

From Flowcode Help
Revision as of 16:47, 30 January 2023 by Wiki bot (talk | contribs)
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

GetLogDataReady
Checks to see if the logging is complete and ready to read. 
- BOOL Return


GetRPM
Reads the speed in RPM 
- UINT Return


GetWeight
Reads the voltage of a single channel 
- BYTE Scale
Range: 0-1 - 0=Weight, 1=Torque 
- FLOAT Return


SetControlKP
 
- FLOAT Value
 
- VOID Return


SetControlSetpoint
 
- FLOAT Value
 
- VOID Return


GetAPIVersion
Reads the API firmware version 
- BYTE Return


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 
- BYTE Buffer
Buffer to store the incoming log data 
- BOOL Return


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. 
- FLOAT data
 
- BYTE Return


GetSafetySwitch
Reads the safety switch 
- UINT Return


SetControlKI
 
- FLOAT Value
 
- VOID Return


ZeroLoadCell
 
- VOID Return


SetControlMaxDrivePercentage
 
- FLOAT Value
Range 0.0-1.0 
- VOID Return


SetMotorType
 
- BYTE MotorType
0=DC, 1=1 Phase, 2=3 Phase 
- VOID Return


SetLoadCellCalibration
 
- FLOAT Value
 
- VOID Return


GetVoltage
Reads the voltage of a single channel 
- BYTE Channel
Range: 0-5 - 0=DC1, 1=DC2, 2=U, 3=V, 4=W, 5=VEXT 
- FLOAT Return


GetControlFeedback
 
- FLOAT Return


SetControlKD
 
- FLOAT Value
 
- VOID Return


SetCapacitorBank
 
- BYTE Cap
 
- VOID Return


GetCommsOK
Checks if comms are ok and stable 
- BOOL Return


GetLogStartAngle
Collects the U Phase angle at the start of logging. Used to calculate and re-create the 3Phase voltage data. 
- BYTE Return


SetVoltage
Sets the DC Voltage from 0 to 24V 
- FLOAT Voltage
 
- BYTE Index
 
- VOID Return


Get3PhaseMode
Checks to see if the brushless mode is enabled 
- BOOL Return


GetAbsPosition
Reads the absolute position of the encoder 
- ULONG Return


SetFan
|Sets the speed of the FAN from 0 (MIN) to 3000 (MAX) 
- UINT Speed
 
- VOID Return


SetMotorDirection
 
- BOOL MotorDirection
0=FW, 1=BW 
- VOID Return


GetMotorDirection
Reads the motor direction 
- UINT Return


SetThreePhaseDriveMode
 
- BOOL Mode
0=Simple, 1=Accurate 
- VOID Return


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


SetFrequency
 
- UINT Frequency
Frequency of sine wave in Hz 
- VOID Return


SetDynoLoad
 
- FLOAT Load
 
- VOID Return


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 
- BYTE Return


GetControlOutputs
 
- FLOAT Data
 
- VOID Return


SetActive
 
- BOOL Active
0=Off, 1=On 
- VOID Return


SetDriveMode
 
- BYTE Mode
0=PWM, 1=On/Off/Float 
- VOID Return


SetTCPProps
Sets the TCP IP address and Port 
- BYTE IP0
 
- BYTE IP1
 
- BYTE IP2
 
- BYTE IP3
 
- UINT Port
 
- VOID Return


SetAbsPosition
Resets the absolute motor position to 0 
- VOID Return


Initialise
Returns 1 if the connection is ok and communications have been established 
- BYTE MotorType
0=DC, 1=1Phase, 2=3Phase, 3=AngleControl 
- BOOL Return



Property reference

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