Previous in Forum: FM/UL Pumps   Next in Forum: Blending Unit
Close
Close
Close
9 comments
Rate Comments: Nested
Active Contributor

Join Date: Apr 2012
Posts: 22

Visual Basics to PLC

10/17/2012 3:24 AM

Hello Forum,

I have a few questions regarding VB and PLC's. Is it possible to control a PLC using a VB program? I would only need to have a STOP and CONTINUE function sent to the PLC, nothing more than that as far as controlling the PLC.

I would be using Microsoft Visual Studio 2010 Professional and I would be attempting to control a Siemens S7 300 PLC with either the 312, 314, or 315 processor. I am not sure which processor is in it right now. I would be able to communicate either through ethernet or serial port (RS232) connection.

Also, is it possible to record data from the Siemens S7 300 PLC using a VB program to either a CSV file or a Excel 2010/2007 file?

Thanks for you help and for your time!!

Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

Good Answers:

These comments received enough positive votes to make them "good answers".

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Guru
Popular Science - Weaponology - New Member Netherlands - Member - New Member Fans of Old Computers - Commodore 64 - New Member

Join Date: Sep 2007
Location: Japan
Posts: 2703
Good Answers: 38
#1

Re: Visual basics to PLC

10/17/2012 3:44 AM

Yes, it is possible if the PLC accepts commands through Ethernet and/or serial cable, you just have to program it.

__________________
From the Movie "The Big Lebowski" Don't pee on the carpet man!
Register to Reply Score 1 for Good Answer
Guru

Join Date: Dec 2008
Location: Cd. Juarez, Chihuahua, Mexico.
Posts: 1023
Good Answers: 69
#2

Re: Visual Basics to PLC

10/17/2012 9:19 AM

Yes, you have to talk to a Siemens sales/applications engineer to know about the communication modules between the PC and the PLC (interfaces) and the programming involved.

Ethernet is a lot faster than RS232, but you will notice this diference in data heavy transmissions, for your start - stop application the serial port might be good enough.

__________________
No hay conocimiento ni herramienta que sustituya al sentido comun.
Register to Reply
Guru
United Kingdom - Member - Indeterminate Engineering Fields - Control Engineering - New Member

Join Date: Jan 2007
Location: In the bothy, 7 chains down the line from Dodman's Lane level crossing, in the nation formerly known as Great Britain. Kettle's on.
Posts: 32175
Good Answers: 839
#3

Re: Visual Basics to PLC

10/17/2012 10:29 AM

Of what meaning and of what consequence would <...STOP and CONTINUE function...> have to a PLC? Isn't that the same as an on/off switch?

__________________
"Did you get my e-mail?" - "The biggest problem in communication is the illusion that it has taken place" - George Bernard Shaw, 1856
Register to Reply
Power-User

Join Date: Apr 2006
Location: USA
Posts: 252
Good Answers: 6
#4

Re: Visual Basics to PLC

10/17/2012 1:10 PM

Others are correct that you can communicate to a PLC over ethernet from a VB program. However if you want the ability to actually RUN VB (OR C+) programs within the PLC environment, and share data over the backplane, then your best PLC option is Rockwell Automation's ControlLogix platform. They have a readily available "SAM" module, that is a full blown Windows PC, that fits within a PLC slot. The module has ports for monitors, mouse, USB and keyboards. It has Wondows pre-installed, and the user has full Windows programming control options including playing "solitare" if you so desire.

I used one of these years back to allow me to write a custom ethernet interface to a coating weight gauge. Then I backplaned (not a real word) the data to/from the Logix controller-- Still in operation today. and the good thing is once set up you can disconnect all the peripherals and it looks just like a normal PLC card.

Numerous power cycles/failures since then, and I have never had to reconnect the monitor or keyboard- it just boots up and runs the VB program, that I put in the "Start=up folder"

I realize I sound like a salesman, but I am very pleased with the performance, and the only warning I have is the price may seem high depending on your application.

good luck!

Register to Reply Score 1 for Good Answer
Power-User

Join Date: May 2010
Location: Cambridge, MA
Posts: 390
Good Answers: 82
#5
In reply to #4

Re: Visual Basics to PLC

10/18/2012 7:28 AM

I imagine you resisted the temptation to hook your finished controller to the internet using its Windows internet capability. Properly done, that would have meant running antivirus programs, continually upgrading the software and hardening the firewall, etc., to deal with today's hostile environment. Poorly or non-maintained old versions of operating systems running inside aging but-still-works-fine instruments can be a big source of vulnerability in an industrial network.

__________________
Thanks, Win
Register to Reply
2
Associate

Join Date: Oct 2012
Posts: 30
Good Answers: 3
#6
In reply to #5

Re: Visual Basics to PLC

10/18/2012 8:57 AM

Very good point. So many people aren't aware that anything that connects to the internet can be "gotten to", even if it only used as 'bot for denial of service attacks or a transfer node. The only caveat I would offer is that the PLC doesn't need as heavy a support IF it is isolated behind a competently maintained network server AND the authentication is strong...then again we are talking Windows, the most heavily targeted OS around.

Register to Reply Good Answer (Score 2)
Power-User

Join Date: Apr 2006
Location: USA
Posts: 252
Good Answers: 6
#8
In reply to #5

Re: Visual Basics to PLC

10/18/2012 8:51 PM

It was hardly a temptation , in fact I only resorted to this card because I could not comm directly to the gauge using the standard Logix Enet card. Seems it only allows Rockwell's protocol.

Yes, I was (am) afraid to change anything on the setup once it was all working. It is a very expensive uni-tasker!

Register to Reply
Commentator

Join Date: Aug 2012
Posts: 68
#7

Re: Visual Basics to PLC

10/18/2012 10:32 AM

Yes it is possible by using visual basic program .the issue is not within type of the processor . but with serial port. if S7 300 PLS has an RS232 interface you should convert it to USB(universal serial bus) by using FTD device USB to serial bus converter i think the best device number you can easy deal with, it is FTD232RL comes with its software driver installation for more details go to search FTD232RL DATASHEET .

Register to Reply
Guru

Join Date: Aug 2010
Posts: 687
Good Answers: 21
#9

Re: Visual Basics to PLC

10/21/2012 3:36 AM

If all you need is to turn an input on or off using VB program from a PC, then insert an opto 22 card into pc and take a in put to or from unit. Cheap way to get what you want. For no more then you want to control.

Register to Reply
Register to Reply 9 comments

Good Answers:

These comments received enough positive votes to make them "good answers".

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Copy to Clipboard

Users who posted comments:

caeser (1); Epke (1); fixitorelse (1); Mevel123 (2); MkSteel (1); PWSlack (1); Winfield Hill (1); Yahlasit (1)

Previous in Forum: FM/UL Pumps   Next in Forum: Blending Unit

Advertisement