You are not logged in.
Pages: 1
Topic closed
i am looking for a fuction block that count 2 signals when digitale input is high
like if a digitale input is high count signal1 + signal2 2 + 2 = 4
Last edited by tomáš čechura (2017-08-31 09:49:14)
Offline
the input signal can be high for a couple of second bit stil he must count one time
not counting and counting untill the signal is low again
ps sorry for my bad englisch
Offline
Hi martijnperdaan,
thank you for your question. The REX Control System is based on continuous execution. What do you expect to be the output of the function block when the digital input is low? Zero? Last valid value?
You can use "ADD" function block followed by multiplication "MUL". The second input of "MUL" will be connected to the digital signal. See attached screenshot.
I'm not sure if I understand clearly your problem. Please, can you describe your issue more in general? What is the aim of your current project? I will be happy to help.
Regards, Tomas
Offline
he has to count up like 1+ 1 = 2 when it is high voor the first time the second time he has toe count the answer 2 + 1 = 3 when the input is high at the third time he has to count 3 + 1 = 4 when the input is high
like that over and over again
Offline
Hi martijnperdaan,
look at "COUNT" function block (see docs: https://www.rexcontrols.com/media/doc/P … f#page=244). The digital signal connect through "EDGE" function block to "UP" input of "COUNT" function block. "EDGE" will catch only the rising edge of the digital signal (or any edge according to the function block settings).
Hope it helps.
Regards, Tomas
Offline
can you show me a Example
Offline
Hi martijnperdaan,
just connect your digital signal to the "UP" input of "COUNT" function block. "EDGE" function block is not necessary in this case because the "COUNT" block reacts only on rising edges.
Regards, Tomas
Offline
But how do I count signals 1 ( 5.4) and signals 2 (3.6) together when digitale input is high
Like 5.4 + 3.6
Offline
Hi martijnperdaan,
I'm sorry, I'm still not able to understand what exactly are you trying achieve. Please, can you describe the purpose of the algorithm? What are inputs, outputs, states, etc.? What problem does it solve?
Your previous post can be implemented using ADD block. What should the output look like in next period? (5.4 + 3.6)+new signal 1 + new signal 2?
Regards, Tomas
Offline
minimal_rexlang3.cexec.mdlEierTeller.mdlmysql_ioconfig.rio
if you loke at the rexlang fuction blok you she there is a analoge input
and there is a formula that give's a aswer to output 15
if digitale input 2 (not drawd yet) is high the analoog input is goiong back to zero but at that moment i has to count the aswere from output 15 whe the answere he alreddy had whit output 15
sorry for my bad englisch
Offline
How can I make a pulse from a digitale input ?
Offline
Hi martijnperdaan,
as far as I can understand you are hopefully looking for "Sample and hold" function, am I right? If yes, have a look at "SHLD" function block - https://www.rexcontrols.com/media/doc/P … f#page=142
If not, try to write your comments in Dutch and I will do my best to answer correctly - the possibilities of Google Translator are unbelievable these days
And according to your last post: the digital input can be transformed to pulse by "EDGE_" function block - https://www.rexcontrols.com/media/doc/P … f#page=251
Hope it helps.
Regards, Tomas
Offline
Pages: 1
Topic closed