YUTAKA NAKAYAMA
Nice to meet you.
Thank you for watching.
I am studying openPLC using Raspberry Pi4.
And I have some questions.
Please teach about them.

Ultimate goal: Monitor the status of the monitored machine and send an email when an alarm occurs.
Also, I would like to use SCADA to check the status of the monitored machine in real time.

Q1. Is it possible to create programs such as time acquisition and email transmission using only the LD language?

Q2. If Q1 is not possible, can I use the LD language as the main language and control it with PYTHON or
  ST language under certain conditions?
  (Time acquisition, email transmission control, etc.)

Q3. Does the OPEN PLC function have an internal switch function that can maintain the state even
  when the power is turned off?

Q4. Since there is not much information on ST language on Japanese sites, please let me know if there are
  any useful sites.


* Translation software is used.
It may be a rude sentence.
Thank you for your cooperation.
NWT.Stuff
Hi Yutaka

For Question 1 and  2, I would send email alerts from python routine.

https://docs.python.org/3/library/smtplib.html

To communicate between python and OpenPLC the best way is with Modbus TCP Client

https://pypi.org/project/pyModbusTCP/

Q3 - very unlikely and pretty sure it’s no. Explain what you want to do with this as maybe someone could provide a suggestion.

Q4 Not my area of expertise🙂

Kevin







Reply 0 0
thiagoralves

Q1. Is it possible to create programs such as time acquisition and email transmission using only the LD language?

No.

Q2. If Q1 is not possible, can I use the LD language as the main language and control it with PYTHON or
  ST language under certain conditions?
  (Time acquisition, email transmission control, etc.)

You can use pragmas to call any external tool, script, etc. In this case you could use pragmas to call python and run a python script that sends an email. Here is a discussion on how to use them: https://openplc.discussion.community/post/command-exec-in-openplc-rpi-9707083?pid=1303821827
Also, this is a good example I made for the OSCAT library that uses pragmas: https://openplc.discussion.community/post/oscat-library-arithmetics-section-10260702?pid=1309458163

Q3. Does the OPEN PLC function have an internal switch function that can maintain the state even
  when the power is turned off?

Check persistent storage under settings on the runtime. Persistent storage will only backup on disk variables that are located in %MW regions, so it will not backup everything. If you store your current state information on those variables, you can have a routine on your program that loads these values back on the first program run (first cycle).

Q4. Since there is not much information on ST language on Japanese sites, please let me know if there are
  any useful sites.

Search for IEC 61131-3 books and tutorials on the internet. That's the standard that defines Structured Text and other PLC languages. This is a good one:  https://www.plcacademy.com/structured-text-tutorial/
Reply 0 0
NWT.Stuff
Quote:
Check persistent storage under settings on the runtime. Persistent storage will only backup on disk variables that are located in %MW regions, so it will not backup everything. If you store your current state information on those variables, you can have a routine on your program that loads these values back on the first program run (first cycle).


This looks like a very interesting function for me. Will look into it 🙂
Reply 0 0
YUTAKA NAKAYAMA
Hi! Kevin and thiagoralves

Thank you for your comment.
I will study with reference to what you have taught me.


Kevin
What I wanted to do in Q3 was to switch the control method by turning the keep switch on / off as shown in the attached image, and to keep the switched state even when the power is turned off. (The image is an example)
KEEP SW = OFF: Y1 output only while SW A is ON
KEEP SW = ON: Y1 output by self-holding even if SW A turns on and turns off immediately

Thank you everyone.
If you have any questions, please help us.
Reply 0 0
NWT.Stuff

Yutaka,

What is the physical device connected to Output Y1 ?  Voltage ?

When you say loose power what do you mean? E.g. loose power to the raspberry pi or loose power to something else further up the power supply chain ?

Kevin

Reply 0 0
Reply