并行端口问题 [英] parallel port problem

查看:100
本文介绍了并行端口问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
i几年前创建一个程序,以便通过VC ++ 2005和XP通过并行端口控制步进电机,它运行良好

但现在我写的是在VC ++ 2008和Windows 7中相同的代码和链接相同的库(inpout32.lib),它也工作,没有错误,但我无法控制并行端口,我无法弄清楚问题是什么帮助!这是我的代码;



hi i create a program a couple years ago in order to control step motor via parallel port by using VC++2005 and XP, it worked fine
but now i am writing the same codes and linking the same library (inpout32.lib) in VC++ 2008 and windows 7, it also works and no error acoours, but i cannot control parallel port, i cant figure out what the problem isç pls help!. here is my code;

#include "stdafx.h"

#define PORT 0x378



short _stdcall Inp32(short PortAddress);
void _stdcall Out32(short PortAddress, short data);


int main(array<System::String ^> ^args)
{
	Out32(PORT,255);
	
}

推荐答案

嗨...

没问题代码..



要测试并行端口,首先使用LEDS ...将8个LED连接到并行端口的8个输出引脚......



代码'Out32(PORT,255);',所有8个LED应发光,否则每个数据分别为1,2,4,8,16,32,64,128时间看看每个LED是否单独发光..



如果LED没有响应,那么我确定,在控制之前你需要冲洗并口。 。
hi...
There is no problem with the code..

To test the parallel port, use LEDS first... connect 8 LED's to the 8 ouput pins of parallel port...

for the code 'Out32(PORT,255);' , all 8 LEDs should glow, else give the data as 1,2,4,8,16,32,64,128 each time to see whether each LED glows individually..

If the LEDs dont respond, then i am sure, u need to flush the parallel port, before controlling it...


你可以使用win95io.dll从visual basic控制并行端口....
U can use win95io.dll to control parallel port from visual basic....


这篇关于并行端口问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆