Support of NI PCI 6602 for Simulink

Hi,
I want to use the NI PCI 6602 for a simple function, which is to convert Simulink analog signals into standard PWM signals. I am not sure if this is feasible. Additionally, is generating PWM signals through the NI PCI 6602 faster than using an Arduino, since there is no additional data conversion process?

Answers (2)

dpb
dpb on 25 May 2026
See <NI DAQMX Hardware Support> which lists the NI PCI-6602 as supported. You'll need the Data Acq Toolbox or the legacy drivers.

1 Comment

The input modes supported for the 6602 are: Digital, EdgeCount, PulseWidth, Frequency, Position
The output modes supported are: Digital, PulseGeneration
It is not immediately clear to me that PulseGeneration includes Pulse Width

Sign in to comment.

tianyuan wang
tianyuan wang on 26 May 2026
Edited: tianyuan wang on 26 May 2026
In Simulink, only Digital input and output are supported, without Counter/Timer. I also could not find Counter/Timer in the Data Acquisition Toolbox. Can Digital Output generate a PWM signal?
If the Data Acquisition Toolbox cannot output a PWM signal, are there other ways to output a PWM signal, for example through MATLAB Function + external code or an S-Function?
Thank you in advance for your suggestions.

3 Comments

dpb
dpb on 26 May 2026
Edited: dpb on 26 May 2026
I don't know Simulink nor the particular NI device, but I can't imagine it doesn't have the ability to control the pulse width; would seem pretty useless without. So, I asked an AI 'bot and got the following...
Yes, you can generate a hardware-timed PWM output using the NI 6602 in Simulink. To achieve this, you need to use the physical device's built-in counters, which requires the MATLAB Data Acquisition Toolbox or the legacy xPC Target/Simulink Real-Time blocks.
Step-by-Step Implementation:
  1. Define the Counter Task: In Simulink, use a Counter Output block configured for Pulse Width or Frequency Generation.
  2. Assign Physical Pins: Route the counter output signal to a physical PFI (Programmable Function Interface) pin on your NI 6602 breakout box to send the signal to your hardware.
  3. Control from Simulink: Pass your Simulink duty cycle or frequency signal (as a value between 0 and 1) to the DAQ block. The NI 6602 hardware handles the high-frequency clock generation, ensuring stable PWM without overloading your computer's CPU.
Important Considerations:
  • Simulink Compatibility: Because the NI 6602 uses traditional DAQmx or legacy drivers, verify that your version of MATLAB natively supports your specific OS and hardware via the Data Acquisition Toolbox Support Package for National Instruments NI-DAQmx Devices.
  • Software vs. Hardware Timing: Avoid generating PWM using standard digital output (DIO) and pure software timing. Software-timed solutions run at the mercy of the operating system's execution loop, causing jitter. Using the NI 6602's hardware counters ensures microsecond-level precision.
This NI device is quite old (introduced Jan,1999) so you may have issues if using recent MATLAB/Simulink release with having to find legacy tools to implement with...will need to read the details in the NI user's manual to learn how to use the device in detail.
tianyuan wang
tianyuan wang on 26 May 2026
Edited: tianyuan wang on 26 May 2026
Hi dpb
Thank you very much for your comment. I searched through the Simulink library, but I still could not find a Counter Output block suitable for DAQ devices.
I have installed all Simulink toolboxes, so there are many different kinds of Counter Output blocks available. I tried several of them, but none of them seem able to connect to the NI device.
My current MATLAB version is R2024b. Was this type of Counter Output block available only in earlier MATLAB/Simulink versions? Or do you mean the implementation method in MATLAB instead? AI often makes mistakes, which is very frustrating.
Please forgive my lack of experience in this area. I would really appreciate any suggestions or guidance you may have.
I've never even seen a Simulink installation so I know absolutely nothing about it; I'm just searching the NI links can find for the particular device.
Have you downloaded/installed the <NI Data Acq Toolbox> that appears to be needed?
There's also the <NI DAQMX Hardware Support> link which is the one that lists the 6602 under PCI devices. It claims it's compatible with R2017 on.
Again relying on the AI 'bot, it says that after everything needed is installed that there should be a set of NI-DAQmx blocks in the Data Acquisition Toolbox library browser. If you don't see that, may need to contact official support on how to finish an installation to use it.

Sign in to comment.

Products

Release

R2024b

Asked:

on 25 May 2026

Commented:

dpb
on 26 May 2026

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!