LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI USB 6212 output digital data pin for 02 bit counter application

Solved!
Go to solution

Dear members.

Need your help, I have designed a 2 bit binary counter using a digital signal acquired from an arbitrary waveform generator through NI USB 6212 DAQ. I am using DAQ assistant ......In setting, I have selected 01 samples on demand and using PFI 0/P1.0 channel as input. I have designed 02 bit counter using a shift register but I don't know how to get that delayed signal back to check it on the oscilloscope. Which port number or changing in the code for that digital output port

The related device configuration and VI are attached. 

Download All
0 Kudos
Message 1 of 3
(1,389 Views)
Solution
Accepted by topic author photonick

Hi photonick,

 

what exactly are you doing in your VI?

Your DAQAssistent is set to read "one value on demand", but you are converting:

  • a 1D U32 array is converted to a 1D I32 array
  • the 1D I32 array to a 2D array
  • the 2D array is converted to an U64 array
  • this 2D U64 array is converted to a DDT wire
  • the DDT wire is converted to a 1D DBL array
  • this 1D DBL array is compared with "1", resulting in a 1D boolean array
  • the boolean array is converted to a I16 value

 

Wouldn't it be much easier like this?

 

Why is the second shift register set to DBL datatype when you want to count integer pulses?

 


@photonick wrote:

I have designed 02 bit counter using a shift register but I don't know how to get that delayed signal back to check it on the oscilloscope. Which port number or changing in the code for that digital output port 


When you want to output a digital signal you may use another DAQAssistent.

I advise to use regular DAQmx functions…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Download All
0 Kudos
Message 2 of 3
(1,357 Views)

Haha, I knew the conversion is quite complicated as I did not know the shortcut as you did. I just wanted to implement 2 bit counter through shift registers.

I converted the second shift register to DBL  maybe I was using a waveform chart, I did not exactly remember but as you can see I have messed everything because of that data type issues everywhere in the code. Another DAQ assistant? I think I need to switch DAQmx functions because that simple code is going complicated for me if I go like this.

Thanks for the valuable input.  I am learning about DAQmz functions to acquire a digital signal, divide its freq, and provide it to another output port of the DAQ. 

0 Kudos
Message 3 of 3
(1,334 Views)