WinccOA 3.17 using dpQueryNGA

Find and share HowTos to various installations / configurations!
Search

Post Reply
2 posts • Page 1 of 1
eeveeMC
Posts: 1
Joined: Tue Jun 02, 2020 9:15 am

WinccOA 3.17 using dpQueryNGA

Post by eeveeMC »

I'm trying to use dpQueryNGA with
SELECT * FROM EVENT.EVENT LIMIT 10
and I don't recive any data

here is my code and logs


#uses "CtrlNgaFrontend"

main()
{
bool ifset = setNGADirectRead(true);
bool check = useNGADirectRead();

DebugTN(check);

dyn_dyn_anytype tab;
string qry = "SELECT * FROM EVENT.EVENT LIMIT 10'";
int err = dpQueryNGA(qry, tab);
dyn_errClass qryErr = getLastError();

DebugTN(tab, err, qryErr);

}


WCCOAui1:2021.05.12 10:10:38.138[TRUE]
WCCOAui1:2021.05.12 10:10:38.159[dyn_dyn_anytype 1 items
WCCOAui1: 1: dyn_anytype 1 items
WCCOAui1: 1: (Type: 0 Sys: 0 Dp: 0 El: 0 : 0..0)
WCCOAui1:][0][dyn_errClass 0 items
WCCOAui1:]


in comparision, when I put the same query in Influx running on console I recive something like
name: EVENT
time _comment _manager _status64 _unit _user name original_value_bool original_value_dyn original_value_float original_value_int original_value_string valuetype variabletype
1620640496052000000 16844289 -9007199254740990000 0 System1:ExampleDP_Trend1. 0.9476013 3 ExampleDP_Float
1620640496067000000 16844289 -9007199254740990000 0 System1:ExampleDP_DDE.f1 10 3 ExampleDP_DDE
1620640496067000000 16844289 -9007199254740990000 0 System1:ExampleDP_DDE.f2 20 3 ExampleDP_DDE
1620640496068000000 16844289 -9007199254740990000 0 System1:ExampleDP_DDE.b1 true 0 ExampleDP_DDE
1620640496080000000 16844289 -9007199254740990000 0 System1:ExampleDP_DDE.string1 Das ist ein Testtext! 4 ExampleDP_DDE
1620640500780000000 16844289 -9007199254740460000 0 System1:_ReduManager.MyErrorStatus 4294967295 2 _ReduManager
1620640500781000000 16844289 -9007199254740460000 0 System1:_ReduManager.PeerErrorStatus 4294967295 2 _ReduManager
1620640500782000000 16844289 -9007199254740460000 0 System1:_ReduManager.IsRecovering 0 1 _ReduManager
1620640500792000000 16844289 -9007199254740460000 0 System1:_ReduManager_2.MyErrorStatus 4294967295 2 _ReduManager
1620640500793000000 16844289 -9007199254740460000 0 System1:_ReduManager_2.PeerErrorStatus 4294967295 2 _ReduManager


Could anyone advice me what should I configure or how should I execute my code to obtain such data in wincc?

User avatar
leoknipp
Posts: 2569
Joined: Tue Aug 24, 2010 7:28 pm

Re: WinccOA 3.17 using dpQueryNGA

Post by leoknipp »

If you want to use the function dpQueryNGA() you have to use the same query string syntax as for the function dpQuery().
The query string you are using does not fit the syntax rules for a WinCC OA query string.

Best Regards
Leopold Knipp
Senior Support Specialist

Post Reply
2 posts • Page 1 of 1