I am using your ZAD1232PROXR 32-Channel analog to digital converter
in a prototype device to monitor 18 optical sensors:
I have conditioned the sensor output to be between 1-5V to be read by the controller. An object will pass by the sensor within 4ms. I am having trouble getting the polling interval to be less than 290ms, thereby missing the events as they happen.
Here is the polling methodology:
Connect to COM port
Send Byte Array to converter (mode, number of bytes to receive, command, bank, channel, checksum)
Receive Byte Array of 5 bytes.
The SerialPort Class in .NET raises an event that there are bytes received in the port buffer.
The program receives the event and reads the 5 byte response from the serial port buffer.
Bytes #3 & #4 are calculated as follows to get the result for the current poll:
Byte#3 + (Byte#4 * 256) = Poll Result (the number between ~100 (untriggered state) and ~4000 (triggered state)
Send the poll for the next channel on the bank and repeat through all channels on both banks.
The full sweep takes ~290ms to complete. Very easy to miss sensors triggering.
Is there a better way to get these sensor events in real time? Is there a more appropriate device for this?
Thank you for your time,