Mar 23, 2011

Baldor Mint Servo Drive Programming Tutorial - Part 1


Baldor Servo Drives are very famous in the market for their reliability and smooth operation. The Next Move controller family and Mint Servo drive can be programmed in Mint language. The Mint language seems difficult for beginners but here we will see the step by step learning for Mint Programming language for Baldor Controllers and Servo Drives.



Mint MT Programming Language Introduction Tutorial:-

MT stands for Multi Tasking and there are range of many products by Baldor which are programmable in MINT language. Mint language is Structured implementation of BASIC (Beginners All-purpose Symbolic Instruction Code). This language is designed specifically for Motion Control and it has Motion Controlling Keywords built in for better Controlling. Mint Features tasks, subroutines, functions, user variables and arrays. Mint Language is Sequential in Nature but it can also be even driven based on interrupts. It uses Workbench v5 as programming environment.

Variables and Constants In Mint MT Language :-

As we all know that variables are used to store data with in a Program , every variable has a name and data type. In Mint Language Variables are there for storing the value and each variable is retentive as all controllers are battery backed up. Each variable name must start with a letter or underscore and it need to be declared first in program before its use. Mint Language Support for ‘integer’, ‘float’ and ‘string’ variables.

As for example the valid Variable name will be my_var1 or xPosition or _distanceX or _2xDistance BUT 3rdAxisPosition will not be a valid variable name as it starts with number. Also _ercurrent_limit is invalid variable name as it is pre-defined Mint constant.

Also we can define the constants in the program and use later in their value in the program for calculation or some other purpose.

How to Define Variables and Constants in Mint Programming Language:-

Defining variables which we are going to use in program is necessary before we can use it in program. As we alrady discussed there are 3 types of variable which we can define in Mint language.

See below for Declaring Variables Syntax :-

The general syntax is as follows :

Dim A as B
where A is Name of Variable and B is Data Type , see below examples for further understanding.

||Syntax for Declaring Integer Variable ||
Dim nMyInteger As Integer

||Syntax for Declaring Integer Variable ||
Dim fMachineWidth As Float

||Syntax for Declaring Integer Variable ||
Dim sProductName As String

Important Note :- Floating point assumed if data type omitted.

Syntax For Declaring a Constant in Mint Language:-

The method of declaring a constant is same as variable . As in Variables we can also define constants as Integer , float or string .See below examples.

Const _fPI As Float = 22/7
Const _nMaxCount As Integer = 1000
Const _sPrompt As String = “Enter Number”

Declaring a constant ensures that the program cannot modify this value elsewhere within the code.

Terminal Input/Output and Formatting Commands :-

MINT supports a large number of terminal Input / Output and formatting commands
The most common of these are PRINT (?) and INPUT
PRINT outputs text and or values to the terminal (Workbench provides a default terminal window)

--PRINT “Current Position = ”, POS.0

The comma places the value after the text. A semi-colon would place it at the next TAB position .The USING parameter is used to format the output

--PRINT 234.672 USING 4,2
0234.67 (4 whole numbers, 2 decimal places)

INPUT is used to get data from the terminal.

INPUT “Enter Ratio”, ratio USING 5,2

This puts the number (no text) into the variable ratio, allowing up to 5 integer places and 2 decimal places
--The INKEY command is used to read a single key

e.g. PAUSE INKEY = ‘A’

We will be discussing more about the types of commands, Syntax in Mint Programming language for Baldor Motion Controllers and Servo Drives. Till then you can subscribe to get all latest updates via E-mail.Subscribe to Automation-Talk by Email.

Advertisements :-

2 comments:

  1. Good One. Keep sharing your programming skills.

    ReplyDelete
  2. Yes sure . We at AT always want our readers to develop their programming skills. Keep Reading.
    Learn--------->> Share ------------>> Innovate

    ReplyDelete

Receive all updates via Facebook. Just Click the Like Button Below