views:

6

answers:

0

Hello,

I work on project based on a FASTRACK SUPREME which has to receive commands via a serial RS232. The

problem is: When I use HyperTerm the command ATDxxxxxxxxx; works fine. When I use the CVI RS232 library nothing happens. Is it possible that my command remains blocked in

the serial buffer? Here is my code:

#include <ansi_c.h>
#include <cvirte.h>
#include <userint.h>
#include <rs232.h>
#include <utility.h>
#include <formatio.h>
#include <string.h>

int configurePort(void);
int sendCommand(void);
int port_open;
int error;

int main()
{
 configurePort();
 sendCommand ();
 return 0;
}
int configurePort()
{
 port_open = 0;

 error = OpenComConfig (4, "COM4",115200 ,0,8,1,0, -1);
 if (error) 
 {
  printf("Error!\n");
 }
 if (error == 0)
        {
        port_open = 1;
  SetXMode (4, 0);
  SetCTSMode (4, 0);
  SetComTime (4, 0);
        }


 return 0;
}
int sendCommand ()
{
 char bufferWrite[100] ;
 Fmt(bufferWrite,"%s","ATD0040761768027;");
    ComWrt(4, bufferWrite, 18);
 return 0;
}

Where is the problem? Please help! Thanks.