asaikk Posted February 23, 2012 Share Posted February 23, 2012 For an exercise, I made the following exression concerning three virtual channels; V.DataBoxV03 = V.DataBoxV01[0] + V.DataBoxV02[0] It worked well when the expression was put on a local channel, whereas it did not work on a virtual channel. This leads me to infer that expressions work only on local channels. Is it right? Link to comment Share on other sites More sharing options...
AzeoTech Posted February 23, 2012 Share Posted February 23, 2012 No, it should work fine for a V channel. What didn't work? Can you post a sample showing it not working? Link to comment Share on other sites More sharing options...
asaikk Posted February 23, 2012 Author Share Posted February 23, 2012 test_VirtualCannel_notwork.ctlHere attached are two samples, one which works fine and the other not, the difference of which are just the place where the same expression is put.test_VirtualCannel_workfine.ctl Link to comment Share on other sites More sharing options...
AzeoTech Posted February 23, 2012 Share Posted February 23, 2012 The box labelled "Expression" in the V Channel is an expression, not script. An expression is a formula that results in a value. Anything with = in it is a statement (assignment in this case). AddValue() is also a statement because it doesn't return anything. If you want V.DataBoxV03 to equal the sum of the other two, just put: V.DataBoxV01[0] + V.DataBoxV02[0] in the expression. Or drop the [0] and get the whole history. I thought you put those statements in a sequence. Link to comment Share on other sites More sharing options...
asaikk Posted February 23, 2012 Author Share Posted February 23, 2012 Thank you for the explanation. I well understood the difference of "expression" and "statement". The expression "V.DataBoxV01 + V.DataBoxV02" worked fine on the virtual channel. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.