04-27-2010 02:22 AM
Hi,
I have a Dasylab ciruit witch is iterating calculation results. Because of the iteration at the beginning the results can't be calculated and Dasylab shows the error-value "-1,#J" and writes "ERR" into the globale variables.
I'd like to distinguish whether Dasylab has a numeric number or an error value. I tried it with combi-triggers but they trigger also on the error values which is quite strange.
Has anybody an idea how I can catch error values in Dasylab so I can switch between a constant value (at the beginnig) and the calculated result bevor it writes them into the globale variables?
Thank You very much.
Marc
04-27-2010 07:15 AM
04-27-2010 07:53 AM
Hi Tom,
that is the way I kept it running til now. But I want to make it more flexible, because I'm not shure if the time I've choosen will always be adequate. A second thing is that I'd like to catch errors resulting from broken sensors. The circuit has to run stable over 2 years in a house with people living in it.
Does anybody know a different solution?
Thanks
Marc
04-27-2010 08:31 AM
Ok, I checked with the developers. There is no official way to do this.
If you can give us some idea of the calculation that is causing the error, we might be able to figure a way around it. The simplest way is to use a Scaling Module and set lower and upper limits -- thereby forcing your value to some defined high or low.
To see if you can trigger on a value... have you tried the pre-post trigger -- trigger when the value is out of the acceptable range?
04-27-2010 08:58 AM
I'm also thinking, depending on your computation, that you should test for 0, and never divide by it.
In the formula module, you can make a test:
(IN(0)<>0) * (your computation/IN(0))
If the input is 0, then the output will be 0, if the input is non-zero, then the output will be the result of the computation ( 1 * computation)
04-27-2010 09:10 AM
Another thought...
ERR means that the number is too big for the Digital Meter or the Global variable. Increase the number of digits to allow for the full display.
04-27-2010 09:12 AM
Thank is a good point from CJ.
The variables need to be set for the amount of digits
04-27-2010 10:20 AM
Hello,
thank You for Your intense thinking about my problem.
What I'm doing: I'm reading values from 3 different sensors every second like all other sensors (about 50). Because the sensor signal is changing only once per minute (and the controller I'm building has to be moderated) I'm handling the values once per minute to two modules (black boxes) which are calculating their result with the current value and the value in the timestep before. The result of the first black box is the input of the second one which is also calculating with the current value and the one of the timestep before. This means that it takes about 180 seconds til the output of the second black box has the first correct result. The error value which causes the problem is no a division by zero, it is an output because of missing input values.
While the hole ciruit is running at 1 Hz these two black boxes are running with 0,0166 Hz. The decoupling is made with global variables.
I also tried the use of triggers but their output is always high with the error value "-1,#J".
Has anybody any idea?
Thanks
Marc
04-27-2010 11:47 AM
Marc,
Did you try to use the sync input in the variable module?
Also, I would prefere running everithing at 1Hz so that you have a good flow of data.
Also, mabe you should set the varable to 0 at start of experiment so that you have 0 while waiting for the first data block.
We should defenitely see the worksheet to see how you are working.
Tom
04-28-2010 05:52 AM
Hi Tom,
the ciruit will be restarted every nigth because of Dasylab problems with multimedia timers after 40 days, I read about. Til now, the inputs are set to a fixed value. This causes a period of about 4 hours until the calculated result has reached the measured value which isn't satisfying.
Now I want to change the circuit to use the last value before the restart. An that's the point where the problem starts because if I store the last result in a globale variable I have to verify that it is a number. If not, for example if for some reason the ciruit restarts during the first 180 seconds - there are some other inputs under surveillance - the iterating black boxes will never be able to calculate a result again.
The ciruit is now realy complex (4 MB) an a lot of parts are running well and are tested so I really can't imagine to change such basic things like timing.
I added a reduced version of the ciruit but because there the sensor signal is replaced by a fixed value it acts in a different way than the original ciruit (no "-1,#J"). Anyway You can find this reduced version in the attachment.
Greedings
Marc