Discussion:
Agilent 34970A continuous scanning
(too old to reply)
swsyoon
2008-06-18 15:40:06 UTC
Permalink
Hi, Agilent Users,
 
I'm using 34970A with 20channel multiplexer module and try to scan the voltage signal and save the data file using LABVIEW 8.2.
Communication with Labview and the 34970A is made via USB-GPIB and the example code that I downloaded from NI instrument driver sites works fine
 
But, I have difficulties in scanning continuously for a certain time, let's say, 2 minutes with 10 ms. The example code, "The advanced scan example.vi" is for only one scan.
So,I wanted to modify the program being able to scan the channel with the configuration explained above. I set the interval time,  max trigger time and any other parameter that might affect the scanning function but,  I couldn't get results that I wanted.
Any idea or comment are welcome and if you have a code for that purpose, it would be appreciated if you can share the code.
 
Thank you very much.
 
Wonseok Yoon
 
 
 
 
Sputnikrent
2008-06-19 19:40:04 UTC
Permalink
How are you trying to make it run continuously? Did you put the VIs in a while loop? What sort of behavior were you getting?
JoeLabView
2008-06-19 19:40:08 UTC
Permalink
You could create a loop and call the single scan VI example as a sub-vi within the loop.
If you tried that and had problems, then you could post your code.
RayR
swsyoon
2008-06-19 20:40:06 UTC
Permalink
Thanks, guys,
I appreciated your comments.
I tried to scan channels with "Immediate" source with scan to scan interval of 10ms, # of trigger (300), but I realized that was wrong.
Today, I figured that out  using "Timer" source with configuration above and the VI can scan the channel that I set without using "While" or "For" loop.
However, I got another problem. I want to get more than 300 scanned data per channel, but the data shows in the front panel is only around 113 data, not 300 data.
I don't know why the VI can not read 300 data.
The attached are front panel and block diagram of my VI.
Thank you very much.
 
Wonseok Yoon


front panel.JPG:
http://forums.ni.com/attachments/ni/170/333392/1/front panel.JPG


block diagram.JPG:
http://forums.ni.com/attachments/ni/170/333392/2/block diagram.JPG
JoeLabView
2008-06-19 20:40:08 UTC
Permalink
Are you requesting enough data to read from the instrument?  I would have to check the actual commands, but although you tell it to do 300 samples, the size of the data to read may be a larger number.
Question:  Are you trying to remove the commas in that loop?? 
RayR
JoeLabView
2008-06-19 21:10:05 UTC
Permalink
If you want to remove the commas, try the example below using the Search & Replace string function.
 
RayR<img src="Loading Image..."> Message Edited by JoeLabView on 06-19-2008 04:43 PM


SearchReplaceString.PNG:
http://forums.ni.com/attachments/ni/170/333402/1/SearchReplaceString.PNG
swsyoon
2008-06-19 21:10:05 UTC
Permalink
Hi, Thank you for the suggestion.
What do you mean by&nbsp;"requesting enough data to read from the instrument?"&nbsp;and "&nbsp;the size of the data to read may be a larger number."
&nbsp;
I didn't remove the comma in the " while" loop.
The weird thing is that if I use, let's say, # of trigger of 10, then the VI exactly can read 10 data of each channel. but If I set the number as the value more than 100,
then, the same thing happens.
I'll post the results tomorrow after I try yours.
&nbsp;
Regrads,
&nbsp;
Wonseok Yoon
&nbsp;Message Edited by swsyoon on 06-19-2008 03:52 PM
JoeLabView
2008-06-19 22:40:05 UTC
Permalink
Hi Wonseok Yoon,
&nbsp;
So if I understand correctly, you are getting reasonable results up to a value for # of Triggers of 99.&nbsp; When you go to 100 triggers and beyond (with a target of 300), then you do not get all your data.&nbsp; Is that correct?
&nbsp;
So for 10 channels with a trigger of 99, you are looking for 990 points of data.&nbsp; For 300 triggers, you are expecting 3000 data points.
&nbsp;
In your VI, the HP34970 READ...&nbsp; does it have a size configuration for the number of data points to read?&nbsp; I do not have that driver installed, so I do not know what&nbsp;configuration is available.&nbsp; You can select from the HELP menu, display Context Help, or click on the question mark at the top right corner of the block diagram window to display Context Help.&nbsp; Place your mouse cursor on top of the HP34970 READ and look at the description.&nbsp; (also posting the picture would help ;) )&nbsp; It may have a default maximum number of bytes to read which is equivalent to 99 data points.
&nbsp;
I just looked more closely to your While Loop.&nbsp; You're converting the text to an array of strings, delimiting it by a comma..
Okay..&nbsp; I'll post another example of a simpler way to do this.
&nbsp;
RayR
&nbsp;
<img src="Loading Image..."> Message Edited by JoeLabView on 06-19-2008 06:13 PM


HP34970.PNG:
http://forums.ni.com/attachments/ni/170/333420/1/HP34970.PNG
JoeLabView
2008-06-19 22:40:06 UTC
Permalink
Hi Wonseok Yoon,
&nbsp;
The image below is the example.&nbsp; You do not need a loop to convert the text to an array.&nbsp; You can replace the While Loop with a "Spreadsheer String To Array" vi.&nbsp;&nbsp; It is located in the strings functions.&nbsp;
&nbsp;
You&nbsp;simply wire the string from the HP34970 READ to the spreadsheet string input, place a blank string at format string, place a comma for the delimiter (on top), and very importantly, wire a sting array constant to the array type (bottom).
&nbsp;
RayR
&nbsp;
<img src="Loading Image..."> Message Edited by JoeLabView on 06-19-2008 06:25 PM


SprdShtStr2Array.PNG:
http://forums.ni.com/attachments/ni/170/333423/1/SprdShtStr2Array.PNG
JoeLabView
2008-06-20 02:10:06 UTC
Permalink
Another question:&nbsp; did you actually want to have a 2-D array for Read?
&nbsp;
Can you describe that portion of the code?
&nbsp;
RayR
swsyoon
2008-06-20 13:40:05 UTC
Permalink
Hi, RayR
&nbsp;
Your suggestion is really helpful. As you mentioned about the byte count for the data reading in "HP34970A Read.vi",&nbsp; I checked the value as shown in the attached figure,
I found that it was 5000 originally. But I changed it to 50000, and then the VI can read all the data.&nbsp;Thank you for your help.
&nbsp;
And the "while" loop at the end of my&nbsp;VI is to read the&nbsp;voltage, date, and channel number. It seems to me that the data from the&nbsp;"HP34970A Read.vi" is&nbsp;one dimensional string type and each term
is separated by&nbsp;"comma". That's why I removed the comman in that&nbsp;loop, so that I can get the&nbsp;corresponding data per channel row by row as shown in the front panel of my vi.
What I really want is&nbsp;ploting X-Y graph using two voltage output from two different channel, but I don't know how to extract the voltage output only from the total string output.
To plot the graph, I need to extract the two voltage outputs and convert them to floating point numbers, but I have&nbsp;a little difficulties&nbsp;on that.
&nbsp;
I appreciated&nbsp;all your suggestion and comments.
&nbsp;
&nbsp;
Wonseok Yoon&nbsp;
&nbsp;


HP34970A Read.JPG:
http://forums.ni.com/attachments/ni/170/333568/1/HP34970A Read.JPG


Read Block Diagram.JPG:
http://forums.ni.com/attachments/ni/170/333568/2/Read Block Diagram.JPG
JoeLabView
2008-06-20 14:40:04 UTC
Permalink
swsyoon wrote:

Hi, RayR
&nbsp;
I checked the value as shown in the attached figure, I found that it was 5000 originally. But I changed it to 50000, and then the VI can read all the data.&nbsp;&nbsp;
&gt;&gt;&nbsp; Yes, that's what I figured.&nbsp; You may want to modify the VI and change the constant to a control and have tohe ability to set the value outside the vi (from the calling one).&nbsp; I don't know why they didn't do that...&nbsp;
&nbsp;
That's why I removed the comman in that&nbsp;loop, so that I can get the&nbsp;corresponding data per channel row by row as shown in the front panel of my vi.
&gt;&gt;&nbsp; Okay..&nbsp; That explains the 2D array.&nbsp; I can modify my example..
&nbsp;
What I really want is&nbsp;ploting X-Y graph using two voltage output from two different channel, but I don't know how to extract the voltage output only from the total string output. To plot the graph, I need to extract the two voltage outputs and convert them to floating point numbers, but I have&nbsp;a little difficulties&nbsp;on that.&nbsp;
&gt;&gt; I'll include converting to numeric..&nbsp; It is quite simple actually.&nbsp; If you look in the string functions, you'll see some conversion to &amp; from string to numerics.&nbsp;
JoeLabView
2008-06-20 15:10:07 UTC
Permalink
Here is the example for both, and code attached..&nbsp; No While Loop Needed.&nbsp; And all your data is numeric..&nbsp; connected directly to a graph.
&nbsp;
RayR
&nbsp;
<img src="Loading Image..."> Message Edited by JoeLabView on 06-20-2008 11:02 AM


Simplified.PNG:
http://forums.ni.com/attachments/ni/170/333608/1/Simplified.PNG


Simplified.vi:
http://forums.ni.com/attachments/ni/170/333608/2/Simplified.vi
swsyoon
2008-06-20 17:40:09 UTC
Permalink
Thank you very much, RayR.
&nbsp;
Best regards,
&nbsp;
Wonseok
JoeLabView
2008-06-20 18:10:06 UTC
Permalink
Glad to help.
Did the waveform graph work for you?
RayR
swsyoon
2008-06-20 19:40:04 UTC
Permalink
Yeah, Everything works fine.
&nbsp;
I modified a little bit and the attached is the block diagram.
&nbsp;
Many thanks, again.
&nbsp;
Regrads,
&nbsp;
Wonseok
&nbsp;
&nbsp;


diagram.JPG:
Loading Image...
JoeLabView
2008-06-20 19:40:07 UTC
Permalink
Very nice.
&nbsp;
Much cleaner code and easier to read.&nbsp; :)
&nbsp;
RayR

Loading...