DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

How to catch errors

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

0 Kudos
Message 1 of 11
(8,750 Views)
Did you try to use a relays with 0 at the output?  You could put a timer to close the relay after so many seconds the application started so that you avoid the first results.
Tom Rizzo
InSyS Corp.
www.insyscorp.com
Your DASYLab integrator
0 Kudos
Message 2 of 11
(8,746 Views)

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

0 Kudos
Message 3 of 11
(8,739 Views)

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? 

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 4 of 11
(8,736 Views)

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)

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 5 of 11
(8,731 Views)

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.

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 6 of 11
(8,729 Views)

Thank is a good point from CJ. 

 

The variables need to be set for the amount of digits

Tom Rizzo
InSyS Corp.
www.insyscorp.com
Your DASYLab integrator
0 Kudos
Message 7 of 11
(8,727 Views)

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

 

0 Kudos
Message 8 of 11
(8,724 Views)

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

Tom Rizzo
InSyS Corp.
www.insyscorp.com
Your DASYLab integrator
0 Kudos
Message 9 of 11
(8,718 Views)

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

0 Kudos
Message 10 of 11
(8,702 Views)