Home > Software engineering >  Cyapi in open multiple devices at the same time, and how he and output the output of the node defini
Cyapi in open multiple devices at the same time, and how he and output the output of the node defini

Time:11-16

USBDevice=new CCyUSBDevice ();
Int devices=USBDevice - & gt; DeviceCount ();//number of computing devices,
Int d=0;
If (devices)
{
Do {
USBDevice - & gt; Open (d);
//device_names [d]=USBDevice - & gt; DeviceName;
Device_names & lt; Find the USBDevice - & gt; EndPoints in [I] in the endpoint and out endpoint
Here on the current equipment in_endpoint and out_endpoint assignment

USBDevice - & gt; Close ();
D++;
} while (d & lt; Devices);

}
If I had four devices, then eight is to define the endpoint respectively corresponding to the input and output nodes of four devices and communication is after eight endpoints
Then the endpoint of the equipment 1 after initialization, again to device endpoint initializing need close 2 1, 2 or directly open the equipment, then usbdevice - & gt; EndPointCount () and USBDevice - & gt; The EndPoints are equipment 2

CodePudding user response:

Write a communication device class, and then create N instance

CodePudding user response:

Device class is already written, but as far as I know ccyusbdevice * usbdevice this class initialization after he was detected in all have connection usb device, then how I get each device endpoint

CodePudding user response:

USBDevice - & gt; Open (d); This is to open a device, not open all equipment
Cyapi SDK examples, can under reference

CodePudding user response:

Now I have a problem, it is in the open when (I) how do I know which is a device to open, and if I connect the 4 devices at the same time, if pull the plug in again, if the device is open originally (0), then plug in later still open (0), or other equipment will, in turn to reconnect the device has become open (3)
  • Related