LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Transfer data to the "Prompt User" express VI converted to a standard subVI

Solved!
Go to solution

I need to send the medical record number (MRD) to the Patient_Data VI so that I can compare the number to the list which is read from the excel and then display the corresponding other data. The Patient_Data VI is converted from the Prompt User VI, now I provide the number to it in the Read_Patient_Data_trial_1 VI, but it is not read by the subVI. I already did create a terminal for the variable MRD. What is the error in here?

I have attached both the VIs and a trail excel too with the data.

Download All
0 Kudos
Message 1 of 3
(2,105 Views)

Some comments:

  • You have made the common mistake of calling a Comma-separated Values (.csv) Text file an "Excel" file.  The company that makes Windows also makes Excel, and creates an Icon for these Text files that "looks like" the icon for their proprietary .xlsx and .xls files.  Use LabVIEW's more-correct name, a Delimited Spreadsheet file (note that the LabVIEW default delimiter isn't even a comma -- it is a <tab>).
  • I regret that I didn't have the patience to try to figure out your (somewhat messy) code.  You do realize, I hope, that you wrote a header line (oh, yes, I see you trying to read Array Element 1, which skips the header).
  • You are writing strings, and reading strings, so you need to "worry" about conversions with the underlying types (ah, it looks like you did that, as well).
  • Wow, when you "slow down" by writing a response (as I'm doing), you see a lot more.  Look at the "is equal" function, and notice the Coercion dot (red) on the lower input.  Also notice the different look of the wires going into the function -- the top wire is thin (a scalar), the bottom wire is thick with two lines (2D array).  If you right-click the wires, you can see their type (scalar and 2D array).  Oops, something is wrong with the way you tried to "pluck out" the first element of the second row ...
  • Concentrate on learning how to extract a single element from a 2D array.  Build a small VI with a 2D array and practice.  Sometimes VIs named "untitled 1" are Your Friends!

Bob Schor

0 Kudos
Message 2 of 3
(2,087 Views)
Solution
Accepted by topic author yp96
  • How often does the file change? Do you really need to read it 20x per second over and over?
  • Since you are reading the file in the caller, you could just wire the matching patient info to the subVI, 
  • It is usually not necessary to write all the button strings every time the VI is called, because they never change.
  • MRD is a control (i.e. input), so the terminal should be on the left.
  • In the subVI, you are resetting all values to defaults (!!!), meaning the MRD value received from the caller will be irreversibly lost as soon as the subVI is called.
Message 3 of 3
(2,071 Views)