Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

Working with Alarms in an OPC-DA 2.05A

More
28 Aug 2012 18:07 #1004 by jeancg
Sorry for the delay in replying I had to travel urgently to solve a problem in a job.

My sincere apologies. I am going through a painful process of adapting this new platform. It's the first time I'm migrating an application based on CoDeSys for ASP.NET, I had many doubts as you can see in your forum I am learning about QuickOPC and have much to learn yet. I'm trying to develop a simple application to control and visualization of my industrial process.

We are very happy with the results we've had using QuickOPC.

Now we have a new completely rewritten application in ASP.NET, we need only displays alarms to be complete our application.

The sample will be sent a great help I will study it and try to improve it.

This week will be no access to my computer, when I return I will try again and post the results here.

Thank you and best regards.

Please Log in or Create an account to join the conversation.

More
25 Aug 2012 18:42 #1001 by support
Hello,
I admin that I still do not understand where is the problematic point, since you said you already have HMI screens, and I do not see any substantial difference from that - you call methods to read the OPC data, and then use that data to create the Web page markup. You either want something very simple, or something wquite special, but I do not know what it is.
I was thinking how I can help you, and decided to send you a simple application that reads some OPC variable, and displays them in a DataGrid. The whole project is attached to this post; here is the relevant part of it:

class Row
{
public string ItemId { get; set; }
public string Value { get; set; }
}

protected void Page_Load(object sender, EventArgs e)
{
var client = new EasyDAClient();
var itemDescriptors = new DAItemDescriptor[]
{
"Simulation.Register_BOOL",
"Simulation.Register_I2",
"Demo.Ramp",
"Demo.Single"
};

ValueResult[] valueResults = client.ReadMultipleItemValues("OPCLabs.KitServer.2", itemDescriptors);

var data = new List<Row>();
for (int i = 0; i < itemDescriptors.Length; i++)
data.Add(new Row
{
ItemId = itemDescriptors.ItemId,
Value = valueResults.Value.ToString()
});

GridView1.DataSource = data;
GridView1.DataBind();
}

You can see that we are reading some values, and then use the result to construct a data source for the grid. The resulting page looks e.g. like this:



ItemIdValue

Simulation.Register_BOOLFalse

Simulation.Register_I20

Demo.Ramp-6.16515159606934

Demo.Single-6.1339




I thought that we can now start modifying this example to achieve what you need. You can replace the server and Item IDs with those that you need. If they are all bool values indicating which alarm is active, and you only want to fill in the grid with active alarms, you can put in an 'if-then' statement and only put into the list the active alarms. And so on-and if you do not know how to do something, you can ask concrete question. Otherwise, I am left guessing where your problem really is.
Best regards,
DataGridWebApplication.zip

Please Log in or Create an account to join the conversation.

More
24 Aug 2012 11:13 #997 by jeancg
Do not need necessarily be a gridview, can be a table in html to display the alarms, I thought the gridview for which I would easily make this setting, but I see that it is very complicated. A table html already solve my problem.

I am thinking how I'll do it here if you can help with a simple example I would greatly appreciate it, will be of great help.

Thank you.

Please Log in or Create an account to join the conversation.

More
24 Aug 2012 06:10 #995 by support
Regarding bullet 1), I assume you are OK with filling in the data when the page loads, and then you somehow reload (refresh) the page when you need new updated data? Or how do you do it in your HMI screens? I guess we'd like to keep the same approach.
Is there a special requirement to use ASP.NET grid view, or why cannot you just generate HTML table with the data?
Thanks

Please Log in or Create an account to join the conversation.

More
23 Aug 2012 12:23 #993 by jeancg
Sorry difficulty with the language just a little hindering in communication.

I'll explain how it works my system alarms:

All my alarms are Booleans Digital (False = inactive, True = active)

I need to show in a gridview only the active alarms and when your state return for this false alarm is removed from gridview.

Priority now.
1) I need a help with an example that can help me write this method filling a gridview with ReadMultipleItems or with SubscribeMultipleItems, but I can read these tags opc when their true state is to show in gridview and when fake it removed the gridview.

If you can help me with some tips on this item would also help.
2) I need to also insert a datetime field to show the time that these alarms were acknowledged and a string field to display a message for the alarm and change the color of gridview according to the alarm state (row red for alarm active row green to show that the alarms were acknowledged but are yet active in the system).
Thank you.

Please Log in or Create an account to join the conversation.

More
23 Aug 2012 09:02 #992 by support
Hello,
I am sorry but I do not understand this part:

I need only fill this gridview with active alarms coming from my PLC for viewing only, but I can not see a way to retrieve the objects coming from the OPC carry methods within this gridview.

Can you please re-phrase it differently, and possibly in more detail? It seems to me that you can just call e.g. ReadMultipleItems, filter the results that signify active alarms, and put them into the grid.

Please Log in or Create an account to join the conversation.

More
20 Aug 2012 18:15 #988 by jeancg
Hi again.
My apologies if I was not clear in the above explanation. I am developing an application in ASP.NET C# where I have control screens as an HMI and 2 screens to display the active alarms in the system is one of the historical alarms and other alarms online.

On-screen alarms historico I have a gridview control doing a sql query as a dataset showing the alarms that were recorded by a method SubscribeMultipleItems this is working correctly.

In alarm screen online I need to add a gridview control to display the active alarms within this gridview for display only, I have a button of a method WriteItemValue changing the status of my variable within my PLC this variable recognizes all active alarms this is working correctly too.

I need only fill this gridview with active alarms coming from my PLC for viewing only, but I can not see a way to retrieve the objects coming from the OPC carry methods within this gridview.
Thank you again.

Please Log in or Create an account to join the conversation.

More
20 Aug 2012 15:12 #987 by support
Hello,
yes, I meant to use the State parameter as you indicated. But whether that's actually the right suggestion, we need to figure out yet. Before your latest reply, I have not realized/aware that you are writing an ASP.NET application, and that may change some things.
I think I need to know a bit more about the structure of your application in order to answer the rest. What have you achieved so far? Do you have an ASP.NET GridView filled in with OPC item values when the page is generated? If so, wouldn't it be more appropriate to simply use "reads" (e.g. ReadItem, ReadMultipleItems), since the subscriptions can only update some "background" value on the server, but will not be immediately sent to the client browser anyway?
I am also a bit confused about your last paragraph - is there just a single OPC-DA tag that acknolwedges all active alarms? If so, you can have a button or something that in turn sets this tag to acknowledge all alarms, and for this purpose, you wil not need to know which active alarm tag it corresponds to. Can you clarify this?
Best regards

Please Log in or Create an account to join the conversation.

More
17 Aug 2012 17:29 #986 by jeancg
No problem, I'll be waiting and thank you again.

best regards.

Please Log in or Create an account to join the conversation.

More
17 Aug 2012 16:54 #985 by support
I apologize for delay-I am on travel, will reply by Monday.

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.063 seconds