FORUM TOPIC · READ ONLY
Some help needed reg data conversion for this model
Some help needed reg data conversion for this model
Forum : General Remark and Questions
3 message(s) · archive en lecture seule
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 .
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
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 .
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
Re: Some help needed reg data conversion for this model
why did you ask me to change the switch box ? is there any specific reasons for it
Re: Some help needed reg data conversion for this model
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)
Isn't it more simple ?
C code generated is also more simple thus more efficient.
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)
Citation : barryforever 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.