2RFID-S Modbus Sample Program Visual Basic and C

2RFID-S Modbus Sample Program Visual Basic and C
MANUAL
2RFID-S Modbus Sample Program
Visual Basic and C#
MA1000
Published 03/23/2012
Table of Contents
Table of Contents............................................................................................................Page 1
About This Guide..............................................................................................................Page 2
Hardware Setup................................................................................................................Page 3
Demonstration................................................................................................................ Page 4
Scenarios........................................................................................................................Page 12
www.turck.com • 1-800-544-7769 • Fax: (763) 553-0708 • TURCK • Minneapolis, MN 55441
1
About This Guide
The purpose of this guide is to provide a fast and simple demonstration of how RFID
works without having to install a large program such as PACTware or CoDeSys.
www.turck.com • 1-800-544-7769 • Fax: (763) 553-0708 • TURCK • Minneapolis, MN 55441
2
Hardware Setup
To use the “2RFID-S Modbus Sample Program” you will need one of the following 3
hardware configurations setup at your station:
1) Gateway
Slice Housing
Slice
Power Cable
Data Cable
Transceiver Cable
Transceiver
Tag
->
–>
->
->
->
->
->
->
BL67-GW-EN
BL67-B-2M12-P
BL67-2RFID-S (Must be in first slot)
RKM 50-*M
RSSD RJ45S 441-*M
RK 4.5T-*-RS 4.5T/S2501
Any (Connect to channel 1 not channel 0)
Any
2) Gateway
Power Cable
Data Cable
Transceiver Cable
Transceiver
Tag
->
->
->
->
->
->
BLCEN-2M12MT-2RFID-S
RKC 4.4T-3-RSC 4.4T
RSSD RJ45S 441-*M
RK 4.5T-*-RS 4.5T/S2501
Any(Connect to channel 1 not channel 0)
Any
3) Gateway
Slice Housing
Slice
Power Cable
Data Cable
Transceiver Cable
Transceiver
Tag
->
–>
->
->
->
->
->
->
BL20-GW-EN or BL20-E-GW-EN
BL20-S4T-SBBS
BL20-2RFID-S (Must be in first slot)
Field Supply
RJ45S RJ45S 845-2M
RK 4.5T-*/S2501
Any (Connect to channel 1 not channel 0)
Any
Note: I am using configuration 3. (Displayed below)
* If you choose to use a BL20 gateway then you need to wire the
transceiver up to channel 1 not channel 0.
(Blue->22, Brown->23, Black->14 and White->24)
www.turck.com • 1-800-544-7769 • Fax: (763) 553-0708 • TURCK • Minneapolis, MN 55441
3
Demonstration
Choose Your Path
Visual Basic
Open email and drop folder on your desktop.
Open "RFID-S Sample"
C#
Open email and drop folder on your desktop.
Open "RFID_Modbus_Sample"
www.turck.com • 1-800-544-7769 • Fax: (763) 553-0708 • TURCK • Minneapolis, MN 55441
4
Open "ModbusMaster Test"
Open "bin"
Open "Release"
Open "RFID_Modbus_Sample"
Open "bin"
Open "Release"
www.turck.com • 1-800-544-7769 • Fax: (763) 553-0708 • TURCK • Minneapolis, MN 55441
5
Open "ModbusMaster Test"
Type in the Gateway IP address and hit connect.
(A new gateway’s default address is 192.168.1.254)
Open "RFID_Modbus_Sample"
Type in the Gateway IP address and hit connect.
(A new gateway’s default address is 192.168.1.254)
Note: If you are unable to connect to the station you should set the rotary switches to 000 and power
cycle the device. Once the device comes back up, attempt to ping the device.
- Open Start Menu
- Type “cmd” into the command line
- Click on “cmd.exe”
www.turck.com • 1-800-544-7769 • Fax: (763) 553-0708 • TURCK • Minneapolis, MN 55441
6
-
Type “ping 192.168.1.254” into the command line and press “Enter” on the key board.
-
You should notice the device replying to your ping. You should now be able to connect to your
device.
Check the "Turn On Transceiver" box. Notice
"Transceiver On", "Transceiver Connected" and
"Done” boxes are all checked.
Click the "Transceiver" button. Notice
"Transceiver On”, “Transceiver Connected" and
"Done" LED's are all green.
www.turck.com • 1-800-544-7769 • Fax: (763) 553-0708 • TURCK • Minneapolis, MN 55441
7
Check "Read Tag". Notice "Busy" is checked.
Uncheck "Read Tag". Change drop down menu to
read "8 bytes".
Click “Read”. Notice “Busy” LED is yellow.
Present tag. Notice "Done", "Tag Present", and
"Tag Fully Read" are all checked. Also notice the
“Read Data” in the lower right corner.
Present tag. Notice "Done", "Tag Present", and
"Tag Fully Read" are all green. Also notice the
“Read Data” in the lower right corner.
Input new data into the "Write Data" registers.
Check "Write Tag". Notice "Busy" is checked.
Uncheck "Write Tag".
Input new data into the “Write Data” registers.
Click “Write”. Notice “Busy” is yellow.
(Each register can only support a value between 0-255)
(Each register can only support a value between 0-255)
Present tag. Notice "Done", "Tag Present", and
"Tag Fully Read" are all checked. Also notice the
Present tag. Notice "Done", "Tag Present", and
"Tag Fully Read" are all green. Also notice the
www.turck.com • 1-800-544-7769 • Fax: (763) 553-0708 • TURCK • Minneapolis, MN 55441
8
“Read Data” in the lower right corner.
Check "Read Tag". Notice "Busy" is checked.
Uncheck "Read Tag".
Present tag. Notice "Done", "Tag Present", and
"Tag Fully Read" are all checked. Also notice the
“Read Data” in the lower right corner.
“Read Data” in the lower right corner
Click “Read”. Notice “Busy” is yellow.
Present tag. Notice "Done", "Tag Present", and
"Tag Fully Read" are all green. Also notice the
“Read Data” in the lower right corner.
www.turck.com • 1-800-544-7769 • Fax: (763) 553-0708 • TURCK • Minneapolis, MN 55441
9
Check "Read Tag ID". Notice "Busy" is checked.
Uncheck "Read Tag ID".
Present tag. Notice "Done", "Tag Present", and
"Tag Fully Read" are all checked. Also notice the
“Read Data” in the lower right corner.
Check "Read Tag Info". Notice "Busy" is checked.
Uncheck "Read Tag Info".
www.turck.com • 1-800-544-7769 • Fax: (763) 553-0708 • TURCK • Minneapolis, MN 55441
10
Present tag. Notice "Done", "Tag Present", and
"Tag Fully Read" are all checked. Also notice the
“Read Data” in the lower right corner.
Note: The "Read Trans Info" check box does not
function. The "Reset" check box resets a
“Busy” command. You must check and then
uncheck “Reset” to clear a “Busy” command.
Note: The “Reset” clears stored “Read Data”
and resets a “Busy” command.
www.turck.com • 1-800-544-7769 • Fax: (763) 553-0708 • TURCK • Minneapolis, MN 55441
11
Scenarios
Scenario 1
You could demonstrate how RFID is different from “line of sight” technologies. Try placing a tag under
a table, assuming that the table is not metal, point the transceiver toward the tag and demonstrate
how data can be written to and read from the tag.
Scenario 2
You could demonstrate how RFID works in wet environments. Place the transceiver into a container
of liquid, water is probably the easiest. Assuming the container is not metal; you can show the
read/write functionality by placing a tag outside the container in the field of the transceiver. This
scenario also shows the ingress protection of the transceiver and associated cord set.
Scenario 3
It doesn’t need to be water and might be better suited to a typical sales call, drop a tag in your coffee
cup and have the transceiver read and write data, assuming the coffee cup is not metal this should be
a good demonstration of how RFID technology is less susceptible to environmental influences.
www.turck.com • 1-800-544-7769 • Fax: (763) 553-0708 • TURCK • Minneapolis, MN 55441
12
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement