Hello,
My question is related to dpQuery().
I would like to know if it is possible to use _address.._type or other power config like _archive.._type in the dpQuery() query parameter.
Example:
SELECT '_original.._value' FROM '*' WHERE '_address.._type' == 16
Best regards,
Luis Miguel BP.
dpQuery() _address.._type
- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: dpQuery() _address.._type
Doing a dpQuery() to get information for the _address config is not possible.
With the dpQuery() command only information can be read which is saved in memory of the Event Manager. All driver related configs (_address, _cmd_conv, _msg_conv, _smooth) are only saved in memory of the driver and cannot be accessed with a dpQuery() command. The same applies to the _archive config which is only known by the Data Manager.
Best Regards
Leopold Knipp
Senior Support Specialist
With the dpQuery() command only information can be read which is saved in memory of the Event Manager. All driver related configs (_address, _cmd_conv, _msg_conv, _smooth) are only saved in memory of the driver and cannot be accessed with a dpQuery() command. The same applies to the _archive config which is only known by the Data Manager.
Best Regards
Leopold Knipp
Senior Support Specialist
- luis.bustamante
- Posts:30
- Joined: Thu Jan 24, 2019 8:11 am
Re: dpQuery() _address.._type
Hello leoknipp.
Thank you very much for your response.
I will continue to use the traditional method.
Best regards,
Luis Miguel BP.
Thank you very much for your response.
I will continue to use the traditional method.
Best regards,
Luis Miguel BP.
- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: dpQuery() _address.._type
I am not sure what the "traditional" method is.
Which information do you want to read?
How do you read the information?
Best Regards
Leopold Knipp
Senior Support Specialist
Which information do you want to read?
How do you read the information?
Best Regards
Leopold Knipp
Senior Support Specialist
- luis.bustamante
- Posts:30
- Joined: Thu Jan 24, 2019 8:11 am
Re: dpQuery() _address.._type
Hi leoknipp,
When I referred to the traditional method I meant using loops and dpGet(), without dpQuery().
Here is an example.
main(mapping event)
{
// Get DPE names with address config.
dyn_string dsDpeNames = dpNames("Example_*.**:_address.._type", "Example");
dyn_int diAddressType;
// Get all address type values.
dpGet(dsDpeNames, diAddressType);
// Remove all elements from the list that do not have address configured.
for (int i = dsDpeNames.count(); i > 0 ; i--) if (diAddressType == DPCONFIG_NONE) dynRemove(dsDpeNames, i); dsDpeNames.sort();
DebugTN(__FUNCTION__, __LINE__, "dsDpeNames", dsDpeNames);
}
Best regards,
Luis Miguel BP.
When I referred to the traditional method I meant using loops and dpGet(), without dpQuery().
Here is an example.
main(mapping event)
{
// Get DPE names with address config.
dyn_string dsDpeNames = dpNames("Example_*.**:_address.._type", "Example");
dyn_int diAddressType;
// Get all address type values.
dpGet(dsDpeNames, diAddressType);
// Remove all elements from the list that do not have address configured.
for (int i = dsDpeNames.count(); i > 0 ; i--) if (diAddressType == DPCONFIG_NONE) dynRemove(dsDpeNames, i); dsDpeNames.sort();
DebugTN(__FUNCTION__, __LINE__, "dsDpeNames", dsDpeNames);
}
Best regards,
Luis Miguel BP.
- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: dpQuery() _address.._type
If you want to get only those elements with an active _address config an easier solution is possible using the _DriverCommon datapoints.
You can have a look at a sample panel to see how it works:
https://www.winccoa.com/downloads/detai ... 5fd68eb99a
Best Regards
Leopold Knipp
Senior Support Specialist
You can have a look at a sample panel to see how it works:
https://www.winccoa.com/downloads/detai ... 5fd68eb99a
Best Regards
Leopold Knipp
Senior Support Specialist
- luis.bustamante
- Posts:30
- Joined: Thu Jan 24, 2019 8:11 am
Re: dpQuery() _address.._type
Hi leoknipp,
Thank you very much for the example, I have analyzed it and it is very interesting, I will apply it. THANKS.
Happy new year.
Best regards,
Luis Miguel BP.
Thank you very much for the example, I have analyzed it and it is very interesting, I will apply it. THANKS.
Happy new year.
Best regards,
Luis Miguel BP.
- gschijndel
- Posts:376
- Joined: Tue Jan 15, 2019 3:12 pm
Re: dpQuery() _address.._type
The '_type' attribute might be the one exception, which is known by the event manager and can be queried.
In case you are not using the driver number 1 the dpe also has a distrib config, which can be queried as I have done in the past.
For (at least) the archive configs a trick might work to send the query to the data manager by adding the 'TIMERANGE' option.
In case you are not using the driver number 1 the dpe also has a distrib config, which can be queried as I have done in the past.
For (at least) the archive configs a trick might work to send the query to the data manager by adding the 'TIMERANGE' option.
- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: dpQuery() _address.._type
The Event Manager does not have any information for the driver related configs. Therefore you cannot use any of the attributes in a query.
Doing a TIMERANGE query to get the elements which have an archive config is not a good option as you will get only results for those elements where values are saved within the given time range. Using a bonus of 1 will possibly in a high load for a long period of time if the Data/Archive Manager needs to search data in different parts of the database.
Best Regards
Leopold Knipp
Senior Support Specialist
Doing a TIMERANGE query to get the elements which have an archive config is not a good option as you will get only results for those elements where values are saved within the given time range. Using a bonus of 1 will possibly in a high load for a long period of time if the Data/Archive Manager needs to search data in different parts of the database.
Best Regards
Leopold Knipp
Senior Support Specialist