0% found this document useful (0 votes)
17 views5 pages

DF1 Toman Tron

Uploaded by

Sergio Bezerra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views5 pages

DF1 Toman Tron

Uploaded by

Sergio Bezerra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

TomanTron, Inc.

17942 66th Ave, Tinley Park, IL 60477


_________________________________________________________________________________________________

Free DF1 Driver for Allen Bradley SLC500 and Micrologix Programmable Logic
Controllers.

DF1TomanTron is a .NET Component (DLL) compatible with .NET Framework.


It is completely free of charge. This is not a demo that will expire after certain amount of time and
there are no pop-ups or keys. This is a fully functional piece of software. You are free to distribute it
free of charge but you are not allowed to re-sell it!
Although only Integer data is supported, I believe that this is enough for majority of applications.

Key Features:

Does not require RSLinx

Visual Studio.NET compatible

DF1 full duplex, no handshaking

Supports (8) Com Ports (COM1 through COM8)

Works with virtual Com Ports (Digi, Moxa etc.)

Multithreaded operation for maximum speed

PLC types supported: SLC 5/03, 5/04, 5/05 and Micrologix1000 channel 0 configured for full duplex
DF1, no handshaking. Operation with these PLC’s was fully tested.

Support for other PLC’s: Micrologix 1200 and 1500


Possible if communication commands listed below are supported. Not
tested.
ControlLogix
Possible if data table mapped as SLC500, must support
communication commands listed below. Not tested.
PLC5
Not possible.

Communication commands used: Protected typed logical read with three address fields, CMD 0F
and FNC A2
Protected typed logical write with three address fields, CMD 0F
and FNC AA

Read up to 100 Integers based on a polling rate

Write up to 100 Integers

Does not support unsolicited messages

9/15/2004 Page 1 © Copyright 2004, TomanTron,Inc.


TomanTron, Inc. 17942 66th Ave, Tinley Park, IL 60477
_________________________________________________________________________________________________

Supports embedded responses

OnDataAvailable event

DF1TomanTron Members:

Properties:

[VB.NET]
Public Property CheckSum() As TomantronDF1Lib.DF1TomanTron.SumCheckEnumerator
Either CRC or BCC.

'VB.NET Example, set check sum to BCC


DF1TomanTron1.CheckSum = TomanTronDF1Lib.DF1TomanTron.SumCheckEnumerator.BCC

[VB.NET]
Public Property ReadElementNo() As Byte
Starting Element number of PLC Integer (N) data to be read each time the ReadPollTime timer
expires.

[VB.NET]
Public Property ReadFileNo() As Byte
File number of PLC Integer (N) data to be read each time the ReadPollTime timer expires.

[VB.NET]
Public Property ReadNoOfElements() As Integer
Number of elements of PLC Integer (N) data to be read each time the ReadPollTime timer expires.
Maximum value is 100.

'VB.NET example, read 50 Integers starting at N7:0 each time


'the polling timer expires

DF1TomanTron1.ReadFileNo = 7
DF1TomanTron1.ReadElementNo = 0
DF1TomanTron1.ReadNoOfElements = 50

[VB.NET]
Public Property ReadPollTime() As Integer
Polling rate in ms at which the integer data will be read from the PLC.
Range 100 ms to 32767 ms.
User needs to set the appropriate polling rate for reliable operation.
Consider the Baud rate and number of characters to determine the optimal polling rate.
For example, if you were going to read 100 integers at 9600 Baud, you would need 1 ms per character
and there would be appr. 220 characters in a message (2 characters per integer plus

9/15/2004 Page 2 © Copyright 2004, TomanTron,Inc.


TomanTron, Inc. 17942 66th Ave, Tinley Park, IL 60477
_________________________________________________________________________________________________

overhead). You should use 250 ms polling rate. Setting the polling rate faster than 220 ms
will result in missed write requests. In applications where no data will be written into the PLC
you can set the polling rate to 100ms.

'VB.NET example, set the read polling rate to 200 ms.


DF1TomanTron1.ReadPollTime = 200

[VB.NET]
Public ReadOnly Property ReadIntegerData() As Integer()
Range: ReadIntegerData(0) to ReadIntegerData(99).
Integer data read from the PLC each time the ReadPollTime timer expires.
'VB.NET example, read 10 Integers to text boxes when OnDataAvailable
'event is triggered.

Private Sub DF1TomanTron1_OnDataAvailable() Handles D1TomanTron1.OnDataAvailable


TextBox1.Text = DF1TomanTron1.ReadIntegerData(0).ToString
TextBox2.Text = DF1TomanTron1.ReadIntegerData(1).ToString
TextBox3.Text = DF1TomanTron1.ReadIntegerData(2).ToString
TextBox4.Text = DF1TomanTron1.ReadIntegerData(3).ToString
TextBox5.Text = DF1TomanTron1.ReadIntegerData(4).ToString
TextBox6.Text = DF1TomanTron1.ReadIntegerData(5).ToString
TextBox7.Text = DF1TomanTron1.ReadIntegerData(6).ToString
TextBox8.Text = DF1TomanTron1.ReadIntegerData(7).ToString
TextBox9.Text = DF1TomanTron1.ReadIntegerData(8).ToString
TextBox10.Text = DF1TomanTron1.ReadIntegerData(9).ToString
End Sub

[VB.NET]
Public Property WriteFileNo() As Byte
File number of the Integer (N) data to be written to PLC each time the WriteToPLC
Method is called.

[VB.NET]
Public Property WriteElementNo() As Byte
Starting Element number of Integer (N) data to be written to PLC each time the
WriteToPLC method is called.

DF1TomanTron Methods:

[VB.NET]
Sub WriteToPLC(ByVal ParamArray IntegerData() As Integer)
Range: IntegerData(0) to IntegerData(99).
When this method is called the IntegerData() will be written to PLC file number specified
in WriteFileNo() Property and element number in WriteElementNo() Property.
Length of the data is automatically determined by ParamArray Keyword which allows you
to pass in a variable number of parameters.

9/15/2004 Page 3 © Copyright 2004, TomanTron,Inc.


TomanTron, Inc. 17942 66th Ave, Tinley Park, IL 60477
_________________________________________________________________________________________________

'VB.Net example, write 6 Integers (1,2,3,4,5,6) to PLC starting at N8:1

Dim Data(2) As Integer


Dim DataThree As Integer

Data(0) = 1
Data(1) = 2
Data(2) = 3
DataThree = 4

DF1TomanTron1.WriteFileNo = 8
DF1TomanTron1.WriteElementNo = 1
DF1TomanTron1.WriteToPLC(Data)

DF1TomanTron1.WriteFileNo = 8
DF1TomanTron1.WriteElementNo = 4
DF1TomanTron1.WriteToPLC(DataThree, 5, 6)

[VB.NET]
Public Function OpenComPort (ByVal ComPort As String, ByVal BaudRate As Integer, ByVal
theParity As String, ByVal DataBits As Integer, ByVal StopBits As Integer) As Boolean

Parameters:

ComPort
Number of the Com Port to be opened.
Allowable ComPorts are: “COM1” “COM2” “COM3” “COM4” “COM5” “COM6” “COM7”
“COM8”

BaudRate
Baud Rate.
Allowable baud rates are: 9600, 19200, 38400

theParity
Parity.
Allowable parities are: “N” “O” “E” (None, Odd, Even)

DataBits
Number of data bits.
Allowable data bits are: 7 and 8

StopBits
Number of stop bits.
Allowable stop bits are: 1 and 2

Return Type:

Returns true if ComPort has been opened.


'VB.Net example, open ComPort as COM1, 19200 Baud, No Parity,

9/15/2004 Page 4 © Copyright 2004, TomanTron,Inc.


TomanTron, Inc. 17942 66th Ave, Tinley Park, IL 60477
_________________________________________________________________________________________________

'8 Data bits and 1 stop bit

DF1TomanTron1.OpenComPort("COM1", 19200, "N", 8, 1)

[VB.NET]
Public Sub CloseComPort()
Closes the ComPort if it is opened.

9/15/2004 Page 5 © Copyright 2004, TomanTron,Inc.

You might also like