Siemens#ArrayDB

In this post I will explain how to operate the ArrayDB by using the System Function “ReadFromArrayDB” and “WriteToArrayDB”.

ArrayDB is a DataBlock that only has one element of “Array”. The data type of this array can be anything, but Index should be started from 0 and only allow optimized access.

Create ArrayDB

Choose the “Array DB” in the type selection.

In the ARRAY data type, you can define the type of Array.

In the Array limit, you can define the length of your Array.

After OK is pressed, you can see only one element inside your block.

ReadFromArrayDB

Actually I do not know why we need to use this function..because we can just use a[i]:=x to directly access the variables that you want.

  • DB
    • ArrayDB
  • Index
    • Index the index of that Element that you want to read
  • RET_VAL
    • Result
  • VALUE
    • The value of that element

Result

The value of myArrayDB index is 44.

WriteToArrayDB

  • DB
    • ArrayDB
  • INDEX
    • Indexの変数Index the index of that Element that you want to write
  • VALUE
    • The values that you want to write
  • RET_VAL
    • Result

Result

You write 44 into index 5 of  myArrayDB.

Footer_Basic

Please Support some devices for my blog

Amazon Gift List

Find ME

Twitter:@3threes2
Email:soup01threes*gmail.com (* to @)
YoutubeChannel:https://www.youtube.com/channel/UCQ3CHGAIXZAbeOC_9mjQiWQ

シェアする

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

フォローする