LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MS2036 Memory problem with 2 PCs

Hi,
 
I have developed a program using labview 7.1 and works fine on one PC but not on the second one.
 
The first PC has windows 2000, service pack 4, with 1G of memory the second PC has windows 2000, service pack 2 and 256K of memory.
 
In the second PC, I can only get a maximum reading of 174points (instead of 551 points -anvna Fetch Trace.vi).  Fisrt PC is fine.
 
Could somebody help me to find out if this is a memory problem or could by an issue with my code.  Please see attached code for more details.
 
 
Thanks very much,
 
Frank
 
 
0 Kudos
Message 1 of 11
(3,773 Views)

Briefly looking at the code, I would expect unpredictable race conditions everywhere.

Your main VI has disconnected code segments all over the diagram, resetting certain values. There is no way to tell what happens first, e.g. will the indicator first get a value from inside the stacked sequence or get reset first with a code segment on the outside. Since you use indicators as controls and vice versa (e.g. timeout) it is very difficult to troubleshoot.

Your error handling is highly suspect: You start each frame of the stacked sequence with the same error value, and if an error occurs on one of the frames you just update a local variable without using the error information in subsequent frames.

Shouldn't there be a small delay in the "wait for..." subVI?

Sorry, I cannot troubleshoot your code because of missing subVIs and hardware. I also have a hard time with all these references, deeply stacked sequences, leaking dataflow, and right-to-left flowing wires.

Here are a few quick tips to simplify your math in you "data transform" subVI. If you would cast your string to a complex datatype (CSG), the code gets significantly simpler (basically, it goes from the size of an envelope to the size of a postage stamp without change in result! :)).

Have a look at the image below:

 

Another example is in frame #7. Here you keep every third element of a 1D array using a complicated while loop (mislabeled as: REMOVE EVERY THIRD ELEMENT FROM ARRAY). All you really need is a decimate array node. 🙂

Sorry, as mentioned, I cannot address your main problem, but I suspect it is directly caused by your coding style. 

Message Edited by altenbach on 07-07-2007 05:02 PM

Download All
0 Kudos
Message 2 of 11
(3,764 Views)

Thanks altenbach for your comments.

I have simplified this vi by removing all control references (used for troubleshooting purpose only).  The problem is in the "anvna Fetch Trace.vi."   Please refer to attached word document that shows the change that I need to make in order for second PC to work (256KB memory).

Basically I need to change the visa read buffer from 1000000 to 1420, which only gives me 174 point instead of 551 that I get in the first PC (1GB of memory)

Thanks again for your assistance on this issue.

Frank

 

 

0 Kudos
Message 3 of 11
(3,753 Views)
It doesn't make any sense to decrease the number of number of bytes in order to read more data. If you are not getting the complete buffer, you would want to increase the number of bytes. In any case, the amount of memory in your pc will have no effect. You can specify for every VISA Read, a very high number of bytes. The VISA Read will automatically terminate when the instrument asserts EOI and EOI will be asserted when the entire bufer is transfered. For example, if there are only 2 bytes in the buffer and you specify 1000000 bytes to read, as soon as the 2 bytes aer transfered, the instrument asserts EOI, the VISA Read terminates, and you have two bytes in the pc. I think you have an instrument setup issue besides all of the LabVIEW code problems alreay mentioned. I don't see any code where you do anything except load a cal setup. You don't even do a reset to place the instrument into some known configuration. Have you tried to do a trace transfer manually in MAX? Try that and see what you get. My guess is that you are getting only 174 bytes because that's all there is.
0 Kudos
Message 4 of 11
(3,732 Views)
Dennis Kn… Knight of NI  thanks for you replay, but if I change the above number to 1000000 (on second PC), I only get a single number in the array returned by the equipment, and that number is zero.  However using the same code (VIs), same set-up and same equipment in the first PC (1GB of memory) I receive an array of 551 points (with 1000000).  So then, I found that by changing VISA reading from 1000000 to 1420 it returns an array of only 174 points, not what I want but defenetily is pointing to some problems with the second PC, and I am not sure if is memory related.
 
In the main VI, I am resetting the equipment, setting to VNA mode, then loading a calibration, set to measure S11 and initiate a reading, and finally read the array or data coming from the equipment.   Which by the way I am not sure if it is a limitation of the equipment or the Labview library, but I am forced to load the whole equipment set up (which takes about 20 seconds), every time that I need to change to a new calibration.
 
Could you please let me know how to do the "Have you tried to do a trace transfer manually in MAX"?  Thanks again for your help on this matter.
 
Frank
 
0 Kudos
Message 5 of 11
(3,727 Views)

You go into MAX, right click on the instrument and select 'Communicate with instrument'. You get a window with read/write/query tabs. Use the query tab and send the TRAC? 1 command just like it is in the driver and just like it is in your programming manual. If you want to experiment with the VIs, put an indicator on the return count and read buffer outputs of the VISA Read. Both the MAX window and the LabVIEW mods will tell you exactly what is read and how many bytes are read.

 

0 Kudos
Message 6 of 11
(3,723 Views)
Dennis,
 
I started MAX but not able to see this equipment (ms2026a).  The ms2026a is connected directly to PC's network card and has the following IP address: 10.0.0.2
 
Coud you please let me know how to make this equipment appear on MAX?  I only see a list of other devices but not this one!
 
Thanks,
 
Frank
 
0 Kudos
Message 7 of 11
(3,687 Views)
Sorry, I missed the fact that you had an Ethernet connection and not a GPIB. In MAX, right click on Devices and Interfaces and select Create New>VISA TCP/IP Resource. Just follow the directions. You can then use the Tools>NI-VISA>VISA Interactive Control.
0 Kudos
Message 8 of 11
(3,682 Views)

I selected the Raw socket option and entered the IP address 10.0.0.2 and automatically shows port 7, but it gives me an error "could not open a visa session to 'TCPIP:10.0.0.2:socket"

I am entering or selecting the right option?  What about the port number?  Thanks,

Frank

 

 

 

0 Kudos
Message 9 of 11
(3,677 Views)
I think your instrument is a VXI-11 type but you should verify that with the manual. Try the auto-detect. Is your pc's nic set to the same sub-net? If it is, the auto-deect should work.
0 Kudos
Message 10 of 11
(3,672 Views)