Function that returns the contents of the indicated workstation status word.
Note: From RTE 34.03.06, the keywords fb_stsw and fb_ctrlw are available.
|
i32 co_statusword (i32 nWs [, i32 flgCw=FALSE])
|
|
Robox station ID (logical workstation 1-:-64).
Note: If 0 is specified as ws then it is meant for all.
|
|
Parameter to also enable reading the control word as well. (optional, default FALSE)
|
|
Returns:
|
|
|
flgCw = 0
|
Value of status word
|
Value returned in w0 (lower part, first word)
|
0
|
Value returned in w1 (upper part, second word)
|
flgCw <> 0
|
Value of the status word
|
Value returned in w0
|
Value of the control word
|
Value returned in w1
|
|
|
Rule, Task
|
|
|
|
|
|
0
|
0x00000001
|
Ready to switch ON
|
1
|
0x00000002
|
Switched ON
|
2
|
0x00000004
|
Operation enabled
|
3
|
0x00000008
|
Fault
|
4
|
0x00000010
|
Voltage enabled
|
5
|
0x00000020
|
Quick stop
|
6
|
0x00000040
|
Switch on disabled
|
7
|
0x00000080
|
Warning
|
8
|
0x00000100
|
Manufacturer specific
|
9
|
0x00000200
|
Remote
|
10
|
0x00000400
|
Target reached
|
11
|
0x00000800
|
Internal limit active
|
12
|
0x00001000
|
Operation mode specific
|
13
|
0x00002000
|
Operation mode specific
|
14
|
0x00004000
|
Manufacturer specific
|
15
|
0x00008000
|
Manufacturer specific
|
The figure was extrapolated from CiA Draft Standard Proposal 402.
|
Example of use:
int stws[33]
for(i= 1 , i<=32 , i++)
stws[i] = co_statusword(i)
end_for
|
Example of use:
reso = co_statusword(ws,true)
r(1000) = w0(reso)
r(1001) = w1(reso)
|
|