0
저는 FASTRACK SUPREME을 기반으로 한 프로젝트에서 작업합니다.이 프로젝트는 직렬 RS232를 통해 명령을 수신해야합니다.LabWindows/CVI에서 RS232를 통해 Fastrack Supreme으로 ATD 명령을 보내십시오.
문제는 다음과 같습니다. HyperTerm을 사용할 때 ATDxxxxxxxxx 명령을 사용합니다. 잘 작동합니다. CVI RS232 라이브러리를 사용할 때 아무 일도 발생하지 않습니다. 내 명령이 차단 된 상태 일 가능성이 있습니까
직렬 버퍼가 있습니까?
#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;
}
문제가 : 여기 내 코드? 도와주세요! 감사합니다. .