08-09-2023 02:47 PM
Hi all, I'm having trouble understanding how to work with matrix and array functions.
I have matrix in a csv file I've attached and I need to essentially add column A to column B then have it display to my indicator.
More specificially, if I have [1,2,3;4,5,6] what I am wanting is 1 + 2 = 3
and then the code needs to go down to the next row and do the same thing: 4 + 5 = 9
and display each sum one at a time for x amount of time.
I'm just really lost and not sure what I need to do.
I have it all inside of a case structure and button because when its in 'manual mode' I'm supposed to be able to add x and y and have it display to the same indicator I mentioned before. whereas the 'automatic' mode will pull from the csv and automatically perform the addition functions and display the sums for me.
Any help on this would be appreciated.
08-09-2023 04:13 PM
Hey guys, I got some help so this is a much better version of my code. Only a few things however.
I want my button to run the portion of the code that operates with the arrays.
I also want the values to start from the beginning of the CSV file when i activate teh button.
RIght now in this current configuration, when the csv file is running, switched to the other mode, then back, it starts where it left.
08-10-2023 12:42 AM - edited 08-10-2023 12:45 AM
Hi tompm,
@tompm wrote:
I got some help so this is a much better version of my code.
This is not "code", this is just an image of code.
Remember: we cannot edit/debug/run "images of code" with LabVIEW!
(When attaching code you should downconvert to an older LabVIEW version so more active members can actually access the code. I prefer LV2019.)
@tompm wrote:
I want my button to run the portion of the code that operates with the arrays.
I also want the values to start from the beginning of the CSV file when i activate teh button.
RIght now in this current configuration, when the csv file is running, switched to the other mode, then back, it starts where it left.
Which "button"? There is no "button", but only "manual" and "stop"…
When you want to start from beginning then you should not use the loop iterator to index rows…
08-15-2023 01:13 PM
Hi, GerdW,
Thanks for letting me know I should attach my code instead of using images. I apologize, I am new to this forum.
I would downgrade my code, but unfortunately I suffer from technical complications on NI's side that leaves me stuck with the version I have now which is the latest version (2023 Q3).
Yes, I meant my manual button.
Gotcha, I will not use the loop iterator to index rows. I understand now how that could prevent me from starting at the beginning of the file.
I had help from someone and they were less concerned with the small details and focused on getting the code to do what I want. It's up to me now to workout the details. I will figure out how to implement this change.
Apologies, I am not familiar with what that is. I'm assuming it's a function of some sort that cleans up my wires and spacing?
its not? I did not know that thank you. I just removed them and I see now my code is doing the same thing still.
I will look into removing the index function.
I just learned how to use them a couple weeks ago. I'll look into implementing this method.
apologies for my verbiage. My csv file is an array I made in excel that has 3 columns and 21 rows of data.
I am now having an issue where I click my 'automatic' button and it's supposed to stay latched but becomes unlatched after 1 iteration.
To give you more context, I will give you the goals I am trying to accomplish with my code:
This time I've attached my code with the CSV file. Here's a screen shot of it too just incase.
08-15-2023 01:30 PM
Hi Tom,
@tompm wrote:
I would downgrade my code, but unfortunately I suffer from technical complications on NI's side that leaves me stuck with the version I have now which is the latest version (2023 Q3).
There is no menu entry File->Save for previous available in your LabVIEW installation?
08-15-2023 01:40 PM - edited 08-15-2023 01:41 PM
OH!
I didn't realize that is what you meant. I thought you meant I needed to literally install an older version. I did not know you could also save as previous version! So sorry for confusion. I'm obviously very new to labview, I hadn't even heard of labview until 2 months ago now I'm learning it for my internship project!
I've attached the 2016 version!
Edit: I also added the 2019 version since you said you prefer it!
08-15-2023 01:52 PM - edited 08-15-2023 01:53 PM
08-15-2023 02:37 PM
thanks for the simplification.
I just tried it myself, and I see what you mean by (nearly).
However, now the automatic button isn't working at all in this version.
Everything else seems fine, just need help figuring out how to make the button activate the csv file from the beginning and start adding colums A and B.
I think the original intent/purpose I had with the 1 and 0 constant was that that was effectively grabbing my column A and B from the csv and then summing them.
How do we go about doing that with this set up?