Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I read a CWAI in one app, while reading it in another app

We have a system that has 2 applications running simultaneously. A background application uses a thermistor sensor and a heating controller to maintain a certain temperature.
The foreground application needs to read the temperature and graph it. Both applications are written in VB and use a CWAI active-x control to perform the reads. When I try to run them both at the same time, I get an error when I try to start the foreground app the CWAI.start command returns an error stating that the resource is already in use. Is there any way around this? They are running on the same machine.
0 Kudos
Message 1 of 2
(2,998 Views)
You can not access the same hardware simultaneously from multiple applications. What you need to do is have one application acquire the data from the hardware and then share the data it acquired with the other application. DataSocket can be used for this and is easy to use. DataSocket is supported in VB with the CWDataSocket control and the "Bindings" property pages on the other controls. For applications running on the same computer, you can also used Windows named pipes (look up "named pipes" in MSDN for more info). Reading/writing named pipes is just like reading/writing files, except that you have to make different calls to open and connect to the pipe.

Hope that helps. Let me know if you still are having problems.

Tony
Measurement Studio
0 Kudos
Message 2 of 2
(2,998 Views)