Is there a 'workProc' in the C# manager API ?

Find and share HowTos to various installations / configurations!
2 posts • Page 1 of 1
fmulder
Posts:330
Joined: Wed Feb 03, 2010 9:46 am

Is there a 'workProc' in the C# manager API ?

Post by fmulder »

I've developed drivers before and there was a HWService::workproc() where you could implement recurring tasks (like looking for incoming data on a serial port)

Code: Select all

void _TEMPLATE_HWService::workProc()
{

}
Is there something similar in the C# API or can I just do the following code at the bottom of my main():

Code: Select all

static void main()
{
  // .. (do all the init and connect stuff)

            while(true)
            {
                Thread.Sleep( 2000 );

                // Get Access to the ProcessValues
                var writeValues = myManager.ProcessValues;

                writeValues.SetDpValue(
                    new Tuple<string, OaVariant>("mydp.element1", 1),
                    new Tuple<string, OaVariant>("mydp.element2", 2)
                );

            }

}
I'm planning a C# manager to do some database work and would like to dpSet() a status every second.

Hope anyone can help

share the fun
Frenk Mulder

gschijndel
Posts:376
Joined: Tue Jan 15, 2019 3:12 pm

Re: Is there a 'workProc' in the C# manager API ?

Post by gschijndel »

I would use a Timer to call a function every second.

2 posts • Page 1 of 1