Stored Procedures

If I am to trigger a stored procedure from some VB button application through some remote PC, how do I load the result of this triggered stored procedure from the database to the PLC through SQL bridge?. Any Examples??

You’ll have to clarify a bit. A stored procedure lives in the database. Who is calling it? If you call/“trigger” it from Ignition, you can use a Stored Procedure group and map outputs and the return to addresses in the PLC.

If you are triggering it from somewhere else- say, a VB application, Ignition has no knowledge of this. If the stored procedure happens to write some data to a table somewhere, you can use a Standard group to map the columns of the result table to addresses in the PLC.

I guess the question is this: what does the stored procedure do, who calls it, and what result do you want to map?

Regards,

I am using a stored procedure to be called by a PLC to get some values such as recipes from SQL database to load into control system. This is achieved by triggering a PLC bit which in turn triggers a stored procedure through SQL Bridge.
I need the same functionality, but from remote location applications such as VB (VB button Action
) to trigger a download of recipes into the PLC through SQL Bridge.
I will try your suggestion as to populate some field and map to the PLC tags.

Thanks for your help on this.

I think I see- you simply want to trigger the Transaction Group to run from an outside source.

Trigging on multiple conditions is unfortunately not super easy right now, but depending on your setup, it may not be that hard.

First, some basic ideas:
[ul][li]Expression Items can be used as triggers for the group[/li]
[li]Expression Items can be SQL Queries or actual expressions, and both can refer to other tags.[/li]
[li]You can create an expression item that combines both the PLC value, and a value in a database, to trigger the group.[/li][/ul]

So, let’s say that you want to trigger the execution from the PLC or a VB application. If the VB application can access the database, there can be a table with a Trigger column and a row per group.

In the group, you could create an expression item (I’ll call it “DBTrigger”), set to Query mode, like this:

SELECT trigger FROM trigger_table WHERE group=1

The expression item would be set to “Run Always”, so that it will run all of the time.

In your group, you would also have the plc trigger, which I’ll pretend is called “PLCTrigger”.

Finally, you would create another expression item, that was also run always, and would be in expression mode:

if({DBTrigger}>0 || {PLCTrigger}>0, 1, 0)

And you would use this item for the trigger. You would also set the group to “only execute once per trigger”. Finally, it’s likely you’d want to reset your triggers after execution. In this case, you could create two expression items that weren’t run always - one that ran an update query against the table, and the other that wrote 0 to the PLC (the expression would just be the number 0, and the “writeback target” would be your tag).

Hope this gives you some ideas,

Again, thanks for the help on this.