- Thank you received: 0
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.
- Forum
- Discussions
- QuickOPC-Classic in .NET
- Reading, Writing, Subscriptions, Property Access
- Working with Alarms in an OPC-DA 2.05A
Working with Alarms in an OPC-DA 2.05A
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.
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.
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.
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.
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.
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.
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.
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.
best regards.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- Forum
- Discussions
- QuickOPC-Classic in .NET
- Reading, Writing, Subscriptions, Property Access
- Working with Alarms in an OPC-DA 2.05A