From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-20-2009 03:54 PM
Could it be that the data is being buffered in the shared variable?
Is there a way to make a loop run only once per activation? What I have been trying to generate is a loop that runs only once, but can be reused.
04-21-2009 09:18 AM
04-21-2009 09:51 AM
04-21-2009 10:28 AM
It should work pretty much the same in 8.6.
Also, I was looking at where you had the write to spreadsheet file. When a new value is written to a variable the timestamp is updated. You could do a comparison between the current timestamp value and the timestamp value from the previous iteration. If they are the same, a new value has not been written to the variable. If they are different, a new value has been written to the variable. By using this logic before the write to spreadsheet file you can determine whether or not to write a new value to your spreadsheet.
04-21-2009 11:11 AM
I am confused. Say the shared variable leaves the cRio with 'A' as the time stamp. The PC reads the data, time stamped 'A', writes the file, but runs the loop again, with the data still time stamped 'A'. Is the time stamp 'stamped' by the cRio or the PC? If by the cRio, the PC will not see a change.
I have tried comparing the data with a PC local variable to see if they are the same. If so, I would not write. LV would not let me do this because of it being a 2d array. Is there a command that I should use?
The program works in that I am able to get the data. The issue is that the 'true' I send to record stays on too long and the loop runs again. What I need is a loop that will run once and only once, but I can reuse. I am thinking a for loop, but I need to reset the counter. In a text based programming language I could make this work, but I am not sure how to do it in Labview.
04-21-2009 10:08 PM
I have tinkered in LV with just two vi's (leaving the cRio out of the equation) and have been able to find a way that seems to make this work. I am comparing the string sent to the string I wrote, if they are not equal and I have the command to write, it writes. On the computer this works, and I'll find out tomorrow if it works with the cRio.
Since I will have a vi running on the PC as well as the cRio, is there a way to have one of the vi's start the other? I can cause one to wait for a signal from the other, and send a stop command. What I am wondering is if there is something equivalent to clicking the 'run button'.
04-22-2009 09:52 AM
04-22-2009 11:35 AM
What I came up with is pretty close to what you have. I was able to compare the string to the string I recorded. If they are not equal, then it records.
This works, but is a little convoluted.
Is there a way to nest the PC program in the cRio's so all I need to do is hit run once?
04-22-2009 12:08 PM - edited 04-22-2009 12:08 PM
Yes. You can use VI server to programmatically start another VI, even if it is on another system. Take a look at the image I have attached (This code should be on your RT target). Also, make sure that you have enabled VI Server on both the host and the RT target. Also you need to make sure that you have added access for each device to talk to one another. Take a look at this KnowledgeBase for more information on VI server.