Description

Learn about the Block Group and how it can be used to write "blocks" of data into a database. The Block Group can be used to store historical data or write data arrays bi-directionally.

Video recorded using: Ignition 7.9

Transcript

(open in window)

[00:00] The block group is a type of group that stores data vertically in multiple rows under the columns defined. This is opposite of the standard group which stores data as multiple columns in a single row. Beyond this distinction, block groups operate very similarly to standard groups. They have all the same features, such as bi-directional mode, triggers, handshakes, and expression items. As an example, we can create a new block group and use it to write an array of data vertically into a single column of a table. We'll browse an array in our PLC, select all the tags, and bring them into the group. You'll note that unlike a standard group, which would create multiple columns of data, here by default, we've created a single block item that maps to a column in our table. We'll give it a friendly name. And we'll set our table name to the name that we want. As always, this table doesn't need to exist already. The group will create it for us when it first executes. The block item, defines all of the sub-items. Here we see all of our items coming from our OPC server and supports many of the other features that we're used to such as scaling, deadband, and alarming. In addition to inserting the value, we can choose to add some additional data that might be useful to us. For example, we can store the row ID which will provide an index for the array. And we can store the block ID, which would be a unique number incrementing each time a new block is inserted. In this case, we'll insert new values, and we'll choose to insert them every 10 seconds. When we start the group, it will create the table and begin inserting values. In the database, we can now see the rows for the first block inserted along with the block ID, and the row ID that we chose to also include. Now, every ten seconds, a new block is inserted. If the values in the array represented samples for a single point over a span of time, with the time stamp, the block ID, and the row ID, we can figure out the exact time represented by each sample. As mentioned, block groups support, bi-directionality, just like standard groups. So instead of inserting new block, we can choose bi-directional DB Wins, and set the group to update or select the first block. If we save the group in this state, we can go into the database and right to the column will be synchronized automatically to the PLC. Block groups can be effectively used to solve a couple key problems. As already mentioned, if a block item represents a single value that's been buffered in the PLC, it can be used to transfer all of the values at one time. Additionally, because all of the rows in a block group are stored inside of a transaction, you can achieve a very high performance of writes. This makes block groups great for store large amounts of history or bulk data from the PLC.

You are editing this transcript.

Make any corrections to improve this transcript. We'll review any changes before posting them.