LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get continuous data in excel file from Instrument device using USB-RS232

Hi,

I am currently using USB-RS232 to get data to excel from the instrument but I am getting all 8 channel data only in one channel. But I need all different channel data go into 8 different row.  My excel file and VI is attached.

Download All
0 Kudos
Message 1 of 54
(1,962 Views)

Hi,

I am using LabVIEW for first time. 

I am currently trying to send command to my instrument device using LabVIEW visa but when I write in the normal command window no response is coming. I tried fining the solution but no luck yet. I want sent command "WFreadall". I used serial example "Continuous Serial Write and Read". In addition when the device is debug mode its providing me value. So I am not sure what modification need to do to communicate with the device. 

0 Kudos
Message 2 of 54
(1,970 Views)

You haven't asked any specific questions here.

 

At a minimum this is the information we will require to help you:

- What device are you communicating with

- a user manual for this device

- Attach the code you have already written (the actual VI, not pictures)

 

0 Kudos
Message 3 of 54
(1,943 Views)

Hi Intern,

 


@InternlABVIEW wrote:

I am currently using USB-RS232 to get data to excel from the instrument but I am getting all 8 channel data only in one channel. But I need all different channel data go into 8 different row.  My excel file and VI is attached.


You better use AutoCleanup before posting your VI…

And you definitely should watch this video before starting again!

(No need to start two threads for the same problem!)

 

Conclusion:

  • Don't use BytesAtPort! Your messages are determined by TermChars (atleast according to your port initialization), so use that TermChar!
  • Don't place a wait time in the loop: it's not needed once you get rid of BytesAtPort!!!
  • You don't need to "Set to end of file" in each iteration of the loop! You only need to do that once before the first Write operation before the loop
  • You don't create an "Excel file", you create a simple (delimited) text file aka TSV/CSV file!

Try this:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 54
(1,930 Views)

Thank you for your reply but I am still getting the same result like before. All 8 channels data coming as a single row. But I have total 8 channels and want to get data in 8 different rows. Just wondering is it possible to send same command continuously and record the data in excel or text file.

 

I tried sending command. But it’s not working. I have to send command “WFreadall” which is ASCII command. 
Lastly is it possible for labview to send 8 different commands continuously to 8 different channels and get the data. Thanks 

0 Kudos
Message 5 of 54
(1,886 Views)

Here are the document you have requested. I am trying to send command to the device through Labview but no response. Please look page 43&44 for the command manual. Thanks

0 Kudos
Message 6 of 54
(1,880 Views)

Hi Intern,

 


@InternlABVIEW wrote:

I am getting all 8 channel data only in one channel. But I need all different channel data go into 8 different row.


You just need to parse the received messages and sort the data into their individual rows/columns/arrays!

Each line contains the channel number, along with the sensor data:


@InternlABVIEW wrote:

21/07/2021 12:58
Channel 05 Converting pH sensor InBuff= 0.000 Converted hex value to AD420 = 0000


Read the device response and parse the values as needed!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 54
(1,876 Views)

That’s what I am struggling to do for few days and struggling to find anything or examples that will allow me to it. Always coming data in a sane rows. 

0 Kudos
Message 8 of 54
(1,835 Views)

Hi Intern,

 


@InternlABVIEW wrote:

That’s what I am struggling to do for few days and struggling to find anything or examples that will allow me to it. Always coming data in a sane rows. 


You found no examples on how to parse a string into numeric values?

 

See this:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 9 of 54
(1,833 Views)

No examples of getting data of different channels with different command. I have an idea but not sure how to execute that. I am a new Labview user. I was thinking of getting 8 data rows for 8 different channels which will runs with 8 specific command 😅

0 Kudos
Message 10 of 54
(1,825 Views)