06-03-2022 07:34 AM
Hello,
I have a poblem where I want to use a cursor to place 2 point on a graph and then save the x and y data of those 2 cursors repeatedly until stoped. Which means that every single time I would like to save 4 data into an array, and move the cursors until satisfied and then save them again. I have tried using a while llop because the number of saves are not known prior. It is not working and I dont know why, I am bad at using shift registers and I think that is the problem, if you could help I would appreciate.
Cheers,
Diural
Solved! Go to Solution.
06-03-2022 08:34 AM - edited 06-03-2022 08:41 AM
(Sorry, I cannot open your VI. consider "save for previous")
06-03-2022 08:41 AM
You've got race conditions: Time time and order in which the Active cursor is being set is unpredictable.
Do this:
Also, the loop in a loop makes no sense.
06-03-2022 08:48 AM - edited 06-03-2022 08:51 AM
Or:
There is really no reason to create a 2D array with one row. You need to built array if you want to append a row to a 2D array in a shift register.
06-03-2022 09:01 AM - edited 06-03-2022 09:03 AM
@Diural wrote:
I have a poblem where I want to use a cursor to place 2 point on a graph and then save the x and y data of those 2 cursors repeatedly until stoped. Which means that every single time I would like to save 4 data into an array, and move the cursors until satisfied and then save them again. I have tried using a while llop because the number of saves are not known prior. It is not working and I dont know why, I am bad at using shift registers and I think that is the problem, if you could help I would appreciate.
OK, let's throw away your code and start over:
06-08-2022 06:02 AM - edited 06-08-2022 06:03 AM
Altenbach and Paul,
Thank you very much for answering, I have changed and solved it thanks to you, and my code looks tidier now. Thanks a bunch, cheers !
Diural