RSLinx OPC Server + MS Excel Question

arth608

Member
Join Date
Jul 2017
Location
Auburn Hills
Posts
7
Hello All,

I know it is possibile to access data from a PLC directly to excel using a OPC link through RSLinx. https://www.youtube.com/watch?v=pERxjWUaRUI

Question: Once the data is in excel and continuously being updated, is it possible to automatically export it at a specific time interval? (i.e. every 15 mins) If yes, how can I go about achieving this?

Question 2: If the above is possible, can I also export in a XML format at all?

Thank you and please let me know if there are any questions.
 
Hello All,

I know it is possibile to access data from a PLC directly to excel using a OPC link through RSLinx. https://www.youtube.com/watch?v=pERxjWUaRUI

Question: Once the data is in excel and continuously being updated, is it possible to automatically export it at a specific time interval? (i.e. every 15 mins) If yes, how can I go about achieving this?

Question 2: If the above is possible, can I also export in a XML format at all?

Thank you and please let me know if there are any questions.

My first initial thought would be to write a script to handle that automation. A few common scripting languages come to mind, but I would probably use Python, as there are most likely ready-made, easy to use methods in one of the Python libraries to handle those automation tasks.

Excel to XML using Python

File Handling using Python
 
Last edited:
Never tried it but you could generate the XML in VBA here is a link, I have not looked at it closely & I'm sure there are plenty of others if you search.
https://www.tek-tips.com/faqs.cfm?fid=7736
On the 15 minute log, perhaps rather than enabling/disabling the OPC you could again in VBA create a 15 min timer & then every time it triggers run the XML code to save the file.

Here is some code :

Dim nextTriggerTime As Date

Private Sub UserForm_Initialize()
ScheduleNextTrigger
End Sub

Private Sub UserForm_Terminate()
Application.OnTime nextTriggerTime, "modUserformTimer.OnTimer", Schedule:=False
End Sub

Private Sub ScheduleNextTrigger()
nextTriggerTime = Now + TimeValue("00:15:00")
Application.OnTime nextTriggerTime, "modUserformTimer.OnTimer"
End Sub

Public Sub OnTimer()
''//... Trigger whatever you want here

''//Then schedule it to run again
ScheduleNextTrigger
End Sub

''// Now the code in the modUserformTimer module
Public Sub OnTimer()
MyUserForm.OnTimer
 

Similar Topics

Hello All, I am going to try and lay out my situation as good as I can. Scenario: We have sites in different location across US that's running...
Replies
4
Views
2,952
Hey! In my previous queries on how to handle an OPC server like RSLinx in the ArchestrA IDE galaxy, I have succeeded and the answer was to just...
Replies
0
Views
1,822
Hey everyone!. I would like to know how to use a third-party data server other than Wonderware, such as RSLinx server to integrate it into the...
Replies
3
Views
1,582
Hi Experts, I am using Matlab as an OPC DA Client to communicate with AB PLC rslogix5560. I can successfuly read from the PLC but when i try to...
Replies
3
Views
1,562
Hello PLC expert i need your help. i want to use OPC communication and Matlab to read and write data from/to a Logix5561. A Topic is...
Replies
0
Views
1,652
Back
Top Bottom