Matrix MIAC AIICode Series User manual


Page 2
Copyright © 2017 Matrix Technology Soluons Limited www.matrixtsl.com
Contents
Introducon - Geng Started 3
Take the Tour - Features of the MIAC AllCode 4
Language Neutral - Applicaon Programming Interface 5
Pseudo Code - A Simple Programming Aid 7
Bluetooth Setup - Windows PC 8
Bluetooth Setup - Android Tablet / Phone 10
Bluetooth Setup - Raspberry Pi and Linux 12
WIFI Setup - Connecng to the IP Address 14
Controlling The MIAC - Using Flowcode 15
Controlling The MIAC - Using App Inventor 17
Controlling The MIAC - Using C++ / C# / VB 20
Controlling The MIAC - Using Python 22
Controlling The MIAC - Using Labview 24
Transistor Outputs - Using PWM 25
API Documentaon - Input and Output 26
API Documentaon - Display and Relay 27
API Documentaon - Peripheral 28
MIAC AllCode
Instruconal Guide

Page 3
Copyright © 2017 Matrix Technology Soluons Limited www.matrixtsl.com
Introducon
Geng Started
Where do you start?
Congratulaons. You now have a state-of-the-art MIAC AllCode industrial controller.
This instruconal guide has been prepared to help you get up the learning curve as quickly as
possible so you can enjoy making the MIAC do the things you want it to do.
Powering up the MIAC
To Power up the MIAC simply connect a 12V to 24V DC supply to
the 2.1mm DC jack or to the 0V / V+ screw terminals. The green
LED at the top le hand side of the MIAC will light when the unit
is powered.
API UART
The MIAC AllCode has two serial UART peripherals which can be used to connect to the AllCode
API. By default UART 1 is selected which allows access to the internal Bluetooth / WIFI module (if
ed). The API UART can be controlled using the conguraon menu when powering up the MIAC.
The MIAC datasheet shows the UART connecons and the internal conguraon jumpers to select
between RS232 and RS485 communicaons modes.
Pairing your Bluetooth enabled device to the MIAC
The Bluetooth enabled MIAC AllCode must be paired to your Bluetooth enabled device to allow
API communicaons to work correctly. Pages 8 through 13 show how to pair the MIAC AllCode to
various dierent devices.
Connecng the MIAC AllCode to your WIFI network
The WIFI enabled MIAC AllCode can be connected to your WIFI network by using the conguraon
menu when powering up the MIAC. The Network Cong seng must be set to Join Network. The
Network SSID seng can then be used to scan for WIFI networks in range. The Password seng
can be used to enter the password for the network.
Hosng a WIFI network from the MIAC
The WIFI enabled MIAC AllCode can be used to host a WIFI network by using the conguraon
menu when powering up the MIAC. The Network Cong seng must be set to Host Network. The
Network SSID seng can then be used to enter the WIFI network name. The Password seng can
be used to enter the password for the network. The Encrypon and Channel sengs can be used
to alter the sengs of the network.
The Pre-Programmed Firmware
The original API rmware can be found on the AllCode secon of the Matrix Website and can be
re-programmed using the mLoader programming tool.
MIAC AllCode
Instruconal Guide

Page 4
Copyright © 2017 Matrix Technology Soluons Limited www.matrixtsl.com
Take the Tour
Features of the MIAC AllCode
This secon explores the various parts of the MIAC AllCode and explains the basic operaon.
MIAC AllCode
Instruconal Guide
Analog / Digital Inputs x 8
Relay Outputs x 4
(Normally Open)
(Mains Rated)
Transistor Outputs x 4
(High Speed)
(2 x DC motor Full H-Bridge)
Graphical Display
with Backlight
9 Button Keypad
Reset Switch and USB Socket
Bluetooth / WIFI communications module
(Internally Fitted)
DIN Rail Mounting
Screw Hole Mounting
CAN Bus Communications Serial RS232/RS485 Communications

Page 5
Copyright © 2017 Matrix Technology Soluons Limited www.matrixtsl.com
Language independent, agnosc, language neutral,
plaorm independent - what do these terms mean?
Basically it means you are not forced to use a certain
programming language or plaorm to control the MIAC.
This is because the MIAC AllCode oers an Applicaon
Program Interface (API) that enables you to interact with the
MIAC using a set of simple rounes or protocols.
If you have not heard of APIs then this secon will help
you understand how to make use of it with the MIAC.
One way to explain this is to think about how a TV remote controller works. Although
modern televisions have touch buons or so-touch areas along the edges of the screen,
most people nd it more convenient to use a remote controller to turn the TV On/O,
change a channel, adjust the volume or brightness sengs, etc.
A TV remote is a very simple device consisng of a keypad
and an infrared light beam. When a buon is pressed its
value is encoded and used to send a binary paern, via the
infrared beam, to the TV. The TV decodes the received
paern and carries out the required funcon.
If for some reason the TV remote failed it would be an easy
task to replace it with a new one, or even purchase a
universal remote (if you had a number of devices to control).
There are Apps that can be used to turn smart phones into a TV remote controller and other hardware is
available that can send out TV remote codes. The only crical part is to
send the correct paern (i.e. command) when it is required.
So you could say the TV has an API that allows a remote controller (whatever form it might
take) to control the intelligence or electronic control systems within the television.
The API, as used on the MIAC AllCode, oers the same plaorm and language independence as the TV
example described above. The dierence is the transmission medium for the MIAC is Bluetooth or Wi
rather than an infrared beam. This means providing you have a Bluetooth or Wi facility on your system,
you have the freedom to use your favourite plaorm and programming language to interact with the
MIAC.
As an example, you might choose to use a Bluetooth enabled mobile phone to control the
MIAC. Alternavely, a Wi enabled PC/Mac/Raspberry Pi® or a Matrix E-block upstream board would do
the same to create a simple controller.
Language Neutral
Applicaon Program Interface
MIAC AllCode
Instruconal Guide

Page 6
Copyright © 2017 Matrix Technology Soluons Limited www.matrixtsl.com
Language Neutral
Applicaon Program Interface
MIAC AllCode
Instruconal Guide
As the API reacts to a simple text-based protocol (as shown below) it means you have the
freedom to use formal programming languages like C, C#, C++ or Python, or graphical or
icon-based languages like Flowcode, App Inventor or LabView.
The other thing to note about the API is that some commands are bi-direconal. This
means that a command sent to the MIAC could result in a value being returned. A good
example of this is the command to read the input terminals of the MIAC. An API command
could be sent to sample the input (that eecvely interrogates it) causing it to return a
numerical value of the voltage present on the input terminal.
Shown below is the general format for the MIAC’s API.
API command ...Parameters...
Text string Numeric values and/or text string
Every command starts o with a text string that idenes what the MIAC should do. This
may be followed by one or more parameters. Depending on what you are trying to do with
the MIAC these parameters can be numerical or textual or a mixture of both.
For example to send a value to the four relays on the MIAC you would use:
WriteRelays <value>
As the relays are grouped together and form an 4-bit row, they can be driven by sending a
binary number to them. So the parameter <value> can take a value between 0 and 15.
It should be noted that the API commands for a parcular language might have some subtle
dierences. For example, Python will use something like "ma.WriteRelays(2)" whereas C#
would look like "MA_DLL.MA_WriteRelays(2);" and for App Inventor, Flowcode and
LabView the appropriate icon would be selected.
Here’s another example that shows how to control a transistor on the MIAC.
WriteTran <channel> <value>
The parameter labelled <channel> can take a value between 1 and 4 to dene which transistor
output to control. The parameter labelled <value> can take a value between 0 to 1 to dene the
state of the output.
If you wanted to control all transistor outputs at once you could use this command.
WriteTrans <value>
The parameters <value> can take a value from 0 to 15 to dene the binary state of the transistor
outputs.

Page 7
Copyright © 2017 Matrix Technology Soluons Limited www.matrixtsl.com
Pseudo-code
A Simple Programming Aid
MIAC AllCode
Instruconal Guide
Most of the examples that appear in this Instruconal Guide are wrien with pseudo-code.
This pseudo-code can be used with the many programming languages that can be used with the
MIAC AllCode.
One of the reasons for this is that this Guide would be huge if all the examples were wrien in
every language the MIAC AllCode supported, and only certain parts would be applicable to you.
API calls allow you to interact with the MIAC AllCode. The name of these calls will map across to
the set of macros available in Flowcode, AppInventor, Python and other languages supported by
the MIAC AllCode. A full list of available API calls is available at the end of this document.
Using pseudo-code allows you to take the rst step of pung your ideas into pracce in a
structured way without geng tripped up by the syntax of a formal programming language.
Once you have expressed your ideas, using pseudo-code, you can move on and write the
actual program using your chosen programming language, which should hopefully be a fairly
simple coding task.
Open COM Port
WriteRelays ( 15 )
Close COM Port
Open the communicaons port
Close the communicaons port
Switch On Relays 1-4

Page 8
Copyright © 2017 Matrix Technology Soluons Limited www.matrixtsl.com
Bluetooth setup
Windows PC
MIAC AllCode
Instruconal Guide
A lot of Windows devices, especially laptops and
tablets, have inbuilt Bluetooth funconality. If your PC
does not, you will need to use a Bluetooth 2 USB
dongle.
Dierent versions of the Windows operang system
use slightly dierent ways of connecng Bluetooth
devices, but they all follow the same steps.
You will need to perform this process just once as
Windows will remember which devices are paired.
1) Turn on Bluetooth
Oen, Bluetooth is enabled by default and you can usually ignore this step. However if it is
not, it can be enabled in the Windows sengs and/or control panel. Very occasionally,
Bluetooth needs to be switched on using a special switch or funcon-key. Please consult
your PC or Windows help for more informaon.
2) Pair the MIAC
First switch on the MIAC - the Bluetooth device name, pair key and visibility can be checked and
edited using the Congure menu and then selecng Bluetooth Sengs when powering up the
MIAC.
Again, pairing works slightly dierently on the various Windows versions and so it is dicult to
give specic instrucons here. The Windows help and website will have guides explain how.
When pairing, you will be presented with a screen or list of available Bluetooth devices.
Select the device with the name of your MIAC and click Next or Pair.
You will be asked to enter the pairing code. The MIAC AllCode uses the default
code of 1234, although this can be changed to another code if you want to ensure no-one
else can pair with your MIAC.
Once the code has been entered, Windows will conrm that it has paired with the MIAC.

Page 9
Copyright © 2017 Matrix Technology Soluons Limited www.matrixtsl.com
Bluetooth setup
Windows PC
3) Determine the COM port number
You should get a popup balloon on the task bar saying device is ready to use. If you click
this before it fades away then you can nd out the COM port assigned to the MIAC.
You use this COM port number when
communicang with the MIAC AllCode and this
COM port number will stay the same as long as
you do not remove or unpair the MIAC from
Windows.
If you did not see the COM port when the MIAC
was paired, you can nd it in the Bluetooth
Sengs window, as shown on the right.
There are two COM ports listed for each MIAC.
Make sure you always use the “outgoing” port
number.
This window can be a bit hard to nd on some
versions of Windows. For example, on Windows 10
you can nd this via the “More Bluetooth opons”
link on the Bluetooth sengs screen.
Luckily, there is a guaranteed way of opening this
window in all versions of Windows from version 7. Open the “Run…” window by holding the
Windows key and pressing R, then
type (or copy and paste) the following command into the box and press “OK”:
rundll32.exe shell32.dll,Control_RunDLL bthprops.cpl,,2
Now you have paired the MIAC and determined the COM port number, you can use any of
the many programming languages available on Windows to control the MIAC AllCode.
MIAC AllCode
Instruconal Guide

Page 10
Copyright © 2017 Matrix Technology Soluons Limited www.matrixtsl.com
MIAC AllCode
Instruconal Guide
Android phones and tablets, when used with intuive
programming soware such as App Inventor, provide a
movang plaorm for controlling the MIAC AllCode.
These devices almost always include Bluetooth and Wi
built-in.
As with other devices, the MIAC AllCode must be paired
with the phone or tablet before it can be used.
If your Phone or Tablet already has Bluetooth funconality built in then you may rst have
to enable it by clicking on Sengs -> Connecons.
Once Bluetooth is enabled you need to pair the MIAC AllCode to your phone to allow Apps to see
the device.
Begin by clicking the Bluetooth opon in Sengs -> Connecons
Next make sure your MIAC is switched on and click the Scan buon on your Android device to
check for new Bluetooth devices. Note you may have to scroll down to see the results from the
scan.
The name of the MIAC AllCode can be found by using the MIAC keypad and navigang to the
Congure menu followed by the Bluetooth Sengs menu when powering up the MIAC.
Bluetooth Switched O
Bluetooth Switched On
Bluetooth setup
Android Tablet / Phone

Page 11
Copyright © 2017 Matrix Technology Soluons Limited www.matrixtsl.com
Bluetooth setup
Android Tablet / Phone
MIAC AllCode
Instruconal Guide
When the device name has appeared click the device
name and you will be asked to
enter the pair key.
The default key is 1234.
Once the device is paired it will be listed along with any other paired Bluetooth devices you
might have and is ready to be used with any MIAC AllCode apps you download or create.
Please note: This may be subtly dierent on your Android device. For specics on your
Phone or Tablet please look up how to pair Bluetooth devices for your specic device.

Page 12
Copyright © 2017 Matrix Technology Soluons Limited www.matrixtsl.com
Bluetooth setup
Raspberry Pi and Linux
The Raspberry Pi is a popular single-board computer.
The most common operang system used on the
Raspberry Pi is a variety of Linux called Raspbian.
The instrucons here for pairing the MIAC AllCode are
not limited to a Raspberry Pi and should apply to most
Linux-based computers.
Seng up Bluetooth is relavely easy on a Raspberry Pi and can be done in a number of
ways. The following steps are perhaps a more complex way of seng it up, but it should
work in all situaons. Note the Pi needs a Bluetooth USB dongle.
Step 1 – Get your Bluetooth sengs
Open a command-line terminal and type the command “hcicong”. This will bring up a list
of Bluetooth devices available on your RPi. The important thing to note is the idener of
the Bluetooth module – in my case it is “hci0”:
Step 2 – Detect the MIAC AllCode
Switch on the MIAC and then type “hcitool scan”. When I did this, it showed two devices.
Mine was the laer (“API_B”) and you will need to take note of the 6 pairs of hexadecimal
numbers that are the MAC address, a unique idener to the MIAC – in my case,
“00:BA:55:23:1C:20”.
Step 3 – Pair the MIAC with the RPi
To pair, you can use the “bluez-simple-agent” command using the “hci0” and MAC
address found in the previous steps.
MIAC AllCode
Instruconal Guide

Page 13
Copyright © 2017 Matrix Technology Soluons Limited www.matrixtsl.com
Bluetooth setup
Raspberry Pi and Linux
Step 4 – Making the change permanent
The nal step is to make this pairing happen automacally when the RPi is next used.
This can be done by eding the “/etc/bluetooth/rfcomm.conf” le (e.g. using nano) and
entering the following code. Again, you will need to ensure you use the correct MAC
address that was found earlier.
You will need to add a secon to this rfcomm.conf le similar to the following:
rfcomm1 {
# Automatically bind the device at startup
bind yes;
# Bluetooth address of the device
device 00:BA:55:23:1C:20;
# RFCOMM channel for the connection
channel 1;
# Description of the connection
comment "MIAC AllCode";
}
The three red bits of text can be customised - you will use the MAC address found in step
2, and can use the name in the “comment” eld.
If you have more than one MIAC, you can add mulple secons - just name each one
“rfcomm1”, “rfcomm2”, etc.
Step 5 – Tesng the connecon
Once you are paired, you can test the connecon by using the following in the command line
terminal:
echo "WriteRelay 1 1\n" > /dev/rfcomm1
If all goes well, the Relay Q1 should become acvated and the LED for Q1 should light up.
If this does not work and you get “permission denied” message, you may need to add
yourself to the “dialout” group. To see if this is the case, use the “id” command with your
username as a parameter to check which groups you belong to. If the group “dialout” is
not listed, you can add yourself to the group using the following command (remember to
substute your username in place of “username”!):
sudo usermod -a -G dialout username
You will then need to logout and log back in and the “WriteRelay” command should now work
ok.
MIAC AllCode
Instruconal Guide

Page 14
Copyright © 2017 Matrix Technology Soluons Limited www.matrixtsl.com
WIFI setup
Connecng to the IP Address
WIFI Connecvity
The MIAC can be used to Host or Join a WIFI network by using the Congure and Wi Sengs
menu when powering up the MIAC. Once the network sengs have been specied they will be
retained so you don’t have to keep re-conguring the MIAC when powering up.
Network Host Mode
The host mode allows the MIAC to host a WIFI network. The various sengs of the network can be
specied using the Congure menu when powering up the MIAC. Once the API mode has been
started the MIAC will display its local IP address you should use to connect to the MIAC.
To communicate with the MIAC you will need to connect your controller (PC/Linux/Phone/Tablet/
etc) to the WIFI network and then use the IP address provided by the MIAC.
Network Join Mode
The join mode allows the MIAC to join an exisng WIFI network. The network to join and access
password can be specied using the Congure menu when powering up the MIAC. Once the API
mode has been started the MIAC will display its local IP address you should use to connect to the
MIAC.
To communicate with the MIAC you will need to connect your controller (PC/Linux/Phone/Tablet/
etc) to the WIFI network and then use the IP address provided by the MIAC.
MIAC AllCode
Instruconal Guide

Page 15
Copyright © 2017 Matrix Technology Soluons Limited www.matrixtsl.com
Controlling the MIAC
Using Flowcode
MIAC AllCode
Instruconal Guide
This secon explains how to use Flowcode to control the MIAC
AllCode.
As you probably know, Flowcode provides component macros for
all complex devices like CAN bus, ZigBee, and the MIAC AllCode
There are programs on the Matrix website to inspire and help you.
hps://www.matrixtsl.com/allcode/resources/
This secon assumes you are familiar with the basics of using Flowcode. There are two
ways of using Flowcode to control the MIAC AllCode.
1) using the in-built API funconality
2) re-programming the rmware on the MIAC.
In Flowcode 7.3 and later there is a component available
from the MIAC component menu to allow you to easily
control the MIAC AllCode via the command API.
The component comes with a fully operaonal simulaon allowing us to create and test programs
before we move to the hardware.
The component’s Mode property allows us to decide if we are using the component to control the
simulaon or the real hardware.
Bluetooth / Serial Component Properes WIFI Component Properes
The Bluetooth and Serial mode has a COM port property that points to the MIAC AllCode. This
COM port number can be found in the Bluetooth pairing secon of this document.
The WIFI mode has a Network Interface opon, this allows you to specify the network adapter
connected to the same network as the MIAC AllCode should you have more than one Network
adapter available on your PC. The MIAC IP address should be entered so that it matched the IP
address shown on the MIAC display when entering API mode.

Page 16
Copyright © 2017 Matrix Technology Soluons Limited www.matrixtsl.com
MIAC AllCode
Instruconal Guide
Direct control from Flowcode
The component (“MIAC AllCode”) allows us to
control a MIAC AllCode from within Flowcode
without compiling or downloading.
Note that the Component Macro funcons appear in
the Simulaon tab rather than the usual components
tab. This highlights the fact that the component code
is not downloadable onto the MIAC.
The selected communicaons port is automacally
opened when you start the simulaon and closed
when you end the simulaon.
The console window shows the API commands as
well as any return values allowing an easy way of
seeing the communicaons between the simulaon
and the MIAC.
Downloading code to the MIAC
Flowcode also allows us to create code which will
run on the microcontroller on-board the MIAC. This
is not recommended unless you know what you’re
doing.
Note: Downloading code to the MIAC will remove the API funconality from the MIAC AllCode.
Instrucons on restoring the API rmware to get the MIAC back to the original factory
funconality are provided on page 3.
Controlling the MIAC
Using Flowcode

Page 17
Copyright © 2017 Matrix Technology Soluons Limited www.matrixtsl.com
Controlling the MIAC
Using App Inventor
MIAC AllCode
Instruconal Guide
This secon explains how to get started with the coding
language called App Inventor that will enable you to use
an Android device to control the MIAC.
These QR codes and hyperlinks will help speed-up your
installaon, so you can start having some
fun coding.
App Inventor Template
App Inventor
App Inventor is a freely available graphical programming language hosted on one of the
cloud-compung and storage systems at Massachuses Instute of Technology (MIT) in
the United States. All you need to get started developing apps for an Android mobile
phone or tablet is a web browser and a Google account. App Inventor uses colour-coded
icons, shaped like jigsaw-puzzle pieces, to create an app by joining the pieces together.
The system prevents you making mistakes by ensuring only certain shapes with the same
colour scheme can be joined together. This technique encourages people of all ages to
enjoy ‘coding’ and develop their condence and ability in computer programming.
Seng up App Inventor
The key items you need are a desktop or laptop (running a modern browser like Chrome
or Firefox) and a phone or tablet running the Android operang system. You will also need
a QR reader so it would be a good idea at this stage to download one on to your mobile.
Just follow these simple steps to get yourself up and running really quickly.
1. Set up a Google account (if you haven’t already got one).
2. Go to the App Inventor website by scanning the QR code or clicking the hyperlink above
and then login using your Google account.
3. Follow the online instrucons, including installing the “MIT AI2 Companion App” onto
your Android device.
4. You will need to link the web-based App Inventor with your phone or tablet. To do this,
select ‘AI Companion’ from the ‘Connect’ menu in App Inventor.
5. Download the MIAC AllCode template onto your computer by scanning the QR code or clicking
the hyperlink. Remember where you saved them on your desktop/laptop.

Page 18
Copyright © 2017 Matrix Technology Soluons Limited www.matrixtsl.com
Controlling the MIAC
Using App Inventor
MIAC AllCode
Instruconal Guide
Currently AppInventor only supports the Bluetooth form of communicaons.
Your rst program
Each me you want to start a new project, follow these steps:
1. Load the template le by clicking ‘My Projects’ from the App
Inventor menu and selecng the ‘MIACMacros’ project.
2. Save this template as a new le by selecng ‘Save project
as…’ from the ‘Projects’ menu and then entering an
appropriate name for your project.
3. Click ‘Screen1’ from the ‘Components’ pane and set
the ‘AppName’ and ‘Title’ in the ‘Properes’ pane to
something suitable.
4. Drag a buon from the User Interface panel onto the
Viewer screen and alter its text to read “Relay 1 On”.
Also rename the buon so it reads “R1On”. Do the
same again to create another buon called “Relay 1
O” with the name “R1O”. Repeat for the other
relays.
5. Switch to ‘Blocks’ mode and click on the ‘R1On’
object - a list of icons will appear.
Drag the “when R1On.Click” icon onto your
program. Do the same again but this me click on
the ‘R1O’ object. Repeat for the other switches.

Page 19
Copyright © 2017 Matrix Technology Soluons Limited www.matrixtsl.com
Controlling the MIAC
Using App Inventor
MIAC AllCode
Instruconal Guide
6. Click ‘Procedures’ from the ‘Built-in’ list and drag the “call WriteRelay” icon into the middle of
your “when R1On.Click” and “when R1O.Click” icons. Add literal values
from ‘Math’ as the Channel and Value parameters to the WriteRelay code blocks.
Your two blocks should look something like this:
Repeat for the other switches.
7. Now you should build the project. Select “App (provide QR code for .apk)” from the
“Build’ menu. Once this is complete, run the “MIT AI2 Companion” app and then scan the
QR code into your Android device using the “Scan QR Code” buon.
Note:
If you visit the App Inventor website you will nd instrucons about other methods that are
available for transferring your program to your Android device.
8. You can now run your program on your Android device. Click “Connect to device” and
select the MIAC AllCode from the list. Clicking the “Relay 1 On” buon should make Relay Q1
switch on. Clicking the “Relay 1 O” buon should make Relay Q1 switch o.
You may have noced a number of icons at the top of the screen in App Inventor. These
dene the procedures for communicang with the MIAC AllCode and some standard funcons to
allow the Bluetooth link to be set-up.
The tan coloured icons represent events such as when a buon is clicked, when a mer
triggers or when an error occurs.
The mauve coloured icons relate to a set of procedures or subrounes that have been
designed to perform certain tasks for you. You should not alter these unless you are an
experienced App Inventor user.

Page 20
Copyright © 2017 Matrix Technology Soluons Limited www.matrixtsl.com
Controlling the MIAC
Using C++ / C# / VB
MIAC AllCode
Instruconal Guide
A common programming tool is Visual Studio from Microso.
In this secon we introduce various methods to communicate
with the MIAC AllCode using some of the more widely known
programming languages such as C++, C# and Visual Basic.
Using the MIAC AllCode with Visual Studio via the Visual C++, Visual C# or Visual
Basic programming languages is fairly straighorward and consists of using a DLL
library and associated les provided by MatrixTSL to communicate with the MIAC.
As will other languages, you need to use the COM port number or IP address that the MIAC is
connected to. There are examples on the AllCode pages of the Matrix TSL
website here: hps://www.matrixtsl.com/allcode/resources/
Using C#
The program on the right shows
a basic program in C#.
You should use the namespace
“MIACAllCode” and place the
MA_DLL library le in the same
folder as your project. The DLL
itself needs to be in the same
folder as the EXE you create.
You will noce that the AllCode
API commands are prexed with
the characters “MA_” and also
need to have the COM port / IP
Instance sent to them each me
as the rst parameter.
Remember to modify the API
commands in the appendix when
using them.
Also remember to close the port
at the end of your program!
This manual suits for next models
3
Table of contents
Other Matrix Controllers manuals