Ok, i see what your problem is and what the reason is. You are running out of resources.
The channel api uses the frame api a s underlaying code and therefore it shares the same limitations.
The driver has a shared memory with the board that fits approximately 300 messages for both ports read and write.
This memory can be configured in queues for write and read operations.
The Frame Api has this Queue configured in their API (configure function).
The Channel Api uses a config file to configure the shared memory queues. It is somewhat hidden because normally you do not need to change them.
But in your case you have to reduce the queue size a little bit to allow more tasks to be configured for periodic output.
Here is the explanation:
The driver can configure a maximum of 48 periodic messages or tasks. That's the maximum limit for one or two ports together.
To reach this limit you need to modify the "C:\Program Files\National Instruments\NI-CAN\bin\nicanopt.ini file.
The following section needs to be modified to the following numbers:
[INTERNAL_CHANNEL_QUEUES]
NI_RQL=20
NI_WQL=5
CO_RQL=0
CO_WQL=5
For a single port that leads to 24 tasks with 5 messages Queue, which translates to 120 messages overall queue size.
For a second port add another 120 messages and then we have the Port configuration with 20 messages per Port for the ReadQueue and 5 for the Write Queue.
Do not set that to zero.
The overall shared memory used is then 290.
that's below 300 and the driver should be able to handle the 48 tasks on both ports.
Hope that helps.
DirkW