Using Python To Read PLC Data With Visual Studio By Importing Pycomm3

  Рет қаралды 32,327

Shane Welcher

Shane Welcher

Күн бұрын

Пікірлер: 81
@ShaneWelcher
@ShaneWelcher 3 жыл бұрын
Subscribe: mmini.me/Subscribe-4-Updates Other socials: Facebook: facebook.com/OnlinePLCSupport LinkedIn: www.linkedin.com/in/shane-welcher-sr/
@darthenx2585
@darthenx2585 3 жыл бұрын
Great information. Possibly expand a bit more on how to for example read a int or dint , create a simple calculation and then out put the value to another device like a server or another plc
@ShaneWelcher
@ShaneWelcher 3 жыл бұрын
10-4, I will make a few more videos using Pylogix
@dustin9480
@dustin9480 3 жыл бұрын
Nice video Shane! I appreciate you showing pylogix. I've always wanted to make videos but I feel weird listening to myself :)
@ShaneWelcher
@ShaneWelcher 3 жыл бұрын
That is something I had to get used to as well, just give it a go & adjust as needed. You got this!
@johntgilmore1
@johntgilmore1 Ай бұрын
Dustin, on git hub you have helped me so, so, so freaking much may I share with you what I have done
@chuystark
@chuystark 3 жыл бұрын
Hello, i've been trying to connect to a logix5561 but i get unknown error errno [111] connection refused, do you have any idea of what could be happening?
@ShaneWelcher
@ShaneWelcher 3 жыл бұрын
What communication protocol are you using?
@dustin9480
@dustin9480 3 жыл бұрын
That error comes from pythons socket module, not the PLC. So you are not connecting to the PLC. Make sure you can successfully ping the ethernet module in your ControlLogix rack first. If your L61 is not in slot 0, then make sure you specify which slot it is in.
@chuystark
@chuystark 3 жыл бұрын
Yes, i could successfully ping it, the ip was in the same segment, the weird thing is that with pycomm3 i dindn’t have any problems but with pylogix i wasn’t able to read the tags
@ShaneWelcher
@ShaneWelcher 3 жыл бұрын
@@chuystark Probably missing an updated version of pylogix. Or the import of the needed files.
@kavinyudhitia
@kavinyudhitia 2 жыл бұрын
WOW! Very educative!!! thanks!! Subscribed!
@notme22
@notme22 18 күн бұрын
Thank you! Do you know if this can read tag values fast enough for motion axis? I’m looking for an easy way to sample a 10000 count encoder every 100 counts over 0.75 seconds and this seems to bypass having to learn/pay for the ODVA standards needed for IO Messaging.
@ShaneWelcher
@ShaneWelcher 17 күн бұрын
Depends on the timing used
@vivekpatil7967
@vivekpatil7967 9 ай бұрын
How to set PLC slot if a PLC controller is fitted in Chassis?
@ShaneWelcher
@ShaneWelcher 9 ай бұрын
Look on GitHub
@daviddemjan1916
@daviddemjan1916 2 жыл бұрын
Hi! I would like to ask for some help. I was able to gather the informatiom from PLC control tag (RSLOGIX 5000) but not able to work with it. So if I want to handle that information in forexample in an If statement I won't be able to work with it. import time from PIL import Image from pycomm3 import LogixDriver from tkinter import * with LogixDriver('here my IP adress I removed it') as plc: valami = plc.read('valami') print(valami) if valami: print("works") else: print("Doesn't work") It always says its true even if i toggle the bit to False. It will never go to else branch. Thanks for help.
@ShaneWelcher
@ShaneWelcher 2 жыл бұрын
Sounds like you do not have an active tag or your update time is incorrect, not sure what you are using for python programming I use VS code which is a manual trigger the code that reads the tags so it requires me to trigger the python code to get refreshed data
@daviddemjan1916
@daviddemjan1916 2 жыл бұрын
@@ShaneWelcher I do have an active tag, could you please share your mail I'll send you the picture what I have on pycharm.
@ShaneWelcher
@ShaneWelcher 2 жыл бұрын
I would recommend you reach out to the GitHub, I did not design Pycomm
@cmrncrick
@cmrncrick Жыл бұрын
Whenever you toggle the bit are you restarting the script? If not then I don't think your value will be automatically updated because the python script isn't looping in that code. I have written a class object that looks for the leading transition of a bit constantly so as to circumvent this issue and it works well.
@vigneshsankar8862
@vigneshsankar8862 2 жыл бұрын
Hi, Shane in my application I need to monitor the tag of about 5000 of data length 4byte is that possible using those libraries
@ShaneWelcher
@ShaneWelcher 2 жыл бұрын
Yes however, it may take a bit to collect all the data because of the way Python works. If you need a faster alternative then I would use JavaScript although it's a bit harder to implement
@DuneKraftwerk
@DuneKraftwerk Жыл бұрын
​@ShaneWelcher what is the node js alternative you refer to ?
@vishayinternet
@vishayinternet 3 жыл бұрын
is it possible to change controller mode from Python e.g. Run mode to Programm mode?
@ShaneWelcher
@ShaneWelcher 3 жыл бұрын
Not from my knowledge, that is a safety risk in my opinion
@kennythien2049
@kennythien2049 Жыл бұрын
Hi Shane, are you able to do a video on Modbus TCP/IP using python?
@ShaneWelcher
@ShaneWelcher Жыл бұрын
I do not have a modbus converter to use although yes you can read data from the IP address. Also depends on the modbus converter
@lekanraji9899
@lekanraji9899 3 жыл бұрын
Which file do we need to download from github to do the same thing?
@ShaneWelcher
@ShaneWelcher 3 жыл бұрын
If you have python & an internet connection then open your CMD then run the pip install as shown of the pycomm3 GitHub page
@Slap_it_in
@Slap_it_in 2 жыл бұрын
Why do my imported libraries never show up as purple?
@ShaneWelcher
@ShaneWelcher 2 жыл бұрын
Probably your setup, I use the full version
@Slap_it_in
@Slap_it_in 2 жыл бұрын
@@ShaneWelcher It was the intellisense, also i believe there is a known issue with VS were it wasn't working. I moved to VSC and got familier with using that instead.
@ShaneWelcher
@ShaneWelcher 2 жыл бұрын
@@Slap_it_in Thanks for the reply
@shraddhajadye8057
@shraddhajadye8057 2 жыл бұрын
Can we transfer the reading value of plc into excel file?
@ShaneWelcher
@ShaneWelcher 2 жыл бұрын
With extra code yes, I think you would have to add on the python script & make a small gui
@shraddhajadye8057
@shraddhajadye8057 2 жыл бұрын
@@ShaneWelcher Thnank u....Above program is working for delta plc?
@ShaneWelcher
@ShaneWelcher 2 жыл бұрын
@@shraddhajadye8057 Rockwell Automation
@abdulazizallahdan6546
@abdulazizallahdan6546 3 жыл бұрын
is there a way to connect to studio 5000 emulate?
@ShaneWelcher
@ShaneWelcher 3 жыл бұрын
I believe if you visit the GitHub, there is another source code for that. I haven't tried that one yet
@abdulazizallahdan6546
@abdulazizallahdan6546 3 жыл бұрын
@@ShaneWelcher Will check it out! Thank you for reply!
@fox9starshow
@fox9starshow Жыл бұрын
thanks for your Idea.
@renanamorim7525
@renanamorim7525 10 ай бұрын
Thanks for the video! Is the PLC working as a Scanner or Adapter here?
@ShaneWelcher
@ShaneWelcher 10 ай бұрын
I just attached a plc processor to the computer then ran Pycomm3
@khachuytran3552
@khachuytran3552 2 жыл бұрын
Thanks you a lot, sir!
@ShaneWelcher
@ShaneWelcher 2 жыл бұрын
Glad to help
@DuneKraftwerk
@DuneKraftwerk 3 жыл бұрын
I guess it cannot be used with RSLogix Emulate 5000 because the emulator cannot be accessed via an IP address.
@ShaneWelcher
@ShaneWelcher 3 жыл бұрын
You can use a Python script to read Emulator, however, it is a different code than this. Use the GitHub links in the video notes about how to do this.
@dustin9480
@dustin9480 3 жыл бұрын
pylogix can read tags on emulate, I found out that emulate expects a specific connection size, because Rockwell. so if you add a line comm.ConnectionSize=504, it should connect to emulate as long as you are running your script on the same machine that emulate is running on. Edit: You would use your machines IP address to connect. edit2: I made a commit a while back that should automatically try the correct connection size for emulate if it doesn't connect the first time.
@rezamagham4495
@rezamagham4495 2 жыл бұрын
Thank you very much indeed
@ShaneWelcher
@ShaneWelcher 2 жыл бұрын
You are very welcome
@timkloehn9887
@timkloehn9887 3 жыл бұрын
I do not know python. I know c++, c# , and visual basic. Is it similar? I always wanted to try ingear software to work with allen bradley software because I know these languages. I bought a book on python, but I always read my C books because I work with robotics. C# is my favorite by far. Garbage collection is automatic, no memory leak.
@ShaneWelcher
@ShaneWelcher 2 жыл бұрын
Great to hear
@timkloehn9887
@timkloehn9887 2 жыл бұрын
@@ShaneWelcher I don't know if you did a video on how to implement the encoder card on the powerflex 525. I have the board, just haven't used it yet.
@ShaneWelcher
@ShaneWelcher 2 жыл бұрын
@@timkloehn9887 I have an encoder card in my PF525, I'll try to make a video in the future. Been busy with moving & taking care of my mother.
@timkloehn9887
@timkloehn9887 2 жыл бұрын
@@ShaneWelcher You were right about rs5000 version 20 being buggy and a piece of crap software version. I stand corrected. thankyou.
@gbengaoyede2877
@gbengaoyede2877 2 жыл бұрын
Does it work with all types of plc or it's for a particular plc brand
@ShaneWelcher
@ShaneWelcher 2 жыл бұрын
The GitHub code I am using in this video is for Rockwell Automation. There are separate GitHub codes for other PLC brands
@gbengaoyede2877
@gbengaoyede2877 2 жыл бұрын
@@ShaneWelcher isn't there any one that can be used generally? I am thinking of extracting real time csv data from plc since all plc(s) can do this, and reading it on python, i am actually making research on this and i could use your professionalism on this. Kindly share your me your email sir.
@ShaneWelcher
@ShaneWelcher 2 жыл бұрын
@@gbengaoyede2877 Visit the GitHub site for the information, it gets updated from time to time
@MdMozammelHossain
@MdMozammelHossain 2 жыл бұрын
Hi, thanks for the video, I'm currently trying to use pycomm3 for real project, but what. Getting that very slow read cycle, it's taking around 0.9 sec to 1.3 sec just to for a read cycle. Which is very long in my application as hmi momentary switch only high for 0.5 sec, so it not catching singnal from hmi's push buttons. Is there any way to improve ? I have to read around 22 nos of integer register.
@ShaneWelcher
@ShaneWelcher 2 жыл бұрын
Please refer to the GitHub page for Pycomm3 It most likely could be your computer
@MdMozammelHossain
@MdMozammelHossain 2 жыл бұрын
@@ShaneWelcher not sure if it's my computer, as I tried 3 computer, all of them have similar time, and also I tried ModbusTCP which has significantly less time, but because of some limitation of Modbus protocall, can't use it.
@ShaneWelcher
@ShaneWelcher 2 жыл бұрын
@@MdMozammelHossain Reach out to the creator of Pycomm3
@DuneKraftwerk
@DuneKraftwerk Жыл бұрын
Indeed, polling data blindly is not the way, need to detect changes in values instead. I did change detection in c# but it must be a way to implement it on python or node js
@Tescor_JC
@Tescor_JC 2 жыл бұрын
Is it possible to write PLC outputs?
@ShaneWelcher
@ShaneWelcher 2 жыл бұрын
Yes, just follow the GitHub directions. You are able to read or write
@johntgilmore1
@johntgilmore1 Ай бұрын
I really enjoy your page, is there a ways I can share with you one I have created
@ShaneWelcher
@ShaneWelcher Ай бұрын
Do not use my page to promote yourself
@DuneKraftwerk
@DuneKraftwerk 3 жыл бұрын
Interesting. No OPC or MQTT involved.
@ShaneWelcher
@ShaneWelcher 3 жыл бұрын
Correct
@edinetgrunhed6000
@edinetgrunhed6000 3 жыл бұрын
Nice video,are you using visual studio for python?
@ShaneWelcher
@ShaneWelcher 3 жыл бұрын
I do use Visual Studio but in this video I used a separate VM which was Linux. I prefer Visual Studio 2019
@edinetgrunhed6000
@edinetgrunhed6000 3 жыл бұрын
@@ShaneWelcher in Visual studio what i remember there is toolbox like textbox or button, means you can use this for python reading display?
@ShaneWelcher
@ShaneWelcher 3 жыл бұрын
@@edinetgrunhed6000 yes, just import the tools needed to read data from the PLC . Pycomm is one tool then there is another tool I will show in the future. Using Visual Studio 2019 then install the needed things from GitHub & then when writing scripts, just import that tool first. If you did not have an internet connection for the install then there are ways to manually install as well but is a slight bit harder. The end result is the same. Using python to read data from a plc. Pycomm or Pylogix
@edinetgrunhed6000
@edinetgrunhed6000 3 жыл бұрын
@@ShaneWelcher ok,I prefer pylogix looks more stable
@ShaneWelcher
@ShaneWelcher 3 жыл бұрын
@@edinetgrunhed6000 Yes, more options
@boodeepak
@boodeepak 2 жыл бұрын
Nice Video, How to store the data from an AB PLC into SQL server using Pycomm3
@ShaneWelcher
@ShaneWelcher 2 жыл бұрын
Seems like a very detailed topic that most people won't watch because of how long the video is. Your comment is very detailed to explain
@cmrncrick
@cmrncrick Жыл бұрын
use sqlite and create your own database
Using Pylogix to Read PLC Data through a Python3 GUI
13:25
Shane Welcher
Рет қаралды 10 М.
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 18 МЛН
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
Read and Write Data in MS Excel, using RSLinx to and from ControlLogix
15:27
Robotics & Automation - Electro-Mechanical
Рет қаралды 39 М.
Python Modbus
16:31
APMonitor.com
Рет қаралды 25 М.
Basics 06: Communicate with OpenPLC Runtime using Python
23:23
This Is Why Python Data Classes Are Awesome
22:19
ArjanCodes
Рет қаралды 821 М.
Solving one of PostgreSQL's biggest weaknesses.
17:12
Dreams of Code
Рет қаралды 222 М.
Packaging Data Using Structs in Python
18:41
NeuralNine
Рет қаралды 22 М.
Real-time Data Logging Using RSLinx OPC and Excel
13:56
PLCGurus.NET
Рет қаралды 51 М.
10 Important Python Concepts In 20 Minutes
18:49
Indently
Рет қаралды 423 М.
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 18 МЛН