05-03-2011 01:21 PM
Hello,
I am trying to isolate one signal at a time to show on the graph when inputting 3 signals using 3 Simulate Signal VIs. I have attached my code below. This would be great if it weren't for these problems:
Can someone please help me to troubleshoot this? I originally had them all with their own Property Nodes but I saw no differences when I combined them to the same node and clustered the booleans.
The inputs with their corresponding booleans are:
Signal 1 = Sine 1 = 10.1 Hz,1V, Boolean 2
Signal 2 = Sine 2 = 100Hz, 3V, Boolean 3
Signal 3 = Sine 3 = 100Hz, 2V, Boolean 4
05-04-2011 07:22 PM
Hi GradStudent,
I was able to open your VI and edit it to make it work for you. For some reason, when you tried to index the array after you merged the signals together, it was not correlating the indexed numbers to the corresponding simulated signal. The first think that I did was to reverse the order of your active plot and plot visibility for each signal in the property node. Next, I deleted your index array function and simply wired constants to each of the Active Plot nodes.
I have attached a picture of the block diagram here as well since I am not sure which version of LabVIEW you have. The attached fixed VI is in LabVIEW 2010.
I hope this helps!
Kim W.
05-04-2011 08:10 PM - edited 05-04-2011 08:11 PM
You don't really want to hammer these property nodes with every iteration of the loop. It is sufficient to run them once at the beginning and then only when the control changes. I would use a parallel event loop instead.
You should also make the code more scalable. If you iterate over the plots, very litte code changes are needed when you want fewer or more plots later.
Here's a quick draft. Also, unless you simulate acquisition timing, place a small wait inside the loop.
05-05-2011 10:34 AM
Thanks for the response guys! I found someone's example yesterday that seems to solve the problem. It pretty much looks like Altenbach's top half without the Event Loop.
Kim: You made an interesting point in switching the Plot Visible and Active Plot around on the property node. I tried to implement this on the new version but the Boolean buttons were off by 1 channel on the DAQ board so, I left it alone.
Altenbach: I'm not sure about adding Time Wait as this code will be inside a While Loop that contains code to write data (which it must do within a certain time frame while data is being acquired). Also, what do you mean by making it more scalable?
I've attached a screen shot below.
05-05-2011 10:50 AM
@GradStudent wrote:
Also, what do you mean by making it more scalable?
Using a FOR loop that automatically itereates over the existing number of plots is scalable, because the code does not need to change if you make changes in the future. For example you can use it equally well on a graph with 50 plots, the only thing you need to do is change the number of plots and the number of elements in the cluster. Even better would be to use a boolean array instead of a cluster, because it can be resized and adapted much more easily.
GradStudent wrote:Altenbach: I'm not sure about adding Time Wait as this code will be inside a While Loop that contains code to write data (which it must do within a certain time frame while data is being acquired). Also, what do you mean by making it more scalable?
Nothing needs to run at infinite speed. Without the wait, the execution speed will heavily depend on the computer hardware and is thus unpredictable. the program will also use 100% of at least one CPU core. The speed should depend on the given problem, and not on the compting hardware. If you run it on a new computer 10 years from now, does it really need to run 1000x faster than today? 😮 Think about it!!