Tag Values to Telegram #183
Replies: 6 comments 10 replies
-
My suggestion to you is to read telegram documentation and create a bot and write commands, etc. Then play with pylogix separately. Once you know both api's, put that knowledge together and create your telegram/pylogix bot. Asking for someone to create a bot for you is a bit lazy imo especially when both pylogix/telegram have tons of examples. |
Beta Was this translation helpful? Give feedback.
-
Alright, everyone calm down. Let's just chalk this e-communication doesn't convey emotion very well. Starting over... A very simple example of reading from 3 PLC's (assuming the tag names are the same in each): import pylogix
tags = ["Tag1", "Tag2", "Tag3"]
plc1 = pylogix.PLC("192.168.1.10")
plc2 = pylogix.PLC("192.168.1.20")
plc3 = pylogix.PLC("192.168.1.30")
vals1 = plc1.Read(tags)
vals2 = plc2.Read(tags)
vals3 = plc3.Read(tags)
print(vals1)
print(vals2)
print(vals3)
plc1.Close()
plc2.Close()
plc3.Close() |
Beta Was this translation helpful? Give feedback.
-
I assume it was the word SETUP that caused the confusion. Apologies for the incorrect phrasing of my question.
Yes thank you. Makes a ton of sense. Instead of print(vals1) I would... Now that I have 1 foot in the door, I will wait for my devices to arrive then tackle it head on. |
Beta Was this translation helpful? Give feedback.
-
I installed telebot (on the raspberry I did not want to use) with a working example of diceyclock. This is the output in telegram... My custom description with the tag value. Looks perfect
This is the modified example.
|
Beta Was this translation helpful? Give feedback.
-
Just an update. @dmroeder , thank you for the valuable advice. |
Beta Was this translation helpful? Give feedback.
-
O no. Removing the ethernet from a plc stops the script, but that caused by telepot because of the None value. Is the word None the same as NO Comms? I assume now I should be testing for comms first before proceeding to the other parts of the script? |
Beta Was this translation helpful? Give feedback.
-
I have been reading about telegram bots in python and how to use them to send different replies with different commands.
It would be great of I could command /vibrations and then get a reply about all the motor bearing vibrations on the 3 PLC's that controls motors and pumps.
Any way you could setup an example of of such a scenario, get 40 tags from 3 PLC's and send it via telegram?
Beta Was this translation helpful? Give feedback.
All reactions