Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI - 6534 Waveform Generation

I am using NI’s PCI-6534, we are facing the following problems:

When using the active-x control cwdaq.ocx  :

1.  I am not able to use the virtual channel name which is created in MAX as the Channel name
    when trying to generate a waveform on AxCWDAQControlsLib.AxCWDO.

    It is giving exception when DO1.Configure function is called. Exception as
    “Configuring handshaking – The specified operating mode is invalid, or the resources have not been configured for the specified operating mode”

 

2. It is able to generate the waveform on the DO only for the channel name as “0” or “0:1”. 

   For name “0” it is generating waveform only on Port A - Line 0.
   For name “0:1”, it is generating waveform on Port A – Line 0 to 7  &  Port B – Line 0 to 7.

   It is not accepting any other names. I don’t understand what is the format for giving the physical channel names.

 

When using the active-x control daqmx.dll :

3. I am able to generate a waveform on DO by creating a task in MAX on all 8 lines of a port.
   But, it is not allowing to run the task for one or lesser than 8 digital lines.
 
   The same thing I am not able to do programmatically by using Task.DOChannels member.
   With the program it is allowing waveform generation only by Counter output by using
   Task.COChannels.CreatePulseChannelFrequency  function.


Note :    I am using       
  Measurement & Automation Explorer Version no. 3.1.1
  NI-DAQ version 7.4
  Visual Studio Dot-Net 2003  platform – C Sharp

My requirement is to generate a waveform pattern on a Digital output using virtual channel name,
where the virtual channel is created in MAX.

Please suggest the solution to my problems.

Regards,
Neeraj Tiwari
EDEC-India

0 Kudos
Message 1 of 2
(3,192 Views)

Dear Neeraj,

I have attached a program that shows how to output static DO using a task. Play around with this code to see if you can get the waveform generation working. Here is the code that reads in the task and outputs it:

try

{

using (Task digitalWriteTask = DaqSystem.Local.LoadTask("Neeraj"))

{

bool[,] dataArray = new bool[4,1];

dataArray[0,0] = bit0CheckBox.Checked;

dataArray[1,0] = bit1CheckBox.Checked;

dataArray[2,0] = bit2CheckBox.Checked;

dataArray[3,0] = bit3CheckBox.Checked;

DigitalMultiChannelWriter digWrite = new DigitalMultiChannelWriter(digitalWriteTask.Stream);

digWrite.WriteSingleSampleMultiLine(true, dataArray);

}

}

Have a great day!
Marni S.
0 Kudos
Message 2 of 2
(3,146 Views)