LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

a problem with The DSP toolkit for TI DSPs

I'd like to see a sinusiod (that my C6711 DSK is playing)on a waveform in a LabView's VI; I'm trying to use the RTDX protocol but it doesn't work; on the ccs everything is set up well(I guess) .Can anyone suggest me something? thank you very much!!!
0 Kudos
Message 1 of 7
(3,733 Views)
You first need to setup the RTDX channel in your CCS program. Declare an array outside of main to hold your filtered data and create a RTDX output channel. For example:
unsigned short FilterBuffer[100];
RTDX_CreateOutputChannel(mybuffer_array_int16);

In main(), you will need to call your various initializations for the CSL and Hardware interrupts. Then enable the RTDX output with a call to,
RTDX_enableOutput(&mybuffer_array_int16);

As the filter runs, you will need to fill FilterBuffer with your filtered data and periodically write the data to the RTDX channel in the following way:

RTDX_write(&mybuffer_array_int16, &FilterBuffer, sizeof (FilterBuffer));

You will want to declare FilterBuffer to be a size large enough to hold the filtered data witho
ut causing an overflow because it was not written to the RTDX channel fast enough. After a write to the RTDX channel, be sure to begin filling the buffer again from start of the buffer, at element zero.

In LabVIEW, you will use a CCS RTDX Read Array I16 in a loop to grab the data. Set the channel input to mybuffer_array_int16 because that was the name assigned to the buffer in CCS. Use the Build Waveform vi to assign the appropriate sample rate to the returned array of values.

Hope this helps.

Kristi Hummel
Applications Engineer
National Instruments
0 Kudos
Message 2 of 7
(3,732 Views)
Hi Kristi!
Thank you very much for your answer, I appreciate it; the problem -i guess- is the ''various initialization'' I have to call in the main(); I'm not into C programming and I'm creating my ccs project with simulink and then with the TI tool that creates automatically the project; notice that in the simulink project I can put some RTDX blockset and after all I can create the project; in Labview I use the''Easy CCs file automation'' with a RTDX reading block without the build,open,load -etcetc- blocksets (they don't work..I get an error..even if I run the filter example..but if I cut this blocksets on the Vi ,leaving only the RTDX blocksets, the -filter works..so everything seems all right,concerning the RTDX enviroments);
I've attached
the ccs project and the Vi so you can see my thousand mistakes and tell me what you think .

Thank you very much again!!!

Franbo
Download All
0 Kudos
Message 3 of 7
(3,732 Views)
Hi Franbo,

You should be able to run the Filter example for the 6x11 DSK that came installed with the LabVIEW DSPToolset. In the VI you sent to me, you removed the RTDX input to the DSP (among all of the other missing CCS automation VI's), thus filtering the signal with zeroes. What kind of errors did you see when you ran the original example program?

I looked through your code briefly, but I'm still pretty unclear what all of it is doing. Are you only generating data at this time? Is there filtering? If you are receiving data from somewhere, how are you reading from the AD535? What problems are you seeing now?

Which version of CCS are you using?

Regards,

Kristi Hummel
Applications Engineer
National Instruments
0 Kudos
Message 4 of 7
(3,732 Views)
Hi Kristi,
the Vi I've sent you is a simple Vi to read a sinusoid that the dsp is generating..my aim is to see the sin in the waveform graph,it should be a simply task to check if everything is all right and then to build more complicated(?) projects on the dsp verifying them with LabView (project like filters and stuff like that..).I use LAbView only to check the output and other variables...
Concerning the filter example of the toolkit I can tell you that it works only if I ''cut'' the blocksets for opening the project,building it,starting stopping etcetc..it's not a big deal..I load the project and manage it via CCS..
***
(anyway the error I get is the ''broken arrow'' of the Vi..I can not start the Vi filter example.. it gives me an
error list : ''Block diagram errors:
-SubVi' CCS Download code.vi' :subVi is not executable
-SubVi' CCS Build.vi' : subVi is not executable
-SubVi' CCS Open Project.vi' : subVi is not executable
what you think about it?..
***

so to sum up:
- the project I gave you creates a sin (2000Hz) and sends this signal at the codec so I can hear it and at the RTDX channel out..the Vi should see this data and plot the waveform but on LabView gives '' Error 2147287010 occurred at RTDX error ENoDataAvailable''

- my set up ,on a win Xp machine, :

- matlab v6.5 with simulink; I use the toolbox ''embedded target for TI C6000 DSP'' to create projects (code and the other staff)for the dsp (TI C6711 DSK)..I'm not a good C programmer so I use this solution
- code composer Studio v2.2 and TI dsp C6711 DSK
- labview v6.1 with the DSP test integration Toolkit evaluation version

I hope this could give you a better idea of what I'm trying to do and what is going on

thank you ver
y much for your precious help

franbo
0 Kudos
Message 5 of 7
(3,732 Views)
Hi Franbo,

Sorry for the delay. The broken run error may mean that the toolkit installation is corrupt and you should reinstall it.

The error -2147287010 may be caused because the DSP was not halted before the code was downloaded to the DSP. Try closing CCS, resetting the DSP, and perhaps cycling the power.

Here are some suggestions:
- Move "RTDX_CreateOutputChannel(out);" from DSPsin2.c to the top of DSPsin2_main.c, perhaps after the two #define statements. That's by no means the only valid location, just a suggestion.
- It appears that there is also a problem with your call to RTDX_Write( &out, &rtB.Sine_Wave[0], 256*sizeof(real_T)) because of where you placed the ampersand. Instead, try:
RTDX_write(&out, &(rt
B.Sine_Wave), sizeof(rtB.Sine_Wave)); //make the "w" in "write" lowercase
- It's also possible that LabVIEW is not interpretting the real_T datatype properly. You could create an additional array of type double and pass that to the RTDX_write instead.
- In LabVIEW, you'll need to ignore some of the errors returned by RTDX because LabVIEW may try to read from the buffer before data is available.

I cannot compile your project because I'm missing the libraries, dsp_rt_c6710.lib and rtw_rt_c6710.lib.

Let me know how it goes.

Kristi Hummel
Applications Engineer
National Instruments
0 Kudos
Message 6 of 7
(3,732 Views)
Hi, I have a question about RTDX. I want to transfer 8 "Integer 16" data from DSP to Labview in every 20ms. The data transfer frequency is 50Hz. One way to do is transfer these 8 data by 8 seperated Channels. I am doing this way. Another way is to create an array to store these data and then only use one channel to send it back to Labview. My question is which way is better? Because the RTDX transfer data rate is only like 8-12k bps (bandwidth). I want to find out a way to avoid the RTDX reach it's bandwidth limit. Now I am encounting the "RTDX  traffic" problems. Some times it works well sometimes the RTDX is very slow. Because at the same time I need to use labview input one 16bit integer and a floating point data.
0 Kudos
Message 7 of 7
(3,537 Views)