on 10-31-2014 12:39 PM
Hi Experts,
I am Querying Multiple tags for Current time , using PCo Tag Retrieve Query.
Following Settings
In Query i am passing Start Date , End Date as same Date-time for the following query i am getting output in multiple rows , it shows the last value of tags in multiple rows , but why its not coming in single row .
I am attaching the time stamp & query Output screen shot .
Thanks in Advance
Regards
Adhikesh
Hi Mahesh ,
Thanks for Inputs,
Have tried by Tag Aggregate Query mode and Aggregates as Max , i am getting the Multiple tag latest value in single row and its meet my requirement .
Regards,
Adhikesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Other options if your values are coming in different Rowsets at different time then the point to observe is that
Suppose 3 Tags Tag1,Tag2,Tag3 updated at time T1,T2,T3 and values are coming in different row set when Get Response in Multiple Rowsets is checked. The your output when you seen in XMl then it will be some what like below
<Time>T1<Time>
<Tag1>value<Tag1>
<Tag2>NA or 0<Tag2>
<Tag3>Na or 0<Tag3>
<Time>T2<Time>
<Tag1>Na or 0<Tag1>
<Tag2>Value<Tag2>
<Tag3>Na or 0<Tag3>
<Time>T3<Time>
<Tag1>Na or 0<Tag1>
<Tag2>Na or 0<Tag2>
<Tag3>Value<Tag3>
looking to the above example you can see that at time T1 tag1 has values rest tags do not so on for other time. So you can write an xpath to get the values of tags where values is not NA or 0. This will give you unique values.
This example may clarifies your doubt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mahesh ,
My Source agent is proficy historian and its version 4.5.
As you mentioned i have tried in Tag Aggregate Query i am not getting the latest values for a second.
Coming to Output structure part i am getting output as you mentioned above , my scenario is like i will be query for 180 tags or more for every minute . so by looping logic /xpath to make NA or zero will lead to performance issue.
I think i need to work around in other ways.
Thanks for sharing your ideas mahesh and rohit.
Regards,
Adhikesh
Hi Adhikesh,
Not sure about your requirement but the other way round is that you can distribute the number of tags fetched per minutes in 2/4/6 groups and then you can use the above logic . Suppose you have divided in 4 groups so that the first 45 tags will be fetched by first trx/job and so on, each jobs updating the same database/file/table etc according to your requirement.
Just a thought
Hi Adhikesh,
I guess i can help you with this issue, recently we have deployed PCo. So, to answer your question consider below scenerios
1. Which agent you are using, if you are using DA agent then it will only give the recently updated values .ie. the current values of the tags irrespective of time. For example you queried for Tag T1 and Tag T2 for same start and End time Which is ST, ET but Tag T1 got updated most recently at time ST1 and T2 at time ST2. Now in the output you will see ST1 and ST2 time not the time given by you which is ST and ET. For multiple/Single row you can check/uncheck the Get Response in Multiple Rowsets check
2. If you are using HDA agent and want to get the most recent values then you can select mode as Aggregate list and in Tag Aggregate Query you can select group as "END" to get the latest values.
Permutation and Combination of above two will give you all the possible solutions needs .
Hope it is useful for you, please let me know if you need more details.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Adhikesh,
My assumption is, as you mentioned in timestamp Duration (60) and Duration unit(Minutes). So due to that its taking whole on 1hr. So better try with below change timestamp options
Duration: 1
Duration units: Seconds
Hope it works
And if you observe, its not fetching for that particular timestamp minute (i.e. 17: 38)
One more point, check when tag values are capturing for individual tag (i.e. in milliseconds or seconds or minutes) in Kepware
Regards,
Praveen Reddy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Praveen ,
Thanks for Sharing your inputs.
Actually in PCo Tag Retrieve Query its picking the current time / latest updated values of selected tag.
All selected tags won't be getting updated on same time.
So i am getting in different rows, my query is like is the limitation in PCo query or is there any work around to get all the values in single row.
Regards,
Adhikesh
Hi Adhikesh,
As you have mentioned that all selected tags would be getting updated at different timestamps thus they will not come in a single row in a rowset.
There is no workaround for this in MII.
You can get every tag in different rowset (there is a checkbox for this in the tag retrieve mode screen) but I don't think that this will help you here.
Regards,
Rohit Negi.
Hi Adhikesh,
Timestamp of all the values is different so they will come in different rows.
Regards,
Rohit Negi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
6 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.