银河娱乐国际

Register   |   Login

Print

[Technical Inquiry] PCIe 1810 and PwMeterCtrl

PCIe 1810 and PwMeterCtrl

Hi,
I'm trying used 2 Input PwMeterCtrl.
When used only one, operation is correct.
But i want used both, i don't know how back the result ?
Quote:
int32       startChannel = 0;
int32       channelCount = 2;
...
int main(int argc, char* argv[])
{
   PulseWidth pwValue;

   PwMeterCtrl* pwMeterCtrl = PwMeterCtrl::Create();
   DeviceInformation devInfo(deviceDescription);
   pwMeterCtrl->setSelectedDevice(devInfo);
   pwMeterCtrl->setChannelStart(startChannel);
   pwMeterCtrl->setChannelCount(channelCount);
   pMeterCtrl->setEnabled(true);
   pwMeterCtrl->Read(0,&pwValue);
   pwMeterCtrl->Read(1,&pwValue);
...     }

But only ID 0 is read ???
Have you an example to code this implementation.
Thancks
Thierry
|

TOP

OK,
I found,
it is necessary to launch both command with a delay between them.
like this
Quote:
pwMeterCtrl->setChannelStart(channel_1);
usleep(10000);
pwMeterCtrl->Read(channel_1,&pwValue);
pwMeterCtrl->setChannelStart(channel_2);
usleep(10000);
pwMeterCtrl->Read(channel_1,&pwValue);
...
...

TOP

Quick search in Advantech Support Portal