LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading in data from VISA

Solved!
Go to solution

Hi 

I am total beginner with labview and have searched but to no avail.

I have MC which is pumping data from five sensors , each sensor outputs a high bit and low bit. I have created a VI that reads in the data and converts the string to an unsigned byte array. My problem is that I am having trouble seperating each individual byte so I can add the two bytes to get a decimal value.

 

 

0 Kudos
Message 1 of 5
(3,114 Views)

Index Array and Join Numbers is the safest way.  This will allow you to get the values you need and then combine two bits to make a U16.  You can then convert it however you need to.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 5
(3,100 Views)

Hi 

 

I have done that but I am having further trouble writing the data to a TDMS file.  I want to write each of the numbers to a file every 20ms but when I try to enter the data into the wrtie to TDMS function , I get an error saying I cant enter polymorphic data. 

0 Kudos
Message 3 of 5
(3,071 Views)
Solution
Accepted by zain1612

You will want to combine the U16 data into an array and then write the array.  You should also use an array of strings to tell the TDMS Write what channel names to use.  Also, make sure you open/create the file before the loop.  And finally, make sure you are closing your serial port and your file.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 5
(3,064 Views)

Awesome thank you so much 🙂 

0 Kudos
Message 5 of 5
(3,057 Views)