12-08-2011 08:34 AM
It appears the Rand(1) calculation requires a variable in the formula to work properly. For example:
x = Rand(1) failes to deploy
x = 0 + Rand(1) failes to deploy
x = Rand(1)*[Var0] deploys correctly
Has anyone verified this or I am I just nuts?
12-09-2011 05:00 PM
Hi Intertia,
This is expected behavior since the purpose of a Calculated Channels produce new values based on calculations performed on other channels in the system. So, it does need to involve a channel, whether it's I/O or a User Channel.
Can you provide some context for wanting to generate a random value without any other channel input? A possible reason that I've thought of is to control your AO with this. But, maybe if you could provide some context we can examine ways to accomplish what you want.
As a workaround, you can create a user channel and set the value to "1" and multiply it with this random number.
Regards,
Che T
12-12-2011 06:48 AM
My use case is a random number from 0 to 1 that I want to apply to multiple calculations (using the same random number). I know there is a workaround - the confusion is that this calculation is allowed and seen as valid until deployment. It would be better to flag it as invalid prior prior to that point. I would also challenge the assumption that all calculations must involve a variable. Frequently we have customers use "fixed" calculations that only employ constants in an effort to self document the calculation and break it into smaller chunks. It is not as efficient but more readable. Also, you're implying that the VeriStand calculation engine can't/shouldn't be able to handle x = 1 + 1? Just my 2 cents worth...
12-19-2011 01:25 PM