From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

manufacturing process control. How?

Hi, I know how to use NI and VB.NET to log data, setup channels for AI etc. My question is how do you set it up to both read data and write data as well.
 
Example, in a process we have, there are Ph meters, ON/OFF valves, temperatures and pumps. How do I write a program that constantly reads the Ph and temps, and based on some simple process logic, turn on values and pumps etc.
 
Currently I only know how to set the system up to log data, not both read and write.
 
A simple example would be great. Either MAX or Active X in VB, would be ideal.
 
Thanks
Stuman
 
0 Kudos
Message 1 of 2
(2,929 Views)
Hi Stuman,

There are several good examples to start with in the C:\Program Files\National Instruments\MeasurementStudioVS2005\DotNET\Examples\DAQmx directory.   I would suggest combining the ContAcqVoltageSamples_IntClk example and the WriteDigChan example.

The key to having both an analog input and digital output is to create a task for each (create AI channels and DO channels).  Then you can start both tasks, execute an DAQmx Analog Read, perform your logic, and then execute a DAQmx Digital Write.

If you are having trouble, post the code you are working on an I can help.  In the mean time, I'll see if I can find a small existing example for you.

Have a nice weekend,
Erik J.
0 Kudos
Message 2 of 2
(2,916 Views)