Hello all NI experts:
Please help. I have tried to search the forum for solution but I cannot find it. Please help me.
[ Problem ]
I am currently having a problem with PCI-6534 output waveforms. I am doing a simple test: "generating CLK and output signals and then verifing these signals on the oscilloscope". I got the CLK signal works, but when I want to output '11111111' in port DIOA0 (which means making DIOA0 remain HIGH), I got some strange output '110011001100' in port DIOA0. Would you please tell me why this happens?? Is something wrong with my code, configuration, or H/W problem?? How can I solve this problem??
This is the waveform I got from the oscilloscope (Sorry I could not attach my jpg here! I hope this is clear)
REQ: 01 01 01 01 01 01 01...
DIOA0: 01 10 01 10 01 10 01...
But I expect to get the following waveform
REQ: 01 01 01 01 01 01 01...
DIOA0: 11 11 11 11 11 11 11...
PS. I must control the PCI-6534 using Matlab (I can not use Labview or other software).
[ NI Driver ]
NI_Driver: Traditional NIDAQ 7.4
[ My Configuration ]
I am using PCI-6534 to generate some patterns therefore I configure it as "Pattern Generation Mode" and I am using the internal clock as my clocking source.
[ My Matlab code ]
my_count = 100000;
my_array = ones(1,my_count,'int16'); <- generate [1 1 1 1 1 1 1 1 1 1.....]
%% Load library
loadlibrary('nidaq32.dll','nidaq.h','alias','myni')
%% Display the list of available functions
% libfunctionsview('myni')
calllib('myni','DIG_Grp_Config',1,1,1,0,1)
calllib('myni','DIG_Block_PG_Config',1,1,1,0,3,2,0)
calllib('myni','DIG_Block_Out',1,1,my_array,my_count); <- This is supposed to make DIOA0 remain 'HIGH' (which means output '1111111'), right??
calllib('myni','DIG_Block_Clear',1,1);
%% Unassign any 'previously assigned ports' to group
calllib('myni','DIG_Grp_Config',1,1,0,0,0)
unloadlibrary myni
Thank you in advanced