Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Background Server to allow multiple programs to read the same analog channels simultaneously

What would be the best way to create a server that runs in the background to read 4 analog channels and continuously stream the data to multiple VB6 applications.  I need to be able to allow 3 seperate VB6 applications to have access to the same 3 analog inputs.  Any one of the three programs can be used independantly.  Since we are using the M-series DAQ board we are only permitted to make one call to read the analog channels from one program at a time right?  We would rather not buy the S-series DAQ cards so we are looking for an elegant software solution.
 
Has anyone tried something like this before?  What would you suggest we try? 
 
 
0 Kudos
Message 1 of 9
(4,409 Views)
Hi,
The best method would be similar to what you've suggested. You would need one program to acquire all four channels and then publish this information. The other client programs would not make calls to the DAQ device; all of this would be handled by the server program. The server program could then publish this information to the other programs using global variables, writing it to a file, publishing it on a TCP or ActiveX server, etc. It's possible that someone in the community has done this and can provide an example of this in Visual Basic 6.
 
The S-series cards do allow you to have simultaneous sampling, but you would still be limited to one task open with the analog input at a time. Since there is only one set of timing circuitry for all channels, you would still only be able to reserve this for one analog input task at a time. The benefit is that each channel has its own analog to digital converter (instead of a multiplexer to a single ADC), greatly reducing the interchannel delay.
 
I hope this helps!
 
Regards,
Missy S.
Project Engineer
RoviSys
0 Kudos
Message 2 of 9
(4,392 Views)

MissyD

After I posted that question I thought about it a little more and realized that even the S cards cannot do what I want natively.  The problem is that multiple simultaneous calls to the driver/board do not work.  I agree that there are benefits to having isolated ADC's but simply adds cost to what we want to use it for.  Hopefully someone has done this.

I want to sample at the highest rate I can on the channels and then process the data in software.  This means I would need to buffer a lot of points.  In fact by writing one channels read to a file results in several 10's of MB of text file.  I think we will need something more efficient than writing to a file.  I was thinking maybe a memory mapped file or a named pipe.  I need to be able to allow multiple  processes to access the same data without causing issues.

I have never messed with named pipes or a memory mapped file so hopefully someone can make some suggestions.

0 Kudos
Message 3 of 9
(4,380 Views)
Hi,
I found some resources on named pipes here and here. A resource on mapped memory files can be found here. I found these by searching Google, but there are many others.
 
Please let me know if you have any questions about configuring or performing the acquisition. I hope this helps!
 
Regards,
Missy S.
Project Engineer
RoviSys
0 Kudos
Message 4 of 9
(4,364 Views)
Is datasocket available for VB?
0 Kudos
Message 5 of 9
(4,359 Views)

Hi,

DataSocket is another good suggestion. To use DataSocket in Visual Basic (without the use of LabVIEW wrappers), you will need Measurement Studio. The Professional and Enterprise editions include support for VB 6.0. Here and here are tutorials on DataSocket. The second is focused on LabVIEW, but has some good information for DataSocket in general. Here is tutorial on connecting Measurement Studio user interface ActiveX controls to remote data.

For more information on Measurement Studio, see http://www.ni.com/mstudio/.

I hope this helps!

Regards,

Missy S.
Project Engineer
RoviSys
0 Kudos
Message 6 of 9
(4,330 Views)

What kind of bandwidth limits does the datasocket have?  I would be talking about reading 100,000 data points per second and streaming them to a datasocket so that 3 clients could use the data all running from the same PC.  This seems like a simple way to do what I want, but I am just concerned that it will be too slow.  How would you expect the speed to compare to memory mapped files, or named pipes?

 

thanks everyone for helping

0 Kudos
Message 7 of 9
(4,320 Views)

I read through the links that were provided above, but are there any included examples with either measurement studio or the daqmx driver?  It would be helpful to see an example of how to emplement this now that I know what it is used for.

 

 

0 Kudos
Message 8 of 9
(4,314 Views)
While we don't really have much benchmarking data since transfer speeds are highly system dependent, here is a document that might help you find out about how fast Datasocket would be:
How Fast Can I Transfer Live Data with DataSocket?

Note that Datasocket is built on TCP/IP, so benchmarking statistics for TCP/IP should be comparable.

As well, here's a discussion forum in which they discuss ways to optimize Datasocket speed (including finding the ideal packet size based on your setup):
http://forums.ni.com/ni/board/message?board.id=170&message.id=83289&requireLogin=False

Hope this helps!
Thanks,

Andy McRorie
NI R&D
Message 9 of 9
(4,278 Views)