Friends, today I just show you how to digitally generate a signal using any DAC devices.
So over here, as you see, this is my National Instruments 6001 DAC card.
As you see over here, these are my analog pin.
A stands for analog Pin analog input.
A0 stands for analog output as you see over here zero and one.
Two analog output ports are there.
Using the datasheet of this DAC card you can find out how many analog pins are there.
How many analog output pins are there?
How many analog input pins are there?
So on the other side, as you see over here, there is a d I o digital input output pins.
You can use these digital pins as an input or as a output means let's say in the port 0PO dot x port
zero pin zero.
You can configure it as a input or you can configure it as a output.
Okay.
So first I just generate a digital signal using Matlab Data Acquisition Toolbox with the help of this
DAC card.
So first I just need to connect this device with my PC.
So first I just show you in the Measurement and Automation Explorer.
As you see over here, there is a broken arrow on the device USB 6001 when I just connect this device.
Over here it is now connected.
So I just minimize this one.
So you need to acquire or you need to program using Simulink.
This is my Simulink window over here.
I just need to generate a signal.
So for that purpose I just drag I just show you how to generate a digital signal using National Instruments.
Descartes.
So over here, as you see, I just connect the pin number zero with the positive pin of the LED.
And over here I have a ground that is black pin.
I just connect it to the negative pin of the LED.
I just use a breadboard as you see the long wire of the LED is my positive pin and shorter one is my
negative pin.
Okay, so over here.
Otherwise you just check the substrate.
The lesser part is my positive one and the higher one is my negative one.
So I just connect.
So this is the hardware connection.
Now in the software part I just drag this little output pin.
And inside this I just select port zero line zero as on the hardware.
Okay.
If you want to go with this one pin I just select this one.
And on the hardware pin I just connect it to pin number 1 or 0.
Right now, as you see, this one is pin number one.
So let's.
Apply it.
Now I just need a signal generator.
In the Matlab we just go with pulse generator.
Pulse generator is there.
I just drag it and connect it to the DAC block.
Okay, so now I just need to run it.
Let's check what happened.
It generates some error, as you see.
It will ask me.
The output of this pulse generator is double means floating value, and that card require a boolean
value.
So we need a data converter over here.
So data type conversion we require over here.
So just click on it.
You just need to change the output should be boolean.
In this case, apply it okay, now delete this wire.
Connect from here to here.
Now it will convert the double data into boolean.
Let's check what happened to it when I click over here as you see right now, it is running and it is
blinking because this is a pulse on off, on, off.
It will generate to the output side.
Okay.
So I just stop it.
Let's check change some values inside this pulse.
As you see there is a phase delay.
There is a pulse width.
Let's say I want to change it to 50%.
Let's check what happened to it when it is 50% on off on off.
Okay, let's check again.
Change it to change the time.
Time period.
Let's say 100 seconds.
Again.
On.
Off.
On.
Off.
In that case, the frequency changed as you see in the output side.
So this is how you can generate digital signal using that card and a USB 6001 with the help of Matlab.
Thank you.