LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write and read back cursor values

Hi everyone. I'm collecting data for a cyclist and plotting a graph while the VI is running. I'm using cursors to identify the times when the cyclist does something which changes the flow of the data, so that I can locate these points when the VI has finished running. When the VI finishes I have create an Express Write to File so that the data is saved, and then I want to read back this data to plot a graph so that it can be used for analysis at any time. However, I also want the cursors to show on the new graph I produce when I read back the data - does anyone know how I can get the cursors back onto the graph? I'm using case structures so that in the 'true' case data is being collected, and then in the false case the data is being written to a file. If I'm right then do I have to use the property node function to get the XY co-ordinates of the cursors? However, I'm a bit confused with how I would use this if it relates to a graph in the 'true' case but I want to use it in the 'false' case (i.e. While the VI is running I am moving the cursors, but when I stop the VI I want to save the cursor values). I have then written a separate VI to read back the data and tried to create something to read back cursor values and plot it on the same graph but I can't seem to plot just the points (which don't actually relate to the time). I did find an example which saves cursor values in an array, but my problem is that I want to read back the cursor values once the VI has finished. Can anyone help?

0 Kudos
Message 1 of 6
(3,247 Views)

Hi,

 

          If you want to read the cursor values use property node, select cursor position x & cursor position y. Read those values and store it in a file or array so you can reuse it after you stop your VI.

0 Kudos
Message 2 of 6
(3,234 Views)

Thanks for getting back so quickly - is there a certain way I need to save the cursor values or read them back in, because when I tried to do this it was saving them all in the same column like this:

 

Example Write to Text File

 

1            5.5    (X-valuecursor 1)

2            1.2    (Y-valuecursor 1)

3            8.9    (X-valuecursor 2)

4            5.6    (Y-valuecursor 2)

 

 

Then when I tried to read the values and plot them onto a graph it wasn't plotting X against Y for each cursor, but it was plotting X against time and Y against time for each cursor and then joining them up in a line. Sorry I don't have LabVIEW on this computer because I'm at home but is there any way you could send an example - is there something to do with arrays I have to specify before I read back or write the data?

 

Thanks. 

 

 

0 Kudos
Message 3 of 6
(3,220 Views)

Hi ,

 

    I have attached a vi. I have simulated the cursor position as you shown in your example and read back the same. To read different cursor positions change the index of the index array. Please check it out and let me know if any issues.Hope this helps you.

0 Kudos
Message 4 of 6
(3,216 Views)

Thanks Geeta that did help me - sorry I've been away from the internet all day so couldn't reply sooner. I do have another question though. I'd like to plot just the X-values of these cursors at Y=0 (so they all sit on the X-axis). I tried to do this by using the Express Read and Express Write to file functions. When I write the values to a file they are all stored in a row. Then when I read them back to plot on a graph, the values end up on the Y-axis instead of the X-axis. It must have something to do with 1D arrays and the way they are saved or written to a file, but I don't know how I can plot the cursor X-values with Y=0 for all points. Is there a way I can set Y=0 when I either read in or write back the cursor values?

 

Thanks! 

0 Kudos
Message 5 of 6
(3,189 Views)

Hi,

 

          You please post your code here so that i can help you better.

0 Kudos
Message 6 of 6
(3,171 Views)