Thread Subject: Multiple Sensoray cards with Windows Real Time Target

Subject: Multiple Sensoray cards with Windows Real Time Target

From: Quinton Christensen

Date: 21 Nov, 2009 08:44:13

Message: 1 of 7

I have been looking for an answer on various forums but have yet to find a solution to my problem.

Please help if you can.

I am controlling a robot using sensoray 626 cards. I was running with two NI DAQ cards but the NI cards had only four encoder counters available between the two cards. A recent addition to the robot required an additional three encoder inputs. At this point we replaced the two NI DAQ cards with two Sensoray 626 cards giving me a total of eight encoder counters available.

I had my control model completely defined in Simulink using the Real Time Workshop to control the robot. I was hoping that I could simply install the driver, replace the DAQ cards and redirect the analog outputs and encoder counter inputs.

The drivers successfully loaded and the hardware is recognized by Windows. When I setup the Sensoray cards under Real Time Target in Simulink I can get the system to recognize one of the cards with the auto detect configuration, however I am unable to recognize both cards using auto detect.

All attempts to manually select the PCI port that the Sensoray cards is attached to have failed. I know that the API that sensoray ships with these cards allows access to up to 16 cards simultaneously. Is it possible to run two sensoray cards with Real Time Target? If so what format does the specified port information take? Is there an easy way to poll the cards for their port number?

Any help that could be offered would be appreciated.

Thanks,

Quinton Christensen
Bio Robotics Lab
University of Utah
Department of Mechanical Engineering

Subject: Multiple Sensoray cards with Windows Real Time Target

From: Jan Houska

Date: 21 Nov, 2009 20:51:33

Message: 2 of 7

Hi Quinton,

it is not possible to have multiple cards of the same type recognized by
Autodetect. This always finds the first available board and never gets
to the second one. However, it is possible to use the boards
simultaneously if you explicitly specify their slot numbers.

The only difficulty that remains is how to find out these slot numbers.
Unfortunately, there's no easy way. One possible way is just to try it
out. Please issue these commands:

rtload('Sensoray/Model_626')
rtwho

Now, you see the slot number of the first board (in hex) in the Address
column. The slot number of the second board is likely to be somewhere
around, so if the second board is in the physically next slot, you can
try something like this:

rtload('Sensoray/Model_626', 7); % the slot number reported above was 6
rtload('Sensoray/Model_626', 5); % in case numbering is reverted

You get an error when you pick a wrong slot number. If you don't get an
error, check the result with "rtwho". Once you get two instances of the
driver loaded, please note their slot numbers, enter these to the Board
Setup GUI in your model, and you are finished. This is necessary to do
only once for a given computer.

In good old times, slot numbers were documented in your motherboard
documentation. Of course you can also try to read that, but
unfortunately this information is usually no more available.

Good Luck, Jan


Quinton Christensen wrote:
> I have been looking for an answer on various forums but have yet to find a solution to my problem.
>
> Please help if you can.
>
> I am controlling a robot using sensoray 626 cards. I was running with two NI DAQ cards but the NI cards had only four encoder counters available between the two cards. A recent addition to the robot required an additional three encoder inputs. At this point we replaced the two NI DAQ cards with two Sensoray 626 cards giving me a total of eight encoder counters available.
>
> I had my control model completely defined in Simulink using the Real Time Workshop to control the robot. I was hoping that I could simply install the driver, replace the DAQ cards and redirect the analog outputs and encoder counter inputs.
>
> The drivers successfully loaded and the hardware is recognized by Windows. When I setup the Sensoray cards under Real Time Target in Simulink I can get the system to recognize one of the cards with the auto detect configuration, however I am unable to recognize both cards using auto detect.
>
> All attempts to manually select the PCI port that the Sensoray cards is attached to have failed. I know that the API that sensoray ships with these cards allows access to up to 16 cards simultaneously. Is it possible to run two sensoray cards with Real Time Target? If so what format does the specified port information take? Is there an easy way to poll the cards for their port number?
>
> Any help that could be offered would be appreciated.
>
> Thanks,
>
> Quinton Christensen
> Bio Robotics Lab
> University of Utah
> Department of Mechanical Engineering


--

--
Jan Houska HUMUSOFT s.r.o.
houska@humusoft.com Pobrezni 20
http://www.humusoft.com 186 00 Praha 8
tel: ++ 420 284 011 730 Czech Republic
fax: ++ 420 284 011 740

Subject: Multiple Sensoray cards with Windows Real Time Target

From: Quinton Christensen

Date: 21 Nov, 2009 21:30:12

Message: 3 of 7

Thanks Jan,

I spent about an hour last night changing PCI slot numbers starting from 1 through I believe 32 and never got them to recognize the cards. I noticed that the port numbers are listed as being a hex value so would I try 0 through F ?

Thanks again for your help.

Quinton

Subject: Multiple Sensoray cards with Windows Real Time Target

From: Jan Houska

Date: 22 Nov, 2009 19:26:01

Message: 4 of 7

Hi Quinton,

slot numbers aren't necessarily small numbers from 1 to 32. Motherboards
use various numbering schemes, so it is important to start searching
around what does "rtwho" display after you load the driver without any
slot number. It does load without error in this case, doesn't it?

Or try this little program which searches slots from 0 to 65535 - it may
take up to 15 minutes to finish but should be able to reliably find the
slot number.

%%%%%%%% save this as slotdetect.m
function slots = slotdetect(name, numboards)

slots = [];
for slot=0:65535
   try
     rtload(name, slot);
     slots(end+1) = slot;
     if numel(slots)>=numboards
       break;
     end
   catch ME
   end
end
slots = dec2hex(slots);
%%%%%%%%

% then call it like this:
slotdetect('Sensoray/Model_626', 2);

This will print the slot numbers in hex, and you should then type them
to driver GUI literally as printed.

Good Luck, Jan


Quinton Christensen wrote:
> Thanks Jan,
>
> I spent about an hour last night changing PCI slot numbers starting from 1 through I believe 32 and never got them to recognize the cards. I noticed that the port numbers are listed as being a hex value so would I try 0 through F ?
>
> Thanks again for your help.
>
> Quinton


--

--
Jan Houska HUMUSOFT s.r.o.
houska@humusoft.com Pobrezni 20
http://www.humusoft.com 186 00 Praha 8
tel: ++ 420 284 011 730 Czech Republic
fax: ++ 420 284 011 740

Subject: Multiple Sensoray cards with Windows Real Time Target

From: Seyed Mahdi Hashemi

Date: 17 Aug, 2011 10:11:09

Message: 5 of 7

Hello,

I have the same problem with two Sensoray 626 cards which I have to get them worked simultaneously in real time windows target.
I tried Jan's code, but I got an empty variable [] at the end.
Dose anyone have a solution for this problem?

Thanks
Mahdi


"Quinton Christensen" wrote in message <he898t$eaj$1@fred.mathworks.com>...
> I have been looking for an answer on various forums but have yet to find a solution to my problem.
>
> Please help if you can.
>
> I am controlling a robot using sensoray 626 cards. I was running with two NI DAQ cards but the NI cards had only four encoder counters available between the two cards. A recent addition to the robot required an additional three encoder inputs. At this point we replaced the two NI DAQ cards with two Sensoray 626 cards giving me a total of eight encoder counters available.
>
> I had my control model completely defined in Simulink using the Real Time Workshop to control the robot. I was hoping that I could simply install the driver, replace the DAQ cards and redirect the analog outputs and encoder counter inputs.
>
> The drivers successfully loaded and the hardware is recognized by Windows. When I setup the Sensoray cards under Real Time Target in Simulink I can get the system to recognize one of the cards with the auto detect configuration, however I am unable to recognize both cards using auto detect.
>
> All attempts to manually select the PCI port that the Sensoray cards is attached to have failed. I know that the API that sensoray ships with these cards allows access to up to 16 cards simultaneously. Is it possible to run two sensoray cards with Real Time Target? If so what format does the specified port information take? Is there an easy way to poll the cards for their port number?
>
> Any help that could be offered would be appreciated.
>
> Thanks,
>
> Quinton Christensen
> Bio Robotics Lab
> University of Utah
> Department of Mechanical Engineering

Subject: Multiple Sensoray cards with Windows Real Time Target

From: Jan Houska

Date: 23 Aug, 2011 10:26:32

Message: 6 of 7

Hi,

Seyed Mahdi Hashemi wrote:
> Hello,
>
> I have the same problem with two Sensoray 626 cards which I have to get
> them worked simultaneously in real time windows target. I tried Jan's
> code, but I got an empty variable [] at the end.
> Dose anyone have a solution for this problem?
>
> Thanks
> Mahdi
>
>
> "Quinton Christensen" wrote in message <he898t$eaj$1@fred.mathworks.com>...
>> I have been looking for an answer on various forums but have yet to
>> find a solution to my problem.
>>
>> Please help if you can.
>>
>> I am controlling a robot using sensoray 626 cards. I was running with
>> two NI DAQ cards but the NI cards had only four encoder counters
>> available between the two cards. A recent addition to the robot
>> required an additional three encoder inputs. At this point we replaced
>> the two NI DAQ cards with two Sensoray 626 cards giving me a total of
>> eight encoder counters available.
>> I had my control model completely defined in Simulink using the Real
>> Time Workshop to control the robot. I was hoping that I could simply
>> install the driver, replace the DAQ cards and redirect the analog
>> outputs and encoder counter inputs.
>> The drivers successfully loaded and the hardware is recognized by
>> Windows. When I setup the Sensoray cards under Real Time Target in
>> Simulink I can get the system to recognize one of the cards with the
>> auto detect configuration, however I am unable to recognize both cards
>> using auto detect.
>> All attempts to manually select the PCI port that the Sensoray cards
>> is attached to have failed. I know that the API that sensoray ships
>> with these cards allows access to up to 16 cards simultaneously. Is it
>> possible to run two sensoray cards with Real Time Target? If so what
>> format does the specified port information take? Is there an easy way
>> to poll the cards for their port number?
>> Any help that could be offered would be appreciated.

When loading drivers for two boards of the same type, you must specify
their PCI slot (not port) numbers explicitly. Auto-detect is able to
recognize only one board of a given type. Here are some tips how to get
the slot numbers:

Please type "rtwho" after you have loaded one of the drivers using
auto-detect. It will show you the PCI slot number. Then, the second
board which is physically located in one of the neighboring slots should
have a slot number just around the first one - try increasing and
decreasing the slot number by one and after few trials, you should get
the second driver loaded.

The slot number can be also read from your operating system. Please open
Device Manager, find the Sensoray device and the slot number is there:
"device 7" means slot 7. You should have two Sensoray devices in the
Device Manager with different slot numbers.

And, you can also physically remove one of the boards, load the driver,
do "rtwho", note the slot number. Then put the board back, remove the
other one, repeat the procedure. You should now have slot numbers for
both the boards.

Good Luck, Jan


--
Jan Houska HUMUSOFT s.r.o.
houska@humusoft.com Pobrezni 20
http://www.humusoft.com 186 00 Praha 8
tel: ++ 420 284 011 730 Czech Republic
fax: ++ 420 284 011 740

Subject: Multiple Sensoray cards with Windows Real Time Target

From: Seyed Mahdi Hashemi

Date: 8 Sep, 2011 14:41:28

Message: 7 of 7

Hello Jan,

Thanks for your response.
I tried both of your solutions, but non of them worked.
First I installed just one board, useed autodetect option and tested successfully. When I typed "rtwho" in MATLAB, I got this message:
 
********************************
Real-Time Windows Target version 3.1.0 (C) The MathWorks, Inc. 1994-2007
Running on Multiprocessor APIC computer.
MATLAB performance = 100.0%
Kernel timeslice period = 0.625 ms

DRIVERS: Name Address Parameters
 
                       Sensoray Model 626 0xd []
********************************

I could not understand the PCI slot number from this.

About the second way which I had tried before, I got the device number "device 13".
When I use "13" in RTWT for loading, nothing is found and "test" dose not work.

What can be the problem?

Thanks again
Mahdi

>
> When loading drivers for two boards of the same type, you must specify
> their PCI slot (not port) numbers explicitly. Auto-detect is able to
> recognize only one board of a given type. Here are some tips how to get
> the slot numbers:
>
> Please type "rtwho" after you have loaded one of the drivers using
> auto-detect. It will show you the PCI slot number. Then, the second
> board which is physically located in one of the neighboring slots should
> have a slot number just around the first one - try increasing and
> decreasing the slot number by one and after few trials, you should get
> the second driver loaded.
>
> The slot number can be also read from your operating system. Please open
> Device Manager, find the Sensoray device and the slot number is there:
> "device 7" means slot 7. You should have two Sensoray devices in the
> Device Manager with different slot numbers.
>
> And, you can also physically remove one of the boards, load the driver,
> do "rtwho", note the slot number. Then put the board back, remove the
> other one, repeat the procedure. You should now have slot numbers for
> both the boards.
>
> Good Luck, Jan
>
>
> --
> Jan Houska HUMUSOFT s.r.o.
> houska@humusoft.com Pobrezni 20
> http://www.humusoft.com 186 00 Praha 8
> tel: ++ 420 284 011 730 Czech Republic
> fax: ++ 420 284 011 740

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
hardware config... Quinton Christensen 21 Nov, 2009 03:49:12
real time target Quinton Christensen 21 Nov, 2009 03:49:12
sensoray 626 Quinton Christensen 21 Nov, 2009 03:49:12
simulink Quinton Christensen 21 Nov, 2009 03:49:10
rssFeed for this Thread

Contact us at files@mathworks.com