How to talk between an excell spreadsheet and RSlogix 500

reider

Member
Join Date
Sep 2012
Location
meadow lake
Posts
20
Here's my dilemma. At the sawmill I work at, we have a tarping machine and labeling computer that talk to our Rslogix 500 PLC. So basically what happens is this. The operator taps on say 96" Stud. The label printer spits out a label and the tarp automatically knows how much paper to wrap the package with. My problem is that we have now gone to a new HMI. Talking with the HMI developers, they have come up with a plan to send the data I need to a simple excel spreadsheet. The data I need is only 4 cells in excel. Then from there the PLC reads that data so the PLC knows exactly how much paper the package needs. Basically excel is acting as the middle man. Any help will be appreciated. Cheers!
 
Rockwell has a Tech Note that shows how you can "poke" from Excel to the Logix controller. So if you have a Tech Connect contract you can search for Tech Note # 20434.

Basically you need a paid version of RSLinx Classic to get DDE capability. Not the free "Lite" package.

First, you set up an OPC/DDE Topic in RSLinx. Then in Excel you need to be in developer mode and add a button. Then you create some VBA code to assign to the button. When you press the button the code will "poke" that data to the ControlLogix. Once you get a button working then you can see if you want to trigger the code some other way.

Here is an example of the code I used for my example:

Sub DDE_Write_RSLinx()

DDEChannel = Application.DDEInitiate(app:="RSLinx", topic:="Production")
DDEItem = "Poke_From_Excel"
Set RangeToPoke = ActiveCell
Application.DDEPoke DDEChannel, DDEItem, RangeToPoke
Application.DDETerminate DDEChannel

End Sub


"Write_RSLinx" is the macro name assigned to the button
"Production" was the name of my topic in RSLinx. "Poke_From_Excel" was the name of a Controller DINT tag in my CLX.

The ActiveCell means whichever cell I click on, that will be the one written to the CLX tag. You can also specify a range of tags instead.

OG
 
Is the new HMI just talking with the PLC or only printing the labels or is it doing both? I guess what I'm not understanding is why the HMI would write to Excel, then you need something to turn around and write it to the PLC. I would look to the HMI software to do all of it.
 
I'm with Archie on this one. If the HMI can't talk to the PLC directly, I'm not entirely sure what it IS supposed to be good for.

If there is a reason for the data to be in Excel, that's fine, but I'd recommend using something like OPC to communicate to the PLC if the HMI doesn't have a driver for it directly. Communicating via Excel seems like asking for trouble to me.
 
The HMI is directly connected to the Label printer. So for example I want to print a label for 92 5/8 lumber. I tap the HMI button for that label and it prints it off no problem. The developers have everything written in C+ and VB. So what I want to happen is when I print off a label, the paper wrap will come down to the exact length of what I need at the same time. So maybe I don't even need excel to do what I need.

Before our old system was setup with labview. One of those things where a prior employee programmed and made it work and now the computer crashed recently. I don't know labview very good and want to get rid of it from our mill. I find labview to be a pain in the ***.

Sorry if I seem I little lost, Just kinda getting into this AB environment
 
Do you know if it is written in VB.NET or C#? If so, I can give you a very easy example of how to use AdvancedHMI to write values to the PLC within the same program that is printing labels.
 
Since you're using .NET, you can easily integrate the existing application into AdvancedHMI and be able to read/write PLC data. if you wanted to give it a quick try, it is easy to get started and free.

- Download and extract the AdvancedHMI solution
- Using Visual Studio 2012 or higher, open the solution
- Build the project
- If not already open, double click the MainForm in Solution Explorer
- From the ToolBox, add an EthernetIPforSLCMicroCom driver to the form and set the IPAddress property
- Add a BasicLabel to the form
- Set PLCAddressValue and PLCAddressKeypad to N7:0 (or a register you want to look at and change)
- Run the application
- Click on the label to be able to change the value


Now if you want to set a value based on the operator clicking a button, you can use a BasicButton, set OutputType to SetValue, and set ValueToWrite.

If this looks like it is want you want, you can then add the existing project into the solution, by right clicking the top level solution in Solution Explorer and selecting Add Existing Project. You will then need to add 4 references to the imported project. These can be seen by looking at the references in the default project.
 

Similar Topics

This question may be odd but I am a maintenance guy and just started with Rockwell automation software. I have got a computer from my new current...
Replies
2
Views
10,267
I've taken a working FTView 7 project from one PC via the achieve method, dropped it onto another PC on the same network that already had a fully...
Replies
2
Views
1,862
Good Evening , I'm working on a FactoryTalk View ME project and I have my communication path setup with my L33 CompactLogix and when I do the...
Replies
1
Views
2,149
hi all, what's the best way to check the com link between PLC and FTView site edition ? i have a task to run when the link is broken Thanks
Replies
2
Views
2,449
Hi, first time poster. I am a new graduate working in the automation and controls industry for an OEM. I am working on making a new HMI interface...
Replies
3
Views
18,352
Back
Top Bottom