全局的C动作和C语言

已锁定

天之空

  • 帖子

    710
  • 精华

    0
  • 被关注

    7

论坛等级:侠士

注册时间:2005-06-10

普通 普通 如何晋级?

全局的C动作和C语言

1765

11

2005-12-10 15:10:21

#include
#include
#include
#include
#include
#include
#define N1 64
#define N2 32
#define N4 16
#define N8 8
#define N16 4
#define END 0
#define N1 64
enum NOTES{
C10=131,D10=147,E10=165,F10=175,G10=196,A10=220,B10=247,C0=262,D0=296,E0=330,F0=349,G0=392,
A0=440,B0=494,C1=523,D1=587,E1=659,F1=698,G1=784,A1=880,B1=988,C2=1047,D2=1175,E2=1319,F2=1397,
G2=1586,A2=1760,B2=1976};
typedef enum NOTES SONG;
SONG song[]={D0,N4,E0,N8,C0,N4,A10,N4,G10,N8,E10,N8,G10,N8,C0,N2,A10,N4,A10,N8,G0,N4,E0,N4,G10,
N8,E10,N8,G10,N8,A10,N8,C0,N2,A10,N4,A10,N8,C0,N8,A10,N8,A10,N8,D10,N8,E10,N8,G10,N2,D0,N4,D0,N4,G0,N4,
A0,N8,G0,N8,F0,N2,G0,N2,A0,N4,G0,N8,E0,N8,D0,N8,E0,N8,C0,N8,A10,N8,D0,N2,E0,N4,G0,N8,E0,N8,G0,N4,E0,N4,
G10,N8,E10,N8,G10,N8,A10,N8,C0,N4,A10,N4,A10,N8,C0,N8,D0,N8,A10,N8,C0,N8,E0,N8,D0,N1,END,END};
}
void main()
{
int note=0,fre,dur,control;
clock_t goal;
while(song[note]!=0)
{
fre=song[note];
dur=song[note+1];
if(kbhit()) break;
if(fre){
outportb(0x43,0xb6);
fre=(unsigned) (1193180L/fre);
outportb(0x42,(char)fre);
outportb(0x43,(char)(fre>>8));
control=inportb(0x61);
outportb(0x43,control l 0x3);
}
goal=(clock_t)dur+clock();
while(goal>clock());
if(fre)
outportb(0x61,control);
goal=(clock_t)0;
note+=2;}
}

以上是在C环境下写的一个程序是关于写的一手歌
在C环境下编译是正常能运行的可是到了WINCC中的全局脚本中编译就不能进行
首先是编译后提示C的库函数不存在
#include
#include
#include
#include
#include
#include
是不是C不能在全局脚本中直接写和调用!!!
请高手指点!!!
全局的C动作和C语言 已锁定
编辑推荐: 关闭

请填写推广理由:

本版热门话题

SIMATIC WinCC / Panel

共有32658条技术帖

相关推荐

热门标签

相关帖子推荐

guzhang

恭喜,你发布的帖子

评为精华帖!

快扫描右侧二维码晒一晒吧!

再发帖或跟帖交流2条,就能晋升VIP啦!开启更多专属权限!

  • 分享

  • 只看
    楼主

top
X 图片
您收到0封站内信:
×
×
信息提示
很抱歉!您所访问的页面不存在,或网址发生了变化,请稍后再试。