I mistakenly posted this in the VB6 area, I'm developing this app in VB.NET
I'm designing a large automation system that requires nearly 100 DIO bits. For this I've purchased two NI6515 cards.
Many, but not all, of the output bits go to air cylinders that have sensors indicating which end the piston is at, and other parts of the system need to know what state the cylinders are in after a OUTPUT is called.
My hope in using the NI products was that the "ChangeDetect" system could manage these events. After looking in more detail into the way this works, there are some serious limitations on how the system can be used. Let me try to expalin how I currently plan on implementing this and hope to get some feedback as to a better/different way of operating.
All the input lines for each device need to be in one task, because, I found out from error 50103, two tasks can not be running at the same time on the same card.
For that task, I will configure one big "ChangeDetect" that includes all the bits that will be monitoring cylinders.
I will start one "Reader" that will call a "OnDataReady" when ANY bit in the "ChangeDetect" system changes state.
I will pass an object of my own design to through the IAsyncResult to the "OnDataReady" function.
When "OnDataReady" is called, I will use the contents of the IAsyncResult object to determine which bit changed, and perform the appropriate action for that bit.
I will then restart a "Reader" to catch the next bit change.
I hope that is clear. Please let me know if this is a crazy scheme or if there is an easier way.