Skip to content

Export data to Excel #243

Answered by evaldes2015
VadimShadorin asked this question in Q&A
Mar 21, 2024 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

Simple program to write to CSV:
from pylogix import PLC

plc = PLC()
plc.IPAddress = '192.168.128.22'
plc.ProcessorSlot = 0
data = plc.Read('conveyor', 300)
sdata = [str(d) for d in data.Value]
print(data)

f = open('data.csv', 'w')
f.writelines("\n".join(sdata))
f.close()

You'll obviously need to change the IP address, the tag name and the read length.

Good luck.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@VadimShadorin
Comment options

Comment options

You must be logged in to vote
1 reply
@VadimShadorin
Comment options

Answer selected by VadimShadorin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants