Sign in to follow this  
Followers 0
BlurDavinci

DF1 Protocol with VB

21 posts in this topic

Hi: I'm trying to write VB6/Net protocol for Micrologix and SLC. I search thru this Forum, the only thing I found is the DDE which I'm not interested. I read thru the DF1 Manual from AB, which I do not quite understand. I try to use Hyperterminal sending DLE and ENQ (10 05), I supposed the PLC should response ACK or NAK? Can Some one tell me how? Note: I'm sure we can make use of hyperterminal to read certain value from the PLC. Thanks

Share this post


Link to post
Share on other sites
Take a look at this and see if it helps. Another member on another forum wrote it. http://sourceforge.net/project/showfiles.php?group_id=192333

Share this post


Link to post
Share on other sites
Try downloading Docklight, it can show you the data stream. http://www.docklight.de/

Share this post


Link to post
Share on other sites
You may want to take a look at this post... lots of information here. http://forums.mrplc.com/index.php?showtopic=4529

Share this post


Link to post
Share on other sites
Thanks for the info. that a bit complicated I'm looking at a basic procedure code Say I would like to read N7:0 to N7:10 What is the most simple way to send the read command to PLC? Step by Step? Thanks

Share this post


Link to post
Share on other sites
see this post http://www.plctalk.net/qanda/showthread.ph...p;highlight=DF1 http://www.plctalk.net/qanda/showthread.ph...p;highlight=DF1 read this manual http://forums.mrplc.com/index.php?autocom=downloads&showfile=45

Share this post


Link to post
Share on other sites
I have the DF1 manual. I'm not interested on the .net version. No $ to buy yet ! ha ha. I wrote Modbus and Omron protocol with VB6 before. It is rather straight forward. But not this AB, I can not understand the manual. So I may need some guidance from some one here. Can it be : Send command to PLC requesting N7:0 to N7:10, PLC Reply Ack Send Ack (PC to PLC) PLC reply Data. Please give some tips Thanks

Share this post


Link to post
Share on other sites
BlurDavinci, I may not understand what you want but that link I posted is all free and you can download the .net that is needed.

Share this post


Link to post
Share on other sites
Bob: I'm actually try to write simple protocol just to read say X elements from Integer table N7. I do not want to spend $ buying opc or using Rslinx. The only software that I have is VB6.0. I could write protcol on Omron or Schneider Telemec but I could not do it on SLC or Micrologix. Because I do not understand the DF1 Manual from AB. I have a project coming up using either SLC or Micrologix but with limited budget. That why I'm trying to piece the code my self. Beside I do it myself, I could control what ever i wrote. I do believe someone here do know how to do it or Some one really understand the AB manual of DF1 Protocol and command set. That why I need some help and guidance how it suppose to write. Thanks

Share this post


Link to post
Share on other sites
It has been done. http://www.tomantron.com/services.htm

Share this post


Link to post
Share on other sites
Sparky: I do know that, That Why i would like to write myself. As I say, I do not want to have any ocx or dll. I would prefer to have the standard component like MScomm. I hope you understand. Thanks again

Share this post


Link to post
Share on other sites
You're probably going to need a tool more sophisticated than Hyperterminal to do this. How do you type a non-printable character in Hyperterminal ? DF1 isn't that much different than Modbus, in that there are node numbers, function codes, data types, byte lengths, and checksums. There are also Transaction Sequence Words and the elusive DLE Escaping principle. Consider a simple SLC-500 integer data read request for data from N7:0 through N7:10: 10 02 01 00 0F 00 TNSW A2 14 07 89 00 00 10 03 CRC 10 02 = DLE STX, the start of a DF1 Full Duplex command 01 = Destination Node 01 (the controller) 00 = Source Node 00 (the computer) 0F = Command Code 0F 00 = Status of command code, zero = OK TNSW = Transaction Sequence Word, new value for each transaction. A2 = Function Code A2, "Protected Type Logical Read with Three Address Fields" 14 = Byte Length of data, 20 bytes 07 = File Number, data file 7 89 = File Type, 0x89 = Integer 00 = Element Number (N7:00) 00 = Sub-Element Number 10 03 = DLE ETX, the end of a DF1 Full Duplex command CRC = the CRC16 checksum for the preceding data, excluding the DLE STX and DLE ETX and any "DLE Escape" characters. The hardest part, in my experience, is calculating the checksum.

Share this post


Link to post
Share on other sites
Ken: you are right about hyperterminal, but i thot i could just send 10 02 01 00 0F 00 TNSW A2 14 07 89 00 00 10 03 CRC where TNSW is a random number and CRC is also a number? The CRC calculation is the same as Modbus CRC ? or AB offer a different way of calculation? Thanks for your tips. I may try using your info and try with VB. Thanks again

Share this post


Link to post
Share on other sites
Ron Gage's source code for a C++ version is fairly straightforward and easy to read (and uses the TCP/IP version as well). I've converted it to Python before without any trouble at all. Doing it in VB would drive me up the wall since support for string manipulation is kind of poor. One of the huge reasons for the success of Modbus is that it is just about the simplest PLC protocol ever done. The DF1 basic packet format is a lot more complicated. What makes it worse is that every time AB came up with a different processor, they also automatically came up with yet another set of commands in the DF1 protocol "just because". Also at least with the TCP version before you can get anything at all to work, you have to send a "hello" packet. It's been a while since I've done it so I don't recall the exact command name/number. It also supports a lot of goofy addressing such as "multihop" where you embed multiple addresses in a chain of gateways in the packet.

Share this post


Link to post
Share on other sites
Ron Gage's source code for a C++ version is fairly straightforward and easy to read (and uses the TCP/IP version as well). I've converted it to Python before without any trouble at all. Doing it in VB would drive me up the wall since support for string manipulation is kind of poor. One of the huge reasons for the success of Modbus is that it is just about the simplest PLC protocol ever done. The DF1 basic packet format is a lot more complicated. What makes it worse is that every time AB came up with a different processor, they also automatically came up with yet another set of commands in the DF1 protocol "just because". Also at least with the TCP version before you can get anything at all to work, you have to send a "hello" packet. It's been a while since I've done it so I don't recall the exact command name/number. It also supports a lot of goofy addressing such as "multihop" where you embed multiple addresses in a chain of gateways in the packet.

Share this post


Link to post
Share on other sites
http://www.rongage.org/

Share this post


Link to post
Share on other sites
Probably a little late, but here is something tha can be helpful to show how to get what you need all for free:

Share this post


Link to post
Share on other sites
Pretty cool video and Sourceforge has a lot of cool projects going.

Share this post


Link to post
Share on other sites
Hi Do you think is it possible to download/backup plc program with DF1 protocol on Micrologix 1200 ?

Share this post


Link to post
Share on other sites
This is to read values from registers

Share this post


Link to post
Share on other sites
so what is the meaning of: (chapter 12) Upload and download constraints When using the upload and download procedures described in this chapter, remember: • You can download only to a processor of the same type, model, series, and revision that you upload the image from • You cannot give the uploaded image to a programming software package • You cannot download the 6200 Series software archive file using these procedures

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0