LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA and READ function - Problem linked to the bytes at port

Ohhh well, should I take back that remark about the plumber? Smiley Surprised

Probably not! Smiley Very Happy

Rolf Kalbermatter
My Blog
0 Kudos
Message 31 of 114
(1,314 Views)

@rolfk wrote:

Ohhh well, should I take back that remark about the plumber? Smiley Surprised

Probably not! Smiley Very Happy


Here is a cleaner version of my code

 

vi cp pump.png

 

 

Thank you all for your help 🙂  I've rarely seen such an helpful community

 

Flo

0 Kudos
Message 32 of 114
(1,310 Views)

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.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 33 of 114
(1,306 Views)

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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 34 of 114
(1,294 Views)

I've got something maybe: 

 

 

vi cp pump.png

 

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.

 

 

0 Kudos
Message 35 of 114
(1,293 Views)

@ICCR-Lab wrote:

I've got something maybe: 

 

 

vi cp pump.png

 

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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 36 of 114
(1,286 Views)

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!

0 Kudos
Message 37 of 114
(1,284 Views)

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.  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 38 of 114
(1,279 Views)

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.



-Matt
0 Kudos
Message 39 of 114
(1,277 Views)

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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 40 of 114
(1,276 Views)