04-30-2009 03:32 PM
Solved! Go to Solution.
04-30-2009 04:47 PM
You do a dynamic call to the Write Trace VI. But a couple of the inputs are to take 1-D data or 2-D data arrays. Since you aren't passing the data into through the connector panel, the default data gets written which is an empty array.
Why are you using the VI open, invoke, close? Why not just drop the subVI on your main program block diagram and connect the array to it?
04-30-2009 04:59 PM
Thanks for reply
I am sorry I think I attached the wrong Labview file. In the original file the file path input to the invoke node is
C:\Documents and Settings\SoftwareInstall\Desktop\LABVIEW codes\86140B Trace_Screen Capture(2).llb\86140B Trace_Image Capture.vi
The VI "86140B Trace_Image Capture.vi" is the one that enable communication with the spectrum analyzer through GPIB. "Image Xfer" and "Trace Xfer" are sub VI s to this VI. Write to Trace File is a sub VI to Trace Xfer. That's all of the VIs work parallelly. Just calling Trace_Image Capture.vi just gives an empty csv. file.
05-01-2009 01:15 PM
Additional comment from other thread:
I am trying to evaluate a temperature sensor.To do that I have to monitor thermocouple readings.Thermocouple is connected to FP-TC-120 temperature module. Besides, I have to acquire data from an optical spectrum analyzer. I am using 3650.VI to monitor the temperature and 86140B Trace_Screen Capture (2).llb o trace the data from the OSA. I want to combine these two VIs and automate the process. I tried to use "invoke node" to call the VI that traces data from spectrum analyzer but I came face to face with the problem that I explained in the link below. http://forums.ni.com/ni/board/message?board.id=170&thread.id=405775 If you can solve this problem by using that VI,I really appreciate it. Then another solution came to my mind. I defined the VIs inside the .llb file as an executable file. But, then I had trouble with the command line input of "System exec.VI". I either got error#267 or error#2 despite the fact that I have spelled the file path correctly any time that I run the code.(attachment 3650.VI) What should be the input to command line the System exec. VI? Should I write cmd.exe or the file path as an input to command line?(I am using Labview 8.2)
Thanks a lot
You are making this way more complicated than it needs to be. As Ravens Fan noted, just use the subVIs directly in your code. In your original 3650 VI you have a case structure to trigger the OSA capture. The "86140 Trace_Image Capture" VI is a top-level VI that collects the data from the OSA and saves it to a GIF file. If you want to do the same thing then all you need to do is to simply place the "Trace Xfer" VI and the "Image Xfer" VI inside your case structure along with the VISA Open and Close. If you want to save it to a delimited file then you need the "Trace Xfer" VI which gets you a cluster and the "Write Trace To File" VI instead of the "Image Xfer" VI. Unbundle the cluster to create the 2D array that you feed to the "Write Trace To File" VI.
There is no need to use dynamic calling or executables.
05-01-2009 05:23 PM
Thanks for your comments smercurio_fc,
I have corrected the code as you suggested. I have put the spectrum analyzer tracing VI inside of a case structure. Now, I have trouble with timing. The problem is if I put a timer inside of a case structure, it disables the elapsed time VI that are used to trace the running time of while loop (and the elapsed time VI that checks the stability time). What I want is tracing spectrum analyzer data at one minute increments up to the target time, once the temperature begins to meet the stability criterion. If i put the case structure out of the while loop, then I have problem with passing the data to out of while loop, since the loop does not stop unless stop button is pressed.
Thanks a lot
05-01-2009 05:43 PM
deniz wrote:Now, I have trouble with timing. The problem is if I put a timer inside of a case structure, it disables the elapsed time VI
That's not what's actually happening. What's happening is that the loop must wait until the Time Delay function is finished before it can continue to the next iteration. There are several ways to fix this. Here's 2:
I recommend method 1.
P.S. I just noticed that the "Trace Xfer" VI has a Write To Spreadsheet File already embedded in it. As it is you'll get a dialog box asking you for a filename. You can either:
05-04-2009 11:43 AM
Thanks a lot for your help,
I tried to implement the first method you suggested. But i had trouble since I am just a beginner. Could you please be more specific in explaining the solution? I am stating the problem again. Once the stability criterion is met I want the case structure to execute on the increments of 30 second or so. How can I do that by using shift registers? I tried to do what you suggested as in the code attached but it did not work. (I could not make the case structure dependent on two conditions)
The other proplem is again about timing. The while loop execute only if the temperature value changes since it is dependent on FP Open sub VI. Thus, the elapsed time VIs that are inside of the loop does not progress at 1 second increments. Is there any way to set an elapsed time that is independent of timestamp of thermocouple reading device?
05-04-2009 04:40 PM
deniz wrote:
I tried to implement the first method you suggested. But i had trouble since I am just a beginner. Could you please be more specific in explaining the solution? I am stating the problem again. Once the stability criterion is met I want the case structure to execute on the increments of 30 second or so. How can I do that by using shift registers? I tried to do what you suggested as in the code attached but it did not work. (I could not make the case structure dependent on two conditions)
I understood what you wanted perfectly fine. You just didn't implement it correctly. See attached. Please revisit my comment regarding the Write To Spreadsheet File that already exists inside of the "Trace Xfer" VI.
The other proplem is again about timing. The while loop execute only if the temperature value changes since it is dependent on FP Open sub VI.
The while loop has no dependence on the FP Open VI other than waiting for the error cluster and Fieldpoint refnum. There is no dependence on the while loop executing only if the temperature value changes. The while loop continuously acquires data, so I do not understand your statement.
Thus, the elapsed time VIs that are inside of the loop does not progress at 1 second increments. Is there any way to set an elapsed time that is independent of timestamp of thermocouple reading device?
They can't and won't. The Elapsed Time VIs simply tell you ... elapsed time. They have no bearing on how fast the loop runs. It seems as if you have contradictory requirements. Do you want to the loop to run once a second and record, or run at the advise rate and only do something once a second, or run at the advise rate and only do something if the temperature changes?