LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

invoke node (parallely working VIs in a library)

Solved!
Go to solution
Hello everyone,

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 am trying to use Invoke Node VI to trace data from spectrum analyzer. To do that I specified the necessary file path as an input to the code. The problem is the necessary VI (Write Trace to File.VI) is inside of a llb. file and needs other codes to completely function.
That's when I run the code, (and when the stability condition is met) the computer asks me to save the spectrum analyzer data to a file called trace.csv. When I press ok, it just saves an empty file with a header (Power(dbm) Wavelength (nm)). Apparently it works parallely with other VI. How can I make use of the VIs inside of a .llb file with invoke node VI or should I use other VI to do combine temperature monitor VI with data tracing VI.

The second problem is with the stability criterion of temperature.In the attached VI, I check whether the thermocouple reading stays within 0.8 degree stability range for 900 seconds. I want to change this. I
want to check the stability of the temperature by comparing the final data with the previous ones. Is there any specific VI that should be exploited to check the fluctuations of waveforms?

 Thanks a lot
Download All
0 Kudos
Message 1 of 8
(4,348 Views)

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?

0 Kudos
Message 2 of 8
(4,337 Views)

 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. 

0 Kudos
Message 3 of 8
(4,332 Views)

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. 

 

0 Kudos
Message 4 of 8
(4,313 Views)

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 

0 Kudos
Message 5 of 8
(4,297 Views)
Solution
Accepted by topic author deniz

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:

 

  • Instead of having a Time Delay inside the case structure, use a shift register to keep track of the last time a trace was captured. If the time is greater than or equal to 1 minute, and you're supposed to be capturing, then perform the capture and reset the timer. Thus, the case structure would be driven by 2 conditions rather than 1. This is a relatively simple change.
  • Place the trace capture in a separate and independent loop. The case structure would be as is inside this independent loop. You would need to use a local variable or property node as a flag so that the trace capture can be triggered. I.e., you would need to create an indicator from the output of the Less or Equal? function so that you can read the value in the other loop.


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:

 

  • Delete the Write to Spreadsheet File from the "Trace Xfer" VI since you're doing it in your higher level code.
  • Delete the Write to Spreadsheet File from your top-level VI and add a path control to the "Trace Xfer" VI and pass in the path to the file that you wish to write.
0 Kudos
Message 6 of 8
(4,292 Views)

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? 

0 Kudos
Message 7 of 8
(4,239 Views)

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. Smiley Wink 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?

 

0 Kudos
Message 8 of 8
(4,221 Views)