From: Ben Chiel on
I have attempted to use the solution posted here, but unfortunately I've been unable to get any signal from the simulink block.
I've tried changing the block settings to match the non-xPC 6220 A/D board, changing the voltage input range, using differential signal mode, adding all 16 channels and looked at all of them (though the 6220 A/D itself has only 7 channels), but I don't get any signal from any of them.
The non-xPC block works perfectly.

I noticed that the S-function the blocks point to is not the same, but the working non-xPC block does not seem to point to a block matlab can find, so I can't change the xPC block to point to it.

Ideas?

Thanks

"Furui" <freewang1982(a)gmail.com> wrote in message <hig3mp$ffh$1(a)fred.mathworks.com>...
> "Ben Finio" <bfinio(a)fas.harvard.edu> wrote in message <hig0jd$p76$1(a)fred.mathworks.com>...
> > I have the same issue (NI PCI-6220 board that I would like to use for real-time Simulink), could someone please either post the solution or forward me the email? Thanks.
>
> Here is the solution i got :
> ===============Citation=======================
>
> 1. Insert the block for the function on the 6221 you want to use.
> 2. Open the 'right' click menu and go down to 'Link Options' and
> select 'Disable Link' on the submenu.
> 3. Open the 'right' click menu again and once again go to the
> 'Link Options' submenu. This time choose 'Break Link'. Now the
> block is not linked back to the library you got it out of. You
> can change the mask.
> 4. Again open the 'right' click menu, but this time choose 'Edit
> Mask'. This will open the mask editor. If you haven't done both
> steps 2 and 3, you won't be able to edit the mask.
> 5. Switch to the 'Initialization' tab. In the Initialization commands
> edit box, the top line says 'boardType=21;'. Change that to
> 'boardType=20;'. This is an index into an array in the driver
> that selects the 6220 board information. Then click the 'Apply'
> button and you'll notice the mask decoration changes to 'PCI-6220'
> although the name under the block doesn't change. You have to
> change that manually if you want to.
>
> Repeat that for each of the functions you want to use with this
> board. A/D, DI, DO, PWM Gen, PWM measure and Encoder.
From: Gordon Weast on
Ben,

I'm not sure I understand what you're trying to do here. Your mention
of 'non-xPC' makes me suspect that you're trying to get the block to
work in simulation on the host. That won't work with the xPC Target
blocks. The xPC Target driver goes directly to the hardware to read
and write registers. If you need this on the host, you need a different
solution that calls the NIDAQ library. The Data Acquisition Toolbox
includes blocks for simulation on the host for the 6220.

Am I understanding what you're trying to do?

Gordon Weast
xPC Target Development
The MathWorks

Ben Chiel wrote:
> I have attempted to use the solution posted here, but unfortunately I've
> been unable to get any signal from the simulink block. I've tried
> changing the block settings to match the non-xPC 6220 A/D board,
> changing the voltage input range, using differential signal mode, adding
> all 16 channels and looked at all of them (though the 6220 A/D itself
> has only 7 channels), but I don't get any signal from any of them. The
> non-xPC block works perfectly.
>
> I noticed that the S-function the blocks point to is not the same, but
> the working non-xPC block does not seem to point to a block matlab can
> find, so I can't change the xPC block to point to it.
>
> Ideas?
>
> Thanks
>
> "Furui" <freewang1982(a)gmail.com> wrote in message
> <hig3mp$ffh$1(a)fred.mathworks.com>...
>> "Ben Finio" <bfinio(a)fas.harvard.edu> wrote in message
>> <hig0jd$p76$1(a)fred.mathworks.com>...
>> > I have the same issue (NI PCI-6220 board that I would like to use
>> for real-time Simulink), could someone please either post the solution
>> or forward me the email? Thanks.
>>
>> Here is the solution i got :
>> ===============Citation=======================
>>
>> 1. Insert the block for the function on the 6221 you want to use.
>> 2. Open the 'right' click menu and go down to 'Link Options' and
>> select 'Disable Link' on the submenu.
>> 3. Open the 'right' click menu again and once again go to the
>> 'Link Options' submenu. This time choose 'Break Link'. Now the
>> block is not linked back to the library you got it out of. You
>> can change the mask.
>> 4. Again open the 'right' click menu, but this time choose 'Edit
>> Mask'. This will open the mask editor. If you haven't done both
>> steps 2 and 3, you won't be able to edit the mask.
>> 5. Switch to the 'Initialization' tab. In the Initialization commands
>> edit box, the top line says 'boardType=21;'. Change that to
>> 'boardType=20;'. This is an index into an array in the driver
>> that selects the 6220 board information. Then click the 'Apply'
>> button and you'll notice the mask decoration changes to 'PCI-6220'
>> although the name under the block doesn't change. You have to
>> change that manually if you want to.
>>
>> Repeat that for each of the functions you want to use with this
>> board. A/D, DI, DO, PWM Gen, PWM measure and Encoder.