User`s guide
Getting Started with Automation Interface
-1 508 647 7000
If you used 8-bit integers (int8), the returned values would be incorrect.
idatv=read(cc,address(cc,'idat'),'int8',4)
idatv =
10-41
c C hange the value s stored in ddat by entering
write(cc,address(cc,'ddat'),double([pi 12.3 exp(-1)...
sin(pi/4)]))
The double argument directs MATLAB software to write the values to
the processor as double-precision d ata.
d To change idat, enter the following command:
write(cc,address(cc,'idat'),int32([1:4]))
In this command , y ou w rite the d ata to th e proce ssor as 32-bit integers
(convenient for representing phone numbers, for example).
e Next, start the p rogram running again by entering the following
command:
run(cc,'runtohalt',30);
The Stdout tab in CC S IDE rev eals that ddat and idat contain new
values. Read those new values back i nto MATLAB software.
f Enter ddatv = read(cc,address(cc,'ddat'),'double',4).
ddatv =
3.1416 12.3000 0.3679 0.7071
Verify that ddatv contains the values you wrote in step c.
g V erify that the change t o idatv occurred by entering the following
command:
idatv = read(cc,address(cc,'idat'),'int32',4)
2-17