ericg Posted August 13, 2010 Share Posted August 13, 2010 How do I get data from a virtual channel to appear on the graph? I can view the virtual channel variable realtime but when I add it to the graph it does not plot. Other channels plot fine. What 's the trick? Link to comment Share on other sites More sharing options...
AzeoTech Posted August 13, 2010 Share Posted August 13, 2010 I'm assuming you know to put V. in front of the channel name. If so, then the problem is probably with the time stamps. They are probably all the same for every point in the array. Either that, or you only have one value in the V channel. Link to comment Share on other sites More sharing options...
ericg Posted August 16, 2010 Author Share Posted August 16, 2010 So how do I graph it? I'm trying to graph a complex function of a few inputs. The virtual channel is duing the calc fine but can't get it on the graph. Link to comment Share on other sites More sharing options...
AzeoTech Posted August 16, 2010 Share Posted August 16, 2010 Look at the V channel data and make sure the time stamps are decreasing and not the same value. You can do this by typing ? V.mychannel.time in the command/alert window Link to comment Share on other sites More sharing options...
ericg Posted August 16, 2010 Author Share Posted August 16, 2010 clearly it thinks the variable has only one element, not a list. I did enable the history on it. Link to comment Share on other sites More sharing options...
AzeoTech Posted August 16, 2010 Share Posted August 16, 2010 If you have a expression in a V channel, the history setting means nothing. History setting is only when you are using V channels without a formula, i.e. doing something like V.mychannel = 3, basically using it to store historical values. If you have an expression in the V channel, the V channel is just like a macro. All it does is evaluate that expression whenever the V channel is referenced. So, if the V.myChannel contained just: 3+4 Then whenever you entered V.myChannel elsewhere in DAQFactory, DAQFactory would simply replace "V.myChannel" with 3+4. Its not exactly like a macro though, as it doesn't substitute inside of strings, and the expression in the V channel has to be complete. In otherwords you can't do this: global string x = "foo V.myChannel foo" this will just make x = "foo V.myChannel foo", not "foo 7 foo" nor can you make V.myChannel's expression: 3+ and then do: V.myChannel 4 This is invalid on both counts. Anyhow, my guess is that you have lots of [0]'s in your formula, which would only work with the latest readings and not give you a history. If you want, post your formula. Link to comment Share on other sites More sharing options...
ericg Posted August 16, 2010 Author Share Posted August 16, 2010 V.efficiency = Avg(OutputKVA[0,5])/Avg(InputKVA[0,5])*100 Link to comment Share on other sites More sharing options...
AzeoTech Posted August 16, 2010 Share Posted August 16, 2010 The result of that expression is a scalar value. Avg() is always going to return a scalar, so you have scalar / scalar * 100 which is a scalar. Scalar values can't be graphed because they have no history. What are you trying to do? Display a smoothed result? If so, I'd try this: smooth(OutputKVA / InputKVA * 100, 6) Note that this is a running average, not a boxcar. You could use boxcar instead. Link to comment Share on other sites More sharing options...
ericg Posted August 16, 2010 Author Share Posted August 16, 2010 I'll try that, it's not quite as nice, but neither method is good enough. Really need to reject odd values. But I also did a max and a min on the data after the average. So I need a better method, maybe it's not virtual channel. Link to comment Share on other sites More sharing options...
AzeoTech Posted August 16, 2010 Share Posted August 16, 2010 I'm not clear what you are trying to do. If you are just trying to remove outliers you don't need min/max, but instead need something like: filter(outputKVA / inputKVA * 100, outputKVA / inputKVA * 100 < 50) which returns an array with all values >= 50 removed. I also refer you to this post and others where I tell the story of the ozone hole and how a group missed the find of a lifetime by automatically deleting outliers that turned out to be real: http://www.azeotech.com/board/index.php?&showtopic=3517 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.