NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

CWAIPoint SingleRead()

Sorry that I can't figure this out. How do I just sample a voltage off of channel 0? I have only one string set up in the AIPoint control and have called it 0. I thought that might select channel 0. Anyway, what's wrong with this code?

double voltage;

m_analogInput.SingleRead(CNiVariant(Voltage), CNiVariant(1));

It doesn't seem to work but maybe I don't have my channel string configured correctly from the dialog.

Grant
Grant M. Johnson
Project Engineer
LECO Corporation
0 Kudos
Message 1 of 4
(3,484 Views)
Grant -

Hello and thanks for using NI's Developer Zone. We are very proud of this forum because it allows for just this type of interaction. I hope that you have found it satisfactory thus far and will continue to use it, along with many of our other resources, in the future.

Now, on to your solution. I would venture to say that some of the greatest resources that are available for examination of code and syntax are the example programs that are included with Measurement Studio and NI-DAQ. Your solution is going to lie in these.

Specifically, you are going to want to check out the AIAO.VBP project. You will notice the CWAIPoint1.SingleRead call that is made within AcquireButton_Click(). You will be able to use this example code to incorporate the proper s
yntax into your system, dependent upon your previous declarations.

Good luck with your data acquisition project. If we can be of any further assistance to you, please feel to contact us again. Thanks again for using National Instruments!

Best Regards,

Greg Wempe
Application Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,484 Views)
Grant,

I think you may want to post this to a different group as it is really unrelated to TestStand. Try posting to the Measurement Studio group of which ComponentWorks is a part.
Message 3 of 4
(3,484 Views)
Sorry. I went one to far on the list box.

Grant
Grant M. Johnson
Project Engineer
LECO Corporation
0 Kudos
Message 4 of 4
(3,484 Views)