Location:
Search - scon
Search list
Description: 串口标准程序,串口标准程序 串口标准程序-Serial standard procedure, a standard procedure Serial serial standard procedures Serial standard procedures
Platform: |
Size: 245952 |
Author: 长沙 |
Hits:
Description: 单片机与上位机(电脑)通信的简单程序,波特率为12
Platform: |
Size: 1015 |
Author: flyer |
Hits:
Description: 串口小程序, 也许您正需要呢!
Platform: |
Size: 1480933 |
Author: Jawen |
Hits:
Description: 串口与PC机通讯通信(波特率为:1200)
Platform: |
Size: 13988 |
Author: flyer |
Hits:
Description: 一个公司做得多线程接口库,包括串口 UDP TCP 等,自己还可以扩展。动态库的形式调用
Platform: |
Size: 82231 |
Author: zfc |
Hits:
Description: 蓝天短信猫收发控件开发使用手册
安装
通过运行regsvr32.exe程序来安装本控件,如:
regsvr32.exe c:\winnt\system32\alasunsmscon.ocx
提示:
由于本控件使用了微软公司的MSCOMM32.OCX,所以用户在自己程序发布时,除了要分发本
控件外,还要包括MSCOMM32.OCX。
特别声明:
深圳市蓝天信息技术有限公司开发的alasunsmscon.ocx控件稳定支持本公司生产的短信猫设备,已对短信猫芯片调用此控件进行了加密技术,本公司的alasunsmscon.ocx控件在调用其它公司短信猫设备时,刚开始能运行一段时间,但运行一段时间后会出现控件无法调用,导致程序无法运行,短信出现乱码等问题,由此声明只对本公司生产的短信猫调用控件负责,用其它公司生产的短信猫调用此控件所引起的系统不稳定,本公司概不负责,敬请谅解。
控件使用说明
◆属性
序 号 属性名称 数据类型 说 明
1 AutoDelMsg Boolean 设置是否在阅读短信后自动删除SIM卡内短信存档
(建议在经常接收短信时设置为true)。
设计和运行时都可以读写,
true自动删除 false不自动删除
默认为false
2 CommPort Integer 串口号(运行时只读)
3 IsOpen Boolean 设备是否已经打开(只读)
True已打开 False未打开
4 IsRegOK Boolean 控件是否成功注册(只读)
True已打开 False未打开
5 Settings String 设备与计算机的串口通讯设置
设计时和运行时都可以读写
默认值为 9600,n,8,1,分别代表波特率、奇偶校验、
数据位数和停止位数
◆方法
☆ 发送AT指令 (ATCommand)
功能描述:向端口发送AT指令
参数:ATCmd string 您要发送的AT指令
返回:string AT指令返回结果 如为错误,返回ERROR
☆ 关闭通讯端口 (CloseComm)
功能描述:关闭与设备的通讯端口
参数: 无
返回: Long 0 成功,其它 失败
☆ 删除短消息 (DelMsgByIndex)
功能描述:删除SIM卡中指定位置的短信
参数: iIndexNo Integer 要删除SIM卡中短信的位置
返回: Long 0 删除成功,其他 删除失败
☆ 取得机器码(GetMachineNo)
功能描述:取得机器码(注册控件时用)
参数: 无
返回: string 机器码字符串
☆ 取得短信中心号码 (GetMsgCenterNo)
功能描述:取得短信中心号码
参数: 无
返回: string 短信中心号码
☆ 取得注册用户名 (GetRegUserName)
功能描述:取得注册用户名
参数: 无
返回:string 用户名
☆ 取得未读信息列表 (GetUnreadMsgIndexList)
功能描述:取得未读信息列表
参数: 无
返回: string 逗号分隔的未读信息序号的列表
☆ 打开通讯端口 (OpenComm)
功能描述: 打开与设备的通讯端口
参数: 无
返回: Long 0 成功, 其他 失败
☆ 读取设备新收到的短消息 (ReadMsg)
功能描述:读取设备新收到的短消息
参数: sNo string 收到短信的来源号码
sCon string 收到短信的内容
sMsgCenterNo string 短信中心号码
dSendTime date 发送短信的时间
iSendTimeZone Integer 发送短信的时区
返回: Long 0 读取成功, 其他 读取失败
☆ 读取短消息 (ReadMsgByIndex)
功能描述:读取SIM卡中指定位置的短消息
参数: iIndexNo Integer 短信序号
sNo string 收到短信的来源号码
sCon string 收到短信的内容
sMsgCenterNo string 短信中心号码
dSendTime date 发送短信的时间
iSendTimeZone Integer 发送短信的时区
返回: Long 0 读取成功,其他 读取失败
☆ 发送短消息 (SendMsg)
功能描述:发送一条短信息
参数: sNo string 对方的手机号码
sCon string 短消息内容
sMsgCenterNo string 短信中心号码(可选)
iMsgType Integer 短信类型 (见下表)
bAsync Boolean 是否异步发送(可选,默认为False)
返回: Long 0 发送成功,其他 发送失败
◆短信类型:
常量 值 说 明
alasunUCS2 0 Unicode类型,如中文。选择此类型,短信的最长长度
为70个字符。
alasun7Bit 1 7Bit类型,一般用来发送英文短信,选择此类型,短信
最长长度为160个字符。
alasunBlinking 2 闪烁类型的短信(需手机支持)。
alasunFlash 4 免提短信(直接显示在用户手机屏幕上,需手机支持),
选择此类型,短信编码自动为Unicode,并且最长长度
为69个字符。
以为常量可以结合使用,如alasunBlinking+alasunFlash
☆ 设置短信中心号码 (SetMsgCenterNo)
功能描述:设置短信中心号码
参数: sNewValue string 短信中心号码
返回: Long 0 成功,其他 失败
☆ 注册控件 (SetSN)
功能描述:注册控件(注册控件时用);
参数: strUserName string 短信用户名
strRegNo string 注册序列号
返回: Boolean True 注册成功,False 失败
☆ 显示控件关于对话框 (ShowAbout)
功能描述:显示控件关于对话框
参数: 无
返回: 无
◆ 事件
☆ OnReceive 当短信到达时触发这个事件,请在此事件中调用ReadMsg方法
☆ OnSend 在异步发送方式时,短信成功发送时,触发此事件,同步发送时,此事件无效
Platform: |
Size: 207421 |
Author: terry600@163.com |
Hits:
Description: 串口标准程序,串口标准程序 串口标准程序-Serial standard procedure, a standard procedure Serial serial standard procedures Serial standard procedures
Platform: |
Size: 245760 |
Author: 长沙 |
Hits:
Description: 单片机与上位机(电脑)通信的简单程序,波特率为12-MCU and host computer (PC) communications simple procedures, the baud rate of 12
Platform: |
Size: 1024 |
Author: flyer |
Hits:
Description: 串口小程序, 也许您正需要呢!-Serial small program, perhaps you need it!
Platform: |
Size: 1480704 |
Author: Jawen |
Hits:
Description: 串口与PC机通讯通信(波特率为:1200)-Communication with the PC serial port communication (baud rate is: 1200)
Platform: |
Size: 13312 |
Author: flyer |
Hits:
Description: 一个公司做得多线程接口库,包括串口 UDP TCP 等,自己还可以扩展。动态库的形式调用-A company doing multi-threaded interface library, including the serial port, such as UDP TCP itself can also be extended. Dynamic library calls
Platform: |
Size: 81920 |
Author: zfc |
Hits:
Description: void UART_init()
{
//初始化串行口和波特率发生器
SCON =0x58 //选择串口工作方式,打开接收允许
TMOD =0x21 //定时器1工作在方式2,定时器0工作在方式1
TH1 =0xfd //实现波特率9600(系统时钟11.0592MHZ)
TR1 =1 //启动定时器T1
ET1 =0
ES=1 //允许串行口中断
PS=1 //设计串行口中断优先级
EA =1 //单片机中断允许
}-void UART_init (){// to initialize the serial port and baud rate generator SCON = 0x58// Select the serial work, open the receiver to allow TMOD = 0x21// Timer 1 in Mode 2, Timer 0 work in a manner 1TH1 = 0xfd// to achieve 9600 baud rate (system clock 11.0592MHZ) TR1 = 1// start the timer T1ET1 = 0 ES = 1// allow the serial port interrupt PS = 1// Design of Serial Port Interrupt Priority class EA = 1// Single-chip Interrupt Enable)
Platform: |
Size: 2048 |
Author: zhongxinyu |
Hits:
Description: 一系列芯片的驱动代码,这是一个很完整的工程-A series of chip-driven code, this is a very complete works
Platform: |
Size: 18432 |
Author: cqixing |
Hits:
Description: VB遥控播放器红外遥控解码
#include <regX52.h>
#define c(x) (x*110592/120000)
sbit Ir_Pin=P3^2
sbit beep=P2^1
//sbit RELAY=P2^0
#define INBUF_LEN 4 //数据长度
unsigned char inbuf1[INBUF_LEN]={ 0 , 0 , 0 , 0 } //发送缓冲区
unsigned char inbuf2[50] //接收缓冲区
unsigned char count3
void init_serialcomm( void )
{
SCON = 0x50 //SCON: serail mode 1, 8-bit UART, enable ucvr
T2CON=0x30
TH2=0x00
TL2=0x00
RCAP2H=0xFF
RCAP2L=0xDC
TR2=1
}
//向串口发送一个字符
void send_char_com( unsigned char ch)
{
SBUF=ch
while (TI== 0 )
TI= 0-VB player remote control infrared remote control decoder# Include <regX52.h># Define c (x) (x* 110592/120000) sbit Ir_Pin = P3 ^ 2 sbit beep = P2 ^ 1// sbit RELAY = P2 ^ 0# define INBUF_LEN 4// data length unsigned char inbuf1 [INBUF_LEN] = (0, 0, 0, 0)// Send buffer unsigned char inbuf2 [50]// receive buffer unsigned char count3 void init_serialcomm (void) ( SCON = 0x50// SCON: serail mode 1, 8-bit UART, enable ucvrT2CON = 0x30 TH2 = 0x00 TL2 = 0x00 RCAP2H = 0xFF RCAP2L = 0xDC TR2 = 1)// to send a serial character void send_char_com (unsigned char ch ) (SBUF = ch while (TI == 0) TI = 0
Platform: |
Size: 12667904 |
Author: 微微 |
Hits:
Description: 单片机开发汇编基础,学会使用SCON从这里开始-Compilation of basic single-chip development and learn to use the SCON from here
Platform: |
Size: 12288 |
Author: yangsheng |
Hits:
Description: 80c51的一些代码, 希望对初学者有一定的帮助,此程序一运行。-SCON = 0x50 /* SCON: mode 1, 8-bit UART, enable rcvr */
TMOD |= 0x20 /* TMOD: timer 1, mode 2, 8-bit reload */
TH1 = 221 /* TH1: reload value for 1200 baud @ 16MHz */
TR1 = 1 /* TR1: timer 1 run */
TI = 1 /* TI: set TI to send first char of UART */
Platform: |
Size: 1024 |
Author: 孙艳玲 |
Hits:
Description: 多机通信,运行结果:从机对主机发来的从机地址进行比较,控制对对应的从机数据通信,-Multi-machine communication, the results: the host machine sent from the slave address comparison, the corresponding slave control data communications
Platform: |
Size: 53248 |
Author: 心日之泪 |
Hits:
Description: C51的一个很典型的串口通信程序,可发送字符串!-C51, a typical serial communication program can send strings!
Platform: |
Size: 1024 |
Author: james |
Hits:
Description: scon编译工具,比makefile方便多了-scon compiler tools, and more convenient than the makefile
Platform: |
Size: 574464 |
Author: 谢晟 |
Hits:
Description: SCON计算工具.rarSCON calculation tool. Ra rSCON calculation tool. Rar-SCON calculation tool. RarSCON calculation tool. Rar
Platform: |
Size: 1024 |
Author: vds |
Hits: