Hi Team,
I have a bunch of Groov Epics and SNAP PAC R1s with rest api enabled.
I am developing an application which can fetch data from Opto 22 Tables via restapi and save that data to SQL.
I have 2 queries:
Is it okay to send a rest api request every 1 second since i need data to be stored every second. Will these repeated requests affect the PLC Or its Performance by anychance?
Apart from RestAPI, i have seen some c++ dev kits and optommp to get the data. I am using python programming language. Optommp has a python wrapper but seems like it only works with Epic and not the SNAP PAC. What do you suggest is the best way to get data from Opto? Or do you suggest me to switch from python to C++ for data fetching?
Yes i am using a python code in linux to fetch the data via REST API.
I would like to ask a follow up question based on your response.
I have tried to review the available documentation on the rest api but was unable to find any information on how it affects the plc processing capability. Do you have any information on the maximum requests the plc can process without affecting its performance?
There is no performance data available. There are several other aspects that come into play. With a poll rate of 1 second you should be ok. There is also a difference if you do this to a PAC-R controller or EPIC. Then it depends on how much data you are requesting per poll. How large is the table you are transfering?
Once per second would be Ok, but 10 per second would be a bit much.
Also, if you are on a local network only, you can use HTTP for the SNAP controller instead of HTTPS, which will speed things up a bit.
That said, I would not use REST as your communication method. Since you are using Python, I would use MMP.
In your PAC Control strategy, have a command in one of the charts that moves the data you need to get via Ptyhon to the MMP area. That will be quicker than using REST.
Both SNAP PAC R1 and EPIC support REST and MMP, so your Python code will be identical except for the IP address of the device you are talking with.
This will be the most performant way to get the data you need.