LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding data to a specific row in excel

Hi there,

                    I have problems with my data collection from serial read block. I get every time 16 bytes when I write certain command to my serial device. But after a continuous data written to excel, that is let say six rows of data and after that I get one byte of data which I do not want to save in current updating excel sheet. 

 

For that now, I have taken a case structure with two cases, one case contains nothing when I read the one byte and another case contains the code(Spreadsheet file VI) for adding data to excel when 16 bytes received one by one. Still, I am not getting what I wish for. The one byte case adding zero to the current excel file at row 6 and then continuous with 16bytes of data in remaining rows and again after 6 continuous rows it adds zero and so on. I don't know why it is adding zero even i did not put any code inside the case of it.

 

How could I eliminate this adding of zeros?

 

Here it looks like in my excel sheet.

 

row1: 15 16 17 18 19 20

row2: 15 16 17 18 19 20

row3: 15 16 17 18 19 20

row4: 15 16 17 18 19 20

row5: 15 16 17 18 19 20

row6: 0                            (This when one byte reception case which contains no spreadsheet file VI)

row7: 15 16 17 18 19 20

row8: 15 16 17 18 19 20

row9: 15 16 17 18 19 20

row10: 0

 

Any help here around!

0 Kudos
Message 1 of 4
(2,777 Views)

Hi Peter,

 

why do you add a zero in your "one byte case" to your array when you don't need/want this?

 

Eliminate the "adding the zero" by deleting the according BuildArray function!

 

Anything else can be suggested after reviewing your VI...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,773 Views)

You misunderstood my point. I have no code inside the adding zero case. It adding by no meaning. I have only written in one case to add continuous data to excel when ever I receive more than one byte. If I receive one byte exactly, I would not like to append this to excel but currently my program is doing that.

 

I have added my code snippet which is not the current working code. I am out of access to my current code. But instead I have attached similar one. You merely assume that the data is coming form serial read block.

 

Thanks for your efforts.

 

0 Kudos
Message 3 of 4
(2,765 Views)

That piece of code is probably not even close to what you actually have since the True case is never executed. Why would you have a comma separated string wired to the selector and True/False for the two different cases?

 

If you can't post the actual code, just say so. Don't post something that makes no sense.

0 Kudos
Message 4 of 4
(2,747 Views)