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.

Different Timestamp in SubscribeMultipleItems.

More
22 Jul 2012 19:02 #949 by support
Hello.
Yes, all timestamps in OPC are in UTC (per the specs), and we are sticking to the same concept in QuickOPC.
You should be able to use the ToLocalTime() method on the DateTime to get what you want.
Best regards

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

More
20 Jul 2012 18:12 #948 by jeancg
Good afternoon.

I noticed a difference between the timestamp informed by QuickOPC.NET and informed by my computer.

I'm referencing the example provided in the log database with multiple items using SubscribeMultipleItems.

int[] handleTeste1 = EasyDAClient.DefaultInstance.SubscribeMultipleItems(
new[]
{
new DAItemGroupArguments("", "CoDeSys.OPC.02", ".Teste1", 60000, null),
new DAItemGroupArguments("", "CoDeSys.OPC.02", ".Teste2", 60000, null),
new DAItemGroupArguments("", "CoDeSys.OPC.02", ".Teste3", 60000, null),
new DAItemGroupArguments("", "CoDeSys.OPC.02", ".Teste4", 60000, null),

},
(_, eventArgs) =>
{
Console.Write(".");
if (eventArgs.Vtq != null)
{
tableTeste1.Rows.Clear();
DataRow row = tableTeste1.NewRow();
row["ItemID"] = eventArgs.ItemDescriptor.ItemId;
row["Value"] = eventArgs.Vtq.Value;
row["Timestamp"] = (eventArgs.Vtq.Timestamp < (DateTime)SqlDateTime.MinValue)
? (DateTime)SqlDateTime.MinValue
: eventArgs.Vtq.Timestamp;
row["Quality"] = (short)eventArgs.Vtq.Quality;
tableTeste1.Rows.Add(row);

adapterTeste1.Update(dataSetTeste1, "TB_Teste1");
}
}
);

I believe this is referencing QuickOPC.NET the time zone (UTC), but my timezone is (UTC - 3:00) Brasilia. I have a difference of 3 hours in my logs from the database.

How could I set this timestamp to my time zone (UTC - 3:00) Brasilia?

Thank you.

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

Moderators: support
Time to create page: 0.045 seconds