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
Visit site
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.
 

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
 

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 - - -


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?
 

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
 
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
 

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..
 

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. **broken link removed** 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.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…