06-18-2023 11:36 PM
Hi,
I am trying to control a Masterflex L/S peristaltic pump with LabVIEW NI-VISA functions using the below vis.
I was able to run the vi with no error but the pump is not running. Please help.
I connected the pump to my laptop with a RS 232 db 25 to db9 cable and a RS 232 db9 to USB adapter.
The adapter brand is prolific. I've installed the USB to serial driver from prolific. The virtual com port is showing in device manager, NI MAX and in labVIEW. The properties are set to be 1 start bit, 7 data bits, one odd parity bit, and one stop bit at 4800 bits per second which all match the serial data format for the pump.
The pump model is 7551-20. The pump manual can be found here: https://pim-resources.coleparmer.com/instruction-manual/a-1299-1127b-en.pdf
initialization vi:
control vi:
06-19-2023 12:00 AM
06-19-2023 12:07 AM
Here are the VIs.
I tried to use NI MAX to test the communication.
After I sent the command, I tried to read it back and it is always returning the exact string that I passed to the pump.
I am not so sure about the string type. I think it is a normal string.
06-19-2023 01:39 AM - edited 06-19-2023 01:53 AM
Hi,
As far as I see it, your communication problem is just the tip of the iceberg.
The Vis will run exactly once, with the settings set. I would implement a simple state machine for a communication task like this.
Can you get a communication with your pump in NI Max? Advantage is you can control your pump while the vi is running, and you don't have to first search for and start a separate Vi.
Edit: Read the manual from Page 3-29/30. The procedure how to commuicate with the pumpe and the commands are explained there. (easily solved with a state machine)
Edit2: Watch Crossrulz' lecture on https://labviewwiki.org/wiki/VIWeek_2020/Proper_way_to_communicate_over_serial
06-19-2023 01:50 AM
Hi,
Yes, simple state machine is the final plan… I am testing it with the initial vi that only runs once as the pump only needs one time command, it should run until it receives another command.
NI MAX communication doesn’t show any error but I am not able to get the pump running with NI MAX as well.
thanks
06-19-2023 02:25 AM
06-19-2023 12:27 PM
Hi,
Changing it to /n doesn’t solve the issue. The device accepts CR or 0D in hex which corresponds to /r in ‘/‘ code.
06-19-2023 12:31 PM
Most serial communications issues can be solved by watching this video: VIWeek 2020/Proper way to communicate over serial
06-19-2023 01:26 PM
@wen88 wrote:
Hi,
Changing it to /n doesn’t solve the issue. The device accepts CR or 0D in hex which corresponds to /r in ‘/‘ code.
1. Watch the direction of your slashes. You should be using \n (assuming your constants are in "\ Codes" display mode).
2. The device in question actually uses Flow Control. Set the Flow Control to "RTS/CTS".
3. Read carefully the communications section of the manual. There was too much for me to really dive into it in a reasonable amount of time.
06-19-2023 04:56 PM
Thanks for reply.
/ is a typo when I reply, just made sure it is \ in the vi.
I also changed it to \n and the flow control to RTS. (Flow control changed to RTS in device manager and NI MAX as well)
now the vi returns error 1073807339 for every VISA write function.