LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous read and single write on serial port

trigger-at-time.png

 

as i said  before, create a new VI, then use this VI to test the algorithm,

after you understood what it does you can put it into your "real" VI.

 

activate the context help (CTRL+H)

read up on all the things,

play with the things to understand what they do.

 

.... and keep your wires straight


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
Message 21 of 27
(1,280 Views)

Thank you very much for the help provided. I have understood the logic but the only problem is that it sends 0 rather than sending nothing when  none of the " specified times" match. im trying to resolve but if you have the suggestion, pls share.

 

Thanks

0 Kudos
Message 22 of 27
(1,253 Views)

I think, I have found the reason, I was writing too fast for the remote device. I have put some delay and it worked fine. That makes the read slow, so I will take the write in another loop.

Thanks for your immense help

0 Kudos
Message 23 of 27
(1,239 Views)

Sorry guys I am still having the same issue. Even with the wait block in the loop, still the receiving end receives 40 and 0 and sometimes 40 only at the specified time. Is there any way this can be resolved ?

0 Kudos
Message 24 of 27
(1,228 Views)

Only if I use 3000ms as delay and read write in the same loop, it always sends the right value. And that also makes the read v slow, current readings reflect v delayed.

0 Kudos
Message 25 of 27
(1,226 Views)

Guys please help out as Im unable to figure out why sometimes it sends both 40 and 0 and sometimes only 40 at the specified time. How can this be avoided ?

0 Kudos
Message 26 of 27
(1,222 Views)

@jwscs wrote:

trigger-at-time.png 

 


There's an interesting function in the middle of this VI that compares two Booleans, X and Y, using ">" and returns T only if X is True and Y is False.  This is exactly the negation of the (probably-rarely-used) Boolean function "Implies", which (as I remember from my class in Symbolic Logic) is True unless X is True but Y is False.  [If X is True and Y is False, then clearly "X Implies Y" must be false.  If X is False, then from a Falsehood, you can (logically) imply anything, hence X implies Y is always True if X is false).  X Implies Y can also be written (Not X) Or Y.  My personal preference is to use Logic functions for Boolean variables ...

 

Bob Schor

0 Kudos
Message 27 of 27
(1,212 Views)