09-30-2016 10:39 AM
Ohhh well, should I take back that remark about the plumber?
Probably not!
09-30-2016 10:42 AM
@rolfk wrote:Ohhh well, should I take back that remark about the plumber?
Probably not!
Here is a cleaner version of my code
Thank you all for your help 🙂 I've rarely seen such an helpful community
Flo
09-30-2016 10:44 AM
Since the vast amount of users posting questions to the forum are new to LabVIEW, we try to make it a learning experience as well. 🙂
09-30-2016 11:00 AM
I can't see the data type of the integer in the typecast function. make sure it's u8 or the conversion won't work correctly.
09-30-2016 11:02 AM
I've got something maybe:
47 = my termination character. It seems that if I don't add a VISA Flush I/O Buffer I get it working 1 time every 2 runs.
09-30-2016 11:18 AM - edited 09-30-2016 11:20 AM
@ICCR-Lab wrote:I've got something maybe:
47 = my termination character. It seems that if I don't add a VISA Flush I/O Buffer I get it working 1 time every 2 runs.
Adding that property node is exactly like using the termination stuff on the VISA Configure Serial Port VI, so it must be that you were doing the typcasting incorrectly. And yes, I had already mentioned not using that flush thingy. 😉
The manual says: Optionally, a carriage return may be used to indicate the end of a transmitted string. A received carriage return will cause the pump to immediately respond to the received command, and may help speed communications.
So you should tack a carriage return to the string you are sending so the pump doesn't have to wait around and guess that you are done sending the command. This will probably take care of that "every other" thing you were talking about.
09-30-2016 11:20 AM
I'll try with the carriage (so, I just have to replace my 47 by a 13 isn't ?).
The thing is that without the flushing thing, the code doesnt work anymore!
09-30-2016 11:22 AM - edited 09-30-2016 11:23 AM
Sorry for confusing you. The command sent in the VISA Write should have a carriage return attached to the end of it. The VISA propertynode I think was okay, if not maximally efficient. 😉
09-30-2016 11:24 AM
Yes replace with a 13, but also you can flush the IO, but you should put a delay after the flush, use the time delay function(Which is in seconds) so you can have data dependancy before the write. I would suggest about 100ms.
09-30-2016 11:24 AM
Also remember that if you screw up the serial reading by sending bad data, you may have to reset the pump to get it to work right again.