Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Problems with data sharing between fpga and Simulink via SIT
When I connect an indicator of the FPGA via the SIT manager to a simulink in
put and then connect that value back to a labview host vi I get strange valu
es on the host VI.
 The FPGA simulink connection is made via the hardware I/O tab in the S
IT manager.
The NI FPGA is checked and finaly the connection is made via the "Configure 
FBGA..." button.
 
The connection between simulink and the host vi is done via the tab mappings
.
where in simulink the input port is connected to a gain block (multiply with
 1) and this gain block is then conneted to the host via via SIT mappings
 
 All variables, indicator etc are of type I16 ( as well in  labvie
w as in simulink)
 
 When I run the FPGA standalone the value of the indicator which is con
nected to simulink is around 90000.
When I run the FPGA bitfile via the host VI  the value is varying som w
here between -10 and 10.
The -10 to 10 indicates that some where a value is to high for a signed inte
ger, This must be somewhere inside the SIT code, because all other variables
 and indicator are of type I16 as I metioned before.
 
 How Can I solve this problem
 
I amusing
matlab 6.5.1
labview 8.5
and SIT 4.0
 
Regards
Frank

Report this thread to moderator Post Follow-up to this message
Old Post
fengels
03-21-08 12:12 AM


Re: Problems with data sharing between fpga and Simulink via SIT
Thank you Angela,
That makes it more clear to me, but still I have a problem with it.
When I make a contstant (I16) in the FPGA with for example the value 4000, a
nd connect this via the SIT manager to the the Simulink DLL.   I g
et nothing else than zero (or I get nothing?).
But I will try the sugestion off you with the fixed-point data type.
 
Thank you verry much
Frank

Report this thread to moderator Post Follow-up to this message
Old Post
fengels
03-25-08 09:41 AM


Re: Problems with data sharing between fpga and Simulink via SIT
Angela,
The work around with the fixpiont type did not work,  but thanks to you
r reply, I now  know that I have to convert it in simulink.
With the kwonledge of the conversion to Volts, I looked again at the va
lues in simulink (comming from the FPGA), but I see that some of them are co
nverted to volt but some of them are not.
So there are some values wich are not or incorrect converted. How is this po
ssible.
All values output in the FPGA are I16 and the input values in simulink are n
ow double.
Regards
Frank
 

Report this thread to moderator Post Follow-up to this message
Old Post
fengels
03-27-08 12:38 AM


Re: Problems with data sharing between fpga and Simulink via SIT
Hello Frank,
What kind of target are you using (cRIO)?  If the value coming from the
 FPGA is of type I16, then SIT will apply some scaling, but if it is fixed p
oint, then SIT will not apply any scaling.  The scaling that SIT applie
s assumes a -10 to 10 V ran
ge, so if your target has a different range, then the scaling would be inacc
urate.
 
As you've mentioned, you can account for the scaling values in the model its
elf, but if the bitfile is appropriately defined and compiled with a fixed p
oint datatype there should not be a need.
 
So please post back a little more information about what you changed and wha
t exactly you are seeing in terms of scaling and we can provide a little mor
e guidance.
 
Thank you,
Angela MProduct Support Engineer

Report this thread to moderator Post Follow-up to this message
Old Post
Angela M
03-27-08 12:38 AM


Re: Problems with data sharing between fpga and Simulink via SIT
Angela
 I am using a PCI 7813R on a labview RT system
 
When I tried the fixpoint solution I just changed the I16 indicators to FXP 
indicators. It still showed the scaled values (volts) in simulink DLL.
I did not use type converssion before the FXP indicators, perhaps that is th
e cause of still showing the scaling to volts.
 
In the SIT Harware IO tab I connected several indicators from the FPGA to th
e simulink DLL model, some of them show correct values( in volts) other had 
complete incorrect values in simulink.
See the attsched files of labview and simulink (this pictures show the I16 i
ndicator, I changed the FXP indicators back to I16)
Even constan values from the FPGAappear as  0 in simulink model, see at
tachement.
 
Regards
Frank


SITmanager problem.gif:
http://forums.ni.com/attachments/ni...43/1/SITmanager problem.gif


simulinkmodel.gif:
http://forums.ni.com/attachments/ni...mulinkmodel.gif

Report this thread to moderator Post Follow-up to this message
Old Post
fengels
03-28-08 12:26 AM


Re: Problems with data sharing between fpga and Simulink via SIT
Hello Frank,
It is not clear why some values would be returned properly and others not.&n
bsp; When you say some are correct and others are not, how are the valu
es incorrect, are they scaled or just completely nonsense?  As I've men
tioned before, no scaling w
ill be added by SIT in the driver VI if the values are a fixed point number.
  Can you do some probing in your driver VI to see what the values retu
rned from the FPGA are?  When you say the values are wrong in simulink,
 how are you seeing this?&n
bsp; Does your model dll pass the input value directly back out to the drive
r VI?
 
I hope this helps, please post back if there is still any confusion about th
is.
 
Regards,
Angela M
Product Support Engineer
 

Report this thread to moderator Post Follow-up to this message
Old Post
Angela M
03-29-08 12:19 AM


Re: Problems with data sharing between fpga and Simulink via SIT
Angela,
 The values are complete nonsense.
 I read the values in the simulink model back via the SIT manager into 
a windows vi, so I can see them.
I will try to read the values of the FPGA in the driver vi ( I do not know h
ow to, but I will find out)
Regards
Frank

Report this thread to moderator Post Follow-up to this message
Old Post
fengels
03-31-08 10:39 AM


Re: Problems with data sharing between fpga and Simulink via SIT
Hello Frank,
If you have a support contract you can call in and talk with one of our appl
ications engineers, they will be able to help you with your troubleshooting 
and probing in the driver VI.  You can find the contact information but
 clicking Contact NI in the
bar at the top of any ni.com webpage.
Regards,Angela MProduct Support Engineer

Report this thread to moderator Post Follow-up to this message
Old Post
Angela M
03-31-08 01:46 PM


Re: Problems with data sharing between fpga and Simulink via SIT
Angela,
 I have support and and they know about the problem, but I did not get 
any answer yet (It is to complicated)
I looked in the driver and the values are the same as in simulink ( some are
 correct and some are nonsens or 0).
I have in total about 350 connections to simulink, is this perhaps the probl
em (65 inputs and 295 outputs) and can this then be solved by using  ar
ray's or cluster.
What is the total maximun possible connections to simulink,
Regards
Frank

Report this thread to moderator Post Follow-up to this message
Old Post
fengels
04-02-08 12:18 AM


Re: Problems with data sharing between fpga and Simulink via SIT
Hello Frank,
I am currently trying to track down some hardware so I can test out your sce
nario.  Would you be able to post your files so that I can test with th
e same files you are using?  We would need the bitfile, and bitfile sou
rce in addition to all of y
our SIT VIs and your model dll and/or model.  If you cannot attach this
 for security reasons, can you reproduce this with some simple basic files a
nd attach those?
 
Regards,
Angela MProduct Support Engineer

Report this thread to moderator Post Follow-up to this message
Old Post
Angela M
04-02-08 01:24 PM


Sponsored Links




Last Thread Next Thread Next
Pages (2): [1] 2 »
Search this forum -> 
Post New Thread

LabVIEW archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:10 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.