Some help needed reg data conversion for this model

Create new topics, add your comment, remark, bugs...
Post Reply
barryforever
Posts: 11
Joined: Sun Feb 17, 2008 2:58 pm

Some help needed reg data conversion for this model

Post by barryforever » Thu Mar 06, 2008 12:17 pm

Hello
Im a Student doing my undergraduation in Instrumentation and Control Engineering .Im recently developing a smart sensor using your toolbox.
I did build a simple smart sensor but it failed to compile it gave me the following error .

Code: Select all

Error building Real-Time Workshop target for block diagram 'smart_sensor'. MATLAB error message:
Error using ==> rtwgen
--> Error reported by S-function 'dsPIC_UART_TX_Labview_Matlab' in 'smart_sensor/TX Output Multiplexed for Matlab // Labview':
Invalid input or output port data type.
--> An error occurred while propagating data type 'double' from 'smart_sensor/Add', output port 1.
Can you debug the model and give me the corrected simulink model ..
please also tell me what is the error that i did .
i have attached the model to this thread
Attachments
smart_sensor.mdl
this is the model
(35.53 KiB) Downloaded 225 times

barryforever
Posts: 11
Joined: Sun Feb 17, 2008 2:58 pm

Re: Some help needed reg data conversion for this model

Post by barryforever » Thu Mar 06, 2008 4:07 pm

why did you ask me to change the switch box ? is there any specific reasons for it

LubinKerhuel
Site Admin - Expert
Posts: 616
Joined: Wed Mar 07, 2007 11:23 pm
Location: Bayonne- France
Contact:

Re: Some help needed reg data conversion for this model

Post by LubinKerhuel » Fri Mar 07, 2008 1:19 am

Barry,

I did not understand what the purpose of the model you posted is.
However, I corrected few tricks. But I guess that it will not do the job you are expecting.

I posted a second model to use for simulation. I replaced the ADC block by a sinus generator block. It makes you able to simulates the "program" execution if a sinus signal (between 0V and +Vcc) was connected to the ADC input of the dsPIC.

I suggest to modify this model until you get the expected the correct behavior.
Once simulation is OK, just cut-past this model into the mdl file used to program the dsPIC. Few tricks could be necessary to make it compiling.
(For advanced user, it is possible to use a unique mdl file for both simulation and code generation using the "Environment Controller" block that you can find in the standard simulink library)
barryforever wrote:why did you ask me to change the switch box ?
Isn't it more simple ?
C code generated is also more simple thus more efficient.
Attachments
smart_sensor_Simulation.mdl
(37.94 KiB) Downloaded 211 times
smart_sensor.mdl
(39.49 KiB) Downloaded 207 times

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests