Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Please help with ScanClock.Frequency?

I am writing a program which uses 3 channels to collect data. I am confused with the ScanColck.Frquency. As per the defintion this property specifies scans per second. My questions is that does this refer to all the 3 channels workign at the same time and collecting data simultaneously or first channel collects data and then the second one collects data after 1/frequency and so on ...
0 Kudos
Message 1 of 5
(7,165 Views)

Hi vjuno,

 

There’s a great KnowledgeBase (KB) that covers the explanation in more depth, but basically the sample clock (scan clock) is controlling the time between one sample on channel 0 and the next sample on channel 0, regardless of how many channels you’re sampling on. The convert clock (channel clock) is a clock that is responsible for latching every sample of every channel, so it will be faster than the sample clock for multiple channels.


The diagram in the KB above should help make sense of the two. Feel free to post back to the community if you have further questions.

Mark E.
Precision DC Product Support Engineer
National Instruments

0 Kudos
Message 2 of 5
(7,136 Views)
Dear Mark,
Hi. Thank you for your reply. Is there some standard reference available which I can look upon when I need some help. I have a VB6 code that uses CWAI control and it is runnign fine. Now i am shifting to Vb .NET (2008) version. But I am unable to run the code.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim AxCWAI As AxCWDAQControlsLib.AxCWAI = New AxCWDAQControlsLib.AxCWAI
AxCWAI.Configure()
AxCWAI.Start()

End Sub

And on compiling it gives me the follwoign error :
A first chance exception of type 'System.Windows.Forms.AxHost.InvalidActiveXStateException' occurred in AxInterop.CWDAQControlsLib.dll

Can you please help me with this.

Thank you in antcipation
Vijay.
0 Kudos
Message 3 of 5
(7,133 Views)
Hi Vijay,

Transferring VB6 code to VB.NET is not as simple as one would think. There is a big difference in syntax. If you have DAQmx drivers installed, please refer to the VB.NET examples in the following directory:

C:\Documents and Settings\All Users\Documents\National Instruments\MStudioVS2005\DotNET\Examples

From here you will find a shortcut to DAQmx examples for Analog In, Out, Counter In, Out, etc. Once you've navigated to the type of example you will see that each example comes with a version in VB.NET and C#.NET. For example, for the VB.NET example of Continuous Voltage Acquisition with an Internal Clock, you would find yourself in the following directory:

C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples\DotNET2.0\Analog In\Measure Voltage\ContAcqVoltageSamples_IntClk\vb

Hope this helps.
Manooch H.
National Instruments
0 Kudos
Message 4 of 5
(7,110 Views)
Hi Vijay,

Since you are moving to .NET, I would encourage you to also move from Traditional DAQ (i.e. those ActiveX controls) over to DAQmx. We actually have a nice tutorial that will help guide you through this transition. See the Transition from Traditional NI-DAQ (Legacy) to NI-DAQmx using Microsoft Visual Basic .NET tutorial which is a 5-part series. 

Best Regards,
Jonathan N.
National Instruments
0 Kudos
Message 5 of 5
(7,084 Views)