Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Computer to PLC Communication using VB

Status
Not open for further replies.

sharikbaig

Member level 1
Joined
Aug 24, 2013
Messages
41
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,288
Activity points
1,613
Hello Everyone,
I want to control my PLC's digital outputs according to the data given by a Windows Application (Visual Studio 2012). We know that PLC has some registers inside it, so i want this windows application to write some data into one of those registers (register address to be specified in VB code). I can of course use serialPort to write the data into Serial Port, but the problem is, how to make the data written in a specific register of PLC? OR How to read data from a specific register of PLC?
After the data is stored in one of the registers, i can program the PLC to take appropriate action.
Any help would be appreciated.
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
19,727
Helped
4,344
Reputation
8,697
Reaction score
4,304
Trophy points
1,393
Activity points
130,568
Hi,

it depends on what PLC you use.
Try to find at the PLC manufacturers internet pages to find out how to write the registers of the PLC.

But first you have to setup the correct interface and it´s parameters.

For better assistance we need detailed information.
Device types, descriptions, code, schematic and so on.

Klaus
 

sharikbaig

Member level 1
Joined
Aug 24, 2013
Messages
41
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,288
Activity points
1,613
KlausST, thanks for your interest. PLC make & model is "Delta DVP 12SE".

Schematic is what i dont need to have, as i just want to turn a Digital Output HIGH/LOW.
Code is what i am asking for.

I have attached a manual of PLC, please make sure to check chapter 4: Communications.

View attachment 2nd Generation.pdf

- - - Updated - - -

Hello Everyone,
I want to control my PLC's digital outputs according to the data given by a Windows Application (Visual Studio 2012). We know that PLC has some registers inside it, so i want this windows application to write some data into one of those registers (register address to be specified in VB code). I can of course use serialPort to write the data into Serial Port, but the problem is, how to make the data written in a specific register of PLC? OR How to read data from a specific register of PLC?
After the data is stored in one of the registers, i can program the PLC to take appropriate action.
Any help would be appreciated.

Framing the question in a simpler format - How can i 'Write data to' or 'Read data from' specific registers in a PLC with the help of a Windows aplication developed with Visual Studio 2012. What will be the alterations in serialPort class?
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
48,408
Helped
14,251
Reputation
28,763
Reaction score
12,939
Trophy points
1,393
Location
Bochum, Germany
Activity points
280,133
The PLC uses MODBUS protocol. You can either use an existing MODBUS library or write MODBUS master code from the scratch. In both cases, you find helpful information here https://www.modbus.org/tech.php
 

sharikbaig

Member level 1
Joined
Aug 24, 2013
Messages
41
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,288
Activity points
1,613
Dear FvM, Thank you so so much! This information helped a lot to me. I even found some libraries which i will to use. Thank you. I Will upload my code as i finish it. And I'll come back if i get stuck somewhere in programming. Thanks for your help :)
 

sharikbaig

Member level 1
Joined
Aug 24, 2013
Messages
41
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,288
Activity points
1,613
Hi,
Since 2 days I have been trying to use some library but none of them have sample codes for me to understand. And i need them because unfortunately, i am a noob in VB. Someone please help me get a suitable library to read & write data to Modbus RTU devices..
Also sample codes if possible, please..
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
48,408
Helped
14,251
Reputation
28,763
Reaction score
12,939
Trophy points
1,393
Location
Bochum, Germany
Activity points
280,133
I'm not using VB for serious projects (except when modifying existing tools). Obviously you'll find much more C-code on the net. But I think there are a few VB examples linked under modbus.org, e.g. https://homepage.ntlworld.com/p.mcrae/paul/modbuswin.html You may find more using Google.

Of course I can't score understandability. Personally, I've been writing all MODBUS client code from the scratch.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top