epics-modules / microEpsilon

Device support for Micro-Epsilon displacement measurement digitizers
Other
2 stars 0 forks source link

The questions I met in installation #1

Open wchh1233 opened 3 years ago

wchh1233 commented 3 years ago

Hi, I just installed the modules in EPICS according to the microEpsilon.md in the folder named documentation. I finshed the step of "The folowing lines will need to be added to the IOC st.cmd file to configure, connect and load the required databases", then I typed "./st.cmd" in the terminal. It shows "../../bin/linux-x86_64/mms: bad interpreter: No such file or directory"

image

Here is the first few lines in st.cmd image

So, what is mms, how could I add it? I also cannot find "STREAM_PROTOCOL_PATH" in db and mms.dbd in dbd.

Looking forward for your reply. Thank you.

MarkRivers commented 3 years ago

That st.cmd file looks like it was copied from some other application. It uses Modbus, but Modbus is not in configure/RELEASE.

The IOC test application that is built is called capaNCDT6200test. That is the application you need to run, not mms. The command to configure it in the st.cmd is capaNCDT6200Configure. It looks like the second half of st.cmd is probably OK, but the application name needs to be changed and the Modbus commands need to be deleted.

wchh1233 commented 3 years ago

Thank you for your answer.

I've changed the mms to capaNCDT6200test and delated the Modbus. And then I run the st.cmd, it said: The executable "caRepeater" couldn't be located because of errno = "No such file or directory". You may need to modify your PATH environment variable. Unable to start "CA Repeater" process

I can find caRepeater and caRepeater.service in /EPICS/base/bin/linux-x86_64 , but I cannot find the place to modify its PATH.

Besides when I want to load the required databases for the capaNCDT6200 unit according to the microEpsilon.md in microEpsilon.md, it says dbLoadRecords("db/xxCapaNCDT200.vdb", "dev={PV Name Prefix}, Link=L0")

and in st.cmd, it says dbLoadRecords("db/xxCapaNCDT200.vdb", "dev=MMS:S27:MMD1, Link=L0")

So, what should I fill in here?

Looking forward for your reply. Thank you.

MarkRivers commented 3 years ago

I can find caRepeater and caRepeater.service in /EPICS/base/bin/linux-x86_64 , but I cannot find the place to modify its PATH.

You just need to add /EPICS/base/bin/linux-x86_64 to your Linux PATH environment variable. Typically that is done by modifying your shell startup script, i.e. ~/.bash_profile if you are using the bash shell.

and in st.cmd, it says dbLoadRecords("db/xxCapaNCDT200.vdb", "dev=MMS:S27:MMD1, Link=L0") So, what should I fill in here?

The example st.cmd has these lines:

drvAsynIPPortConfigure("L0","10.6.28.17:23",0,0,0)
asynSetTraceIOMask("L0",-1,0x2)
asynSetTraceMask("L0",-1,0x1)
dbLoadRecords("db/xxCapaNCDT6200.vdb", "dev=MMS:S27:MMD1,Link=L0")

You can use the port name "L0" like this example. You need to replace MMS:S27:MMD1 with the PV prefix you would like to use.

wchh1233 commented 3 years ago

Thank you for your answer.

I've solved the previous problems, and I met the following problem:

2021/07/16 15:11:06.952 L1_RBK Successfully connected to MicroEpsilon port: . 2021/07/16 15:11:06.958 L1_RBK: Could not find correct Preamble string: 2021/07/16 15:11:06.964 L1_RBK: Could not find correct Preamble string: 2021/07/16 15:11:06.968 L1_RBK: Could not find correct Preamble string:

It could not find correct preamble string.

What should I do to solve it?

Thank you for your help.

MarkRivers commented 3 years ago

That error is coming here: https://github.com/epics-modules/microEpsilon/blob/522a54df3197f19d29c3eca7695a3b7184db4f45/capaNCDT6200Sup/src/capaNCDT6200Sup.c#L413

You need to change the lines like this in your startup script:

asynSetTraceIOMask("L0",-1,0x2)
asynSetTraceMask("L0",-1,0x1)

to this:

asynSetTraceIOMask("L0",-1,HEX|ESCAPE)
asynSetTraceMask("L0",-1,ERROR|DRIVER)

That will print out the all communication from the driver and the device on both HEX and ASCII with escape characters.

The preamble is created and tested in these lines:

                    sprintf(preamble, "%c%c%c%c", pdpvt->cbuf[3], pdpvt->cbuf[2],
                            pdpvt->cbuf[1], pdpvt->cbuf[0]);
                    preambleOK = strcmp(preamble, "MEAS");

It looks to me like the first 4 characters of that buffer should be the string "MEAS", but in reverse order? You should see if those characters are in the response from the device at all.

wchh1233 commented 3 years ago

Thank you for your answer.

I 've changed the lines

asynSetTraceIOMask("L0",-1,0x2) asynSetTraceMask("L0",-1,0x1) asynSetTraceIOMask("L1",-1,0x2) asynSetTraceMask("L1",-1,0x1)

to

asynSetTraceIOMask("L0",-1,HEX|ESCAPE) asynSetTraceMask("L0",-1,ERROR|DRIVER) asynSetTraceIOMask("L1",-1,HEX|ESCAPE) asynSetTraceMask("L1",-1,ERROR|DRIVER)

and changed the "MEAS" to "SAEM"

It solved most questions, but I could still find the error like this

`2021/07/17 16:00:04.655 L1_RBK Successfully connected to MicroEpsilon port: . 2021/07/17 16:00:04.655 169.254.168.150:23 write 6 $CHI1\r

24 43 48 49 31 0d 2021/07/17 16:00:04.656 169.254.168.150:23 read 67 $CHI1:ANO2303024,NAMDL6230/ECL2,SNO1361,OFS0,RNG1000,UNT\265m,DTY1OK\r\n

24 43 48 49 31 3a 41 4e 4f 32 33 30 33 30 32 34 2c 4e 41 4d 44 4c 36 32 33 30 2f 45 43 4c 32 2c 53 4e 4f 31 33 36 31 2c 4f 46 53 30 2c 52 4e 47 31 30 30 30 2c 55 4e 54 b5 6d 2c 44 54 59 31 4f 4b 0d 0a 2021/07/17 16:00:04.657 L1_RBK: Could not find correct Preamble string: Successfully disconnected MicroEpsilon port: L1_RBK. capaNCDT6200LongWait called. 2021/07/17 16:00:04.659 169.254.168.150:23 write 6 $CHI2\r

24 43 48 49 32 0d 2021/07/17 16:00:04.661 169.254.168.150:23 read 67 $CHI2:ANO2303024,NAMDL6230/ECL2,SNO1362,OFS0,RNG1000,UNT\265m,DTY1OK\r\n

24 43 48 49 32 3a 41 4e 4f 32 33 30 33 30 32 34 2c 4e 41 4d 44 4c 36 32 33 30 2f 45 43 4c 32 2c 53 4e 4f 31 33 36 32 2c 4f 46 53 30 2c 52 4e 47 31 30 30 30 2c 55 4e 54 b5 6d 2c 44 54 59 31 4f 4b 0d 0a 2021/07/17 16:00:04.664 169.254.168.150:23 write 6 $CHI3\r

24 43 48 49 33 0d 2021/07/17 16:00:04.667 169.254.168.150:23 read 68 $CHI3:ANO2303024,NAMDL6230/ECL2,SNO1363,OFS0,RNG10000,UNT\265m,DTY1OK\r\n

24 43 48 49 33 3a 41 4e 4f 32 33 30 33 30 32 34 2c 4e 41 4d 44 4c 36 32 33 30 2f 45 43 4c 32 2c 53 4e 4f 31 33 36 33 2c 4f 46 53 30 2c 52 4e 47 31 30 30 30 30 2c 55 4e 54 b5 6d 2c 44 54 59 31 4f 4b 0d 0a 2021/07/17 16:00:04.668 169.254.168.150:23 write 6 $CHI4\r

24 43 48 49 34 0d 2021/07/17 16:00:04.670 169.254.168.150:23 read 68 $CHI4:ANO2303024,NAMDL6230/ECL2,SNO1364,OFS0,RNG10000,UNT\265m,DTY1OK\r\n

24 43 48 49 34 3a 41 4e 4f 32 33 30 33 30 32 34 2c 4e 41 4d 44 4c 36 32 33 30 2f 45 43 4c 32 2c 53 4e 4f 31 33 36 34 2c 4f 46 53 30 2c 52 4e 47 31 30 30 30 30 2c 55 4e 54 b5 6d 2c 44 54 59 31 4f 4b 0d 0a epics> 2021/07/17 16:00:34.679 L1_RBK Successfully connected to MicroEpsilon port: . 2021/07/17 16:00:34.685 L1_RBK: Could not find correct Preamble string: Process SCAN=I/O Intr records to set STAT/SEVR. Successfully disconnected MicroEpsilon port: L1_RBK. capaNCDT6200LongWait called. 2021/07/17 16:01:04.719 L1_RBK Successfully connected to MicroEpsilon port: . 2021/07/17 16:01:04.726 L1_RBK: Could not find correct Preamble string: Process SCAN=I/O Intr records to set STAT/SEVR. Successfully disconnected MicroEpsilon port: L1_RBK. capaNCDT6200LongWait called. 2021/07/17 16:01:34.749 L1_RBK Successfully connected to MicroEpsilon port: . 2021/07/17 16:01:34.752 L1_RBK: Could not find correct Preamble string: Process SCAN=I/O Intr records to set STAT/SEVR. Successfully disconnected MicroEpsilon port: L1_RBK. capaNCDT6200LongWait called. `

And the data I got from dispChan1M was INVALID.

camonitor MMS:S27:MMD1:dispChan1M MMS:S27:MMD1:dispChan1M 2021-07-17 16:01:04.726103 0 READ INVALID

camonitor MMS:S27:MMD1:dataPacket:badCount MMS:S27:MMD1:dataPacket:badCount 2021-07-17 16:01:38.150704 4

What should I do to solve it?

Looking forward to your reply and thank you for your help.

MarkRivers commented 3 years ago

You can now see all of the unsolicited messages that the device sends. I don't see the string "MEAS" or "SAEM" anywhere in those messages. I don't know anything about the device, so I don't know what is wrong.

I think you will need to get help from Steve Shoaf (@sshoaf0) who wrote the driver.

wchh1233 commented 3 years ago

Thanks a lot and I'm sorry to trouble you on the weekend.