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  <20192020  2021  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  <20192020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: UDP server in model 3 motor driver
From: Lee Hudson via Tech-talk <[email protected]>
To: <[email protected]>
Date: Thu, 24 Oct 2019 11:19:05 +0100

Hi,

I'm currently writing a motor driver and I'm not sure on the best way to implement a particular aspect of it. The main control link to the hardware is via TCP/IP, on startup the driver registers parameters of interest on the controller and the controller then sends all subscribed information out via UDP broadcasts. I think I need to create a udp server on the IOC, so far I am doing the following:

IOC boot script:

#TCP port for control, this works

drvAsynIPPortConfigure("PCS1_CTRL", "192.168.113.10:51512", 100, 0, 0)
asynOctetSetInputEos("PCS1_CTRL", 0, "\r\n")
asynOctetSetOutputEos("PCS1_CTRL", 0, "\r\n")

# Configure UDP port for Walter and Bai streams
drvAsynIPServerPortConfigure(PCS1_UDP,"192.168.113.12:51513 udp", 10, 0, 0, 0)
# Configure Walter and Bai PCS8000 controller
pcsControllerConfig(PCS1, 0, 2, 20, 20)

# Configure Walter and Bai PCS8000 Axis
pcsAxisConfig(PCS1, 1)

# Configure Walter and Bai PCS8000 Axis
pcsAxisConfig(PCS1, 2)


Driver constructor(class pcsController: public asynMotorController ):

    /* Connect to pcsController controller TCP for control */
    status = pasynOctetSyncIO->connect(lowLevelPortName, 0, &pasynUserController_, NULL);


    pasynUserUDPStream = pasynManager->createAsynUser(0,0);
    status = pasynManager->connectDevice(pasynUserUDPStream, streamPortName,0);
    pasynInterface = pasynManager->findInterface(pasynUserUDPStream, asynOctetType, 1);

    pasynOctet = (asynOctet *) pasynInterface->pinterface;
    octetPvt=pasynInterface->drvPvt;


Driver poll():

status = pasynOctet->read(octetPvt, pasynUserUDPStream, rxBuffer, 65535 - 1,
                              &nBytesIn, &eomReason);


In the poll() method or perhaps a separate thread elsewhere I know I will have to update the asyn parameters manually and call callParamCallbacks() to get the record to update. Am I going about this the right way?

Thanks in advance

Lee

 

-- 

This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd.
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
 


Replies:
Re: UDP server in model 3 motor driver Peterson, Kevin M. via Tech-talk

Navigate by Date:
Prev: Re: clarification on PV name max length Johnson, Andrew N. via Tech-talk
Next: Re: UDP server in model 3 motor driver Peterson, Kevin M. 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  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: clarification on PV name max length Johnson, Andrew N. via Tech-talk
Next: Re: UDP server in model 3 motor driver Peterson, Kevin M. 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  <20192020  2021  2022  2023  2024 
ANJ, 24 Oct 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·