Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

the vb NiDaqMx tutorial,how does the program get its input from the DAQ?

Very sheepishly I have returned from the lab to report that the 'zero crossing' of the ai0 signal was actually at 7 volts. This is what MAX told me.  Thank you so much, things work now!
 
 So, no rest for the weary, onto my next barrage of questions:
 
I had been looking at the ai0 signal on a CWGraph autoscaled (chartY), which told me ai0 was between 0 and 3 volts, hence my zero trigger level choice. I hadn' t thought to check MAX.
 
So, now, I need to know how to set up CWGraph so that it will give me the info that MAX testpanel gives, i.e. the actual values. Why does CWGraph shift it like that?
 
Another question. In this same autoscaled CWGraph, the x axis (time) fluctuates between 2000 and 1500 which makes it very jumpy. If I put in fixed limits for the x axis (say 0-10) , it doesnt get the whole picture, but its stable. It sort of stretches out the 2 sinewaves I see when its autoscaled (with a history of 1500, since I have 750 samples per cycle), and I see only a part of the sinewave. How do I get the best of both worlds?
thanks,
saroj
 
 
0 Kudos
Message 41 of 50
(5,270 Views)
Hi Saroj,

We spoke on the phone today about your issue so I wanted to also post to the forums.  I am currently working on an example for you to behave the way you have specified on the phone as well as in your previous post.  Once I have finished with the example, I will send it to you as well as post it on the forums so that others can see the example as well.

Thanks,
Caroline Tipton
Data Management Product Manager
National Instruments
0 Kudos
Message 42 of 50
(5,249 Views)
Appreciate it, Caroline.
saroj
0 Kudos
Message 43 of 50
(5,246 Views)
Hii Saroj,

I was working on your example today and was running into some issues when I realized that I believe we are headed down the wrong path.  If you want that smooth time increase and scaling that you see in MAX, then you have to use single point acquisition and not continuous as you are now.  This is because you are plotting a group of data which changes the scale by a large amount.  This will always appear jerky.  So, you can get the smooth look of the graph in MAX, by calling a single point acquisition in a loop and plotting each point as you acquire it.

Let me know if this is a path that you are will to pursue and we can discuss this in more detail.
Thanks,
Caroline Tipton
Data Management Product Manager
National Instruments
0 Kudos
Message 44 of 50
(5,236 Views)
I've already tried single point aquisiton....it was very strange. I was told by you guys that it cant be done (too fast or something, didnt get it)
However that was a few days ago, so I will retry it tomorrow.
thank you,
saroj
0 Kudos
Message 45 of 50
(5,233 Views)

To clarify, I have two CWGraph issues.

 

 In one of them I can use any frequency and sampling rate I like. This is what we talked about today.

Yesterday we talked about a graph in which I am restrained to getting data at 250 hertz, with each cycle being 3 seconds.

 Will you be posting anysample code tomorrow? I'll look at it and talk to you if I have problems. Thanks so much,

 

saroj

0 Kudos
Message 46 of 50
(5,228 Views)
Hi Saroj,

In working with another AE here we came up with one way to create the smooth look that you are asking for.  However, this is not a simple task and will take a bit of knowledge of the data that you are collecting and the time at which you are collecting it.  The attached example uses random data to oshow how you can manipulate the data by moving it back while incrementing the x-axis to give the smooth look that you have seen in MAX.  Take a look at this example and see if you can use this in your application.
Thanks,
Caroline Tipton
Data Management Product Manager
National Instruments
0 Kudos
Message 47 of 50
(5,214 Views)

Hello Caroline,

I did manage to get the scrolling effect based on your sample app. The timer in your app was not obvious to figure out how to improvise with the actual DAQ board, but its working now. A side effect is that since  I have to replot so many times the time axis values increase astronomically and I dont see a way to get the numbers to be 'actual'. With the previous way (non scrolling) the numbers of time slide along like they should e.g 6->9-12 etc.

Now they are 6->4500->9000 etc and its because I'm plotting in a loop. Is there a way to regain control of the time axis in the numbers it displays? It keeps the range like I tell it to, but the values arent what I want them to be.

Thanks you and the other AE who helped you with the sample. Also thanks to all the other AE's Daniel, Tyler, Nandini, Scott and hope I didnt miss anyone,

saroj

0 Kudos
Message 48 of 50
(5,183 Views)
Hi Saroj,

I know we discussed this on phone but I wanted to also post the answer so that others in the community would know.  Since you are acquiring data in chunks but plotting data points one by one, you will need to also keep track of the x value for each y value that you plot so that your time scale is acurate.  Otherwise, you will be plotting each y point against the newest x value which is not the corresponding x for the y that you are plotting.  Let me know if you were able to get this working or if you are still having some trouble with the plotting.
Thanks,
Caroline Tipton
Data Management Product Manager
National Instruments
0 Kudos
Message 49 of 50
(5,168 Views)
Caroline,
I just hid the time axis. Will see if its acceptable to the user
thanks,
saroj
0 Kudos
Message 50 of 50
(5,153 Views)