This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
I need some help in the thread below:
http://e2e.ti.com/support/dsp/tms320c6000_high_performance_dsps/f/112/p/93656/325750.aspx#325750
Basically, I need to modify a double/float variable using VB scripting but having issues in writing and reading back the updated value. Any pointers?
Thanks in advance.
Hi Anuj,
I'm waiting for an example from Mukul. If you have an example also, I'd like to see it.
Thanks
ki
' start_point is a float in 'C' code
'default value in start_point 4.0
'I want to write 1.0 or 1.5 in this variable using VB
'If I see this in step by step debugging after write start_eb_no shows some junk value instead of 1.0
' Read value is always what I set but not in C
' Here is the code snippet
Dim mk As
Double
Dim dspAddr As
Long
Dim nLength As
Long
dspAddr = MyCCScripting.SymbolGetAddress("start_point")
mk =
Worksheets("Sheet1").Cells(FIRST_TEST_RAW + k,
COLD_CACHE_COL)
Call
MyCCScripting.MemoryWrite(CCS_SCRIPTING_COMLib.PAGE_DATA,
_
dspAddr, _
nLength, _
mk)
mk = MyCCScripting.MemoryRead(CCS_SCRIPTING_COMLib.PAGE_DATA, _
dspAddr, _
nLength, _
False)
Hi Anuj, Mukul,
My apologies for the delay, I have been away for a few weeks.
There are two main limitations with CCScripting here:
1) The CCScripting Memory Write API only takes an integer type for the value so any float type will be converted to an integer, then written as an integer value (same does with the read).
2) The CCScripting Memory Read/Write APIs have a limitation of a max of 32 bits for the length to read/write. Since you are trying to write to a double type (I am assuming "start_point" is a double type) and a double is 64 bits on a C6000, this write will fail with 32 bits specified as the length... or at least not properly write the value as you are expecting it to. If you want to write a value to a double type on the target, you will need to do two consecutive 32-bit int memory writes (0x0 and 0x3FF00000 for value 1.0 on a little endian C6000 target)
Call MyCCScripting.MemoryWrite(0, _
dspAddr, _
32, _
0)
Call MyCCScripting.MemoryWrite(0, _
dspAddr + 4, _
32, _
Val("&H3FF00000"))
Thanks
ki