Parallel Port issues

Discussion in 'Embedded Systems and Microcontrollers' started by knight2000, Jun 25, 2014.

  1. knight2000

    Thread Starter New Member

    Jun 25, 2014
    1
    0
    Hello,
    I have a PCI parallel port card that I'm using to control a relay board. Everything worked great until my hard drive died leaving me no choice but to buy a new drive and replicate the same setup as I had before. On boot up pin 3 (d2) is lit on the relay board, his has always been the case even with the first hard drive. I've re-installed everything as before but now when I run my program to control the parallel port, the LED for the 1st pin (D0) will light up as expected but then shut off instead of just staying lit. It almost seems like another process is interfering with the port. I've pasted my simple program below. Any help would be greatly appreciated. I'm running the same OS (windows 7 ultimate 64 bit) only difference I see is that my .net framework has upgrade from 4.5 to 4.5.1. Could that be related to this issue?

    form1.cs

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;

    namespace Scanner
    {
    public partial class Form1 : Form
    {
    public Form1()
    {
    //InitializeComponent();
    try
    {
    int address = 52999;
    int pinValue = 0;

    Scanner.output(address, pinValue);
    //System.Diagnostics.Process.Start(@"C:\Users\Victor\Desktop\KITT\programs\sounds\scanner.wav");

    }
    catch (Exception a)
    {
    MessageBox.Show(a.Message);
    }

    }

    private void Form1_Load(object sender, EventArgs e)
    {
    this.WindowState = FormWindowState.Minimized;
    this.TopMost = false;

    }
    }
    }

    class.cs

    using System.Text;
    using System.Runtime.InteropServices;

    namespace Scanner
    {
    public class Scanner
    {
    [DllImport("inpout32.dll", EntryPoint = "Out32")]
    public static extern void output(int address, int value);

    }
    }
     
Loading...