OTee#Vritual PLC_Part02_Program creation, variable definition, Using FB

This is a new series of various articles using a Virtual PLC called OTee. In the second episode, we will introduce methods for creating programs, defining variables, and using FBs on the OTee Platform.

Come on, let’s enjoy FA.

Foreword

Thank you from the bottom of my heart for visiting my technical blog and YouTube channel.

We are currently running the “Takahashi Chris” radio show with Full-san (full@桜 八重 (@fulhause) / X) which I deliver every Wednesday night.

Sharing, not hoarding, technical knowledge

We publish technical information related to factory production technology and control systems for free, through blogs and videos.

With the belief that “knowledge should be accessible to everyone,” we share practical know-how and real-world troubleshooting cases from our own field experience.

The reason we keep it all free is simple: to help reduce the number of people who struggle because they simply didn’t know.

If you’ve ever thought:

  • “Will this PLC and device combination actually work?”
  • “I’m having trouble with EtherCAT communication—can someone test it?”
  • “I want to try this remote I/O, but we don’t have the testing environment in-house…”

Feel free to reach out!If lending equipment or sharing your configuration is possible, we’re happy to verify it and share the results through articles and videos.

(We can keep company/product names anonymous if requested.)

How can you support us?

Currently, our activities are nearly all unpaid, but creating articles and videos takes time and a proper testing environment.If you’d like to support us in continuing and expanding this content, your kind help would mean a lot.

Membership (Support our radio show)

This support plan is designed to enhance radio with Mr Full.

https://note.com/fulhause/membership/join

Amazon Gift List (equipment & books for content production)

Lists equipment and books required for content creation.

https://www.amazon.co.jp/hz/wishlist/ls/H7W3RRD7C5QG?ref_=wl_share

Patreon (Support articles & video creation)

Your small monthly support will help to improve the environment for writing and verifying articles.

https://www.patreon.com/user?u=84249391

Paypal

A little help goes a long way.

https://paypal.me/soup01threes?country.x=JP&locale.x=ja_JP

Just trying to share things that could’ve helped someone—if only they’d known.

Your support helps make knowledge sharing more open and sustainable.

Thank you for being with us.

soup01threes*gmail.com

https://x.com/3threes2

Technical knowledge shouldn’t be kept to ourselves.

Reference Link

http://soup01.com/en/category/otee_en/

Implementation

Add a new program

Click the + button below to add a new program to the OTee Platform.

The Create an entity screen will appear.

You can change the Type’s Drop-Down List or the items to be added.

For this article, set Program → Name to enter the program name, and Save to save the settings.

Done!So we added a new program.

Adding local variables

Open the program you just added and open the Local Tab. It will be the area for defining local variables in the program. To add a variable, click on “Add variable” below.

Done!So I defined a new variable.

Add TON FB

Define a TON timer FB in Local. Click on the Data Type column to the left of the variable you just defined.

The variable data type selection screen appears.

Select TON.

Done!So I defined TON FB.

Variable Rename

To create a program that is easy to read, define variable names that are easy to understand.

Done!

Edit Variable Group Name

In fact, the variable we just defined is already in a variable group. Let’s edit the name of that variable group.

Done!

Adding Variable Groups

Next, add variable groups. As the project grows, it is more efficient to manage variables in groups.

Done!So a new group of variables was added.

Separate different groups by variables to suit your application.

TON Program

Next, add the TON timer FB to the program.

Done!The OTee Platform also automatically adds input/output templates.

Let’s assign the variables we declared earlier to parameters.

Adding task instances

Now that we have added a new program, we need to create an instance that will call it. Click on Tool bar>Configuration on the left.

Here you will see the task and global variable definition screens.

Click on “Add an instance” under Task 0.

Done!A new Instance has been added.

Select the program you just added (OB1 in this example) from the Drop-Down List.

Next, let’s change the Instance name.

Done!

compile

Click Compile to compile the program.

Download

Next, click “Download project to device” to download the project to Raspberry pi.

Done!

Tag Browser

To check the result, open the OB1 you just added → Click on Tag Browser.

Done!You can check the current values of variables from this screen.

Also, if you want to change the current value of an individual variable, double-click on that variable and enter the new value.

For example, change a BOOL type variable to true.

Done!

And the TON timer is starting to add time.

result

Done!As shown in the figure below, TON.Q became TRUE after 1 second.

CTU Program

Next, add a CTU (Counter UP FB). Add a CTU type Instance to the Local Variables area.

Done!Please use the same operation as before to change variable names, etc.

The next step is to add the program.

result

Done!As shown in the figure below, when the CU input receives a rising signal from OFF to ON, the CV value is added to 1.

シェアする

  • このエントリーをはてなブックマークに追加

フォローする