cancelar
Mostrando resultados para 
Pesquisar então 
Você quer dizer: 

daq bnc2120

Resolvido!
Ir para a solução

Hello,

The code should work as you suggested. The only reason it would behave that way is if the true case is never entered.

Have you been able to step through the program in debug mode, and make sure everything is working as expected?

Jacob R. | Applications Engineer | National Instruments

0 Kudos
Mensagem 11 de 16
1.328Exibições

The true case is executed but during the false case the values are shifted all the time and so the display after the subtraction (in the true case) is zero and hence it always displays zero.

So the problem is with the false case.

 

The attached file shows an error:

'Resource file not found. The file 'daqbnc.vi' is not a valid LabVIEW file'.

0 Kudos
Mensagem 12 de 16
1.324Exibições

Hello,

That attachement didn't work. Could you repost that code?

I don't have your counters set up, but I will try to replicate the behavior on my end.

Did the code I sent you work as expected?

Jacob R. | Applications Engineer | National Instruments

0 Kudos
Mensagem 13 de 16
1.313Exibições

The file you sent does not work.

I have again attached my program this time.

 

Rgrds,

0 Kudos
Mensagem 14 de 16
1.304Exibições

Hello,

Sorry, I now attached a version you should be able to use.

It is your program with a "fake" counter.

The program behavior is as expected.

 

The attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system, or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense

Jacob R. | Applications Engineer | National Instruments

0 Kudos
Mensagem 15 de 16
1.300Exibições
Solução
Aceita por fhs_dur

Thank you for the reply.

Yes the logic of the program is correct. In your attached file, the delay of the loop is 500ms so each 2.5 second the true condition is reached and is delayed for another 0.5 s. This may not happen in the real case, as it depends on the frequency of the signal.

 

However true the logic of my program is, it does not work in a real system with DAQ.

 

If i put a breakpoint and observe the value in true case, it works but in false case the difference is always zero.

 

This only happens if the true case is also executed in false case, which is impossible.

 

However, i have managed to solve the problem by storing values in an array continuously and subtracting two consecutive values of the array each time of the loop, and this works very well.

 

Thanks.

0 Kudos
Mensagem 16 de 16
1.290Exibições