Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Equivalent function for DIG_Prt_Config in NIDAQmx.

While porting an application using NI-DAQ APIs to NI-DAQmx APIs, I found it difficult to find an equivalent function(s) in NI-DAQmx for DIG_Prt_Config(). Is there any function in NI-DAQmx, which can be used to replace DIG_Prt_Config?
 
0 Kudos
Message 1 of 11
(5,727 Views)
Hi,

Please do not cross-post the same question in different forums: a lot people consider this rude Internet etiquette. It looks like you're receiving help on this particular issue on the following thread. Please continue to use this thread for your issue.

Porting strategy - NIDAQ application to NIDAQmx
http://forums.ni.com/ni/board/message?board.id=250&message.id=39676#M39676
PBear
NI RF
0 Kudos
Message 2 of 11
(5,710 Views)

Hey,

I'm having exatcly the same problem. Do you know how to solve it?

0 Kudos
Message 3 of 11
(5,382 Views)

You will just use separate DAQmx Create Channel functions for inputs and outputs

0 Kudos
Message 4 of 11
(5,368 Views)

And could you teel me what are these functions? I`m not finding them here in my program...

0 Kudos
Message 5 of 11
(5,362 Views)

First you have to actually install DAQmx. Then it's on the main pallette. Finding the function is trivial. Use the search button on the function palette if you are lost. I gave you the name.

 

edit - actually the full name is DAQmx Create Physical Channel and I would hope you've already taken the basic tutorial.

0 Kudos
Message 6 of 11
(5,358 Views)

Ok. Thank you

0 Kudos
Message 7 of 11
(5,355 Views)

Hello ,

 

i have a pci dio 96 , i need to update an application from nidaq to nidaqmx and i need to know how the handshake mode on a port can be configured with nidaqmx.

 

Before with traditional nidaq driver:

status = DIG_Prt_Config (deviceNumber, port, mode, dir);

 

mode indicates the handshake mode the port uses.
   0: Port is configured for no-handshaking (nonlatched) mode.
   1: Port is configured for handshaking (latched) mode. mode = 1 is valid for ports 0, 1, 3, 4, 6, 7, 9, and 10 of the DIO-96.

now with nidaqmx i can

configure the device port and its direction but i don't know how to configure the handshaking mode 😕

 

 

This is an example for reading from the nidaqmx example code but i can't see where the handshake mode is specified.

 

 

// Create the task
        CNiDAQmxTask digitalReadTask;
        // Create the digital input channel
        digitalReadTask.DIChannels.CreateChannel(
            port,
            "",
            DAQmxOneChannelForAllLines)

 

Could give me an example in latched AND non-latched mode?

Thank you so much.

 

 

 

 

 

0 Kudos
Message 8 of 11
(5,208 Views)

Hi stf13,

 

There are shipping examples that demonstrate handshaking for LabVIEW, but not for Measurement Studio C++. Still, the images of the block diagrams may be helpful:

 

Handshaking Output with 8255 with DAQmx (U8)

Handshaking Input with 8255 using DAQmx (Waveform)

The Measurement Studio C++ equivalent to the DAQmx Timing (Handshake).vi is something like digitalReadTask.Timing.ConfigureHandshaking(NI:: DAQmxSampleQuantityModeContinuousSamples, samplesPerChannel).

 

To disable handshaking, you can create a new task and not call ConfigureHandshaking(), or you can set digitalReadTask.Timing.SampleTimingType = DAQmxSampleTimingTypeOnDemand on your existing task.

 

Brad

---
Brad Keryan
NI R&D
0 Kudos
Message 9 of 11
(5,115 Views)

Hi thanks for yout reply,

 

Finally i decided to program my application in ANSI C langage cause i don't need measurment studio.

I have tried this code as you suggested me, but i can't read data anymore...

 

 

uInt8        data[100];
int32        read,bytesPerSamp;

DAQmxErrChk(DAQmxCreateTask("",&taskHandle));

DAQmxErrChk(DAQmxCreateDIChan(taskHandle,"dev1/port3","",DAQmx_Val_ChanForAllLines));
DAQmxErrChk (DAQmxCfgHandshakingTiming(taskHandle,DAQmx_Val_ContSamps,1));

//Verify task configuration
DAQmxErrChk(DAQmxTaskControl(taskHandle,DAQmx_Val_Task_Verify));
DAQmxErrChk(DAQmxStartTask(taskHandle));

DAQmxErrChk(DAQmxReadDigitalLines(taskHandle,1,10.0,DAQmx_Val_GroupByChannel,data,100,&read,&bytesPerSamp,NULL));

The read function always return 0 in data and never read anything.

 

So i don't think that is the corect method for my problem so i will you explain it:

-You-ll find documents in this reply who explains what i was doing before with the traditional DAQ drivers and what i want to do now with ansi C nidaqmx library.

 

pin 8-12-58-62 receive a 4 duplicate signal from an ECD32 peripheral.

Each time I receive a signal i want to start the aquisition on port 3,4,9,10 (32 bits aquisition).

 

pin   8 -> handle 18-32 bits (When a signal is VAL rising on pin 8 it means that i can read 18 - 32 pins (8 bits))

pin 12 -> handle 34-48 (When a signal is VAL rising on pin 12 it means that i can read 34 -48 pins (8 bits))

pin 58 -> handle 68-82 (When a signal is VAL rising on pin 58 it means that i can read 68-82 pins (8 bits))

pin 62 -> handle 84-98 (When a signal is VAL rising on pin 62 it means that i can read 84-98 pins (8 bits))

 

The signal would permits to store the bits in memory until reading...It is a block IO operation.

 

I can't find any working example in ansi C daqmx library on how to configure this.

I have been a long time searching for this.

 

Before (With traditional daq drivers) we call DIG_Prt_Config to configure the port 3-4-9-10 in input latched mode (mode 1)

and we call DIG_Prt_Status to know the status of the handshake ...And no problem for reading...

 

How to do this in nidaqmx ??? I realy need ur help .

 

Thanks you so much for your future replies...

You can answer in french if you prefer cause i'm french.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

     

 

Download All
0 Kudos
Message 10 of 11
(5,005 Views)