Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital output port is always zero

I'm new to DAQ with NI hardware (in my case the NI PCIe-6321 board) and so I tried some simple tasks. However, I fail with writing a "1"/high on a digital output port line. Neither my own C# code (see below) nor NI's MAX work and I can't measure anything but 0 Volts when I connect my multimeter with P0.0 (the pin I want to set to high) and D GND. I tried to disable "Tristate" (I have no clue what it does but I'm sure I don't need that functionality) but it didnt help.

 

What am I doing wrong? I guess

 

writer.WriteSingleSampleSingleLine(true, true);

 

is permanent? Why can't I measure 3.3/5 Volts?

 

// Reset the device
var dev1 = DaqSystem.Local.LoadDevice("Dev1");
dev1.Reset();


// Create a task
var digitalOutTask = new NationalInstruments.DAQmx.Task();
var digitalOutChannel = digitalOutTask.DOChannels.CreateChannel(
    "Dev1/Port0/line0",
    "",
    ChannelLineGrouping.OneChannelForAllLines);
    digitalOutTask.Control(TaskAction.Verify);

// Write var writer = new DigitalSingleChannelWriter(digitalOutTask.Stream); writer.WriteSingleSampleSingleLine(true, false); digitalOutChannel.Tristate = false; writer.WriteSingleSampleSingleLine(true, true);
0 Kudos
Message 1 of 6
(4,697 Views)

Hi lcm0,

 

thank you for your post.

 

Since you can not set the DO to high even when you use MAX, let's do some troubleshooting here first.

 

When you open the MAX, please select the PCIe 6321.

Open the Testpanel for the device.

Switch to the tab "Digital I/O".

Select the port to use.

Select a set of lines to use.

Set the lines to output.

Select High for the status.

Take your measurement to see if the status switched to high.

 

If if does not switch to high, please select a different port or different lines and try again.

 

If no lines or ports work, please contact the support of NI to get your device repaired.

 

Let me know, how it works.

 

Best regards,

Melanie

Best regards,
Melanie Eisfeld
Senior Applications Engineer, National Instruments Germany
Certified LabVIEW Developer
Certified TestStand Architect
0 Kudos
Message 2 of 6
(4,662 Views)

I'd like to thank you for your support. I did already follow these steps before you wrote your message but didn't succeed.

 

However, I didn't directly measure the output of the card but via another board that _should_ conduct the signals of the NI card properly which, as it later turned out, wasn't the case.

0 Kudos
Message 3 of 6
(4,632 Views)

Hi lcm0,

 

this sounds a lot like a hardware defect to me. Please open a service request at your local NI branch and ask for a repair.

 

Best regards,

Melanie

Best regards,
Melanie Eisfeld
Senior Applications Engineer, National Instruments Germany
Certified LabVIEW Developer
Certified TestStand Architect
0 Kudos
Message 4 of 6
(4,617 Views)

You got me wrong. The NI device works fine, it is my custom made board that I used inbetween the 6321 and my multimeter. This custom made board is defect. Anyway, thanks again for your ongoing help.

0 Kudos
Message 5 of 6
(4,611 Views)

Hi lcm0,

 

sorry for the missunderstanding. Anyway, if it worked before with the same setup, it sounds a lot like a damaged board to me. So you should maybe take a look at your board and see if somethings broken there.

 

Best regards,

Melanie

Best regards,
Melanie Eisfeld
Senior Applications Engineer, National Instruments Germany
Certified LabVIEW Developer
Certified TestStand Architect
0 Kudos
Message 6 of 6
(4,608 Views)