Thanks Fulvio. This really helped. We ended up writing a .net application to read/write the data to the PLC. The .net app calls a REST API that I wrote on the iSeries to retrieve the label data.
Would have loved to try the Python solution but the guys we bought the machine from are heading back to Germany tomorrow and we wanted to have a working POC process in place before they left town.
-Rich
________________________________
From: Fulvio Biagini - Gmail <fulvio.biagini@xxxxxxxxx>
Sent: Thursday, March 7, 2024 10:45 AM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>; Rich Dotson <Rich.Dotson@xxxxxxxxxxx>
Subject: Re: Reading data from a SIMATIC.S7-1500 PLC
https://support.industry.siemens.com/cs/document/109748892/opc-ua-client-library-per-microsoft-excel?dti=0&lc=it-WW
Il 07/03/2024 14:19, Fulvio Biagini - Gmail ha scritto:
I've had the same problem ..
From AS400 and in RPG I didn't find anything free...
I solved the problem using an EXCEL example on the OPC Fondation site.
I use a VBA program that runs in Excel and which connects to the AS400 and the PLC where I read and write the variables in completely acceptable times.
HI
Fulvio
Il 07/03/2024 12:37, Rich Dotson ha scritto:
I have a request to read data from a Simatic.S7-1500 PLC directly from an RPGLE program and return data back. Has anyone done this before? I haven't had any luck searching for solutions via Google.
The application flow is as follows:
1.
Camera scans barcode on product and writes serial number to PLC.
2. RPGLE reads serial number on PLC.
3. RPGLE retrieves serial number data from iSeries tables and writes data back to PLC.
4.
PLC sends iSeries table data to printer.
5.
Printer prints iSeries table data on box.
I currently use an application called UaExpert to see the data being captured on the PLC. Not sure if the screen shot will come through but if it does, I need to read the data in the string_Seriennummer field in the stOut Address Space. I need to update the fields defined in the stIn section of the Address Space.
Any direction would be appreciated.
[cid:4482399e-7582-45c4-85d5-4e51865dcbaf]
Reply
Reply all
Forward
As an Amazon Associate we earn from qualifying purchases.