Muhammad Magdy

transfer data from visual studio to s7-300

11 posts in this topic

how i can transfer data from visual studio 2010 ultimate visual basic language to variables in simatic manager siemens s7-300

Share this post


Link to post
Share on other sites

Is this intended for a running program or are you simply initializing PLC variables in a static program that will be downloaded to the CPU?

Share this post


Link to post
Share on other sites

yes i initializing plc variables in an static program that will be downloaded to the plc and i create a visual basic data base program that contains data i want to transfer this data to variables in the simatic manager program via button in visual basic 

Share this post


Link to post
Share on other sites
3 hours ago, pop29684 said:

Is this intended for a running program or are you simply initializing PLC variables in a static program that will be downloaded to the CPU?

Thank you for reply me, yes i initializing plc variables in an static program that will be downloaded to the CPU and i created a visual basic data base program that contains data i want to transfer this data to variables in the simatic manager program via button in visual basic 

Edited by Muhammad Magdy

Share this post


Link to post
Share on other sites

How many variables are you working with?

Share this post


Link to post
Share on other sites
2 hours ago, pop29684 said:

How many variables are you working with?

I think don't exceed 25 variables

Share this post


Link to post
Share on other sites

I would copy and paste them by hand. Twenty-five variables doesn't seem like a lot. There are a couple of options though.

1.) Send your data to an MS Excel spreadsheet. Copy the entire block of data in the spreadsheet. Import the data to a DB.

2.) This is a method I have not used but it may be useful to you: https://support.industry.siemens.com/cs/document/15162450/automatic-generation-of-an-s7-data-block-with-step-7-v5-x-from-an-ms-excel-2003-table?dti=0&lc=en-WW

Share this post


Link to post
Share on other sites
9 hours ago, pop29684 said:

I would copy and paste them by hand. Twenty-five variables doesn't seem like a lot. There are a couple of options though.

1.) Send your data to an MS Excel spreadsheet. Copy the entire block of data in the spreadsheet. Import the data to a DB.

2.) This is a method I have not used but it may be useful to you: https://support.industry.siemens.com/cs/document/15162450/automatic-generation-of-an-s7-data-block-with-step-7-v5-x-from-an-ms-excel-2003-table?dti=0&lc=en-WW

Sorry mr pop there are misunderstanding . Consider that i created a complete program in simatic manager and complete program in visual basic . So, when i write data in visual basic in textbox i want send this data to variables in simatic manager via button 

Edited by Muhammad Magdy

Share this post


Link to post
Share on other sites

Ahhhh, ok. Let me see if I understand your situation. You have a standalone program, written in Visual Basic, that generates data which you wish to send to a running S7-300 CPU. Am I correct?

Where do you wish to send this data - to a DB or IDB?

What communication protocol(s) do you have available - ProfiBus, ProfiNet, serial, Ethernet I/P?

How often does this data need to be transferred to the CPU?

1 person likes this

Share this post


Link to post
Share on other sites
8 hours ago, pop29684 said:

Ahhhh, ok. Let me see if I understand your situation. You have a standalone program, written in Visual Basic, that generates data which you wish to send to a running S7-300 CPU. Am I correct?

Where do you wish to send this data - to a DB or IDB?

What communication protocol(s) do you have available - ProfiBus, ProfiNet, serial, Ethernet I/P?

How often does this data need to be transferred to the CPU?

Thats right, but the user who send data from visual basic to plc manually via button 

and the communication protocol is profibus 

about the last question depend on how often the user press button to send this data.

The project is concrete batching plant pragram ... The visual basic program is consider database program with sql server database take the recipe contents (cement- water- aggregates) by kg i want to send this data from visual basic and sql server db to plc and another data like timers of belt and mixer running and parameters of the plant this data also in visual basic program the user also can edit it in visual basic and will send it to plc by button in visual basic

this is all i want

thank you very much for your efforts

Share this post


Link to post
Share on other sites

Does the system currently use an HMI? Can your VB program be used as a script in the HMI? This would make your life much easier. The HMI already has an established communication path with the PLC. The recipe parameters can be displayed on the HMI for the operator/supervisor to see. Recipe creation and modification could be password protected so that only key personnel are allowed to make changes.

If you must use a separate PC to generate the recipe data, probably the best method to write it to a DB in the PLC is to use an OPC server of some kind. Data can be read, written, and cleared in a specified DB.

There are several choices, with most being paid applications. The use and setup of these packages depends on which one is selected and implemented. Kepware is one package that is frequently used. I've never used it so I cannot give you any further idea about it. Perhaps there are others who can share their ideas and experience in this regard. A long time ago I used AGLink. I was transferring data between a PLC and an Excel spreadsheet on a PC. It was very easy to setup and use. I constructed the Excel sheet so that it automatically collected data from the PLC and then cleared the DB on a schedule of every eight hours. I'm sure it would be easy to create a button on the sheet that would write data to the PLC. Or in your case, create a simple VB button to do the same thing.

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