Block Transaction Group DB to OPC

I would like to synchronize configuration data from a database to a series to tags in a PLC. However I need to sort the data in the table first before sending it to the PLC to make sure that the data is in the correct order before writing it to the array of tags. Is this possible with the Block Transaction Group?

Basically I have a table for configuration that has an index, number (Corresponds to the array index in the PLC) and other information. I need to sort by the number first and then dump the rows from the Database into the PLC.

I did a project recently where I needed to get stuff from a database to a PLC. The database didn’t “align” with the PLC structure, so I created a table that did, I called this my working table. I then used a block transaction group to pull from the working table to the PLC. I had a stored procedure that would “sync” up the working table at various times.

Not sure if this info was helpful, but thought I would share.

Consider creating a view in the database with the required transformation and ordering.

I’m trying to keep as much processing out of the SQL Server as possible. Although if I have to @jlandwerlen I may do something similar.

So I’m using MSSQL, customer spec, and you can’t put orders on a view as the server won’t honor them.

What I ended up doing was just telling the transaction group to use the number as the index and it seems to have everything sorted properly. I’ll be doing more tests to make sure that things don’t get out of wack.