Component: Electrical Machines (AllCode)
Author | Matrix TSL |
Version | 2.0 (Release) |
Category | AllCode |
Contents
- 1 Electrical Machines component
- 2 Examples
- 3 Downloadable macro reference
- 4 Simulation macro reference
- 4.1 GetLogDataReady
- 4.2 GetRPM
- 4.3 GetWeight
- 4.4 SetControlKP
- 4.5 SetControlSetpoint
- 4.6 GetAPIVersion
- 4.7 GetLogData
- 4.8 GetDataArray
- 4.9 GetSafetySwitch
- 4.10 SetControlKI
- 4.11 ZeroLoadCell
- 4.12 SetControlMaxDrivePercentage
- 4.13 SetMotorType
- 4.14 SetLoadCellCalibration
- 4.15 GetVoltage
- 4.16 GetControlFeedback
- 4.17 SetControlKD
- 4.18 SetCapacitorBank
- 4.19 GetCommsOK
- 4.20 GetLogStartAngle
- 4.21 SetVoltage
- 4.22 Get3PhaseMode
- 4.23 GetAbsPosition
- 4.24 SetFan
- 4.25 SetMotorDirection
- 4.26 GetMotorDirection
- 4.27 SetThreePhaseDriveMode
- 4.28 GetCurrent
- 4.29 SetFrequency
- 4.30 SetDynoLoad
- 4.31 GetErrorStatus
- 4.32 GetControlOutputs
- 4.33 SetActive
- 4.34 SetDriveMode
- 4.35 SetTCPProps
- 4.36 SetAbsPosition
- 4.37 Initialise
- 5 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.
Examples
No additional examples
Downloadable macro reference
This component does not contain any downloadable macros
Simulation macro reference
GetLogDataReady
Checks to see if the logging is complete and ready to read.
Parameters
- This macro has no parameters
Return value
- BOOL : Returns true if the operation is a success, else false
GetRPM
Reads the speed in RPM
Parameters
- This macro has no parameters
Return value
GetWeight
Reads the voltage of a single channel
Parameters
- BYTE Scale
- Range: 0-1 - 0=Weight, 1=Torque
Return value
SetControlKP
No additional information
Parameters
- FLOAT Value
Return value
- This call does not return a value
SetControlSetpoint
No additional information
Parameters
- FLOAT Value
Return value
- This call does not return a value
GetAPIVersion
Reads the API firmware version
Parameters
- This macro has no parameters
Return value
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
Parameters
- BYTE Buffer
- Buffer to store the incoming log data
Return value
- BOOL : Returns true if the operation is a success, else false
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.
Parameters
- FLOAT data
Return value
GetSafetySwitch
Reads the safety switch
Parameters
- This macro has no parameters
Return value
SetControlKI
No additional information
Parameters
- FLOAT Value
Return value
- This call does not return a value
ZeroLoadCell
No additional information
Parameters
- This macro has no parameters
Return value
- This call does not return a value
SetControlMaxDrivePercentage
No additional information
Parameters
- FLOAT Value
- Range 0.0-1.0
Return value
- This call does not return a value
SetMotorType
No additional information
Parameters
- BYTE MotorType
- 0=DC, 1=1 Phase, 2=3 Phase
Return value
- This call does not return a value
SetLoadCellCalibration
No additional information
Parameters
- FLOAT Value
Return value
- This call does not return a value
GetVoltage
Reads the voltage of a single channel
Parameters
- BYTE Channel
- Range: 0-5 - 0=DC1, 1=DC2, 2=U, 3=V, 4=W, 5=VEXT
Return value
GetControlFeedback
No additional information
Parameters
- This macro has no parameters
Return value
SetControlKD
No additional information
Parameters
- FLOAT Value
Return value
- This call does not return a value
SetCapacitorBank
No additional information
Parameters
- BYTE Cap
Return value
- This call does not return a value
GetCommsOK
Checks if comms are ok and stable
Parameters
- This macro has no parameters
Return value
- BOOL : Returns true if the operation is a success, else false
GetLogStartAngle
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
SetVoltage
Sets the DC Voltage from 0 to 24V
Parameters
- FLOAT Voltage
- BYTE Index
Return value
- This call does not return a value
Get3PhaseMode
Checks to see if the brushless mode is enabled
Parameters
- This macro has no parameters
Return value
- BOOL : Returns true if the operation is a success, else false
GetAbsPosition
Reads the absolute position of the encoder
Parameters
- This macro has no parameters
Return value
SetFan
|Sets the speed of the FAN from 0 (MIN) to 3000 (MAX)
Parameters
- UINT Speed
Return value
- This call does not return a value
SetMotorDirection
No additional information
Parameters
- BOOL MotorDirection
- 0=FW, 1=BW
Return value
- This call does not return a value
GetMotorDirection
Reads the motor direction
Parameters
- This macro has no parameters
Return value
SetThreePhaseDriveMode
No additional information
Parameters
- BOOL Mode
- 0=Simple, 1=Accurate
Return value
- This call does not return a value
GetCurrent
Reads the current of a single channel
Parameters
- BYTE Channel
- Range: 0-6 - 0=DC1, 1=DC2, 2=U, 3=V, 4=W, 5=Dyno, 6=I, 7=TotalDriver
Return value
SetFrequency
No additional information
Parameters
- UINT Frequency
- Frequency of sine wave in Hz
Return value
- This call does not return a value
SetDynoLoad
No additional information
Parameters
- FLOAT Load
Return value
- This call does not return a value
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
Parameters
- This macro has no parameters
Return value
GetControlOutputs
No additional information
Parameters
- FLOAT Data
Return value
- This call does not return a value
SetActive
No additional information
Parameters
- BOOL Active
- 0=Off, 1=On
Return value
- This call does not return a value
SetDriveMode
No additional information
Parameters
- BYTE Mode
- 0=PWM, 1=On/Off/Float
Return value
- This call does not return a value
SetTCPProps
Sets the TCP IP address and Port
Parameters
- BYTE IP0
- BYTE IP1
- BYTE IP2
- BYTE IP3
- UINT Port
Return value
- This call does not return a value
SetAbsPosition
Resets the absolute motor position to 0
Parameters
- This macro has no parameters
Return value
- This call does not return a value
Initialise
Returns 1 if the connection is ok and communications have been established
Parameters
- BYTE MotorType
- 0=DC, 1=1Phase, 2=3Phase, 3=AngleControl
Return value
- BOOL : Returns true if the operation is a success, else false
Property reference
Comms Mode
This property is of type Fixed list of ints and can be referenced with the variable name CommsMode.
No additional information
Stop On Error
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.
Autodetect Port
This property is of type True or false and can be referenced with the variable name AutoDetect.
No additional information
Network Interface
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.
Select the correct network interface for the network you wish to connect to.
Use the IP address to confirm you are connected to the right network.
IP Address
This property is of type Line of text and can be referenced with the variable name NetworkComms1::IPAddress.
IP Address of the selected network interface.
EM Box IP Address
This property is of type Line of text and can be referenced with the variable name BoxIP.
No additional information
EM Box Port
This property is of type Unsigned integer and can be referenced with the variable name BoxPort.
No additional information
Console Data
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