Jump to content
  • 0

Proper Way of Data Reading with Different Multiple DAQ Boards


Ricky Ooi

Question

I have two different MCC boards, USB-1808 & USB-QUAD08 which connected together to a PC with USB. With my C# programming, I deployed object oriented method by creating two objects, namely class DAQ, each object for one boards. In each object, they have own Thread to execute DaqInScan / CInScan in continuous and background mode. In each thread, it will called GetStatus() function to process the data required. From main thread, it will access the data from each object to combine them together using timer.

Is the method mentioned above suitable? Because I notice the number of scan count for each thread are different much. For example:
(i) At t = 1s,
USB1808 : 200 scans
USBQUAD08 : 195 scans

(ii) At t = 2s,
USB1808 : 402 scans
USBQUAD08: 398 scans

....

(iii) At t = 10s,
USB1808 : 1988 scans
USBQUAD08: 1978 scans

If I would like to combine the data from each board corresponding to each scan index (example shown below), it seem like not so suitable.
(i) At t = 1s,
1st dataset = USB1808 data [0] + USBQUAD08 data [0]
2nd dataset = USB1808 data[1] +  USBQUAD08 data[1]
...
195th dataset = USB1808 data [194] + USBQUAD08 data [194]
--> At this point, there are another 5 scans data in USB1808.

Edited by Ricky Ooi
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hello,

You can run them as separate units, which is what you're doing, or you could make one control the other by linking the external pacer clocks pins. For example, make the clock output (ICLKO) on the USB-1808 drive the clock input (XPCR) on the USB-QUAD08. The key to making this work is to configure the USB-QUAD08 first. This is to get it ready to receive the clock from the USB-1808 once it's started. It's important to note that the clock pin is dead until AInScan is called. Once executed, the clock pin comes alive and because the USB-QUAD08 is set for EXTCLOCK, both start and run in lock step. 

As for collecting data, the GetStatus numbers likely won't be identical because all of our devices behave differently. For instance, you may get 1988 from one an 1978 from the other. But if you were to read only a 1000 from each, the values would line up. Assuming it's a continuous acquisition, you could monitor the current index from GetStatus and when it reports a number past halfway through the buffer, read the lower half of the buffer. When the index rolls over to zero (or less than half) read the upper portion. The following KB article demonstrates this method: https://kb.mccdaq.com/KnowledgebaseArticle50793.aspx

Best regards,

John

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...