Vb6 and AB SLC503 interface programming

rcerva

Member
Join Date
Sep 2005
Location
South Africa
Posts
7
Hi. I'm doing a project that i need to send information to a VB6 program when my machine stop. The operator must put in a job nr to restart the machine. If the nr is the same as the current job the machine must start. If not the same the VB6 program must verify that a new job will be done. The plc used is a AB SLC 503. I am new to VB6. Can anyone help me with this.

Thanks
 
There are a few different ways I have communicated with SLC's / Micrologix & VB6.

1) Buy an ActiveX Driver (I use Automated Solutions and like it very well). There are many others out there. I think vHMI Automation has an inexpensive one as well.

2) Use an OPC server... Going to be fairly expensive and overpowered for what you are wanting to do.

3) Purchase a data acquisition I/O pci card. Run wires to/from PLC to the PC running the VB app.

4) If the PC and PLC are relatively close, you could connect the two via serial cable and output a string from the PLC (comm 0) and read it on the PC. This would not require any additional purchase.

5) DDE. Haven't done this, but I think there are serveral topics on this forum explaining how to do it.

I am sure there are other ways but that is what I can think of off the top of my head. Proximity of the PLC and VB app (PC) will probably have some bearing on how you do this. Can you elaborate on this?

Kyle
 
vb6 and ab plc 503 interface

Hi. Thanks for the help. I have set up the DDE in rslinx and can sent data to the plc. I'm working on a demo so distance at this stage is not a factor. The plc is next to my pc. In the factory i've set up a dh485 networkbetween the machines. My problem is more on the VB6 side and not so much on the plc side. I dont know how to get the plc to send a message to the vb6 program that the machine has stopped, and i must get a signal back to the plc if the job is to be changed.
 
i've used kepserver in the past. Its an OPC driver that cost about $700.00. They have a full version demo on their website that you can download, and use for 2 hours before you have to quit and restart the app. Along with the driver, they include 2 example programs for VB6. This may be helpfull to you.

The website is www.kepware.com, and look under Allen-Bradley.
 
If you're going the DDE route, someone else who has done is going to be more help than I.
You might consider just sending/receiving strings back and forth using an RS232 cable and channel 0 on the PLC. If you want to try this, I can probably be of help. Let me know what you would like to do.
 
What Kbcombs last suggested (communicate via RS232) would be your cheapest option. I did exactly what you are trying, but I used Vb.net and a Koyo DL-06 plc. The one critical thing is timing. As long as you aren't sending and receiving info too quickly, serial communication will work fine.

Try googling vb forums (I focus more on .net, not ver 6) but here's one to start: http://www.visualbasicforum.com/index.php

Good luck,

Mike
 
vb6 read

Here is an example of reading a word fron the plc whenever a command button is pressed, you can however set it up to poll in automatic mode with form_load or the like.

Sub Command1_Click ()

'Read word from N7:0

txt1.LinkTopic = "RSLinx|PLC1"

'Assign application|topic to DDE text box

txt1.LinkItem = "N7:0"

Assign link item to DDE text box

txt1.LinkMode = 2

'Set up link as manual; open up link

txt1.LinkRequest

'Request data RSLinx

txt1.LinkMode = 0

'Close DDE link

End Sub
 
txt1.LinkMode = 2

'Set up link as manual; open up link

Hello Menier,
Your app clearly requires an Auto mode, not Manual mode as shown above.

Herewith an excerpt from one of my DDE programs:

lblPeekIntegerData.LinkTopic = "RSLinx|ROBOT" 'Assign DDE application|topic to DDE label
lblPeekIntegerData.LinkItem = "N11:0,L20,C20" 'Assign DDE link item to DDE label (L20 = Length of 20, C20 = Format the data to go in 20 Columns via Tabs)
lblPeekIntegerData.LinkMode = 1 'Open DDE link (auto)
lblPeekIntegerData.LinkRequest 'Request data from RSLinx

Do not close the DDE link, let it run.
There are issues with DDE in Auto mode. If you switch power Off and On to the PLC and not to the PC you may find that DDE is hanging up. This will then require a re-start of the VB application. The way around this is not easy.
I solved it by using VB.NET and OPC.
There maybe an easier way to cope with this issue. If anyone has a solution I would like to hear it.

By the way I love Cape Town I used to live there (Gardens area).
 

Similar Topics

Hello, I'm trying to solve a problem. The visualisation is done by VB6. How can i figure out wich databit in S7 is linked to wich variable in VB...
Replies
1
Views
1,538
im doing some coding in vb6 and i have an error in this line : Dim myOPCServer As New RSiOPCAuto.OPCServer it gives me this error when compling...
Replies
11
Views
2,303
Good day all. I have a SLC500 that is controlling an air flow rig. The HMI is a PC using a home-made program using VB6. I have no experience with...
Replies
11
Views
4,485
does anybody have an example of how to connect to a 90-30 ge fenuc plc with the SNP-X protcol through visual basic? i have seen something on this...
Replies
5
Views
1,884
G'day there, I want to send real time data to a VB6 application. It works in excel thanks to a previous response from member - plastic, but I...
Replies
0
Views
3,803
Back
Top Bottom