Is it possible to use a PLC to trigger a excell file to print?

Cameron101

Member
Join Date
Apr 2015
Location
Alabama
Posts
1
I have a Allen Bradley L71 processor that I would like to send a command to a printer, or a computer to print a file. In a nut shell anytime our line is down more than thirty min we want a RCA to be printed out for our operators to fill out. The RCA is in excel format, so I guess what I'm looking for is someway to trigger the computer to print it. The processor communicates over Ethernet IP, but I could also send a command to a SLC 5/05 if I need to use a serial command. If anyone has any ideas i would appreciate it.
 
Checkout Advanced HMI on the forum. It would likely need to be running on the the same PC as the printer. Advan'HMI can do both SLC and CLX comms
 
Ever played with a basic module?

I am getting ready to do something similar. I am trying to tie my PLC into a database on a Zero dollar budget. I am wanting to send and receive program information between a PC and my SLC 500/4. I recently went through the process of programming an Allen Bradley Basic Module to run a marquee board. Now that I have learned Allen Bradley basic I figure I can utilize the 2nd port to send and receive info to/from a PC. Towards this end I am learning MS access and visual basic programming. The plan is this:

Add barcode scanner to PC. An 8 digit part number is scanned in and input into database. The database looks it up in a table and then sends this number and other info from a table to the basic module. The basic module updates the marquee board based on this info. Some of the information is then passed onto the PLC processer. The PLC processer then updates the program number info and sends back part count for the last program. This is sent to the basic module which in turn sends it to the PC. This info is then entered into a different table in the database.

Normally I would do this over RS-232 serial communication but the distance is over 50 ft so I use the RS-485 protocol and have a RS-485 to RS-232 converter.

If my boss doesn't get in the way I am hoping to have this done in a couple of months (too many other things going on for it to occur sooner)

Ponder On It
 
https://support.office.com/en-ca/ar...5f5-90a3-50e645fe3155#bmrunmacroautomatically

https://msdn.microsoft.com/en-us/library/czhz96h7.aspx

These may be able to help you out. Configure the macro to auto run in excel using the top link and the printing the sheet is on the bottom.

Compact and ControlLogix both have code in the sample library for communicating via Ethernet TCP/IP using a standard ENBT card, or you can use serial. I think I remember a problem with the CLX continually sending an ENQ command over TCP/IP, but it was fixable.

Note: The TCP/IP logic has saved me a lot of time and money on integrations.

Were you looking to open the file remotely as well?

Advanced HMI is another good option. My experience with it is rather limited, but it may integrate well with Excel due to the VB Shell base.

EDIT: I think the ENBT has to be v20 or later in order to open sockets.
 
Last edited:
AdvancedHMI can definitely do this. Here are some steps to get you started:

- Open the AdvancedHMI project with Visual Studio
- Right Click the AdvancedHMI project in Solution Explorer and select Properties
- Select the References Tab
- Click Add Reference
- On the COM tab, locate Microsoft Excel Object Library, and then check the box


- In Solution Explorer, double click MainForm.vb
- Build the Solution from the Build menu
- In the Toolbox, go to the AdvancedHMIDrivers group and add an EthernetIPforCLXCom to the form
- In the properties window, set the IPAddress to the address of your PLC
- From the ToolBox, add a DataSubscriber to your form
- In the Properties Window, set PLCAddressValue to the BOOL tag name in the PLCwhere you want to trigger the print

- Double click on the DataSubscriber to get back to the code
- Enter this code:
Code:
if e.values(0)="True" then
        Dim oXL As Microsoft.Office.Interop.Excel.Application
        ' Start Excel and get Application object.
        oXL = CreateObject("Excel.Application")
        oXL.Visible = True

        oXL.Workbooks.Open("MyExcelFile.xlsx")
        oXL.Worksheets.PrintOutEx()
End If


I have not been able to completely test this right now, but let me know if there is any problem and I will do a full test this evening. Since AdvancedHMI sits on top of the .NET framework, there is a huge amount of information on this topic, just Google ".NET Excel Automation"
 
Last edited:

Similar Topics

Hello, I have been getting more and more requests for Real Time Clock (RTC) sensitive automation from my clients. I know that there is a Modbus...
Replies
13
Views
2,757
Hi All I have a very simple logic with some light sensors and RFID reader, which are providing start and stop events for capturing some short...
Replies
10
Views
2,735
I will be designing an automated hydrostatic system. The system on paper works like this, a plc like the click will get information from an hmi...
Replies
227
Views
43,168
Hello. I am a very begginer about PLCs, and I would like to know if it is possible the following case. I have a S7 PLC and a TP1500 touchscreen...
Replies
8
Views
2,813
Hello all, I am using a temposonic R series linear transducer for positioning of a lower ram on a hydraulic powdered metal press. The transducer...
Replies
7
Views
1,942
Back
Top Bottom