Compare commits
52 Commits
Author | SHA1 | Date |
---|---|---|
![]() |
9973ea165f | 7 years ago |
![]() |
080b29464e | 7 years ago |
![]() |
c77bbe3009 | 7 years ago |
![]() |
6f608c105f | 7 years ago |
![]() |
8074f99538 | 7 years ago |
![]() |
233cd20fd0 | 7 years ago |
![]() |
0d49e8c1d2 | 7 years ago |
![]() |
803786c402 | 7 years ago |
![]() |
bf1ee8b560 | 7 years ago |
![]() |
2df6387b99 | 7 years ago |
![]() |
e389149f22 | 7 years ago |
![]() |
7463a2c319 | 7 years ago |
![]() |
1bcd1fc071 | 7 years ago |
![]() |
c952aa5a31 | 7 years ago |
![]() |
1e993f20b0 | 7 years ago |
![]() |
66f571f03d | 7 years ago |
![]() |
28e8831029 | 7 years ago |
![]() |
4ad0567169 | 7 years ago |
![]() |
c4c55d74ca | 7 years ago |
![]() |
a4fc173cbf | 7 years ago |
![]() |
2a98f95df8 | 7 years ago |
![]() |
edc093e810 | 7 years ago |
![]() |
31f92b5cf0 | 7 years ago |
![]() |
8d728b3ab4 | 7 years ago |
![]() |
0d7a3750e4 | 7 years ago |
![]() |
074f7a8cd1 | 7 years ago |
![]() |
3ad71c7a0b | 7 years ago |
![]() |
1fbadffd6e | 7 years ago |
![]() |
2bbdfacfe4 | 7 years ago |
![]() |
57eb6bd455 | 7 years ago |
![]() |
74a9eb5856 | 7 years ago |
![]() |
9b4a06e573 | 7 years ago |
![]() |
4a135fa252 | 7 years ago |
![]() |
f68e97b7a1 | 7 years ago |
![]() |
8f523b1706 | 7 years ago |
![]() |
c9fe9b4286 | 7 years ago |
![]() |
1a9de24884 | 7 years ago |
![]() |
59e2d19acc | 7 years ago |
![]() |
cd81f9b13d | 7 years ago |
![]() |
e6ace3a787 | 7 years ago |
![]() |
9f0316e4c0 | 7 years ago |
![]() |
ed13cd7ab8 | 7 years ago |
![]() |
3878a9aad3 | 7 years ago |
![]() |
4d8a768ec5 | 7 years ago |
![]() |
af0b2f9edb | 7 years ago |
![]() |
2a19b2592f | 7 years ago |
![]() |
eb5b8fba5c | 7 years ago |
![]() |
c38a0c3d59 | 7 years ago |
![]() |
f8486de415 | 7 years ago |
![]() |
c97cac5ad9 | 7 years ago |
![]() |
1a8558dcda | 7 years ago |
![]() |
75ca279489 | 7 years ago |
@ -1,26 +0,0 @@
|
||||
name: CIFuzz
|
||||
on: [pull_request]
|
||||
jobs:
|
||||
Fuzzing:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Build Fuzzers
|
||||
id: build
|
||||
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
|
||||
with:
|
||||
oss-fuzz-project-name: 'libiec61850'
|
||||
dry-run: false
|
||||
language: c
|
||||
- name: Run Fuzzers
|
||||
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
|
||||
with:
|
||||
oss-fuzz-project-name: 'libiec61850'
|
||||
fuzz-seconds: 300
|
||||
dry-run: false
|
||||
language: c
|
||||
- name: Upload Crash
|
||||
uses: actions/upload-artifact@v3
|
||||
if: failure() && steps.build.outcome == 'success'
|
||||
with:
|
||||
name: artifacts
|
||||
path: ./out/artifacts
|
@ -1,12 +0,0 @@
|
||||
name: Greetings
|
||||
|
||||
on: [pull_request, issues]
|
||||
|
||||
jobs:
|
||||
greeting:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/first-interaction@v1
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
pr-message: 'Push requests and other code contributions can only be accepted from authorized persons that have signed our contributor license agreement(CLA). When in doubt please write to info@libiec61850.com.'
|
@ -1,2 +1,3 @@
|
||||
build/
|
||||
/Debug/
|
||||
cmake-build-debug/
|
||||
.idea/
|
||||
|
@ -1,5 +0,0 @@
|
||||
# Security Policy
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Please report security issues to `info@libiec61850.com`
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||
</startup>
|
||||
</configuration>
|
@ -1,217 +0,0 @@
|
||||
MODEL(simpleIO){
|
||||
LD(GenericIO){
|
||||
LN(LLN0){
|
||||
DO(Mod 0){
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
DA(ctlModel 0 12 4 0 0)=0;
|
||||
}
|
||||
DO(Beh 0){
|
||||
DA(stVal 0 3 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
}
|
||||
DO(Health 0){
|
||||
DA(stVal 0 3 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
}
|
||||
DO(NamPlt 0){
|
||||
DA(vendor 0 20 5 0 0);
|
||||
DA(swRev 0 20 5 0 0);
|
||||
DA(d 0 20 5 0 0);
|
||||
DA(configRev 0 20 5 0 0);
|
||||
DA(ldNs 0 20 11 0 0);
|
||||
}
|
||||
DS(Events){
|
||||
DE(GGIO1$ST$SPCSO1$stVal);
|
||||
DE(GGIO1$ST$SPCSO2$stVal);
|
||||
DE(GGIO1$ST$SPCSO3$stVal);
|
||||
DE(GGIO1$ST$SPCSO4$stVal);
|
||||
}
|
||||
DS(Events2){
|
||||
DE(GGIO1$ST$SPCSO1);
|
||||
DE(GGIO1$ST$SPCSO2);
|
||||
DE(GGIO1$ST$SPCSO3);
|
||||
DE(GGIO1$ST$SPCSO4);
|
||||
}
|
||||
DS(Events3){
|
||||
DE(GGIO1$ST$SPCSO1$stVal);
|
||||
DE(GGIO1$ST$SPCSO1$q);
|
||||
DE(GGIO1$ST$SPCSO2$stVal);
|
||||
DE(GGIO1$ST$SPCSO2$q);
|
||||
DE(GGIO1$ST$SPCSO3$stVal);
|
||||
DE(GGIO1$ST$SPCSO3$q);
|
||||
DE(GGIO1$ST$SPCSO4$stVal);
|
||||
DE(GGIO1$ST$SPCSO4$q);
|
||||
}
|
||||
DS(AnalogValues){
|
||||
DE(GGIO1$MX$AnIn1);
|
||||
DE(GGIO1$MX$AnIn2);
|
||||
DE(GGIO1$MX$AnIn3);
|
||||
DE(GGIO1$MX$AnIn4);
|
||||
}
|
||||
RC(EventsRCB01 Events 0 Events 1 24 175 50 1000);
|
||||
RC(AnalogValuesRCB01 AnalogValues 0 AnalogValues 1 24 175 50 1000);
|
||||
GC(gcbEvents events Events3 2 0 1000 3000 ){
|
||||
PA(4 1 4096 010ccd010001);
|
||||
}
|
||||
GC(gcbAnalogValues analog AnalogValues 2 0 -1 -1 ){
|
||||
PA(4 1 4096 010ccd010001);
|
||||
}
|
||||
}
|
||||
LN(LPHD1){
|
||||
DO(PhyNam 0){
|
||||
DA(vendor 0 20 5 0 0);
|
||||
}
|
||||
DO(PhyHealth 0){
|
||||
DA(stVal 0 3 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
}
|
||||
DO(Proxy 0){
|
||||
DA(stVal 0 0 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
}
|
||||
}
|
||||
LN(GGIO1){
|
||||
DO(Mod 0){
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
DA(ctlModel 0 12 4 0 0)=0;
|
||||
}
|
||||
DO(Beh 0){
|
||||
DA(stVal 0 3 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
}
|
||||
DO(Health 0){
|
||||
DA(stVal 0 3 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
}
|
||||
DO(NamPlt 0){
|
||||
DA(vendor 0 20 5 0 0);
|
||||
DA(swRev 0 20 5 0 0);
|
||||
DA(d 0 20 5 0 0);
|
||||
}
|
||||
DO(AnIn1 0){
|
||||
DA(mag 0 27 1 1 0){
|
||||
DA(f 0 10 1 1 0);
|
||||
}
|
||||
DA(q 0 23 1 2 0);
|
||||
DA(t 0 22 1 0 0);
|
||||
}
|
||||
DO(AnIn2 0){
|
||||
DA(mag 0 27 1 1 0){
|
||||
DA(f 0 10 1 1 0);
|
||||
}
|
||||
DA(q 0 23 1 2 0);
|
||||
DA(t 0 22 1 0 0);
|
||||
}
|
||||
DO(AnIn3 0){
|
||||
DA(mag 0 27 1 1 0){
|
||||
DA(f 0 10 1 1 0);
|
||||
}
|
||||
DA(q 0 23 1 2 0);
|
||||
DA(t 0 22 1 0 0);
|
||||
}
|
||||
DO(AnIn4 0){
|
||||
DA(mag 0 27 1 1 0){
|
||||
DA(f 0 10 1 1 0);
|
||||
}
|
||||
DA(q 0 23 1 2 0);
|
||||
DA(t 0 22 1 0 0);
|
||||
}
|
||||
DO(SPCSO1 0){
|
||||
DA(stVal 0 0 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(Oper 0 27 12 0 0){
|
||||
DA(ctlVal 0 0 12 0 0);
|
||||
DA(origin 0 27 12 0 0){
|
||||
DA(orCat 0 12 12 0 0);
|
||||
DA(orIdent 0 13 12 0 0);
|
||||
}
|
||||
DA(ctlNum 0 6 12 0 0);
|
||||
DA(T 0 22 12 0 0);
|
||||
DA(Test 0 0 12 0 0);
|
||||
DA(Check 0 24 12 0 0);
|
||||
}
|
||||
DA(ctlModel 0 12 4 0 0)=1;
|
||||
DA(t 0 22 0 0 0);
|
||||
}
|
||||
DO(SPCSO2 0){
|
||||
DA(stVal 0 0 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(Oper 0 27 12 0 0){
|
||||
DA(ctlVal 0 0 12 0 0);
|
||||
DA(origin 0 27 12 0 0){
|
||||
DA(orCat 0 12 12 0 0);
|
||||
DA(orIdent 0 13 12 0 0);
|
||||
}
|
||||
DA(ctlNum 0 6 12 0 0);
|
||||
DA(T 0 22 12 0 0);
|
||||
DA(Test 0 0 12 0 0);
|
||||
DA(Check 0 24 12 0 0);
|
||||
}
|
||||
DA(ctlModel 0 12 4 0 0)=1;
|
||||
DA(t 0 22 0 0 0);
|
||||
}
|
||||
DO(SPCSO3 0){
|
||||
DA(stVal 0 0 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(Oper 0 27 12 0 0){
|
||||
DA(ctlVal 0 0 12 0 0);
|
||||
DA(origin 0 27 12 0 0){
|
||||
DA(orCat 0 12 12 0 0);
|
||||
DA(orIdent 0 13 12 0 0);
|
||||
}
|
||||
DA(ctlNum 0 6 12 0 0);
|
||||
DA(T 0 22 12 0 0);
|
||||
DA(Test 0 0 12 0 0);
|
||||
DA(Check 0 24 12 0 0);
|
||||
}
|
||||
DA(ctlModel 0 12 4 0 0)=1;
|
||||
DA(t 0 22 0 0 0);
|
||||
}
|
||||
DO(SPCSO4 0){
|
||||
DA(stVal 0 0 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(Oper 0 27 12 0 0){
|
||||
DA(ctlVal 0 0 12 0 0);
|
||||
DA(origin 0 27 12 0 0){
|
||||
DA(orCat 0 12 12 0 0);
|
||||
DA(orIdent 0 13 12 0 0);
|
||||
}
|
||||
DA(ctlNum 0 6 12 0 0);
|
||||
DA(T 0 22 12 0 0);
|
||||
DA(Test 0 0 12 0 0);
|
||||
DA(Check 0 24 12 0 0);
|
||||
}
|
||||
DA(ctlModel 0 12 4 0 0)=1;
|
||||
DA(t 0 22 0 0 0);
|
||||
}
|
||||
DO(Ind1 0){
|
||||
DA(stVal 0 0 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
}
|
||||
DO(Ind2 0){
|
||||
DA(stVal 0 0 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
}
|
||||
DO(Ind3 0){
|
||||
DA(stVal 0 0 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
}
|
||||
DO(Ind4 0){
|
||||
DA(stVal 0 0 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,446 +0,0 @@
|
||||
MODEL(simpleIO){
|
||||
LD(GenericIO){
|
||||
LN(LLN0){
|
||||
DO(Mod 0){
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
DA(ctlModel 0 12 4 0 0)=0;
|
||||
}
|
||||
DO(Beh 0){
|
||||
DA(stVal 0 3 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
}
|
||||
DO(Health 0){
|
||||
DA(stVal 0 3 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
}
|
||||
DO(NamPlt 0){
|
||||
DA(vendor 0 20 5 0 0);
|
||||
DA(swRev 0 20 5 0 0);
|
||||
DA(d 0 20 5 0 0);
|
||||
DA(configRev 0 20 5 0 0);
|
||||
DA(ldNs 0 20 11 0 0);
|
||||
}
|
||||
DO(SetInt1 0){
|
||||
DA(setVal 0 3 2 1 0);
|
||||
}
|
||||
DO(SetInt2 0){
|
||||
DA(setVal 0 3 2 1 0);
|
||||
}
|
||||
DO(SetInt3 0){
|
||||
DA(setVal 0 3 2 1 0);
|
||||
}
|
||||
DO(SetInt4 0){
|
||||
DA(setVal 0 3 2 1 0);
|
||||
}
|
||||
DO(SetBool1 0){
|
||||
DA(setVal 0 0 2 1 0);
|
||||
}
|
||||
DO(SetBool2 0){
|
||||
DA(setVal 0 0 2 1 0);
|
||||
}
|
||||
DO(SetBool3 0){
|
||||
DA(setVal 0 0 2 1 0);
|
||||
}
|
||||
DO(SetBool4 0){
|
||||
DA(setVal 0 0 2 1 0);
|
||||
}
|
||||
DO(Int64 0){
|
||||
DA(stVal 0 4 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
}
|
||||
DO(SetAnVal 0){
|
||||
DA(setMag 0 27 2 1 0){
|
||||
DA(f 0 10 2 1 0);
|
||||
}
|
||||
}
|
||||
DS(Events){
|
||||
DE(GGIO1$ST$SPCSO1$stVal);
|
||||
DE(GGIO1$ST$SPCSO2$stVal);
|
||||
DE(GGIO1$ST$SPCSO3$stVal);
|
||||
DE(GGIO1$ST$SPCSO4$stVal);
|
||||
}
|
||||
DS(EventsFCDO){
|
||||
DE(GGIO1$ST$SPCSO1);
|
||||
DE(GGIO1$ST$SPCSO2);
|
||||
DE(GGIO1$ST$SPCSO3);
|
||||
DE(GGIO1$ST$SPCSO4);
|
||||
}
|
||||
DS(Booleans){
|
||||
DE(LLN0$SP$SetBool1$setVal);
|
||||
DE(LLN0$SP$SetBool2$setVal);
|
||||
DE(LLN0$SP$SetBool3$setVal);
|
||||
DE(LLN0$SP$SetBool4$setVal);
|
||||
}
|
||||
DS(Integers){
|
||||
DE(LLN01$SP$SetInt1$setVal);
|
||||
DE(LLN01$SP$SetInt2$setVal);
|
||||
DE(LLN01$SP$SetInt3$setVal);
|
||||
DE(LLN01$SP$SetInt4$setVal);
|
||||
}
|
||||
RC(EventsRCB01 Events1 0 Events 1 24 239 50 1000);
|
||||
RC(EventsRCB02 Events1 0 Events 1 24 239 50 1000);
|
||||
RC(BufferedRCB01 Events1 1 Events 1 24 239 50 1000);
|
||||
RC(BufferedRCB02 Events1 1 Events 1 24 239 50 1000);
|
||||
GC(gcbEvents events Events 1 0 1000 3000 ){
|
||||
PA(4 1 4096 010ccd010001);
|
||||
}
|
||||
}
|
||||
LN(LPHD1){
|
||||
DO(PhyNam 0){
|
||||
DA(vendor 0 20 5 0 0);
|
||||
}
|
||||
DO(PhyHealth 0){
|
||||
DA(stVal 0 3 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
}
|
||||
DO(Proxy 0){
|
||||
DA(stVal 0 0 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
}
|
||||
}
|
||||
LN(GGIO1){
|
||||
DO(Mod 0){
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
DA(ctlModel 0 12 4 0 0)=0;
|
||||
}
|
||||
DO(Beh 0){
|
||||
DA(stVal 0 3 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
}
|
||||
DO(Health 0){
|
||||
DA(stVal 0 3 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
}
|
||||
DO(NamPlt 0){
|
||||
DA(vendor 0 20 5 0 0);
|
||||
DA(swRev 0 20 5 0 0);
|
||||
DA(d 0 20 5 0 0);
|
||||
DA(dU 0 21 5 0 0);
|
||||
}
|
||||
DO(AnIn1 0){
|
||||
DA(mag 0 27 1 1 0){
|
||||
DA(f 0 10 1 1 0);
|
||||
}
|
||||
DA(q 0 23 1 2 0);
|
||||
DA(t 0 22 1 0 0);
|
||||
}
|
||||
DO(AnIn2 0){
|
||||
DA(mag 0 27 1 1 0){
|
||||
DA(f 0 10 1 1 0);
|
||||
}
|
||||
DA(q 0 23 1 2 0);
|
||||
DA(t 0 22 1 0 0);
|
||||
}
|
||||
DO(AnIn3 0){
|
||||
DA(mag 0 27 1 1 0){
|
||||
DA(f 0 10 1 1 0);
|
||||
}
|
||||
DA(q 0 23 1 2 0);
|
||||
DA(t 0 22 1 0 0);
|
||||
}
|
||||
DO(AnIn4 0){
|
||||
DA(mag 0 27 1 1 0){
|
||||
DA(f 0 10 1 1 0);
|
||||
}
|
||||
DA(q 0 23 1 2 0);
|
||||
DA(t 0 22 1 0 0);
|
||||
}
|
||||
DO(SPCSO1 0){
|
||||
DA(Oper 0 27 12 0 0){
|
||||
DA(ctlVal 0 0 12 0 0);
|
||||
DA(origin 0 27 12 0 0){
|
||||
DA(orCat 0 12 12 0 0);
|
||||
DA(orIdent 0 13 12 0 0);
|
||||
}
|
||||
DA(ctlNum 0 6 12 0 0);
|
||||
DA(T 0 22 12 0 0);
|
||||
DA(Test 0 0 12 0 0);
|
||||
DA(Check 0 24 12 0 0);
|
||||
}
|
||||
DA(stVal 0 0 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
DA(ctlModel 0 12 4 0 0)=1;
|
||||
}
|
||||
DO(SPCSO2 0){
|
||||
DA(SBO 0 17 12 0 0);
|
||||
DA(Oper 0 27 12 0 0){
|
||||
DA(ctlVal 0 0 12 0 0);
|
||||
DA(origin 0 27 12 0 0){
|
||||
DA(orCat 0 12 12 0 0);
|
||||
DA(orIdent 0 13 12 0 0);
|
||||
}
|
||||
DA(ctlNum 0 6 12 0 0);
|
||||
DA(T 0 22 12 0 0);
|
||||
DA(Test 0 0 12 0 0);
|
||||
DA(Check 0 24 12 0 0);
|
||||
}
|
||||
DA(Cancel 0 27 12 0 0){
|
||||
DA(ctlVal 0 0 12 0 0);
|
||||
DA(origin 0 27 12 0 0){
|
||||
DA(orCat 0 12 12 0 0);
|
||||
DA(orIdent 0 13 12 0 0);
|
||||
}
|
||||
DA(ctlNum 0 6 12 0 0);
|
||||
DA(T 0 22 12 0 0);
|
||||
DA(Test 0 0 12 0 0);
|
||||
}
|
||||
DA(stVal 0 0 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
DA(ctlModel 0 12 4 0 0)=2;
|
||||
DA(sboClass 0 12 4 0 0);
|
||||
}
|
||||
DO(SPCSO3 0){
|
||||
DA(Oper 0 27 12 0 0){
|
||||
DA(ctlVal 0 0 12 0 0);
|
||||
DA(origin 0 27 12 0 0){
|
||||
DA(orCat 0 12 12 0 0);
|
||||
DA(orIdent 0 13 12 0 0);
|
||||
}
|
||||
DA(ctlNum 0 6 12 0 0);
|
||||
DA(T 0 22 12 0 0);
|
||||
DA(Test 0 0 12 0 0);
|
||||
DA(Check 0 24 12 0 0);
|
||||
}
|
||||
DA(Cancel 0 27 12 0 0){
|
||||
DA(ctlVal 0 0 12 0 0);
|
||||
DA(origin 0 27 12 0 0){
|
||||
DA(orCat 0 12 12 0 0);
|
||||
DA(orIdent 0 13 12 0 0);
|
||||
}
|
||||
DA(ctlNum 0 6 12 0 0);
|
||||
DA(T 0 22 12 0 0);
|
||||
DA(Test 0 0 12 0 0);
|
||||
}
|
||||
DA(stVal 0 0 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
DA(ctlModel 0 12 4 0 0)=3;
|
||||
}
|
||||
DO(SPCSO4 0){
|
||||
DA(SBOw 0 27 12 0 0){
|
||||
DA(ctlVal 0 0 12 0 0);
|
||||
DA(origin 0 27 12 0 0){
|
||||
DA(orCat 0 12 12 0 0);
|
||||
DA(orIdent 0 13 12 0 0);
|
||||
}
|
||||
DA(ctlNum 0 6 12 0 0);
|
||||
DA(T 0 22 12 0 0);
|
||||
DA(Test 0 0 12 0 0);
|
||||
DA(Check 0 24 12 0 0);
|
||||
}
|
||||
DA(Oper 0 27 12 0 0){
|
||||
DA(ctlVal 0 0 12 0 0);
|
||||
DA(origin 0 27 12 0 0){
|
||||
DA(orCat 0 12 12 0 0);
|
||||
DA(orIdent 0 13 12 0 0);
|
||||
}
|
||||
DA(ctlNum 0 6 12 0 0);
|
||||
DA(T 0 22 12 0 0);
|
||||
DA(Test 0 0 12 0 0);
|
||||
DA(Check 0 24 12 0 0);
|
||||
}
|
||||
DA(Cancel 0 27 12 0 0){
|
||||
DA(ctlVal 0 0 12 0 0);
|
||||
DA(origin 0 27 12 0 0){
|
||||
DA(orCat 0 12 12 0 0);
|
||||
DA(orIdent 0 13 12 0 0);
|
||||
}
|
||||
DA(ctlNum 0 6 12 0 0);
|
||||
DA(T 0 22 12 0 0);
|
||||
DA(Test 0 0 12 0 0);
|
||||
}
|
||||
DA(stVal 0 0 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
DA(ctlModel 0 12 4 0 0)=4;
|
||||
}
|
||||
DO(SPCSO5 0){
|
||||
DA(Oper 0 27 12 0 0){
|
||||
DA(ctlVal 0 0 12 0 0);
|
||||
DA(operTm 0 22 12 0 0);
|
||||
DA(origin 0 27 12 0 0){
|
||||
DA(orCat 0 12 12 0 0);
|
||||
DA(orIdent 0 13 12 0 0);
|
||||
}
|
||||
DA(ctlNum 0 6 12 0 0);
|
||||
DA(T 0 22 12 0 0);
|
||||
DA(Test 0 0 12 0 0);
|
||||
DA(Check 0 24 12 0 0);
|
||||
}
|
||||
DA(stVal 0 0 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
DA(ctlModel 0 12 4 0 0)=1;
|
||||
DA(Cancel 0 27 12 0 0){
|
||||
DA(ctlVal 0 0 12 0 0);
|
||||
DA(origin 0 27 12 0 0){
|
||||
DA(orCat 0 12 12 0 0);
|
||||
DA(orIdent 0 13 12 0 0);
|
||||
}
|
||||
DA(ctlNum 0 6 12 0 0);
|
||||
DA(T 0 22 12 0 0);
|
||||
DA(Test 0 0 12 0 0);
|
||||
}
|
||||
}
|
||||
DO(SPCSO6 0){
|
||||
DA(SBO 0 17 12 0 0);
|
||||
DA(Oper 0 27 12 0 0){
|
||||
DA(ctlVal 0 0 12 0 0);
|
||||
DA(operTm 0 22 12 0 0);
|
||||
DA(origin 0 27 12 0 0){
|
||||
DA(orCat 0 12 12 0 0);
|
||||
DA(orIdent 0 13 12 0 0);
|
||||
}
|
||||
DA(ctlNum 0 6 12 0 0);
|
||||
DA(T 0 22 12 0 0);
|
||||
DA(Test 0 0 12 0 0);
|
||||
DA(Check 0 24 12 0 0);
|
||||
}
|
||||
DA(Cancel 0 27 12 0 0){
|
||||
DA(ctlVal 0 0 12 0 0);
|
||||
DA(operTm 0 22 12 0 0);
|
||||
DA(origin 0 27 12 0 0){
|
||||
DA(orCat 0 12 12 0 0);
|
||||
DA(orIdent 0 13 12 0 0);
|
||||
}
|
||||
DA(ctlNum 0 6 12 0 0);
|
||||
DA(T 0 22 12 0 0);
|
||||
DA(Test 0 0 12 0 0);
|
||||
}
|
||||
DA(stVal 0 0 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
DA(ctlModel 0 12 4 0 0)=2;
|
||||
}
|
||||
DO(SPCSO7 0){
|
||||
DA(Oper 0 27 12 0 0){
|
||||
DA(ctlVal 0 0 12 0 0);
|
||||
DA(operTm 0 22 12 0 0);
|
||||
DA(origin 0 27 12 0 0){
|
||||
DA(orCat 0 12 12 0 0);
|
||||
DA(orIdent 0 13 12 0 0);
|
||||
}
|
||||
DA(ctlNum 0 6 12 0 0);
|
||||
DA(T 0 22 12 0 0);
|
||||
DA(Test 0 0 12 0 0);
|
||||
DA(Check 0 24 12 0 0);
|
||||
}
|
||||
DA(Cancel 0 27 12 0 0){
|
||||
DA(ctlVal 0 0 12 0 0);
|
||||
DA(operTm 0 22 12 0 0);
|
||||
DA(origin 0 27 12 0 0){
|
||||
DA(orCat 0 12 12 0 0);
|
||||
DA(orIdent 0 13 12 0 0);
|
||||
}
|
||||
DA(ctlNum 0 6 12 0 0);
|
||||
DA(T 0 22 12 0 0);
|
||||
DA(Test 0 0 12 0 0);
|
||||
}
|
||||
DA(stVal 0 0 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
DA(ctlModel 0 12 4 0 0)=3;
|
||||
}
|
||||
DO(SPCSO8 0){
|
||||
DA(SBOw 0 27 12 0 0){
|
||||
DA(ctlVal 0 0 12 0 0);
|
||||
DA(operTm 0 22 12 0 0);
|
||||
DA(origin 0 27 12 0 0){
|
||||
DA(orCat 0 12 12 0 0);
|
||||
DA(orIdent 0 13 12 0 0);
|
||||
}
|
||||
DA(ctlNum 0 6 12 0 0);
|
||||
DA(T 0 22 12 0 0);
|
||||
DA(Test 0 0 12 0 0);
|
||||
DA(Check 0 24 12 0 0);
|
||||
}
|
||||
DA(Oper 0 27 12 0 0){
|
||||
DA(ctlVal 0 0 12 0 0);
|
||||
DA(operTm 0 22 12 0 0);
|
||||
DA(origin 0 27 12 0 0){
|
||||
DA(orCat 0 12 12 0 0);
|
||||
DA(orIdent 0 13 12 0 0);
|
||||
}
|
||||
DA(ctlNum 0 6 12 0 0);
|
||||
DA(T 0 22 12 0 0);
|
||||
DA(Test 0 0 12 0 0);
|
||||
DA(Check 0 24 12 0 0);
|
||||
}
|
||||
DA(Cancel 0 27 12 0 0){
|
||||
DA(ctlVal 0 0 12 0 0);
|
||||
DA(operTm 0 22 12 0 0);
|
||||
DA(origin 0 27 12 0 0){
|
||||
DA(orCat 0 12 12 0 0);
|
||||
DA(orIdent 0 13 12 0 0);
|
||||
}
|
||||
DA(ctlNum 0 6 12 0 0);
|
||||
DA(T 0 22 12 0 0);
|
||||
DA(Test 0 0 12 0 0);
|
||||
}
|
||||
DA(origin 0 27 0 0 0){
|
||||
DA(orCat 0 12 0 0 0);
|
||||
DA(orIdent 0 13 0 0 0);
|
||||
}
|
||||
DA(ctlNum 0 6 0 0 0);
|
||||
DA(stVal 0 0 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
DA(ctlModel 0 12 4 0 0)=4;
|
||||
}
|
||||
DO(Ind1 0){
|
||||
DA(stVal 0 0 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
}
|
||||
DO(Ind2 0){
|
||||
DA(stVal 0 0 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
}
|
||||
DO(Ind3 0){
|
||||
DA(stVal 0 0 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
}
|
||||
DO(Ind4 0){
|
||||
DA(stVal 0 0 0 1 0);
|
||||
DA(q 0 23 0 2 0);
|
||||
DA(t 0 22 0 0 0);
|
||||
}
|
||||
DO(SchdAbsTm 0){
|
||||
DA(val 24 10 2 1 0);
|
||||
}
|
||||
}
|
||||
LN(MHAI1){
|
||||
DO(HA 0){
|
||||
DO(phsAHar 16){
|
||||
DA(cVal 0 27 1 5 0){
|
||||
DA(mag 0 27 1 5 0){
|
||||
DA(f 0 10 1 5 0);
|
||||
}
|
||||
DA(ang 0 27 1 5 0){
|
||||
DA(f 0 10 1 5 0);
|
||||
}
|
||||
}
|
||||
DA(q 0 23 1 2 0);
|
||||
DA(t 0 22 1 0 0);
|
||||
}
|
||||
DA(numHar 0 7 4 1 0)=16;
|
||||
DA(numCyc 0 7 4 1 0);
|
||||
DA(evalTm 0 7 4 1 0);
|
||||
DA(frequency 0 10 4 1 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,430 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<SCL xmlns="http://www.iec.ch/61850/2003/SCL">
|
||||
<Header id="" version="4.0.2" revision="" toolID="" nameStructure="IEDName">
|
||||
</Header>
|
||||
<Communication>
|
||||
<SubNetwork name="subnetwork1" type="8-MMS">
|
||||
<Text>Station bus</Text>
|
||||
<BitRate unit="b/s">10</BitRate>
|
||||
<ConnectedAP iedName="simpleIO" apName="accessPoint1">
|
||||
<Address>
|
||||
<P type="IP">10.0.0.2</P>
|
||||
<P type="IP-SUBNET">255.255.255.0</P>
|
||||
<P type="IP-GATEWAY">10.0.0.1</P>
|
||||
<P type="OSI-TSEL">0001</P>
|
||||
<P type="OSI-PSEL">00000001</P>
|
||||
<P type="OSI-SSEL">0001</P>
|
||||
</Address>
|
||||
<GSE ldInst="GenericIO" cbName="gcbEvents">
|
||||
<Address>
|
||||
<P type="VLAN-ID">1</P>
|
||||
<P type="VLAN-PRIORITY">4</P>
|
||||
<P type="MAC-Address">01-0c-cd-01-00-01</P>
|
||||
<P type="APPID">1000</P>
|
||||
</Address>
|
||||
<MinTime>1000</MinTime>
|
||||
<MaxTime>3000</MaxTime>
|
||||
</GSE>
|
||||
</ConnectedAP>
|
||||
</SubNetwork>
|
||||
</Communication>
|
||||
<IED name="simpleIO">
|
||||
<Services>
|
||||
<DynAssociation />
|
||||
<GetDirectory />
|
||||
<GetDataObjectDefinition />
|
||||
<GetDataSetValue />
|
||||
<DataSetDirectory />
|
||||
<ReadWrite />
|
||||
<GetCBValues />
|
||||
<ConfLNs fixPrefix="true" fixLnInst="true" />
|
||||
<GOOSE max="5" />
|
||||
<GSSE max="5" />
|
||||
<FileHandling />
|
||||
<GSEDir />
|
||||
<TimerActivatedControl />
|
||||
</Services>
|
||||
<AccessPoint name="accessPoint1">
|
||||
<Server>
|
||||
<Authentication />
|
||||
<LDevice inst="GenericIO">
|
||||
<LN0 lnClass="LLN0" lnType="LLN01" inst="">
|
||||
|
||||
<DataSet name="Events" desc="Events">
|
||||
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="ST" lnInst="1" doName="SPCSO1" daName="stVal" />
|
||||
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="ST" lnInst="1" doName="SPCSO2" daName="stVal" />
|
||||
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="ST" lnInst="1" doName="SPCSO3" daName="stVal" />
|
||||
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="ST" lnInst="1" doName="SPCSO4" daName="stVal" />
|
||||
</DataSet>
|
||||
|
||||
<DataSet name="EventsFCDO" desc="EventsFCDO">
|
||||
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="ST" lnInst="1" doName="SPCSO1"/>
|
||||
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="ST" lnInst="1" doName="SPCSO2"/>
|
||||
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="ST" lnInst="1" doName="SPCSO3"/>
|
||||
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="ST" lnInst="1" doName="SPCSO4"/>
|
||||
</DataSet>
|
||||
|
||||
<DataSet name="Booleans" desc="Booleans">
|
||||
<FCDA ldInst="GenericIO" lnClass="LLN0" fc="SP" doName="SetBool1" daName="setVal" />
|
||||
<FCDA ldInst="GenericIO" lnClass="LLN0" fc="SP" doName="SetBool2" daName="setVal" />
|
||||
<FCDA ldInst="GenericIO" lnClass="LLN0" fc="SP" doName="SetBool3" daName="setVal" />
|
||||
<FCDA ldInst="GenericIO" lnClass="LLN0" fc="SP" doName="SetBool4" daName="setVal" />
|
||||
</DataSet>
|
||||
|
||||
<DataSet name="Integers" desc="Integers">
|
||||
<FCDA ldInst="GenericIO" lnClass="LLN0" fc="SP" lnInst="1" doName="SetInt1" daName="setVal" />
|
||||
<FCDA ldInst="GenericIO" lnClass="LLN0" fc="SP" lnInst="1" doName="SetInt2" daName="setVal" />
|
||||
<FCDA ldInst="GenericIO" lnClass="LLN0" fc="SP" lnInst="1" doName="SetInt3" daName="setVal" />
|
||||
<FCDA ldInst="GenericIO" lnClass="LLN0" fc="SP" lnInst="1" doName="SetInt4" daName="setVal" />
|
||||
</DataSet>
|
||||
|
||||
<ReportControl name="EventsRCB" confRev="1" datSet="Events" rptID="Events1" buffered="false" intgPd="1000" bufTime="50" indexed="true">
|
||||
<TrgOps period="true" />
|
||||
<OptFields seqNum="true" timeStamp="true" dataSet="true" reasonCode="true" entryID="true" configRef="true" />
|
||||
<RptEnabled max="2" />
|
||||
</ReportControl>
|
||||
|
||||
<ReportControl name="BufferedRCB" confRev="1" datSet="Events" rptID="Events1" buffered="true" intgPd="1000" bufTime="50" indexed="true">
|
||||
<TrgOps period="true" />
|
||||
<OptFields seqNum="true" timeStamp="true" dataSet="true" reasonCode="true" entryID="true" configRef="true" />
|
||||
<RptEnabled max="2" />
|
||||
</ReportControl>
|
||||
|
||||
|
||||
<GSEControl appID="events" name="gcbEvents" type="GOOSE" datSet="Events" confRev="1"/>
|
||||
|
||||
<DOI name="Mod">
|
||||
<DAI name="ctlModel">
|
||||
<Val>status-only</Val>
|
||||
</DAI>
|
||||
</DOI>
|
||||
</LN0>
|
||||
<LN lnClass="LPHD" lnType="LPHD1" inst="1" prefix="" />
|
||||
<LN lnClass="GGIO" lnType="GGIO1" inst="1" prefix="">
|
||||
<DOI name="Mod">
|
||||
<DAI name="ctlModel">
|
||||
<Val>status-only</Val>
|
||||
</DAI>
|
||||
</DOI>
|
||||
<DOI name="SPCSO1">
|
||||
<DAI name="ctlModel">
|
||||
<Val>direct-with-normal-security</Val>
|
||||
</DAI>
|
||||
</DOI>
|
||||
<DOI name="SPCSO2">
|
||||
<DAI name="ctlModel">
|
||||
<Val>sbo-with-normal-security</Val>
|
||||
</DAI>
|
||||
</DOI>
|
||||
<DOI name="SPCSO3">
|
||||
<DAI name="ctlModel">
|
||||
<Val>direct-with-enhanced-security</Val>
|
||||
</DAI>
|
||||
</DOI>
|
||||
<DOI name="SPCSO4">
|
||||
<DAI name="ctlModel">
|
||||
<Val>sbo-with-enhanced-security</Val>
|
||||
</DAI>
|
||||
</DOI>
|
||||
<DOI name="SPCSO5">
|
||||
<DAI name="ctlModel">
|
||||
<Val>direct-with-normal-security</Val>
|
||||
</DAI>
|
||||
</DOI>
|
||||
<DOI name="SPCSO6">
|
||||
<DAI name="ctlModel">
|
||||
<Val>sbo-with-normal-security</Val>
|
||||
</DAI>
|
||||
</DOI>
|
||||
<DOI name="SPCSO7">
|
||||
<DAI name="ctlModel">
|
||||
<Val>direct-with-enhanced-security</Val>
|
||||
</DAI>
|
||||
</DOI>
|
||||
<DOI name="SPCSO8">
|
||||
<DAI name="ctlModel">
|
||||
<Val>sbo-with-enhanced-security</Val>
|
||||
</DAI>
|
||||
</DOI>
|
||||
</LN>
|
||||
<LN lnClass="MHAI" lnType="MHAI1" inst="1" prefix="">
|
||||
<DOI name="HA">
|
||||
<DAI name="numHar">
|
||||
<Val>16</Val>
|
||||
</DAI>
|
||||
</DOI>
|
||||
</LN>
|
||||
</LDevice>
|
||||
</Server>
|
||||
</AccessPoint>
|
||||
</IED>
|
||||
<DataTypeTemplates>
|
||||
<LNodeType id="LLN01" lnClass="LLN0">
|
||||
<DO name="Mod" type="INC_1_Mod" />
|
||||
<DO name="Beh" type="INS_1_Beh" />
|
||||
<DO name="Health" type="INS_1_Beh" />
|
||||
<DO name="NamPlt" type="LPL_1_NamPlt" />
|
||||
<DO name="SetInt1" type="ISP" />
|
||||
<DO name="SetInt2" type="ISP" />
|
||||
<DO name="SetInt3" type="ISP" />
|
||||
<DO name="SetInt4" type="ISP" />
|
||||
<DO name="SetBool1" type="SPG_1" />
|
||||
<DO name="SetBool2" type="SPG_1" />
|
||||
<DO name="SetBool3" type="SPG_1" />
|
||||
<DO name="SetBool4" type="SPG_1" />
|
||||
<DO name="Int64" type="INS_64" />
|
||||
<DO name="SetAnVal" type="ASG" />
|
||||
</LNodeType>
|
||||
<LNodeType id="LPHD1" lnClass="LPHD">
|
||||
<DO name="PhyNam" type="DPL_1_PhyNam" />
|
||||
<DO name="PhyHealth" type="INS_1_Beh" />
|
||||
<DO name="Proxy" type="SPS_1_Proxy" />
|
||||
</LNodeType>
|
||||
<LNodeType id="GGIO1" lnClass="GGIO">
|
||||
<DO name="Mod" type="INC_1_Mod" />
|
||||
<DO name="Beh" type="INS_1_Beh" />
|
||||
<DO name="Health" type="INS_1_Beh" />
|
||||
<DO name="NamPlt" type="LPL_2_NamPlt" />
|
||||
<DO name="AnIn1" type="MV_1_AnIn1" />
|
||||
<DO name="AnIn2" type="MV_1_AnIn1" />
|
||||
<DO name="AnIn3" type="MV_1_AnIn1" />
|
||||
<DO name="AnIn4" type="MV_1_AnIn1" />
|
||||
<DO name="SPCSO1" type="SPC_1_SPCSO1" />
|
||||
<DO name="SPCSO2" type="SPC_1_SPCSO2" />
|
||||
<DO name="SPCSO3" type="SPC_1_SPCSO3" />
|
||||
<DO name="SPCSO4" type="SPC_1_SPCSO4" />
|
||||
<DO name="SPCSO5" type="SPC_1_SPCSO5" />
|
||||
<DO name="SPCSO6" type="SPC_1_SPCSO6" />
|
||||
<DO name="SPCSO7" type="SPC_1_SPCSO7" />
|
||||
<DO name="SPCSO8" type="SPC_1_SPCSO8" />
|
||||
<DO name="Ind1" type="SPS_1_Proxy" />
|
||||
<DO name="Ind2" type="SPS_1_Proxy" />
|
||||
<DO name="Ind3" type="SPS_1_Proxy" />
|
||||
<DO name="Ind4" type="SPS_1_Proxy" />
|
||||
<DO name="SchdAbsTm" type="SCA_1_SchdAbsTm" />
|
||||
</LNodeType>
|
||||
|
||||
<LNodeType id="MHAI1" lnClass="MHAI">
|
||||
<DO name="HA" type="HWYE_1_HA" />
|
||||
</LNodeType>
|
||||
|
||||
<DOType id="SPG_1" cdc="SPG">
|
||||
|
||||
<DA name="setVal" bType="BOOLEAN" fc="SP" dchg="true" />
|
||||
</DOType>
|
||||
|
||||
<DOType id="ASG" cdc="ASG">
|
||||
<DA name="setMag" bType="Struct" type="AnalogueValue" fc="SP" dchg="true" />
|
||||
</DOType>
|
||||
|
||||
<DOType id="ISP" cdc="INS">
|
||||
<DA name="setVal" bType="INT32" fc="SP" dchg="true" />
|
||||
</DOType>
|
||||
|
||||
<DOType id="HWYE_1_HA" cdc="HWYE">
|
||||
<SDO name="phsAHar" type="CMV_1_phsAHar" count="16" />
|
||||
<DA name="numHar" bType="INT16U" fc="CF" dchg="true" />
|
||||
<DA name="numCyc" bType="INT16U" fc="CF" dchg="true" />
|
||||
<DA name="evalTm" bType="INT16U" fc="CF" dchg="true" />
|
||||
<DA name="frequency" bType="FLOAT32" fc="CF" dchg="true" />
|
||||
</DOType>
|
||||
|
||||
<DOType id="SCA_1_SchdAbsTm" cdc="SCA">
|
||||
<DA name="val" bType="FLOAT32" count="24" fc="SP" dchg="true" />
|
||||
</DOType>
|
||||
|
||||
|
||||
<DOType id="CMV_1_phsAHar" cdc="CMV">
|
||||
<DA name="cVal" bType="Struct" type="Vector" fc="MX" dchg="true" dupd="true" />
|
||||
<DA name="q" bType="Quality" fc="MX" qchg="true" />
|
||||
<DA name="t" bType="Timestamp" fc="MX" />
|
||||
</DOType>
|
||||
|
||||
<DAType id="Vector">
|
||||
<BDA name="mag" bType="Struct" type="AnalogueValue" /> <!-- M -->
|
||||
<BDA name="ang" bType="Struct" type="AnalogueValue" /> <!-- O -->
|
||||
</DAType>
|
||||
|
||||
<DOType id="INC_1_Mod" cdc="INC">
|
||||
<DA name="q" bType="Quality" fc="ST" qchg="true" />
|
||||
<DA name="t" bType="Timestamp" fc="ST" />
|
||||
<DA name="ctlModel" type="CtlModels" bType="Enum" fc="CF" />
|
||||
</DOType>
|
||||
<DOType id="INS_1_Beh" cdc="INS">
|
||||
<DA name="stVal" bType="INT32" fc="ST" dchg="true" />
|
||||
<DA name="q" bType="Quality" fc="ST" qchg="true" />
|
||||
<DA name="t" bType="Timestamp" fc="ST" />
|
||||
</DOType>
|
||||
|
||||
<DOType id="INS_64" cdc="INS">
|
||||
<DA name="stVal" bType="INT64" fc="ST" dchg="true" />
|
||||
<DA name="q" bType="Quality" fc="ST" qchg="true" />
|
||||
<DA name="t" bType="Timestamp" fc="ST" />
|
||||
</DOType>
|
||||
|
||||
<DOType id="LPL_1_NamPlt" cdc="LPL">
|
||||
<DA name="vendor" bType="VisString255" fc="DC" />
|
||||
<DA name="swRev" bType="VisString255" fc="DC" />
|
||||
<DA name="d" bType="VisString255" fc="DC" />
|
||||
<DA name="configRev" bType="VisString255" fc="DC" />
|
||||
<DA name="ldNs" bType="VisString255" fc="EX" />
|
||||
</DOType>
|
||||
<DOType id="DPL_1_PhyNam" cdc="DPL">
|
||||
<DA name="vendor" bType="VisString255" fc="DC" />
|
||||
</DOType>
|
||||
<DOType id="SPS_1_Proxy" cdc="SPS">
|
||||
<DA name="stVal" bType="BOOLEAN" fc="ST" dchg="true" />
|
||||
<DA name="q" bType="Quality" fc="ST" qchg="true" />
|
||||
<DA name="t" bType="Timestamp" fc="ST" />
|
||||
</DOType>
|
||||
<DOType id="SPC_1_SPCSO8" cdc="SPC">
|
||||
<DA name="SBOw" type="SPCOperate_5" bType="Struct" fc="CO" />
|
||||
<DA name="Oper" type="SPCOperate_5" bType="Struct" fc="CO" />
|
||||
<DA name="Cancel" type="SPCCancel_5" bType="Struct" fc="CO" />
|
||||
<DA name="origin" type="Originator_1" bType="Struct" fc="ST" />
|
||||
<DA name="ctlNum" bType="INT8U" fc="ST" />
|
||||
<DA name="stVal" bType="BOOLEAN" fc="ST" dchg="true" />
|
||||
<DA name="q" bType="Quality" fc="ST" qchg="true" />
|
||||
<DA name="t" bType="Timestamp" fc="ST" />
|
||||
<DA name="ctlModel" type="CtlModels" bType="Enum" fc="CF" />
|
||||
</DOType>
|
||||
<DOType id="SPC_1_SPCSO7" cdc="SPC">
|
||||
<DA name="Oper" type="SPCOperate_5" bType="Struct" fc="CO" />
|
||||
<DA name="Cancel" type="SPCCancel_5" bType="Struct" fc="CO" />
|
||||
<DA name="stVal" bType="BOOLEAN" fc="ST" dchg="true" />
|
||||
<DA name="q" bType="Quality" fc="ST" qchg="true" />
|
||||
<DA name="t" bType="Timestamp" fc="ST" />
|
||||
<DA name="ctlModel" type="CtlModels" bType="Enum" fc="CF" />
|
||||
</DOType>
|
||||
<DOType id="SPC_1_SPCSO3" cdc="SPC">
|
||||
<DA name="Oper" type="SPCOperate_1" bType="Struct" fc="CO" />
|
||||
<DA name="Cancel" type="SPCCancel_1" bType="Struct" fc="CO" />
|
||||
<DA name="stVal" bType="BOOLEAN" fc="ST" dchg="true" />
|
||||
<DA name="q" bType="Quality" fc="ST" qchg="true" />
|
||||
<DA name="t" bType="Timestamp" fc="ST" />
|
||||
<DA name="ctlModel" type="CtlModels" bType="Enum" fc="CF" />
|
||||
</DOType>
|
||||
<DOType id="MV_1_AnIn1" cdc="MV">
|
||||
<DA name="mag" type="" bType="Struct" fc="MX" dchg="true" />
|
||||
<DA name="q" bType="Quality" fc="MX" qchg="true" />
|
||||
<DA name="t" bType="Timestamp" fc="MX" />
|
||||
</DOType>
|
||||
<DOType id="SPC_1_SPCSO6" cdc="SPC">
|
||||
<DA name="SBO" bType="VisString64" fc="CO" />
|
||||
<DA name="Oper" type="SPCOperate_5" bType="Struct" fc="CO" />
|
||||
<DA name="Cancel" type="SPCCancel_5" bType="Struct" fc="CO" />
|
||||
<DA name="stVal" bType="BOOLEAN" fc="ST" dchg="true" />
|
||||
<DA name="q" bType="Quality" fc="ST" qchg="true" />
|
||||
<DA name="t" bType="Timestamp" fc="ST" />
|
||||
<DA name="ctlModel" type="CtlModels" bType="Enum" fc="CF" />
|
||||
</DOType>
|
||||
<DOType id="SPC_1_SPCSO5" cdc="SPC">
|
||||
<DA name="Oper" type="SPCOperate_5" bType="Struct" fc="CO" />
|
||||
<DA name="stVal" bType="BOOLEAN" fc="ST" dchg="true" />
|
||||
<DA name="q" bType="Quality" fc="ST" qchg="true" />
|
||||
<DA name="t" bType="Timestamp" fc="ST" />
|
||||
<DA name="ctlModel" type="CtlModels" bType="Enum" fc="CF" />
|
||||
<DA name="Cancel" type="SPCCancel_1" bType="Struct" fc="CO" />
|
||||
</DOType>
|
||||
<DOType id="SPC_1_SPCSO4" cdc="SPC">
|
||||
<DA name="SBOw" type="SPCOperate_1" bType="Struct" fc="CO" />
|
||||
<DA name="Oper" type="SPCOperate_1" bType="Struct" fc="CO" />
|
||||
<DA name="Cancel" type="SPCCancel_1" bType="Struct" fc="CO" />
|
||||
<DA name="stVal" bType="BOOLEAN" fc="ST" dchg="true" />
|
||||
<DA name="q" bType="Quality" fc="ST" qchg="true" />
|
||||
<DA name="t" bType="Timestamp" fc="ST" />
|
||||
<DA name="ctlModel" type="CtlModels" bType="Enum" fc="CF" />
|
||||
</DOType>
|
||||
<DOType id="LPL_2_NamPlt" cdc="LPL">
|
||||
<DA name="vendor" bType="VisString255" fc="DC" />
|
||||
<DA name="swRev" bType="VisString255" fc="DC" />
|
||||
<DA name="d" bType="VisString255" fc="DC" />
|
||||
<DA name="dU" fc="DC" bType="Unicode255"/>
|
||||
</DOType>
|
||||
<DOType id="SPC_1_SPCSO2" cdc="SPC">
|
||||
<DA name="SBO" bType="VisString64" fc="CO" />
|
||||
<DA name="Oper" type="SPCOperate_1" bType="Struct" fc="CO" />
|
||||
<DA name="Cancel" type="SPCCancel_1" bType="Struct" fc="CO" />
|
||||
<DA name="stVal" bType="BOOLEAN" fc="ST" dchg="true" />
|
||||
<DA name="q" bType="Quality" fc="ST" qchg="true" />
|
||||
<DA name="t" bType="Timestamp" fc="ST" />
|
||||
<DA name="ctlModel" type="CtlModels" bType="Enum" fc="CF" />
|
||||
<DA name="sboClass" type="SboClasses" bType="Enum" fc="CF" />
|
||||
</DOType>
|
||||
<DOType id="SPC_1_SPCSO1" cdc="SPC">
|
||||
<DA name="Oper" type="SPCOperate_1" bType="Struct" fc="CO" />
|
||||
<DA name="stVal" bType="BOOLEAN" fc="ST" dchg="true" />
|
||||
<DA name="q" bType="Quality" fc="ST" qchg="true" />
|
||||
<DA name="t" bType="Timestamp" fc="ST" />
|
||||
<DA name="ctlModel" type="CtlModels" bType="Enum" fc="CF" />
|
||||
</DOType>
|
||||
<DAType id="SPCOperate_1">
|
||||
<BDA name="ctlVal" bType="BOOLEAN" />
|
||||
<BDA name="origin" type="Originator_1" bType="Struct" />
|
||||
<BDA name="ctlNum" bType="INT8U" />
|
||||
<BDA name="T" bType="Timestamp" />
|
||||
<BDA name="Test" bType="BOOLEAN" />
|
||||
<BDA name="Check" bType="Check" />
|
||||
</DAType>
|
||||
<DAType id="Originator_1">
|
||||
<BDA name="orCat" type="OrCat" bType="Enum" />
|
||||
<BDA name="orIdent" bType="Octet64" />
|
||||
</DAType>
|
||||
<DAType id="SPCOperate_5">
|
||||
<BDA name="ctlVal" bType="BOOLEAN" />
|
||||
<BDA name="operTm" bType="Timestamp" />
|
||||
<BDA name="origin" type="Originator_1" bType="Struct" />
|
||||
<BDA name="ctlNum" bType="INT8U" />
|
||||
<BDA name="T" bType="Timestamp" />
|
||||
<BDA name="Test" bType="BOOLEAN" />
|
||||
<BDA name="Check" bType="Check" />
|
||||
</DAType>
|
||||
<DAType id="">
|
||||
<BDA name="f" bType="FLOAT32" />
|
||||
</DAType>
|
||||
<DAType id="SPCCancel_1">
|
||||
<BDA name="ctlVal" bType="BOOLEAN" />
|
||||
<BDA name="origin" type="Originator_1" bType="Struct" />
|
||||
<BDA name="ctlNum" bType="INT8U" />
|
||||
<BDA name="T" bType="Timestamp" />
|
||||
<BDA name="Test" bType="BOOLEAN" />
|
||||
</DAType>
|
||||
<DAType id="SPCCancel_5">
|
||||
<BDA name="ctlVal" bType="BOOLEAN" />
|
||||
<BDA name="operTm" bType="Timestamp" />
|
||||
<BDA name="origin" type="Originator_1" bType="Struct" />
|
||||
<BDA name="ctlNum" bType="INT8U" />
|
||||
<BDA name="T" bType="Timestamp" />
|
||||
<BDA name="Test" bType="BOOLEAN" />
|
||||
</DAType>
|
||||
|
||||
<DAType id="AnalogueValue"><!-- sec 6.3 -->
|
||||
<!--<BDA name="i" bType="INT32" /> --><!-- GC_1 -->
|
||||
<BDA name="f" bType="FLOAT32" /><!-- GC_1 -->
|
||||
</DAType>
|
||||
|
||||
|
||||
<EnumType id="CtlModels">
|
||||
<EnumVal ord="0">status-only</EnumVal>
|
||||
<EnumVal ord="1">direct-with-normal-security</EnumVal>
|
||||
<EnumVal ord="2">sbo-with-normal-security</EnumVal>
|
||||
<EnumVal ord="3">direct-with-enhanced-security</EnumVal>
|
||||
<EnumVal ord="4">sbo-with-enhanced-security</EnumVal>
|
||||
</EnumType>
|
||||
<EnumType id="SboClasses">
|
||||
<EnumVal ord="0">operate-once</EnumVal>
|
||||
<EnumVal ord="1">operate-many</EnumVal>
|
||||
</EnumType>
|
||||
<EnumType id="OrCat">
|
||||
<EnumVal ord="0">not-supported</EnumVal>
|
||||
<EnumVal ord="1">bay-control</EnumVal>
|
||||
<EnumVal ord="2">station-control</EnumVal>
|
||||
<EnumVal ord="3">remote-control</EnumVal>
|
||||
<EnumVal ord="4">automatic-bay</EnumVal>
|
||||
<EnumVal ord="5">automatic-station</EnumVal>
|
||||
<EnumVal ord="6">automatic-remote</EnumVal>
|
||||
<EnumVal ord="7">maintenance</EnumVal>
|
||||
<EnumVal ord="8">process</EnumVal>
|
||||
</EnumType>
|
||||
</DataTypeTemplates>
|
||||
</SCL>
|
@ -1,21 +0,0 @@
|
||||
|
||||
set(goose_observer_SRCS
|
||||
goose_observer.c
|
||||
)
|
||||
|
||||
IF(MSVC)
|
||||
|
||||
set_source_files_properties(${goose_observer_SRCS}
|
||||
PROPERTIES LANGUAGE CXX)
|
||||
|
||||
ENDIF(MSVC)
|
||||
|
||||
add_executable(goose_observer
|
||||
${goose_observer_SRCS}
|
||||
)
|
||||
|
||||
target_link_libraries(goose_observer
|
||||
iec61850
|
||||
)
|
||||
|
||||
|
@ -1,17 +0,0 @@
|
||||
LIBIEC_HOME=../..
|
||||
|
||||
PROJECT_BINARY_NAME = goose_observer
|
||||
PROJECT_SOURCES = goose_observer.c
|
||||
|
||||
include $(LIBIEC_HOME)/make/target_system.mk
|
||||
include $(LIBIEC_HOME)/make/stack_includes.mk
|
||||
|
||||
all: $(PROJECT_BINARY_NAME)
|
||||
|
||||
include $(LIBIEC_HOME)/make/common_targets.mk
|
||||
|
||||
$(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME)
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS)
|
||||
|
||||
clean:
|
||||
rm -f $(PROJECT_BINARY_NAME)
|
@ -1,101 +0,0 @@
|
||||
/*
|
||||
* goose_observer.c
|
||||
*
|
||||
* This is an example for generic GOOSE observer
|
||||
*
|
||||
* Has to be started as root in Linux.
|
||||
*/
|
||||
|
||||
#include "goose_receiver.h"
|
||||
#include "goose_subscriber.h"
|
||||
#include "hal_thread.h"
|
||||
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static int running = 1;
|
||||
|
||||
void sigint_handler(int signalId)
|
||||
{
|
||||
running = 0;
|
||||
}
|
||||
|
||||
void
|
||||
gooseListener(GooseSubscriber subscriber, void* parameter)
|
||||
{
|
||||
printf("GOOSE event:\n");
|
||||
printf(" vlanTag: %s\n", GooseSubscriber_isVlanSet(subscriber) ? "found" : "NOT found");
|
||||
if (GooseSubscriber_isVlanSet(subscriber))
|
||||
{
|
||||
printf(" vlanId: %u\n", GooseSubscriber_getVlanId(subscriber));
|
||||
printf(" vlanPrio: %u\n", GooseSubscriber_getVlanPrio(subscriber));
|
||||
}
|
||||
printf(" appId: %d\n", GooseSubscriber_getAppId(subscriber));
|
||||
uint8_t macBuf[6];
|
||||
GooseSubscriber_getSrcMac(subscriber,macBuf);
|
||||
printf(" srcMac: %02X:%02X:%02X:%02X:%02X:%02X\n", macBuf[0],macBuf[1],macBuf[2],macBuf[3],macBuf[4],macBuf[5]);
|
||||
GooseSubscriber_getDstMac(subscriber,macBuf);
|
||||
printf(" dstMac: %02X:%02X:%02X:%02X:%02X:%02X\n", macBuf[0],macBuf[1],macBuf[2],macBuf[3],macBuf[4],macBuf[5]);
|
||||
printf(" goId: %s\n", GooseSubscriber_getGoId(subscriber));
|
||||
printf(" goCbRef: %s\n", GooseSubscriber_getGoCbRef(subscriber));
|
||||
printf(" dataSet: %s\n", GooseSubscriber_getDataSet(subscriber));
|
||||
printf(" confRev: %u\n", GooseSubscriber_getConfRev(subscriber));
|
||||
printf(" ndsCom: %s\n", GooseSubscriber_needsCommission(subscriber) ? "true" : "false");
|
||||
printf(" simul: %s\n", GooseSubscriber_isTest(subscriber) ? "true" : "false");
|
||||
printf(" stNum: %u sqNum: %u\n", GooseSubscriber_getStNum(subscriber),
|
||||
GooseSubscriber_getSqNum(subscriber));
|
||||
printf(" timeToLive: %u\n", GooseSubscriber_getTimeAllowedToLive(subscriber));
|
||||
|
||||
uint64_t timestamp = GooseSubscriber_getTimestamp(subscriber);
|
||||
|
||||
printf(" timestamp: %u.%u\n", (uint32_t) (timestamp / 1000), (uint32_t) (timestamp % 1000));
|
||||
printf(" message is %s\n", GooseSubscriber_isValid(subscriber) ? "valid" : "INVALID");
|
||||
|
||||
MmsValue* values = GooseSubscriber_getDataSetValues(subscriber);
|
||||
|
||||
char buffer[1024];
|
||||
|
||||
MmsValue_printToBuffer(values, buffer, 1024);
|
||||
|
||||
printf(" AllData: %s\n", buffer);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
GooseReceiver receiver = GooseReceiver_create();
|
||||
|
||||
if (argc > 1) {
|
||||
printf("Set interface id: %s\n", argv[1]);
|
||||
GooseReceiver_setInterfaceId(receiver, argv[1]);
|
||||
}
|
||||
else {
|
||||
printf("Using interface eth0\n");
|
||||
GooseReceiver_setInterfaceId(receiver, "eth0");
|
||||
}
|
||||
|
||||
GooseSubscriber subscriber = GooseSubscriber_create("", NULL);
|
||||
GooseSubscriber_setObserver(subscriber);
|
||||
GooseSubscriber_setListener(subscriber, gooseListener, NULL);
|
||||
|
||||
GooseReceiver_addSubscriber(receiver, subscriber);
|
||||
|
||||
GooseReceiver_start(receiver);
|
||||
|
||||
if (GooseReceiver_isRunning(receiver)) {
|
||||
signal(SIGINT, sigint_handler);
|
||||
|
||||
while (running) {
|
||||
Thread_sleep(100);
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf("Failed to start GOOSE subscriber. Reason can be that the Ethernet interface doesn't exist or root permission are required.\n");
|
||||
}
|
||||
|
||||
GooseReceiver_stop(receiver);
|
||||
|
||||
GooseReceiver_destroy(receiver);
|
||||
return 0;
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
|
||||
set(iec61850_client_async_SRCS
|
||||
client_example_async.c
|
||||
)
|
||||
|
||||
IF(MSVC)
|
||||
set_source_files_properties(${iec61850_client_async_SRCS}
|
||||
PROPERTIES LANGUAGE CXX)
|
||||
ENDIF(MSVC)
|
||||
|
||||
add_executable(iec61850_client_async
|
||||
${iec61850_client_async_SRCS}
|
||||
)
|
||||
|
||||
target_link_libraries(iec61850_client_async
|
||||
iec61850
|
||||
)
|
@ -1,17 +0,0 @@
|
||||
LIBIEC_HOME=../..
|
||||
|
||||
PROJECT_BINARY_NAME = client_example_async
|
||||
PROJECT_SOURCES = client_example_async.c
|
||||
|
||||
include $(LIBIEC_HOME)/make/target_system.mk
|
||||
include $(LIBIEC_HOME)/make/stack_includes.mk
|
||||
|
||||
all: $(PROJECT_BINARY_NAME)
|
||||
|
||||
include $(LIBIEC_HOME)/make/common_targets.mk
|
||||
|
||||
$(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME)
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS)
|
||||
|
||||
clean:
|
||||
rm -f $(PROJECT_BINARY_NAME)
|
@ -1,322 +0,0 @@
|
||||
/*
|
||||
* client_example_async.c
|
||||
*
|
||||
* Shows how to use the asynchronous client API
|
||||
*
|
||||
* This example is intended to be used with server_example_basic_io.
|
||||
*/
|
||||
|
||||
#include "iec61850_client.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "hal_thread.h"
|
||||
|
||||
static ClientDataSet clientDataSet = NULL;
|
||||
|
||||
static void
|
||||
printValue(char* name, MmsValue* value)
|
||||
{
|
||||
char buf[1000];
|
||||
|
||||
MmsValue_printToBuffer(value, buf, 1000);
|
||||
|
||||
printf("%s: %s\n", name, buf);
|
||||
}
|
||||
|
||||
static void
|
||||
readObjectHandler (uint32_t invokeId, void* parameter, IedClientError err, MmsValue* value)
|
||||
{
|
||||
if (err == IED_ERROR_OK) {
|
||||
printValue((char*) parameter, value);
|
||||
|
||||
MmsValue_delete(value);
|
||||
}
|
||||
else {
|
||||
printf("Failed to read object %s (err=%i)\n", (char*) parameter, err);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
readDataSetHandler(uint32_t invokeId, void* parameter, IedClientError err, ClientDataSet dataSet)
|
||||
{
|
||||
if (err == IED_ERROR_OK) {
|
||||
clientDataSet = dataSet;
|
||||
|
||||
printf("Data set has %d entries\n", ClientDataSet_getDataSetSize(dataSet));
|
||||
|
||||
MmsValue* values = ClientDataSet_getValues(dataSet);
|
||||
|
||||
if (MmsValue_getType(values) == MMS_ARRAY) {
|
||||
int i;
|
||||
for (i = 0; i < MmsValue_getArraySize(values); i++) {
|
||||
printf(" [%i]", i);
|
||||
printValue("", MmsValue_getElement(values, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf("Failed to read data set (err=%i)\n", err);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
writeDataSetHandler(uint32_t invokeId, void* parameter, IedClientError err, LinkedList /* <MmsValue*> */accessResults)
|
||||
{
|
||||
if (err == IED_ERROR_OK) {
|
||||
|
||||
if (accessResults) {
|
||||
|
||||
int i = 0;
|
||||
|
||||
LinkedList element = LinkedList_getNext(accessResults);
|
||||
|
||||
while (element) {
|
||||
MmsValue* accessResultValue = (MmsValue*) LinkedList_getData(element);
|
||||
|
||||
printf(" access-result[%i]", i);
|
||||
printValue("", accessResultValue);
|
||||
|
||||
|
||||
element = LinkedList_getNext(element);
|
||||
i++;
|
||||
}
|
||||
|
||||
LinkedList_destroyDeep(accessResults, (LinkedListValueDeleteFunction) MmsValue_delete);
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf("Failed to write data set (err=%i)\n", err);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
reportCallbackFunction(void* parameter, ClientReport report)
|
||||
{
|
||||
MmsValue* dataSetValues = ClientReport_getDataSetValues(report);
|
||||
|
||||
printf("received report for %s\n", ClientReport_getRcbReference(report));
|
||||
|
||||
int i;
|
||||
for (i = 0; i < 4; i++) {
|
||||
ReasonForInclusion reason = ClientReport_getReasonForInclusion(report, i);
|
||||
|
||||
if (reason != IEC61850_REASON_NOT_INCLUDED) {
|
||||
printf(" GGIO1.SPCSO%i.stVal: %i (included for reason %i)\n", i,
|
||||
MmsValue_getBoolean(MmsValue_getElement(dataSetValues, i)), reason);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
getVarSpecHandler (uint32_t invokeId, void* parameter, IedClientError err, MmsVariableSpecification* spec)
|
||||
{
|
||||
if (err == IED_ERROR_OK) {
|
||||
printf("variable: %s has type %d\n", (char*) parameter, MmsVariableSpecification_getType(spec));
|
||||
|
||||
MmsVariableSpecification_destroy(spec);
|
||||
}
|
||||
else {
|
||||
printf("Failed to get variable specification for object %s (err=%i)\n", (char*) parameter, err);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
getNameListHandler(uint32_t invokeId, void* parameter, IedClientError err, LinkedList nameList, bool moreFollows)
|
||||
{
|
||||
if (err != IED_ERROR_OK) {
|
||||
printf("Get name list error: %d\n", err);
|
||||
}
|
||||
else {
|
||||
|
||||
char* ldName = (char*) parameter;
|
||||
|
||||
LinkedList element = LinkedList_getNext(nameList);
|
||||
|
||||
while (element) {
|
||||
|
||||
char* variableName = (char*) LinkedList_getData(element);
|
||||
|
||||
printf(" %s/%s\n", ldName, variableName);
|
||||
|
||||
element = LinkedList_getNext(element);
|
||||
}
|
||||
|
||||
LinkedList_destroy(nameList);
|
||||
|
||||
free(ldName);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
getServerDirectoryHandler(uint32_t invokeId, void* parameter, IedClientError err, LinkedList nameList, bool moreFollows)
|
||||
{
|
||||
IedConnection con = (IedConnection) parameter;
|
||||
|
||||
if (err != IED_ERROR_OK) {
|
||||
printf("Get server directory error: %d\n", err);
|
||||
}
|
||||
else {
|
||||
LinkedList element = LinkedList_getNext(nameList);
|
||||
|
||||
/* Call logical device variables for each logical node */
|
||||
while (element) {
|
||||
|
||||
char* ldName = (char*) LinkedList_getData(element);
|
||||
|
||||
IedClientError cerr;
|
||||
|
||||
printf("LD: %s variables:\n", ldName);
|
||||
|
||||
IedConnection_getLogicalDeviceVariablesAsync(con, &cerr, ldName, NULL, NULL, getNameListHandler, strdup(ldName));
|
||||
|
||||
printf("LD: %s data sets:\n", ldName);
|
||||
|
||||
IedConnection_getLogicalDeviceDataSetsAsync(con, &err, ldName, NULL, NULL, getNameListHandler, strdup(ldName));
|
||||
|
||||
element = LinkedList_getNext(element);
|
||||
}
|
||||
|
||||
LinkedList_destroy(nameList);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
controlActionHandler(uint32_t invokeId, void* parameter, IedClientError err, ControlActionType type, bool success)
|
||||
{
|
||||
printf("control: ID: %d type: %i err: %d success: %i\n", invokeId, type, err, success);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
char* hostname;
|
||||
int tcpPort = 102;
|
||||
|
||||
if (argc > 1)
|
||||
hostname = argv[1];
|
||||
else
|
||||
hostname = "localhost";
|
||||
|
||||
if (argc > 2)
|
||||
tcpPort = atoi(argv[2]);
|
||||
|
||||
IedClientError error;
|
||||
|
||||
IedConnection con = IedConnection_create();
|
||||
|
||||
IedConnection_connectAsync(con, &error, hostname, tcpPort);
|
||||
|
||||
if (error == IED_ERROR_OK) {
|
||||
|
||||
bool success = true;
|
||||
|
||||
while (IedConnection_getState(con) != IED_STATE_CONNECTED) {
|
||||
|
||||
if (IedConnection_getState(con) == IED_STATE_CLOSED) {
|
||||
success = false;
|
||||
break;
|
||||
}
|
||||
|
||||
Thread_sleep(10);
|
||||
}
|
||||
|
||||
if (success) {
|
||||
|
||||
IedConnection_getServerDirectoryAsync(con, &error, NULL, NULL, getServerDirectoryHandler, con);
|
||||
|
||||
if (error != IED_ERROR_OK) {
|
||||
printf("read server directory error %i\n", error);
|
||||
}
|
||||
|
||||
Thread_sleep(1000);
|
||||
|
||||
|
||||
IedConnection_readObjectAsync(con, &error, "simpleIOGenericIO/GGIO1.AnIn1.mag.f", IEC61850_FC_MX, readObjectHandler, "simpleIOGenericIO/GGIO1.AnIn1.mag.f");
|
||||
|
||||
if (error != IED_ERROR_OK) {
|
||||
printf("read object error %i\n", error);
|
||||
}
|
||||
|
||||
IedConnection_readObjectAsync(con, &error, "simpleIOGenericIO/GGIO1.AnIn2.mag.f", IEC61850_FC_MX, readObjectHandler, "simpleIOGenericIO/GGIO1.AnIn2.mag.f");
|
||||
|
||||
if (error != IED_ERROR_OK) {
|
||||
printf("read object error %i\n", error);
|
||||
}
|
||||
|
||||
IedConnection_getVariableSpecificationAsync(con, &error, "simpleIOGenericIO/GGIO1.AnIn1", IEC61850_FC_MX, getVarSpecHandler, "simpleIOGenericIO/GGIO1.AnIn1");
|
||||
|
||||
if (error != IED_ERROR_OK) {
|
||||
printf("get variable specification error %i\n", error);
|
||||
}
|
||||
|
||||
IedConnection_readDataSetValuesAsync(con, &error, "simpleIOGenericIO/LLN0.Events", NULL, readDataSetHandler, NULL);
|
||||
|
||||
if (error != IED_ERROR_OK) {
|
||||
printf("read data set error %i\n", error);
|
||||
}
|
||||
|
||||
LinkedList values = LinkedList_create();
|
||||
LinkedList_add(values, MmsValue_newBoolean(true));
|
||||
LinkedList_add(values, MmsValue_newBoolean(false));
|
||||
LinkedList_add(values, MmsValue_newBoolean(true));
|
||||
LinkedList_add(values, MmsValue_newBoolean(false));
|
||||
|
||||
IedConnection_writeDataSetValuesAsync(con, &error, "simpleIOGenericIO/LLN0.Events", values, writeDataSetHandler, NULL);
|
||||
|
||||
if (error != IED_ERROR_OK) {
|
||||
printf("write data set error %i\n", error);
|
||||
}
|
||||
|
||||
LinkedList_destroyDeep(values, (LinkedListValueDeleteFunction) MmsValue_delete);
|
||||
|
||||
Thread_sleep(1000);
|
||||
|
||||
ControlObjectClient controlClient = ControlObjectClient_create("simpleIOGenericIO/GGIO1.SPCSO1", con);
|
||||
|
||||
if (controlClient != NULL) {
|
||||
|
||||
ControlObjectClient_setOrigin(controlClient, "test1", CONTROL_ORCAT_AUTOMATIC_REMOTE);
|
||||
|
||||
MmsValue* ctlVal = MmsValue_newBoolean(true);
|
||||
|
||||
ControlObjectClient_operateAsync(controlClient, &error, ctlVal, 0, controlActionHandler, NULL);
|
||||
|
||||
if (error != IED_ERROR_OK) {
|
||||
printf("Failed to send operate %i\n", error);
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
printf("Failed to connect to control object\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Thread_sleep(1000);
|
||||
|
||||
IedConnection_releaseAsync(con, &error);
|
||||
|
||||
if (error != IED_ERROR_OK) {
|
||||
printf("Release returned error: %d\n", error);
|
||||
}
|
||||
else {
|
||||
|
||||
while (IedConnection_getState(con) != IED_STATE_CLOSED) {
|
||||
Thread_sleep(10);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf("Failed to connect to %s:%i\n", hostname, tcpPort);
|
||||
}
|
||||
|
||||
if (clientDataSet)
|
||||
ClientDataSet_destroy(clientDataSet);
|
||||
|
||||
IedConnection_destroy(con);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1,17 +0,0 @@
|
||||
|
||||
set(iec61850_client_no_thread_SRCS
|
||||
client_example_no_thread.c
|
||||
)
|
||||
|
||||
IF(MSVC)
|
||||
set_source_files_properties(${iec61850_client_no_thread_SRCS}
|
||||
PROPERTIES LANGUAGE CXX)
|
||||
ENDIF(MSVC)
|
||||
|
||||
add_executable(iec61850_client_no_thread
|
||||
${iec61850_client_no_thread_SRCS}
|
||||
)
|
||||
|
||||
target_link_libraries(iec61850_client_no_thread
|
||||
iec61850
|
||||
)
|
@ -1,17 +0,0 @@
|
||||
LIBIEC_HOME=../..
|
||||
|
||||
PROJECT_BINARY_NAME = client_example_no_thread
|
||||
PROJECT_SOURCES = client_example_no_thread.c
|
||||
|
||||
include $(LIBIEC_HOME)/make/target_system.mk
|
||||
include $(LIBIEC_HOME)/make/stack_includes.mk
|
||||
|
||||
all: $(PROJECT_BINARY_NAME)
|
||||
|
||||
include $(LIBIEC_HOME)/make/common_targets.mk
|
||||
|
||||
$(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME)
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS)
|
||||
|
||||
clean:
|
||||
rm -f $(PROJECT_BINARY_NAME)
|
@ -1,461 +0,0 @@
|
||||
/*
|
||||
* client_example_no_thread.c
|
||||
*
|
||||
* Shows how to use IedConnection in non-thread mode together with the asynchronous client API
|
||||
*
|
||||
* NOTE:
|
||||
* - in non-thread mode only asynchronous service functions can be used!
|
||||
* - the IedConnection_tick function has to be called periodically
|
||||
* - the asynchronous API returns service results by callback functions
|
||||
*
|
||||
* This example is intended to be used with server_example_basic_io.
|
||||
*/
|
||||
|
||||
#include "iec61850_client.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "hal_thread.h"
|
||||
|
||||
static ClientDataSet clientDataSet = NULL;
|
||||
|
||||
static void
|
||||
printValue(char* name, MmsValue* value)
|
||||
{
|
||||
char buf[1000];
|
||||
|
||||
MmsValue_printToBuffer(value, buf, 1000);
|
||||
|
||||
printf("%s: %s\n", name, buf);
|
||||
}
|
||||
|
||||
/* callback function for IedConnection_readObjectAsync */
|
||||
static void
|
||||
readObjectHandler (uint32_t invokeId, void* parameter, IedClientError err, MmsValue* value)
|
||||
{
|
||||
if (err == IED_ERROR_OK) {
|
||||
printValue((char*) parameter, value);
|
||||
|
||||
MmsValue_delete(value);
|
||||
}
|
||||
else {
|
||||
printf("Failed to read object %s (err=%i)\n", (char*) parameter, err);
|
||||
}
|
||||
}
|
||||
|
||||
/* callback function for IedConnection_readDataSetValuesAsync */
|
||||
static void
|
||||
readDataSetHandler(uint32_t invokeId, void* parameter, IedClientError err, ClientDataSet dataSet)
|
||||
{
|
||||
if (err == IED_ERROR_OK) {
|
||||
clientDataSet = dataSet;
|
||||
|
||||
printf("Data set has %d entries\n", ClientDataSet_getDataSetSize(dataSet));
|
||||
|
||||
MmsValue* values = ClientDataSet_getValues(dataSet);
|
||||
|
||||
if (MmsValue_getType(values) == MMS_ARRAY) {
|
||||
int i;
|
||||
for (i = 0; i < MmsValue_getArraySize(values); i++) {
|
||||
printf(" [%i]", i);
|
||||
printValue("", MmsValue_getElement(values, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf("Failed to read data set (err=%i)\n", err);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
writeDataSetHandler(uint32_t invokeId, void* parameter, IedClientError err, LinkedList /* <MmsValue*> */accessResults)
|
||||
{
|
||||
if (err == IED_ERROR_OK) {
|
||||
|
||||
if (accessResults) {
|
||||
|
||||
int i = 0;
|
||||
|
||||
LinkedList element = LinkedList_getNext(accessResults);
|
||||
|
||||
while (element) {
|
||||
MmsValue* accessResultValue = LinkedList_getData(element);
|
||||
|
||||
printf(" access-result[%i]", i);
|
||||
printValue("", accessResultValue);
|
||||
|
||||
|
||||
element = LinkedList_getNext(element);
|
||||
i++;
|
||||
}
|
||||
|
||||
LinkedList_destroyDeep(accessResults, (LinkedListValueDeleteFunction) MmsValue_delete);
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf("Failed to write data set (err=%i)\n", err);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
reportCallbackFunction(void* parameter, ClientReport report)
|
||||
{
|
||||
MmsValue* dataSetValues = ClientReport_getDataSetValues(report);
|
||||
|
||||
printf("received report for %s\n", ClientReport_getRcbReference(report));
|
||||
|
||||
int i;
|
||||
for (i = 0; i < 4; i++) {
|
||||
ReasonForInclusion reason = ClientReport_getReasonForInclusion(report, i);
|
||||
|
||||
if (reason != IEC61850_REASON_NOT_INCLUDED) {
|
||||
printf(" GGIO1.SPCSO%i.stVal: %i (included for reason %i)\n", i,
|
||||
MmsValue_getBoolean(MmsValue_getElement(dataSetValues, i)), reason);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
getControlVariableVarSpecHandler(uint32_t invokeId, void* parameter, IedClientError err, MmsVariableSpecification* spec)
|
||||
{
|
||||
if (err == IED_ERROR_OK) {
|
||||
|
||||
MmsVariableSpecification** ctlVarSpec = (MmsVariableSpecification**)parameter;
|
||||
|
||||
*ctlVarSpec = spec;
|
||||
}
|
||||
else {
|
||||
printf("Failed to get variable specification for object %s (err=%i)\n", (char*) parameter, err);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
getVarSpecHandler (uint32_t invokeId, void* parameter, IedClientError err, MmsVariableSpecification* spec)
|
||||
{
|
||||
if (err == IED_ERROR_OK) {
|
||||
|
||||
printf("variable: %s has type %d\n", (char*) parameter, MmsVariableSpecification_getType(spec));
|
||||
|
||||
MmsVariableSpecification_destroy(spec);
|
||||
}
|
||||
else {
|
||||
printf("Failed to get variable specification for object %s (err=%i)\n", (char*) parameter, err);
|
||||
}
|
||||
}
|
||||
|
||||
/* callback function for service functions IedConnection_getLogicalDeviceVariablesAsync, IedConnection_getLogicalDeviceDataSetsAsync */
|
||||
static void
|
||||
getNameListHandler(uint32_t invokeId, void* parameter, IedClientError err, LinkedList nameList, bool moreFollows)
|
||||
{
|
||||
if (err != IED_ERROR_OK) {
|
||||
printf("Get name list error: %d\n", err);
|
||||
}
|
||||
else {
|
||||
|
||||
char* ldName = (char*) parameter;
|
||||
|
||||
LinkedList element = LinkedList_getNext(nameList);
|
||||
|
||||
while (element) {
|
||||
|
||||
char* variableName = (char*) LinkedList_getData(element);
|
||||
|
||||
printf(" %s/%s\n", ldName, variableName);
|
||||
|
||||
element = LinkedList_getNext(element);
|
||||
}
|
||||
|
||||
LinkedList_destroy(nameList);
|
||||
|
||||
free(ldName);
|
||||
}
|
||||
}
|
||||
|
||||
/* callback function for IedConnection_getServerDirectoryAsync */
|
||||
static void
|
||||
getServerDirectoryHandler(uint32_t invokeId, void* parameter, IedClientError err, LinkedList nameList, bool moreFollows)
|
||||
{
|
||||
IedConnection con = (IedConnection) parameter;
|
||||
|
||||
if (err != IED_ERROR_OK) {
|
||||
printf("Get server directory error: %d\n", err);
|
||||
}
|
||||
else {
|
||||
LinkedList element = LinkedList_getNext(nameList);
|
||||
|
||||
/* Call logical device variables for each logical node */
|
||||
while (element) {
|
||||
|
||||
char* ldName = (char*) LinkedList_getData(element);
|
||||
|
||||
printf("LD: %s variables:\n", ldName);
|
||||
|
||||
IedConnection_getLogicalDeviceVariablesAsync(con, &err, ldName, NULL, NULL, getNameListHandler, strdup(ldName));
|
||||
|
||||
printf("LD: %s data sets:\n", ldName);
|
||||
|
||||
IedConnection_getLogicalDeviceDataSetsAsync(con, &err, ldName, NULL, NULL, getNameListHandler, strdup(ldName));
|
||||
|
||||
element = LinkedList_getNext(element);
|
||||
}
|
||||
|
||||
LinkedList_destroy(nameList);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
controlActionHandler(uint32_t invokeId, void* parameter, IedClientError err, ControlActionType type, bool success)
|
||||
{
|
||||
printf("control: ID: %d type: %i err: %d success: %i\n", invokeId, type, err, success);
|
||||
}
|
||||
|
||||
static void
|
||||
stateChangedHandler(void* parameter, IedConnection connection, IedConnectionState newState)
|
||||
{
|
||||
printf("Connection state changed: ");
|
||||
|
||||
switch (newState) {
|
||||
case IED_STATE_CLOSED:
|
||||
printf("CLOSED\n");
|
||||
break;
|
||||
case IED_STATE_CLOSING:
|
||||
printf("CLOSING\n");
|
||||
break;
|
||||
case IED_STATE_CONNECTING:
|
||||
printf("CONNECTING\n");
|
||||
break;
|
||||
case IED_STATE_CONNECTED:
|
||||
printf("CONNECTED\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
getRCBValuesHandler (uint32_t invokeId, void* parameter, IedClientError err, ClientReportControlBlock rcb)
|
||||
{
|
||||
if (parameter) {
|
||||
printf("get rcb values handler: %s (error:%i)\n", (char*)parameter, err);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
genericServiceHandler (uint32_t invokeId, void* parameter, IedClientError err)
|
||||
{
|
||||
if (parameter) {
|
||||
printf("generic service handler: %s (error:%i)\n", (char*)parameter, err);
|
||||
}
|
||||
}
|
||||
|
||||
static void waitWithTick(IedConnection con, int waitMs)
|
||||
{
|
||||
uint64_t startTime = Hal_getTimeInMs();
|
||||
|
||||
while (Hal_getTimeInMs() < (startTime + (uint64_t) waitMs))
|
||||
{
|
||||
if (IedConnection_tick(con) == true)
|
||||
Thread_sleep(10);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char** argv) {
|
||||
|
||||
char* hostname;
|
||||
int tcpPort = 102;
|
||||
|
||||
if (argc > 1)
|
||||
hostname = argv[1];
|
||||
else
|
||||
hostname = "localhost";
|
||||
|
||||
if (argc > 2)
|
||||
tcpPort = atoi(argv[2]);
|
||||
|
||||
IedClientError error;
|
||||
|
||||
ClientReportControlBlock rcb = NULL;
|
||||
|
||||
/* create new IedConnection with non-thread mode */
|
||||
IedConnection con = IedConnection_createEx(NULL, false);
|
||||
|
||||
/* track connection state change */
|
||||
IedConnection_installStateChangedHandler(con, stateChangedHandler, NULL);
|
||||
|
||||
/* invoke association with server */
|
||||
IedConnection_connectAsync(con, &error, hostname, tcpPort);
|
||||
|
||||
if (error == IED_ERROR_OK) {
|
||||
|
||||
bool success = true;
|
||||
|
||||
/* Call IedConnection_tick until state is CONNECTED or CLOSED */
|
||||
while (IedConnection_getState(con) != IED_STATE_CONNECTED) {
|
||||
|
||||
if (IedConnection_getState(con) == IED_STATE_CLOSED) {
|
||||
success = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (IedConnection_tick(con) == true)
|
||||
Thread_sleep(10);
|
||||
}
|
||||
|
||||
if (success) {
|
||||
|
||||
IedConnection_getServerDirectoryAsync(con, &error, NULL, NULL, getServerDirectoryHandler, con);
|
||||
|
||||
if (error != IED_ERROR_OK) {
|
||||
printf("read server directory error %i\n", error);
|
||||
}
|
||||
|
||||
waitWithTick(con, 1000);
|
||||
|
||||
rcb = ClientReportControlBlock_create("simpleIOGenericIO/LLN0.RP.EventsRCB01");
|
||||
|
||||
/* Read RCB values */
|
||||
IedConnection_getRCBValuesAsync(con, &error, "simpleIOGenericIO/LLN0.RP.EventsRCB01", rcb, getRCBValuesHandler, NULL);
|
||||
|
||||
if (error != IED_ERROR_OK) {
|
||||
printf("getRCBValues service error!\n");
|
||||
}
|
||||
else {
|
||||
waitWithTick(con, 1000);
|
||||
|
||||
/* prepare the parameters of the RCP */
|
||||
ClientReportControlBlock_setResv(rcb, true);
|
||||
ClientReportControlBlock_setDataSetReference(rcb, "simpleIOGenericIO/LLN0$Events"); /* NOTE the "$" instead of "." ! */
|
||||
ClientReportControlBlock_setRptEna(rcb, true);
|
||||
ClientReportControlBlock_setGI(rcb, true);
|
||||
|
||||
/* Configure the report receiver */
|
||||
IedConnection_installReportHandler(con, "simpleIOGenericIO/LLN0.RP.EventsRCB", ClientReportControlBlock_getRptId(rcb), reportCallbackFunction,
|
||||
NULL);
|
||||
|
||||
/* Write RCB parameters and enable report */
|
||||
IedConnection_setRCBValuesAsync(con, &error, rcb, RCB_ELEMENT_RESV | RCB_ELEMENT_DATSET | RCB_ELEMENT_RPT_ENA | RCB_ELEMENT_GI, true, genericServiceHandler, NULL);
|
||||
|
||||
waitWithTick(con, 1000);
|
||||
}
|
||||
|
||||
IedConnection_readObjectAsync(con, &error, "simpleIOGenericIO/GGIO1.AnIn1.mag.f", IEC61850_FC_MX, readObjectHandler, "simpleIOGenericIO/GGIO1.AnIn1.mag.f");
|
||||
|
||||
if (error != IED_ERROR_OK) {
|
||||
printf("read object error %i\n", error);
|
||||
}
|
||||
|
||||
waitWithTick(con, 1000);
|
||||
|
||||
IedConnection_readObjectAsync(con, &error, "simpleIOGenericIO/GGIO1.AnIn2.mag.f", IEC61850_FC_MX, readObjectHandler, "simpleIOGenericIO/GGIO1.AnIn2.mag.f");
|
||||
|
||||
if (error != IED_ERROR_OK) {
|
||||
printf("read object error %i\n", error);
|
||||
}
|
||||
|
||||
waitWithTick(con, 1000);
|
||||
|
||||
IedConnection_getVariableSpecificationAsync(con, &error, "simpleIOGenericIO/GGIO1.AnIn1", IEC61850_FC_MX, getVarSpecHandler, "simpleIOGenericIO/GGIO1.AnIn1");
|
||||
|
||||
if (error != IED_ERROR_OK) {
|
||||
printf("get variable specification error %i\n", error);
|
||||
}
|
||||
|
||||
waitWithTick(con, 1000);
|
||||
|
||||
IedConnection_readDataSetValuesAsync(con, &error, "simpleIOGenericIO/LLN0.Events", NULL, readDataSetHandler, NULL);
|
||||
|
||||
if (error != IED_ERROR_OK) {
|
||||
printf("read data set error %i\n", error);
|
||||
}
|
||||
|
||||
waitWithTick(con, 1000);
|
||||
|
||||
LinkedList values = LinkedList_create();
|
||||
LinkedList_add(values, MmsValue_newBoolean(true));
|
||||
LinkedList_add(values, MmsValue_newBoolean(false));
|
||||
LinkedList_add(values, MmsValue_newBoolean(true));
|
||||
LinkedList_add(values, MmsValue_newBoolean(false));
|
||||
|
||||
IedConnection_writeDataSetValuesAsync(con, &error, "simpleIOGenericIO/LLN0.Events", values, writeDataSetHandler, NULL);
|
||||
|
||||
if (error != IED_ERROR_OK) {
|
||||
printf("write data set error %i\n", error);
|
||||
}
|
||||
|
||||
waitWithTick(con, 1000);
|
||||
|
||||
LinkedList_destroyDeep(values, (LinkedListValueDeleteFunction) MmsValue_delete);
|
||||
|
||||
waitWithTick(con, 1000);
|
||||
|
||||
/* Get the variable specification for the controllable data object by online service */
|
||||
MmsVariableSpecification* ctlVarSpec = NULL;
|
||||
|
||||
IedConnection_getVariableSpecificationAsync(con, &error, "simpleIOGenericIO/GGIO1.SPCSO1", IEC61850_FC_CO,
|
||||
getControlVariableVarSpecHandler, &ctlVarSpec);
|
||||
|
||||
waitWithTick(con, 1000);
|
||||
|
||||
if (ctlVarSpec != NULL) {
|
||||
|
||||
/* ControlObjectClient_create function cannot be used in non-thread mode - use ControlObjectClient_createEx instead */
|
||||
ControlObjectClient controlClient = ControlObjectClient_createEx("simpleIOGenericIO/GGIO1.SPCSO1", con,
|
||||
CONTROL_MODEL_DIRECT_NORMAL, ctlVarSpec);
|
||||
|
||||
if (controlClient != NULL) {
|
||||
|
||||
ControlObjectClient_setOrigin(controlClient, "test1", CONTROL_ORCAT_AUTOMATIC_REMOTE);
|
||||
|
||||
MmsValue* ctlVal = MmsValue_newBoolean(true);
|
||||
|
||||
ControlObjectClient_operateAsync(controlClient, &error, ctlVal, 0, controlActionHandler, NULL);
|
||||
|
||||
waitWithTick(con, 1000);
|
||||
|
||||
MmsValue_delete(ctlVal);
|
||||
|
||||
if (error != IED_ERROR_OK) {
|
||||
printf("Failed to send operate %i\n", error);
|
||||
}
|
||||
|
||||
ControlObjectClient_destroy(controlClient);
|
||||
}
|
||||
else {
|
||||
printf("Failed to connect to control object\n");
|
||||
}
|
||||
|
||||
MmsVariableSpecification_destroy(ctlVarSpec);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
IedConnection_releaseAsync(con, &error);
|
||||
|
||||
if (error != IED_ERROR_OK) {
|
||||
printf("Release returned error: %d\n", error);
|
||||
}
|
||||
else {
|
||||
|
||||
/* Call IedConnection_tick until state is CLOSED */
|
||||
while (IedConnection_getState(con) != IED_STATE_CLOSED) {
|
||||
if (IedConnection_tick(con) == true)
|
||||
Thread_sleep(10);
|
||||
}
|
||||
}
|
||||
|
||||
if (rcb != NULL)
|
||||
ClientReportControlBlock_destroy(rcb);
|
||||
}
|
||||
else {
|
||||
printf("Failed to connect to %s:%i\n", hostname, tcpPort);
|
||||
}
|
||||
|
||||
if (clientDataSet)
|
||||
ClientDataSet_destroy(clientDataSet);
|
||||
|
||||
IedConnection_destroy(con);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1,17 +0,0 @@
|
||||
|
||||
set(iec61850_client_file_async_SRCS
|
||||
client_example_async.c
|
||||
)
|
||||
|
||||
IF(MSVC)
|
||||
set_source_files_properties(${iec61850_client_file_async_SRCS}
|
||||
PROPERTIES LANGUAGE CXX)
|
||||
ENDIF(MSVC)
|
||||
|
||||
add_executable(iec61850_client_file_async
|
||||
${iec61850_client_file_async_SRCS}
|
||||
)
|
||||
|
||||
target_link_libraries(iec61850_client_file_async
|
||||
iec61850
|
||||
)
|
@ -1,106 +0,0 @@
|
||||
/*
|
||||
* client_example_async.c
|
||||
*
|
||||
* Shows how to use the asynchronous client API
|
||||
*
|
||||
* This example is intended to be used with server_example_basic_io.
|
||||
*/
|
||||
|
||||
#include "iec61850_client.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "hal_thread.h"
|
||||
|
||||
static bool fileTransferComplete = false;
|
||||
|
||||
static bool
|
||||
getFileAsyncHandler (uint32_t invokeId, void* parameter, IedClientError err, uint32_t originalInvokeId,
|
||||
uint8_t* buffer, uint32_t bytesRead, bool moreFollows)
|
||||
{
|
||||
if ((err != IED_ERROR_OK) || (moreFollows == false)) {
|
||||
|
||||
if (err == IED_ERROR_OK) {
|
||||
printf("Received %d bytes\n", bytesRead);
|
||||
}
|
||||
|
||||
printf("File transfer complete (err:%d)\n", err);
|
||||
fileTransferComplete = true;
|
||||
}
|
||||
else {
|
||||
printf("Received %d bytes\n", bytesRead);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
char* hostname;
|
||||
char* filename = NULL;
|
||||
|
||||
if (argc > 1)
|
||||
hostname = argv[1];
|
||||
else
|
||||
hostname = "localhost";
|
||||
|
||||
if (argc > 2)
|
||||
filename = argv[2];
|
||||
|
||||
IedClientError error;
|
||||
|
||||
IedConnection con = IedConnection_create();
|
||||
|
||||
IedConnection_connectAsync(con, &error, hostname, 102);
|
||||
|
||||
if (error == IED_ERROR_OK) {
|
||||
|
||||
bool success = true;
|
||||
|
||||
while (IedConnection_getState(con) != IED_STATE_CONNECTED) {
|
||||
|
||||
if (IedConnection_getState(con) == IED_STATE_CLOSED) {
|
||||
success = false;
|
||||
break;
|
||||
}
|
||||
|
||||
Thread_sleep(10);
|
||||
}
|
||||
|
||||
if (success) {
|
||||
|
||||
if (filename) {
|
||||
IedConnection_getFileAsync(con, &error, filename, getFileAsyncHandler, NULL);
|
||||
|
||||
printf("Started file download\n");
|
||||
|
||||
while (fileTransferComplete == false)
|
||||
Thread_sleep(10);
|
||||
}
|
||||
}
|
||||
|
||||
Thread_sleep(1000);
|
||||
|
||||
IedConnection_releaseAsync(con, &error);
|
||||
|
||||
if (error != IED_ERROR_OK) {
|
||||
printf("Release returned error: %d\n", error);
|
||||
}
|
||||
else {
|
||||
|
||||
while (IedConnection_getState(con) != IED_STATE_CLOSED) {
|
||||
Thread_sleep(10);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf("Failed to connect to %s\n", hostname);
|
||||
}
|
||||
|
||||
|
||||
IedConnection_destroy(con);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||
<!--2014.05.12-21:21:53 Academic and Evaluation License (AEL) Powered by Masson Technologies (www.massontech.com)-->
|
||||
<!--2014.05.12-21:21:53 This file is generated using RedWind IED Modeler (www.iedmodeler.com)-->
|
||||
<!--2014.05.12-21:21:53 ????? RedWind IED Modeler ???? (www.iedmodeler.com)-->
|
||||
<SCL xmlns="http://www.iec.ch/61850/2003/SCL" revision="" version="">
|
||||
<Header id="" nameStructure="IEDName" toolID="RedWind IED Modeler">
|
||||
<History>
|
@ -1,35 +0,0 @@
|
||||
LIBIEC_HOME=../..
|
||||
|
||||
PROJECT_BINARY_NAME = server_example_basic_io
|
||||
PROJECT_SOURCES = server_example_basic_io.c
|
||||
PROJECT_SOURCES += static_model.c
|
||||
|
||||
PROJECT_ICD_FILE = simpleIO_direct_control.cid
|
||||
|
||||
all: $(PROJECT_BINARY_NAME)
|
||||
|
||||
LDLIBS += -lm -lpthread
|
||||
|
||||
CP = cp
|
||||
|
||||
LIBIEC61850_INSTALL_DIR = ../../.install
|
||||
|
||||
LIBIEC61850_LIB_DIR = $(LIBIEC61850_INSTALL_DIR)/lib
|
||||
LIBIEC61850_INC_DIR = $(LIBIEC61850_INSTALL_DIR)/include
|
||||
LIBIEC61850_INCLUDES = -I$(LIBIEC61850_INC_DIR)
|
||||
|
||||
INCLUDES += $(LIBIEC61850_INCLUDES)
|
||||
|
||||
model: $(PROJECT_ICD_FILE)
|
||||
java -jar $(LIBIEC_HOME)/tools/model_generator/genmodel.jar $(PROJECT_ICD_FILE)
|
||||
|
||||
$(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME)
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) -L$(LIBIEC61850_LIB_DIR) -liec61850 $(LDLIBS)
|
||||
mkdir -p vmd-filestore
|
||||
$(CP) $(PROJECT_BINARY_NAME) vmd-filestore/IEDSERVER.BIN
|
||||
|
||||
clean:
|
||||
rm -f $(PROJECT_BINARY_NAME)
|
||||
rm -f vmd-filestore/IEDSERVER.BIN
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue