Sign in to follow this  
Followers 0
Patriot

Vhmiautomation Slc500 Df1 Driver Examples

8 posts in this topic

Does anyone out there have any experience using the vHMI Automation Active X DLL PLC Communications drivers? I recently bought the AB Driver to communicate DF1 or ethernet to a Micrologix 1000. I have looked at the supplied demo program, and I have read the supplied documentation. There are no examples for bit reads and writes. Does anyone have any additional examples of communicating with a PLC using either the ethernet or DF1 drivers from vHMIAutomation?

Share this post


Link to post
Share on other sites
Isn't that designed specifically for Visual Basic? I also believe that there are diffrent calls for specific PLC's. I think this might be what you are looking for or have looked at. If you are refering to an AB PLC. I have little experience with these, but I'm almost positive that you cannot directly address an I/O with this driver (you will have to try I: and O: instead of N: to see). You must indirectly do it through the interger bits. This is not quit as pretty as doing it through RSView32 which will allow you to do anything to anything. First of all you need to connect to the PLC with the "Set ab =" command, whether it be by serial or ethernet. Assuming a connection has been established, the first statement sets up a write command to an AB processor. The second statement assigns the interger file that will be written to. The third statement assigns the starting word within that interger file. The forth statement tells the length of words to read. The fifth statement declares the type of words being written to. The sixth statement is the value being sent. The seventh statement actually tells the processor to do it. The last statment is basically like the "go" button. I have seen this on an Automated Solutions Active X control before. I believe the 888 is actually being written to the entire word (not just a single bit) in the example. Just convert decimal to binary and display the Interger file and see what is actually there after doing a write. A PLC uses two bytes as a word which is equal to 65,536. The low byte ranges up to 256 and the high byte does the rest. Things also get a little tricky if you are using 2 or 1/2 slot addressing. You will need to try and keep your numbering system consistent with all output/input modules or you will only read every other module. Ken Roach will be the first to tell you that RSView32 is the way to go because you can read/write to any individual bit that you want to. With third party drivers, you are usually limited to interger words ( at least when writing) which requires you to make ladder logic changes to accomidate the VB program. This is often time consuming. I hope this helps, and remember I could also be wrong on all of this so don't quote me Edited by jonnie75

Share this post


Link to post
Share on other sites
I understand your example, and I have not had problems writing on a "word" level. According to vHMIAUTOMATION's documentation there is a .Memory_Function=SetBit_df1 and .Memory_Function=SetBit_eth which should allow individual bits to be set. I have yet to find a way to make this work. If anyone has any idea how to construct the code to set or clear a bit in the PLC using the vHMIAUTOMATION driver, please let me know.

Share this post


Link to post
Share on other sites
The problem might be that the PLC does not support bit writes. I have yet to get an example working that can set and clear an individual PLC bit in a Micrologix 1000 using the DF1 option for the VHMIAUTOMATION driver. I have used other drivers in the past, and had better documentation and examples than what I got with this, but since I only paid about $50 instead of several hundred, I guess I got what I paid for. If anyone has any ideas or has managed to get this working, please let me know.

Share this post


Link to post
Share on other sites
The specific code I am trying to use to set a bit is shown below. I get a message that the "The Memory_Function type is not supported for this PLC Model." This code error is generated by the VHMIAUTOMATION driver, and makes me suspect that bit writes for a Micrologix 1000 are not supported. With df1 .Memory_Function = SetBit_df1 .Memory_FileAddress = 3 .Memory_StartAddress = 0 .Memory_BitPosition = 0 .Memory_Type = B_Binary_df1 .Control_Update End With The above code is located within the click event of a command button. I am trying to set bit B3:0/0.

Share this post


Link to post
Share on other sites
I think I found the answer. Try downloading the "DF1 Protocol and Command Set" from ab.com (look in chapter 7 page 7-2). The command list shows that a bit write to a Micrologix 1000 can't be done. The only option is to do an uprotected write (a word, to file 7, which is the Integer file). This page shows all of the df1 options for all of there PLC's (a must have). This might explain why it isn't working quit like it should. Where did you find the documentation on how to write/read to/from a bit? My friend has that same driver and he couldn't locate that example anywhere. I also tried to check the vhmiautomation website and I seen no examples for doing that there, either. Their documentation is a little on the weak side. Hope to hear how it all works out. P.S. I took a look at your profile and it appers as though we live in the same city. Edited by jonnie75

Share this post


Link to post
Share on other sites
It sounds like you have the answer. I had downloaded the DF1 command set from AB, but I did not read it very thoroughly. I was suspecting that the Micrologix could not handle bit writes to it. I did not see any example of a bit write (in fact the only Vhmiautomation examples discuss word writes), but I was curious since part of the driver command set includes instructions to set and clear bits using DF1 or ethernet. I tried to piece together some code to set a bit, although there is no example in the documentation. It would have been helpful if the documentation included some more in depth information and examples of the use of the command set of the driver. There appears to be a lot of functionality to it, provided you can figure it out on your own. I will be sure to look more at the DF1 command set from AB as a reference. Thanks for the help.

Share this post


Link to post
Share on other sites
I just thought that I would mention that I emailed Phil Covington , president of Vhmiautomation, about addressing a bit. When he thought that I was a perspective customer with a question regarding single bit reads/writes, he managed to send me an email back assuring me that it was possible to do single bit read/writes. I then replied to his email, explaining to him that no purchase would be involved, and that I just wanted an example of a function call used to address a single bit because neither his website nor the accompanying documentation included an example of this type. He never emailed me back. I went back to the Vhmiautomation website and tried contacting each one of their contacts, allowing a couple of days in between. As a result, I never received a reply. To make a long story short, ask all of your question ahead of time with these guys because they're gone when the sale is over.

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