Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

need daq driver & demo program for pci-6534

Thank you for your suggestion.
It sounds good.  But I still not sure about the some issue:
1, The synchronization.  My system is an image data acquirsiton system. The CLK is not only used for data acquirstion, but also used for x, y, z scan control. So the 16bit digital signal and x, y, z control selection signal should be synchronize with CLK signal. When x is actived, the 6534 will out put the x point 16bit digital signal; and when y is actived, 6534 will output 16bit y point 16bit digital.
    So, if I use software-timed (Unstrobed I/O) outputs for x, y, z and reset, can I synchronize them with CLK? cause in pattern model, the output of data( on board memory) is synchronize with CLK.  For example, when I active x signal to high, it will select the x scan controller, and the output data will send to the x scan controller to finish one line scan; and then the y signal is actived to high, this time the output data will send to y scan controller to move scan to another line.
   
2, So, if the software-timed output for x,y,z and reset can't synchronize with CLK. can I use 32bit model to output control signal and digital signal? use some high bits for control signal and the low 16bits for digital wave form signal. Because the output data is synchronize with the on board CLK.  
    And in such operating model, can I still use PCLK line for the acquirstion synchronization?
 
Attached is a image of the structure of scan control system  and the detail of waveform of all the signals
Thank you very much
 
ruirong
 
 
 
 
 

 
0 Kudos
Message 11 of 22
(2,062 Views)
Hi Ruirong,

Since you are needing precise timing with your signals then running half of the 6534 as Pattern I/O and the other as Unstrobbed I/O (Software Timed I/O) will not work for you.  Instead you will need to figure out the exact digital waveform that you want to generate and write that data to the board.  You will need to configure the board for having all 32 lines as outputs and then write the 32-bit unsigned integer data to the 32-bit port.

Once again, it looks like what you are trying to do would most easily be done with a counter board, but if you spend a lot of time, you will be able to get a digital waveform that resembles that which you showed in the .jpg you attached.

If you need precise timing, then you must use pattern I/O because SW timing will never be deterministic enough to assure that you are generating the proper outputs at the right time.

Regards,
0 Kudos
Message 12 of 22
(2,054 Views)

hi,Otis

you are right.  I need pattern I/O model and big memory to generate realtime digital waveform and synchronizaiton signal.

As you said,  I will configure the board for having all 32 lines as outputs,  and figure out the exact digital waveform(low 16bit)  and x,y,z control signal(use high bits), then generate and write that data to the board.  

But I still have some problems in my application while using the big memory on board:

1, how to make or apply a big memory (32M)? I want to use some code to figure out the waveform and store in a buffer and then download it to the memory on board.  If I can't do like that, can I download part by part? is there any function for me to do that?

2, Can we Use both menory on board? 32M + 32 M

3, I have attached an example download from NI webside. when I try to change some code for my application, there are two failure: one is NIDAQMakeBuffer function only accept WFM_DATA_I16 paremeter and no U32 paremeter according to the help document; the other is if I can't use NIDAQMakeBuffer to build a big buffer then how can I do ?

4, can I download waveform data first and then have another function to triger the output when using pattern model ?

 

 

 

0 Kudos
Message 13 of 22
(2,051 Views)

I have changed some code and it looks like I have got the big buffer(memory ) now !

so, the 1,3 question is caceled.  🙂

But do you have any suggestion on question 2, 4 above?

thanks a lot

 

ruirong

MIT 

0 Kudos
Message 14 of 22
(2,040 Views)
Hi ruirong,

We had been talking earlier about using the DAQmx routines, and then I see that somewhere in here everything got switched back to Traditional DAQ calls.  The reason for using DAQmx in this case is that you do not have to worry about buffer sizes and transfers because it is handled automatically by the drivers; thereby, greatly increasing the ease of programming the application.

By using DAQmx it solves the answer to both of your lingering questions (2 & 4).

2. Yes you can, but the drivers will automatically handle the way in which the memory is handled.
4. Yes, that is what is done.  The data is written to the buffer first and won't start until it receives a trigger.

Go ahead and take a look at some of the Digital examples for Generating data:
C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Digital\Generate Values

As Alan said in a previous post:
"I strongly encourage you to use NI-DAQmx.  It is much easier to use, more intuitive and probably easier to get help with."

Regards,
0 Kudos
Message 15 of 22
(2,038 Views)
Thank you for your warmhearted suggestion.
 
actually I have tried to use DAQmx version 8.0.
But the newest manual and good exmaples for pattern I/O of pci-6534 are based on old version of DAQ. I think I almost done with the example and manual. But for the new DAQmx I only have the manual of DAQ and some basic example of Digital I/O in example directory.
 
So It is difficult for me to have a choice. Because my job should be finished in a few day, so I hope I can let the card run first and then spend some time to read the DAQ manual and upgrade it to the new version of DAQ. 
 
There is another question. how can I use DIG_Block_Out for 32bit out put? the buffer of the paremeter of this function is only 16bit width. 
 
If I have to use the DAQmx. Is there any aditional example and new manual?
 
ruirong
0 Kudos
Message 16 of 22
(2,019 Views)
Thank you,  Otis.
I am working with the DAQmx now.
If I have problems, I will ask question another time.
 
 
Merry Chrismas
0 Kudos
Message 17 of 22
(2,015 Views)
Can you give me an example like this:
 
for Visual C++  or just give me the functions sequence, which I  should used in pattern I/O.
 
thanks
 
0 Kudos
Message 18 of 22
(2,016 Views)
Hi ruirong,

Earlier I linked you to the folder containing the examples for generating digital values.
C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Digital\Generate Values

The example that you are looking at is very similar to one of the examples in the folder that I directed you too (Cont Write Dig Port-Ext Clk).

The only difference is in two lines of code, so I will give you the pseudo-code below:
DAQmxCreateTask("",&taskHandle)
DAQmxCreateDOChan(taskHandle,"Dev1/port0","",DAQmx_Val_ChanForAllLines)
DAQmxCfgSampClkTiming(taskHandle,"/Dev1/PFI0",1000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000)
DAQmxGetDOUseOnlyOnBrdMem(TaskHandle taskHandle, const char channel[], bool32 *data);
DAQmxSetWriteRegenMode(TaskHandle taskHandle, DAQmx_Val_AllowRegen );
DAQmxWriteDigitalU32(taskHandle,8,0,10.0,DAQmx_Val_GroupByChannel,data,NULL,NULL)
DAQmxStartTask(taskHandle)
//keep doing until stop or error
DAQmxStopTask(taskHandle);
DAQmxClearTask(taskHandle);
If you need more help with the specific commands, check out the NI-DAQmx C Reference Help (Start > All Programs > National Instruments > NI-DAQ).

Regards,
Message 19 of 22
(2,000 Views)
In addition to the NI-DAQmx Help files that were referred to previously, you might also find the updated NI 653X help file to be useful.

NI 6533/6534 Devices for NI-DAQmx Help

This document is the revised version of the NI 653X for Traditional NI-DAQ User Manual, and it includes specific information about programming the NI 6533/6534 with NI-DAQmx.
0 Kudos
Message 20 of 22
(1,973 Views)