Component: Electrical Machines (AllCode)

From Flowcode Help
Revision as of 14:46, 7 January 2022 by BenR (talk | contribs) (XML import)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


Author Matrix TSL
Version 2.0 (Release)
Category AllCode


Image 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

UINT


GetWeight

Reads the voltage of a single channel

Parameters

BYTE Scale
Range: 0-1 - 0=Weight, 1=Torque


Return value

FLOAT


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

BYTE


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

BYTE


GetSafetySwitch

Reads the safety switch

Parameters

This macro has no parameters


Return value

UINT


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

FLOAT


GetControlFeedback

No additional information


Parameters

This macro has no parameters


Return value

FLOAT


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

BYTE


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

ULONG


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

UINT


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

FLOAT


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

BYTE


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