EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: "st.cmd" internal code question
From: Mark Rivers via Tech-talk <[email protected]>
To: 최원철 <[email protected]>
Cc: tech-talk <[email protected]>
Date: Wed, 8 Jan 2020 12:42:44 +0000
Hi,


> Question 1. ) MTestSetup (1,7,10) and MTestConfig (0, "SERIALPORT") in the /epics/ioc/MTest/iocBoot/iocMTest/st.cmd file

> Can I edit / check? And what is that doing?


Those commands MTestSetup and MTestConfig are not standard EPICS commands, they are something that your developer wrote for this specific application.  You will need to look at the C/C++ source code that he wrote.  I don't know what they do.



> Question 2. ) It communicates via Rs232 with "raspberry Pi-> motor". I was curious about the communication,
                 so I changed it to "raspberry Pi-> PC com port".


I am not sure I understand this question.  The startup script is using this command to set up the communications:

drvAsynSerialPortConfigure("SERIALPORT","/dev/ttyAMA0",0,0,0)


That is a standard EPICS command, and it is using a tty port /dev/ttyAMA0.


This is something I found on the Web about that port name, and a potential source of problems.

https://raspberrypi.stackexchange.com/questions/45570/how-do-i-make-serial-work-on-the-raspberry-pi3-or-later-model/45571#45571


*****************************

The /dev/ttyAMA0 previously used to access the UART now connects to Bluetooth.
The miniUART is now available on /dev/ttyS0.
In the latest operating system software there is a /dev/serial0 which selects the appropriate device so you can replace /dev/ttyAMA0 with /dev/serial0 and use the same software on the Pi3 and earlier models.

*****************************

So if you have a newer Pi then you may need to use /dev/serial0 rather than /dev/ttyAMA0.

Mark

________________________________
From: Tech-talk <[email protected]> on behalf of 최원철 via Tech-talk <[email protected]>
Sent: Wednesday, January 8, 2020 3:15 AM
To: [email protected]
Subject: "st.cmd" internal code question


hi

I'm a developer new to EPICS.

   My goal is to analyze / modify the project completed by the staff. (He is not here)

  I have a product that installs an IOC on the Raspberry pi 3+ and controls the motor via the RS232 line.

  Installed on Pi 3+ are asyn4-34, motor-R6-10-1, stream, ipac-2.15 and calc-R3-6-1.



Question 1. ) MTestSetup (1,7,10) and MTestConfig (0, "SERIALPORT") in the /epics/ioc/MTest/iocBoot/iocMTest/st.cmd file

Can I edit / check? And what is that doing?



  st.cmd  code...

cd "/usr/local/epics/iocs/MTest/iocBoot/iocMTest"

< envPaths

< pvSettings



   .

cd "$(TOP)"



## Register all support components

dbLoadDatabase("dbd/MTest.dbd")

MTest_registerRecordDeviceDriver(pdbbase)



## Serial Configuration

drvAsynSerialPortConfigure("SERIALPORT","/dev/ttyAMA0",0,0,0)

asynSetOption("SERIALPORT",-1,"baud","19200")

asynSetOption("SERIALPORT",-1,"bits","8")

asynSetOption("SERIALPORT",-1,"parity","odd")

asynSetOption("SERIALPORT",-1,"stop","1")

asynSetOption("SERIALPORT",-1,"clocal","Y")

asynSetOption("SERIALPORT",-1,"crtscts","N")

asynOctetSetInputEos("SERIALPORT",0,"\r")

asynOctetSetOutputEos("SERIALPORT",0,"\r")



MTestSetup(1,8,10)                        <-----------------here

MtestConfig(0,"SERIALPORT")             <-----------------here



## Load record instances

dbLoadRecords "db/motor_record.db","P=$(P),M=$(M1),S=0"

dbLoadRecords "db/motor_record.db","P=$(P),M=$(M2),S=1"

dbLoadRecords "db/motor_record.db","P=$(P),M=$(M3),S=2"

dbLoadRecords "db/motor_record.db","P=$(P),M=$(M4),S=3"

dbLoadRecords "db/motor_record.db","P=$(P),M=$(M5),S=4"

dbLoadRecords "db/motor_record.db","P=$(P),M=$(M6),S=5"

save_restoreSet_IncompleteSetsOk(1)

save_restoreSet_DatedBackupFiles(0)

set_requestfile_path("./")

set_savefile_path("./", "autosave")

set_pass0_restoreFile("auto_settings.sav")

set_pass1_restoreFile("auto_settings.sav")





cd "${TOP}/iocBoot/${IOC}"

iocInit

create_monitor_set("auto_settings.req", 30, "P=$(P),M1=$(M1),M2=$(M2),M3=$(M3),M4=$(M4),M5=$(M5)")




Question 2. ) It communicates via Rs232 with "raspberry Pi-> motor". I was curious about the communication,
                 so I changed it to "raspberry Pi-> PC com port".

  ./// output    PC terminal.
 % 01 # WCP8R08021R08121R08221R08321R08421R08521R08621R08721 **
% 01 # WCP8R08051R08151R08251R08351R08451R08551R08651R08751 **
% 01 # RCP3R0120R0121R0128 **
% 01 # RCP3R0120R0121R0128 **
% 01 # RCP3R0122R0123R0129 **
% 01 # RCP3R0122R0123R0129 **
% 01 # RCP3R0124R0125R012A **
% 01 # RCP3R0124R0125R012A **
% 01 # RCP3R0126R0127R012B **
% 01 # RCP3R0126R0127R012B **
% 01 # RCP3R0130R0131R0138 **
% 01 # RCP3R0130R0131R0138 **
% 01 # RCP3R0132R0133R0139 **

These contents are printed out.

 Is this uart communication "where / who" control?

  I am studying and it is so difficult that I ask these basic questions. Please help me.
Thank you.
[https://mail.naver.com/readReceipt/notify/?img=dwYwMrFo%2BrKXK6t%2FhAnZKobqFzt%2FMqtZKA30FouwFq2dK4tdazKXaxU9KuIo%2BrkSKAuZ74lR74l4b4u516YQaX30Mr2R%2BzJn1dICbHK5M6ln74%2BT%2B2%3D%3D.gif]

References:
"st.cmd" internal code question 최원철 via Tech-talk

Navigate by Date:
Prev: Re: Ethernet question Hinko Kocevar via Tech-talk
Next: RE: Ethernet question Mark Rivers via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
Navigate by Thread:
Prev: "st.cmd" internal code question 최원철 via Tech-talk
Next: s7plc with S7-1200 Saleh, Ibrahim via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024 
ANJ, 08 Jan 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·