Bar Trend Error
Posted: Mon Jan 13, 2020 12:25 pm
Hi,
I'm trying to use a Bar Trend. So I create a dyn_float DP in PARA and I wrote the following command (easy and simple command):
---------------------------------SCRIPT-------------------------------
─// [balken] [1] - [RotateAngle]
main()
{
dpConnect( "work", "ExampleDP_bt.bt1:_original.._value" );
}
work( string dp, dyn_float y )
{
setValue( "balken", "data", y );
setValue( "balken", "flush" );
DebugTN("Ha entrado aqui");
}
─// [NEWDATA] [2] - [Clicked] <-- It is a PUSHBUTTON
main(mapping event)
{
dyn_float random_value;
for(int i=1;i<=24;i++)
{
float random_aux;
random_aux=(rand()/16000)-0.5;
random_value=random_aux;
}
dpSet("ExampleDP_bt.bt1:_original.._value",random_value );
}
---------------------------------SCRIPT-------------------------------
But I does not work and in Log Viewer says that Object "balken" of type "BAR_TREND" does not know the attribute "data" for "setValue()".
I don't understand why it does not work because the example panel of WinCC OA uses the same function and it works.
I'm trying to use a Bar Trend. So I create a dyn_float DP in PARA and I wrote the following command (easy and simple command):
---------------------------------SCRIPT-------------------------------
─// [balken] [1] - [RotateAngle]
main()
{
dpConnect( "work", "ExampleDP_bt.bt1:_original.._value" );
}
work( string dp, dyn_float y )
{
setValue( "balken", "data", y );
setValue( "balken", "flush" );
DebugTN("Ha entrado aqui");
}
─// [NEWDATA] [2] - [Clicked] <-- It is a PUSHBUTTON
main(mapping event)
{
dyn_float random_value;
for(int i=1;i<=24;i++)
{
float random_aux;
random_aux=(rand()/16000)-0.5;
random_value=random_aux;
}
dpSet("ExampleDP_bt.bt1:_original.._value",random_value );
}
---------------------------------SCRIPT-------------------------------
But I does not work and in Log Viewer says that Object "balken" of type "BAR_TREND" does not know the attribute "data" for "setValue()".
I don't understand why it does not work because the example panel of WinCC OA uses the same function and it works.