LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

cannot interfacing with havard apparatus syringe pump 11

Hi all,

 

I am beginner trying to interface with a havard apparatus syringe pump 11 elite (catalog no. 704506) with labwindows. 

 

First, I tried to send command to it using hyper terminal and it worked well.

 

Then I tried the following code on labwindows, 

 

void main (void)

 

{
BAUD = 115200;
PPORT = 8;
Fmt (COMPORT, "%s<%s%i", "COM", PPORT);
SER_PORT_RET = OpenComConfig (PPORT, COMPORT, BAUD, 0, 8, 2, 1024, 1024);
SetCTSMode (PPORT, LWRS_HWHANDSHAKE_OFF);  //Turn off handshaking
SetXMode (PPORT, 0);
FlushInQ (PPORT);    
SetComTime (PPORT, 2);

PUMP_Run();

PUMP_Stop();
}

 

void PUMP_Run (void)
{   FlushInQ (PPORT);
    Fmt (BUF, "%s<%s", "00irun\n");        //00 is the address number for pump, irun is a command to make it run

    NBYTES = strlen (BUF);
    status = ComWrt (PPORT, BUF, NBYTES );
    Delay (0.2);

}

 

void PUMP_Stop (void)

{   FlushInQ (PPORT);
    Fmt (BUF, "%s<%s", "00stop\n");        
   NBYTES = strlen (BUF);
   status = ComWrt (PPORT, BUF, NBYTES );
   Delay (0.2);
 }

 

But the syringe does not give any response. 

 

Please anyone who have any idea about it help me out. Thank you very much!!!!

 

Tina

 

 

0 Kudos
Message 1 of 9
(4,215 Views)

I have never used your apparatus so I can only offer you some general ideas on serial communications.

 

First of all, OpenComConfig does not need the text name of the port (in your case "com8"): simply pass an empty string on this field and that's all.

 

As a second suggestion on OpenComConfig, you may set output buffer to -1: as you can see in the help for this parameter you are excluding the output buffer; this may be helpful later when you may have to poll the instrument and wait for the response: directly writing to the port makes timing a little more predictable.

 

As a last hint, are you sure that "\n" (line feed) is the correct termination character for your commands? Consider that HyperTerminal adds a carriage return (that is a "\r") and not a line feed; your equipment may ignore your commands if they are not well terminated.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 9
(4,187 Views)

Hi Roberto, 

 

You are right about the termination character. I changed it to"\r" and it worked. Thank you so much!!

0 Kudos
Message 3 of 9
(4,154 Views)

You're welcome!



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 9
(4,151 Views)

Hello,

I am working with pump 11 elite . I got pop up error after completion set target volume. In scan from string, which i used for display infused volume.

How i remove this error?

 

My programm is running in side while loop.

 

Attachement :  window of pop error

0 Kudos
Message 5 of 9
(3,828 Views)

Hello, despite being referred to the same instrument, this question relates to LabVIEW language and should be posted in the appropriate forum.

 

Having said this, the error is quite clear: you instructed Scan From String to interpret input message in a way that does not correspond to actual data. Check the format string and verify it with data in input. You can set a probe on the input string and see what is passed to the vi. In case of doubts, posting the vi together with the input string will help someone to detect the errors inside it.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 6 of 9
(3,820 Views)

Thank you.

Here i attached a subvi and input value when i got no error, and input when i got error.

 

 

0 Kudos
Message 7 of 9
(3,815 Views)

Hi, going into specific on your subvi is out of the scope of this board: please repost this question in the LABVIEW board I pointed you to before.

 

With reference to the probes, messages are so different that you can'T imagine to get no errors! The problematic one appears either as a completely different legitimate message or a corrupted one.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 8 of 9
(3,802 Views)

For everybody who may be interested, discussion on LabVIEW follows here



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 9 of 9
(3,785 Views)