Digital Multimeters (DMMs) and Precision DC Sources

cancel
Showing results for 
Search instead for 
Did you mean: 

how to convert an array to numeric

I had success using HP34401A ( Read and meas driver) and the results come out as an array, now I would like to convert it to numeric before I can build the string. (note: that I had use the Build String VI example from Basic 1 self training try to write the data to a file by using File Writer VI). The problem is I did not know how to convert an array to a numeric. Can anyone have some input to help. Thank you
DN
DQN
(480) 250-2545
david.nguyen@arizona.edu
0 Kudos
Message 1 of 9
(8,840 Views)
Hello,

I am assuming here that your array is an array of strings representing numbers.  If this is the case there is a built-in LabVIEW VI which will easily convert your array of strings to an array of numbers.  I have attached an example of its use below.

Thanks for posting, and please let me know if you have any other questions!

Regards,

Travis M
Applications Engineer
National Instruments
Travis M
LabVIEW R&D
National Instruments
0 Kudos
Message 2 of 9
(8,831 Views)

Hello Travis.

Thank you for the response. The source is 1-D array of double [64-bit real(~15 digits precission)] not as you assuming  is an array of strings representing numbers, so the solution you gave me not work I am still struggle and looking for help, hopefully you can give me another one. Thank you Travis

David Nguyen

 
DQN
(480) 250-2545
david.nguyen@arizona.edu
0 Kudos
Message 3 of 9
(8,825 Views)
Hello,

I'm still a little unclear on what exactly what datatype you are trying to convert to then.  I understand you have a 1-D double array, but what "numeric" datatype are you trying to convert to?

Travis
Travis M
LabVIEW R&D
National Instruments
0 Kudos
Message 4 of 9
(8,822 Views)
Travis
The numeric datatype I am  trying to convert to also a double [64-bit real (15 digits precission)] but not an array
 
Regards;
DQN

DQN
(480) 250-2545
david.nguyen@arizona.edu
0 Kudos
Message 5 of 9
(8,820 Views)

Hello DQN,

So just to clarify, you have an array of doubles that you would like to convert to a single double?  If this is the case, what is the algorithm that you would like to use to convert between these two?  Is each entry in the array one significant digit in the desired double, or is it something more mathematical, like you would like to average all the points in the array and return a single double?  I ask, because there is no predefined way to convert between an array of doubles to only one double.  Any conversion between the two requires some sort of relation between the doubles in the array and the desired output.

If you provide me with a little more information about how to convert these I would be happy to help you out further.


Travis

Travis M
LabVIEW R&D
National Instruments
0 Kudos
Message 6 of 9
(8,807 Views)
Travis
The goal is I am trying to use File writer.VI from basic2 training which will help to save the results split out from DMM-34401A  which is an array (double) and the input to File Writer.VI only taking a numeric (also double). So  I need to convert an array into a numeric right before the data enter File Writer.VI. Enclose are the VI's included both DMM driver and the String BuiderVI. I hope you understand it now.
DQN
(480) 250-2545
david.nguyen@arizona.edu
0 Kudos
Message 7 of 9
(8,802 Views)
Travis
Enclose is the VI that shown the error
DQN
(480) 250-2545
david.nguyen@arizona.edu
0 Kudos
Message 8 of 9
(8,800 Views)

Hello DQN,

I'm still a little unclear about what it means to convert an array of numbers to a single number, however it appears to me as though you are acquiring an array of doubles from the instrument which you would like to write to a file.  The "Build String" VI appears to take a double number (not an array) and covert to a string to write to the file.  I think this may be what you are referring to -- converting your array of doubles to a single number to write to the file.  If this is the case you will need to change the "Build String" VI you created to take in an array and convert it to a string.  I modified your Build String (but have not tested it) to do this with the "Numeric" input, but I am still a little unsure that this is exactly what you are looking to do here.

Please let me know if I can help out further.

Travis

Travis M
LabVIEW R&D
National Instruments
0 Kudos
Message 9 of 9
(8,790 Views)