README.md 2.37 KB
Newer Older
Kuner, Bernhard's avatar
Kuner, Bernhard committed
1
# ioPhytron
Kuner, Bernhard's avatar
Kuner, Bernhard committed
2

Kuner, Bernhard's avatar
Kuner, Bernhard committed
3
4
5
6
7
8
9
10
11
12
EPICS drivers for phyMotion IO-cards [Phytron GmbH](https://www.phytron.eu/)

## Ioc shell driver Commands

Create port for a single card. 

- cardNr: card number in chassis, read from left to right
- timeout in ms
- Init commands is a list of phyLogic commands

Kuner, Bernhard's avatar
Kuner, Bernhard committed
13
`phytronCreateIoCtrl( "IP_PORT", "CARD_PORT", cardNr, timeout, "init;by;phyLogic;commands")`
Kuner, Bernhard's avatar
Kuner, Bernhard committed
14
15
16
17
18
19
20
21
22

Show all installed cards. use CARD_PORT is one of the created card_ports.

`phyreport(CARD_PORT)`

Send arbitrary commands to the phyMotion device

`phycmd("list;of;commands")`

Kuner, Bernhard's avatar
Kuner, Bernhard committed
23
24
## Reading EPICS records: ai, longin, bi, mbbi

Kuner, Bernhard's avatar
Kuner, Bernhard committed
25
The card number m is defined by the phytronCreateIoCtrl cardNr parameter, ADDR is the channel number. The reasons AOUT,AIN will readback set values.
Kuner, Bernhard's avatar
Kuner, Bernhard committed
26
27
28
29
30
31
32
33
34

- PORT: CARD_PORT, means card numer in the chassis count from left to right
- ADDR: In- Output channel number n=1,2..
- REASON: the reason defines the used phyLogic Command: m=CardNr, n=Channel
  - DIN: n=0: "EGmR" read all channels of card m, n>0 "EZm.nR" read a single bit
  - DOUT: n=0: "AGmR" card m: readback state of all channels, n>0 "AZm.nSz" read state of a single bit
  - AIN: n>0 "ADm.nR" read analog channel
  - AOUT "DAm.n" Readback channel
  
Kuner, Bernhard's avatar
Kuner, Bernhard committed
35
36
```
record($(REC),"$(PV)") {
Kuner, Bernhard's avatar
Kuner, Bernhard committed
37
38
    field(DTYP,"$(DTYP=asynInt32)")
    field(INP,"@asyn($(PORT),$(ADDR))$(REASON)")
Kuner, Bernhard's avatar
Kuner, Bernhard committed
39
40
}
```
Kuner, Bernhard's avatar
Kuner, Bernhard committed
41

Kuner, Bernhard's avatar
Kuner, Bernhard committed
42
43
44
## Writing EPICS records: ao, longout, bo, mbbo

The card number m is defined by the phytronCreateIoCtrl cardNr parameter, ADDR is the channel number
Kuner, Bernhard's avatar
Kuner, Bernhard committed
45
46
47
48
49
50
51

- PORT: CARD_PORT, means card numer in the chassis count from left to right
- ADDR: In- Output channel number n=1,2..
- REASON: the reason defines the used phyLogic Command: m=CardNr, n=Channel
  - DOUT: n=0: "AGmSvalue" Set all channels of card m, n>0 "AZm.nSz" set a single bit to 
  - AOUT "DAm.n=value" Set channel
  
Kuner, Bernhard's avatar
Kuner, Bernhard committed
52
53
```
record($(REC),"$(PV)") {
Kuner, Bernhard's avatar
Kuner, Bernhard committed
54
    field(DTYP,"$(DTYP=asynInt32)")
Kuner, Bernhard's avatar
Kuner, Bernhard committed
55
    field(OUT,"@asyn($(PORT),$(ADDR))$(REASON)")
Kuner, Bernhard's avatar
Kuner, Bernhard committed
56
57
}
```
Kuner, Bernhard's avatar
Kuner, Bernhard committed
58

Kuner, Bernhard's avatar
Kuner, Bernhard committed
59
## Command interface by stringout, stringin
Kuner, Bernhard's avatar
Kuner, Bernhard committed
60

Kuner, Bernhard's avatar
Kuner, Bernhard committed
61
62
```
record(stringout,"$(DEVN):setCmd") {
Kuner, Bernhard's avatar
Kuner, Bernhard committed
63
64
65
66
67
68
69
70
71
72
73
74
75
76
    field(DESC,"$(DEVN) Command")
    field(DTYP,"asynOctetWrite")
    field(OUT, "@asyn($(PORT),0)CMD")
    field(FLNK,"$(DEVN):rdCmd")
}
record(stringin,"$(DEVN):rdCmd") {
    field(DESC,"cmd response")
    field(DTYP,"asynOctetRead")
    field(INP,"@asyn($(PORT),0)CMD")
    field(FLNK,"$(DEVN):rdIntCmd")
}
record(longin,"$(DEVN):rdIntCmd") {
    field(DESC,"cmd response as int")
    field(INP,"$(DEVN):rdCmd")
Kuner, Bernhard's avatar
Kuner, Bernhard committed
77
78
79
}
```

Kuner, Bernhard's avatar
Kuner, Bernhard committed
80
81