06-22-2012 11:12 AM
Hi all!
I am develiping a driver for a new instrument. I have the basics working, based on the vi tree tutorial. Now I am trying to create a basic example. I started by watchin a state machine tutorial (a soda vending machine). I have 3 states, basically init/read data/check buttons&write. Everything works great, reading and showing data. Now want to add a chart for one of the data (amps in this case). Trying to implement the method of using the loop's counter. Loop cycles at 100ms, for now trying to update at 5 secs (eventually needs to be user input).
So basically I have a simple state machine that updates values on the screen in a certain state. I need those data available to the top level for charting or possibly turning most of this (minus chart) into a stand-alone vi.
So anyways I have a boolean LED in the main loop that blinks every 5 seconds. So far so good. Except that the chart updates seemingly randomly?? Put the prog in watch mode, and saw the chart update when the data was read (inside the red box). Didn't do it every time. I'm just setting a local variable inside the red box... I see sporadic updates on the charts, maybe 5-10 updates every 5 secs. What am I missing? If I change the loop iterations to a faster number (say 10ms) the chart updates likes crazy (even though the CASE is false)!
Solved! Go to Solution.
06-22-2012 11:29 AM
How can i post a new message please? I tried very hard finding the post button, with no success. I went to >"New message", then typed my question " "
, and didnt find what i wanted, but couldnt find post new message button.
Sorry for posting here, I hope you find your answer 🙂
06-22-2012 11:42 AM
Good question. I just went through the steps and I don't see the button to post the question either. This is in IE8. I tried Firefox as well, same situation. I'm going to flag this message to the moderator. I think something is buggy with the website.
06-22-2012 04:27 PM
You guys are correct. I experience the same behavior. It must be a bug since Lithium upgraded us to a new version yesterday. I have informed them of the issue and will update accordingly.
Thanks,
Jordan
06-22-2012 05:20 PM
It is in fact a bug. Advanced search has been disabled and will be reenabled when the bug has been fixed.
Future updates will be posted here:
http://forums.ni.com/t5/Feedback-on-NI-Discussion-Forums/quot-New-Message-quot-bug/td-p/2042056
Jordan
06-25-2012 09:37 AM
Hi Steven8R,
The chart will update any time a local variable referenced to the chart is updated. So the chart should be updating whenever the code in the red box executes.
The code that you have in the case structure isn't actually doing anything. It is simply reading whatever data the chart contains and writing back to itself.
Something you could try doing instead is wiring the output of the Get Amps VI directly to the AMPS chart inside of the 5 second delay case structure. This will update the chart with only the most recent data point every 5 seconds. Is that what you want?
Best,